[ Adding omitted pulseaudio-discuss back to CC ] Hi Jerry, On Fri, Mar 18, 2016 at 01:16:19PM -0400, Jerry Geis wrote: > On Fri, Mar 18, 2016 at 12:52 PM, Ahmed S. Darwish <darwish.07 at gmail.com> wrote: > > On Fri, Mar 18, 2016 at 06:33:02PM +0200, Ahmed S. Darwish wrote: > > > On Fri, Mar 18, 2016 at 12:13:03PM -0400, Jerry Geis wrote: > > > > ( 0.023| 0.000) D: [pulseaudio] module-always-sink.c: Autoloading null-sink as no other sinks detected. > > > ... > > > > ( 0.001| 0.000) D: [pulseaudio] memblock.c: Using shared memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot size is 65472 > > > > ( 0.001| 0.000) D: [pulseaudio] memblock.c: Using shared memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot size is 65472 > > > ... > > > > ( 5.031| 4.989) I: [pulseaudio] module-suspend-on-idle.c: Sink auto_null idle for too long, suspending ... > > > > ( 5.031| 0.000) D: [pulseaudio] sink.c: Suspend cause of sink auto_null is 0x0004, suspending > > > > ( 5.033| 0.001) D: [pulseaudio] core.c: Hmm, no streams around, trying to vacuum. > > > ... > > > > ( 10.047| 5.013) I: [pulseaudio] module-device-restore.c: Synced. > > > > ( 23.563| 13.515) I: [pulseaudio] main.c: Got signal SIGINT. > > > > ( 23.563| 0.000) I: [pulseaudio] main.c: Exiting. > > > > ( 23.563| 0.000) I: [pulseaudio] main.c: Daemon shutdown initiated. > > > > > > Are you sure you've run Asterisk while capturing the log above? It > > > is expected to see something like: > > > > > > I: [pulsecore/client.c:74 pa_client_new()] Created 1 "Native client > > (UNIX socket client)" > > > D: [pulsecore/protocol-native.c:2729 command_auth()] Protocol version: > > remote 31, local 31 > > > I: [pulsecore/protocol-native.c:2762 command_auth()] Got credentials: > > uid=1000 gid=1000 success=1 > > > > > > But I did not see anything like that. The log instead shows an > > > idle PulseAudio daemon with no connected clients. > > > > Also it seems this instace of Pulse did not detect any ALSA > > sinks and is just using null-sink as a fallback default. > > > > So please post the log of the working PA setup instead. That is, > > the one you hear sound nicely from but with Asterisk producing > > sound cracks. > > > > here is the file. > > not sure what the issue was the first time. but this one has more. > Yup, that's the correct log file. I can see the ALSA sink, multiple clients connecting to the daemon (including Asterisk), etc. Let's see .. > W: [pulseaudio] main.c: Running in system mode, but --disallow-exit not set! > W: [pulseaudio] main.c: Running in system mode, but --disallow-module-loading not set! > N: [pulseaudio] main.c: Running in system mode, forcibly disabling SHM mode! You're using system mode, which disables shared memory, and thus negatively affects latency (and in latency-demanding apps this can indeed produce cracks) ... > D: [pulseaudio] memblock.c: Using private memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot size is 65472 Not a shared-memory pool, due to running in system mode.. ... > I: [pulseaudio] sink-input.c: Created input 0 "ALSA Playback" on auto_null with sample spec s16le 1ch 8000Hz and channel map mono > I: [pulseaudio] sink-input.c: media.name = "ALSA Playback" > I: [pulseaudio] sink-input.c: application.name = "ALSA plug-in [asterisk]" > I: [pulseaudio] sink-input.c: application.process.binary = "asterisk" .. > D: [pulseaudio] protocol-native.c: Requested latency=40.00 ms, Received latency=40.00 ms Here is Asterisk connecting.. > I: [alsa-sink-HDMI 0] alsa-sink.c: Scheduling delay of 1538.89 ms > 5.00 ms, you might want to investigate this to improve latency... > I: [alsa-sink-HDMI 0] ratelimit.c: 74 events suppressed > I: [alsa-sink-HDMI 0] alsa-sink.c: Underrun! > I: [alsa-sink-HDMI 0] alsa-sink.c: Increasing wakeup watermark to 10.00 ms > I: [pulseaudio] module-device-restore.c: Synced. > D: [alsa-sink-HDMI 0] protocol-native.c: Requesting rewind due to end of underrun. > D: [alsa-sink-HDMI 0] alsa-sink.c: Requested to rewind 256000 bytes. > D: [alsa-sink-HDMI 0] alsa-sink.c: Limited to 4224 bytes. > D: [alsa-sink-HDMI 0] alsa-sink.c: before: 1056 > D: [alsa-sink-HDMI 0] alsa-sink.c: after: 1056 > D: [alsa-sink-HDMI 0] alsa-sink.c: Rewound 4224 bytes. > D: [alsa-sink-HDMI 0] sink.c: Processing rewind... > D: [alsa-sink-HDMI 0] sink-input.c: Have to rewind 4224 bytes on render memblockq. > D: [alsa-sink-HDMI 0] source.c: Processing rewind... > D: [alsa-sink-HDMI 0] protocol-native.c: Implicit underrun of 'ALSA Playback' > D: [alsa-sink-HDMI 0] sink.c: Found underrun 2272 bytes ago (2816 bytes ahead in playback buffer) > D: [alsa-sink-HDMI 0] sink.c: Found underrun 2272 bytes ago (2816 bytes ahead in playback buffer) > D: [alsa-sink-HDMI 0] sink.c: Found underrun 2272 bytes ago (2784 bytes ahead in playback buffer) > D: [alsa-sink-HDMI 0] sink.c: Found underrun 2272 bytes ago (2752 bytes ahead in playback buffer) > D: [alsa-sink-HDMI 0] sink.c: Found underrun 2272 bytes ago (1440 bytes ahead in playback buffer) > D: [alsa-sink-HDMI 0] sink.c: Found underrun 2272 bytes ago (1408 bytes ahead in playback buffer) > D: [alsa-sink-HDMI 0] sink.c: Found underrun 4832 bytes ago (256 bytes ahead in playback buffer) > D: [alsa-sink-HDMI 0] protocol-native.c: Requesting rewind due to end of underrun. ... and here are the buffer underruns that keeps arising (thus producing audible cracks) until the PulseAudio daemon is shutdown. >From all of the above, it seems like 1) enabling shared-memory by running PA in user mode, and 2) enabling shared ringbuffer support by passing "srbchannel=true" to module-native-protocol-unix, are the logical next steps to try. Good luck, -- Darwish http://darwish.chasingpointers.com