Page 1 of 1

PulseAudio - Network Sink - Constant Buffer Underrun.

Posted: Sat Dec 07, 2013 2:26 pm
by notholmen
Hello!

I have a headless Model B 512MB connected locally with Ethernet.
Running Raspbian (wheezy) Linux knyttet 3.10.21+ #604 PREEMPT armv6l GNU/Linux
I have Pulseaudio 2.0 installed through the apt-get command together with pulseaudio-module-zeroconf.
I stream: Laptop -> Wifi -> Switch -> Ethernet -> Raspberry which produces my problem.
When I connect the laptop by cable it seams to work as long as I don't have two different sources running at the same time.

To my question.
After a while on wifi I seam to get buffer underruns and the audio stops completely.
Only restarting pulseaudio on the raspberry helps. Is there a way to stop buffer underruns from happening still beeing connected by wifi?

I have looked around to try to build pulseaudio 4.0 for the small raspberry but I don't know how.
Could someone help me that maybe have fought with the same problem?

Any help appreciated.

My goal is to have both a pulseaudio network sink and a airplay device running together on the raspberry, clone the image and get another raspberry to the kitchen connected also that over wifi.

My config so far:
I have configured Pulse to run as a system service through /etc/default/pulseaudio
I also edited /etc/pulse/system.pa with the following additions:
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.10.0/24 auth-anonymous=1
load-module module-zeroconf-publish
load-module module-alsa-card device_id=0 tsched=true tsched_buffer_size=2048576 tsched_buffer_watermark=962144
And commented out load-module module-suspend-on-idle.

asound.conf is also edited with the following:

Code: Select all

pcm.pulse {
    type pulse
}
ctl.pulse {
    type pulse
}
pcm.!default {
    type pulse
}
ctl.!default {
    type pulse
}

Below some output when pulseaudio get the buffer underrun and I'm connected over wifi:
(command used to start pulseaudio | pulseaudio --system -vv ):

Code: Select all

D: [alsa-sink] sink.c: latency = 5444
D: [alsa-sink] sink-input.c: Have to rewind 4148 bytes on render memblockq.
D: [alsa-sink] source.c: Processing rewind...
D: [alsa-sink] protocol-native.c: Underrun on 'bcm2835 ALSA Analog Stereo for robban@2530p', 0 bytes in queue.
D: [alsa-sink] protocol-native.c: Requesting rewind due to end of underrun.
D: [alsa-sink] alsa-sink.c: Requested to rewind 1764 bytes.
D: [alsa-sink] alsa-sink.c: Limited to 1764 bytes.
D: [alsa-sink] alsa-sink.c: before: 441
D: [alsa-sink] alsa-sink.c: after: 441
D: [alsa-sink] alsa-sink.c: Rewound 1764 bytes.
D: [alsa-sink] sink.c: Processing rewind...
D: [alsa-sink] sink.c: latency = 10470
D: [alsa-sink] sink-input.c: Have to rewind 1764 bytes on render memblockq.
D: [alsa-sink] source.c: Processing rewind...
I: [alsa-sink] alsa-sink.c: Decreasing wakeup watermark to 346.55 ms
I: [alsa-sink] alsa-sink.c: Decreasing wakeup watermark to 341.56 ms
I: [alsa-sink] alsa-sink.c: Decreasing wakeup watermark to 336.57 ms
I: [alsa-sink] alsa-sink.c: Decreasing wakeup watermark to 331.59 ms
I: [alsa-sink] alsa-sink.c: Decreasing wakeup watermark to 326.60 ms
I: [alsa-sink] alsa-sink.c: Decreasing wakeup watermark to 321.61 ms
D: [alsa-sink] protocol-native.c: Underrun on 'bcm2835 ALSA Analog Stereo for robban@2530p', 0 bytes in queue.
D: [alsa-sink] protocol-native.c: Requesting rewind due to end of underrun.
D: [alsa-sink] alsa-sink.c: Requested to rewind 1764 bytes.
D: [alsa-sink] alsa-sink.c: Limited to 1764 bytes.
D: [alsa-sink] alsa-sink.c: before: 441
D: [alsa-sink] alsa-sink.c: after: 441
D: [alsa-sink] alsa-sink.c: Rewound 1764 bytes.
D: [alsa-sink] sink.c: Processing rewind...
D: [alsa-sink] sink.c: latency = 13173
D: [alsa-sink] sink-input.c: Have to rewind 1764 bytes on render memblockq.
D: [alsa-sink] source.c: Processing rewind...
D: [alsa-sink] protocol-native.c: Underrun on 'bcm2835 ALSA Analog Stereo for robban@2530p', 0 bytes in queue.
D: [alsa-sink] protocol-native.c: Requesting rewind due to end of underrun.
D: [alsa-sink] alsa-sink.c: Requested to rewind 16536 bytes.
D: [alsa-sink] alsa-sink.c: Limited to 4148 bytes.
D: [alsa-sink] alsa-sink.c: before: 1037
D: [alsa-sink] alsa-sink.c: after: 1037
D: [alsa-sink] alsa-sink.c: Rewound 4148 bytes.
D: [alsa-sink] sink.c: Processing rewind...
D: [alsa-sink] sink.c: latency = 0
D: [alsa-sink] sink-input.c: Have to rewind 4148 bytes on render memblockq.
D: [alsa-sink] source.c: Processing rewind...
I: [alsa-sink] alsa-sink.c: Decreasing wakeup watermark to 316.62 ms
I: [alsa-sink] alsa-sink.c: Decreasing wakeup watermark to 311.63 ms

