[pulseaudio-discuss] Problems with Pulseaudio an alsa A52 plugin

Christian Leibig c.leibig at gmx.de
Sat Oct 11 08:10:44 PDT 2008


Hello folks,

I have been using Pulseaudio for a while now. Since I only run a single
digital output to my speaker system I found the chance of using
Pulseaudio to mix all system audio and then pipe the result through the
alsa a52 plugin intriguing. Originally following this manual [1] I
managed to set up pulseaudio just fine.

I also learned a lot about my Problem from a thread [2] on this mailing
list.

Now I have been running Pulseaudio 0.9.10 for a while and was trying to
upgrade to...well, basically anything _above_ 0.9.10. The problems I#ll
be describing are the same with 0.9.11, 0.9.12 and now even 0.9.13. Keep
in mind that my setup is working (almost) perfectly in 0.9.10.


My Setup:
Gentoo 64-bit with 2.6.26 (and recently 2.6.27) kernel.
Intel Q6600 with 4GB RAM
Intel HD Audio Controller


Configs:

>>> /etc/asound.conf:
pcm.!default {
    type pulse
}

ctl.!default {
    type pulse
}

pcm.pulseaudio a52encode

ctl.pulseaudio {
    type hw
    card 0
}

pcm.a52encode {
    type a52
}

>>>/etc/pulse/system.pa (Disabled module auto detect stuff and added the
following two lines at the end):
load-module module-alsa-sink device=pulseaudio rate=48000 channels=6
sink_name=alsa_surround mmap=1
set-default-sink alsa_surround


The Problem:
When using anything above Pulseaudio 0.9.10 I get stuttering sound and
using the debug log level I can see the following (repeating a hundred
times over and over) in my system logfile:

pulseaudio[13279]: module-alsa-sink.c: Starting playback.
pulseaudio[13279]: module-alsa-sink.c: snd_pcm_avail_update: Broken pipe
pulseaudio[13279]: module-alsa-sink.c: snd_pcm_avail_update: Buffer
underrun!

Additional logspam suggests this A52 plugin setup:
pulseaudio[13279]: alsa-util.c: snd_pcm_dump():
pulseaudio[13279]: alsa-util.c: A52 Output Plugin
pulseaudio[13279]: alsa-util.c: Its setup is:
pulseaudio[13279]: alsa-util.c:   stream       : PLAYBACK
pulseaudio[13279]: alsa-util.c:   access       : MMAP_INTERLEAVED
pulseaudio[13279]: alsa-util.c:   format       : S16_LE
pulseaudio[13279]: alsa-util.c:   subformat    : STD
pulseaudio[13279]: alsa-util.c:   channels     : 6
pulseaudio[13279]: alsa-util.c:   rate         : 48000
pulseaudio[13279]: alsa-util.c:   exact rate   : 48000 (48000/1)
pulseaudio[13279]: alsa-util.c:   msbits       : 16
pulseaudio[13279]: alsa-util.c:   buffer_size  : 3072
pulseaudio[13279]: alsa-util.c:   period_size  : 1536
pulseaudio[13279]: alsa-util.c:   period_time  : 32000
pulseaudio[13279]: alsa-util.c:   tstamp_mode  : NONE
pulseaudio[13279]: alsa-util.c:   period_step  : 1
pulseaudio[13279]: alsa-util.c:   avail_min    : 25345
pulseaudio[13279]: alsa-util.c:   period_event : 0
pulseaudio[13279]: alsa-util.c:   start_threshold  : -1
pulseaudio[13279]: alsa-util.c:   stop_threshold   : -1
pulseaudio[13279]: alsa-util.c:   silence_threshold: 0
pulseaudio[13279]: alsa-util.c:   silence_size : 0
pulseaudio[13279]: alsa-util.c:   boundary     : 6917529027641081856


Interestingly enough, even with Pulseaudio 0.9.10 I get the following in
my log, but sound works just fine:
Oct 11 16:40:34 lq66 pulseaudio[24693]: module-alsa-sink.c: EAGAIN         
Oct 11 16:40:34 lq66 pulseaudio[24693]: module-alsa-sink.c: Buffer underrun!
Oct 11 16:40:34 lq66 pulseaudio[24693]: module-alsa-sink.c: EAGAIN         
Oct 11 16:40:34 lq66 pulseaudio[24693]: module-alsa-sink.c: Buffer underrun!


Now I am pretty stumped. I have tried various fragment counts and sizes
(by adding the parameters to the module-alsa-sink line) but none of
those settings made any difference. Even worse, I can't really confirm
that they even stuck at all because the logspam from the A52 plugin
doesn't change a bit. The only thing I can do to make it change is to
change the module-alsa-sink mmap parameter to "0", which will change
MMAP_INTERLEAVED to RW_INTERLEAVED and exactly double the buffer_size.
If I use mmap=0 with 0.9.10 I get a similar result than using mmap=1
with 0.9.11-0.9.13.
I I try using mmap=0 with 0.9.13 pulseaudio never loads and I have to
kill it using the -9 switch.

This may be a bit much for a single post and I suspect it is still
lacking in some regards. I probably left out a lot of vital information
that are necessary to debug this problem and I'll be glad to add them as
soon as anyone tells me what's needed. :)

I really hope you guys can help me with this, I don't want ot be stuck
with 0.9.10 forever.

Thanks in advance,
Christian


[1] http://ubuntuforums.org/showthread.php?t=714712
[2]
https://tango.0pointer.de/pipermail/pulseaudio-discuss/2008-February/001420.html




More information about the pulseaudio-discuss mailing list