Code: Select all

D: [alsa-sink] alsa-sink.c: Wakeup from ALSA!
I: [alsa-sink] alsa-sink.c: Underrun!
I: [alsa-sink] alsa-sink.c: Increasing wakeup watermark to 15.99 ms
I: [alsa-sink] alsa-sink.c: Decreasing wakeup watermark to 336.57 ms
D: [alsa-sink] protocol-native.c: Underrun on 'bcm2835 ALSA Analog Stereo for robban@2530p', 0 bytes in queue.
D: [alsa-sink] protocol-native.c: Requesting rewind due to end of underrun.
D: [alsa-sink] alsa-sink.c: Requested to rewind 3508 bytes.
D: [alsa-sink] alsa-sink.c: Limited to 3508 bytes.
D: [alsa-sink] alsa-sink.c: before: 877
D: [alsa-sink] alsa-sink.c: after: 877
D: [alsa-sink] alsa-sink.c: Rewound 3508 bytes.
D: [alsa-sink] sink.c: Processing rewind...
D: [alsa-sink] sink.c: latency = 2244
D: [alsa-sink] sink-input.c: Have to rewind 3508 bytes on render memblockq.
D: [alsa-sink] sink-input.c: Have to rewind 3508 bytes on render memblockq.
D: [alsa-sink] source.c: Processing rewind...
D: [alsa-sink] protocol-native.c: Underrun on 'bcm2835 ALSA Analog Stereo for robban@2530p', 0 bytes in queue.
D: [alsa-sink] protocol-native.c: Requesting rewind due to end of underrun.
D: [alsa-sink] alsa-sink.c: Requested to rewind 3520 bytes.
D: [alsa-sink] alsa-sink.c: Limited to 3520 bytes.
D: [alsa-sink] alsa-sink.c: before: 880
D: [alsa-sink] alsa-sink.c: after: 880
D: [alsa-sink] alsa-sink.c: Rewound 3520 bytes.
D: [alsa-sink] sink.c: Processing rewind...
D: [alsa-sink] sink.c: latency = 6169
D: [alsa-sink] sink-input.c: Have to rewind 3520 bytes on render memblockq.
D: [alsa-sink] sink-input.c: Have to rewind 3520 bytes on render memblockq.
D: [alsa-sink] source.c: Processing rewind...
D: [alsa-sink] protocol-native.c: Underrun on 'bcm2835 ALSA Analog Stereo for robban@2530p', 0 bytes in queue.
D: [alsa-sink] protocol-native.c: Requesting rewind due to end of underrun.
D: [alsa-sink] alsa-sink.c: Requested to rewind 1764 bytes.
D: [alsa-sink] alsa-sink.c: Limited to 1764 bytes.
D: [alsa-sink] alsa-sink.c: before: 441
D: [alsa-sink] alsa-sink.c: after: 441
D: [alsa-sink] alsa-sink.c: Rewound 1764 bytes.
D: [alsa-sink] sink.c: Processing rewind...
D: [alsa-sink] sink.c: latency = 13242
D: [alsa-sink] sink-input.c: Have to rewind 1764 bytes on render memblockq.
D: [alsa-sink] sink-input.c: Have to rewind 1764 bytes on render memblockq.
D: [alsa-sink] source.c: Processing rewind...
I: [alsa-sink] alsa-sink.c: Decreasing wakeup watermark to 331.59 ms

Re: PulseAudio - Network Sink - Constant Buffer Underrun.

Posted: Sun Dec 08, 2013 9:18 pm
by notholmen
*bump*
Maybe you know a better place to ask this specific questions?

Re: PulseAudio - Network Sink - Constant Buffer Underrun.

Posted: Sat Dec 14, 2013 8:45 pm
by notholmen
Is this the right forum for this kind of question?

Re: PulseAudio - Network Sink - Constant Buffer Underrun.

Posted: Sun Dec 15, 2013 8:16 am
by texy
I've moved thread to multimedia in hopes of better responses.
Texy

Re: PulseAudio - Network Sink - Constant Buffer Underrun.

Posted: Sat Jan 18, 2014 11:02 am
by 8191
I had the same problem with kernel 3.12.0, downgrading to 3.6.11 fixed the problem for me. I didn't change anything else on the pulse config.

Re: PulseAudio - Network Sink - Constant Buffer Underrun.

Posted: Thu Jan 23, 2014 3:40 pm
by kursus
@8191 Thanks downgrading to 3.6 seems to solve the "pool full" issue. However I can't reach my network source anymore. Could you provide you /etc/cmdline.txt please ?