[pulseaudio-discuss] Distribution kernels and glitch-free (Packagers, read this!)

Hynek Hanke hanke at brailcom.org
Tue May 12 03:16:50 PDT 2009


Hello,

I have tried to do some tests and I'd appreciate your help.

> get your bloody kernels fixed. Enable preempt, set HZ to 1000.


We did that on the vanilla 2.6.28 kernel, or so we believe:

$ zgrep -E "HZ|PREEMP" /boot/config-2.6.28.10-pulse
CONFIG_PREEMPT_NOTIFIERS=y
CONFIG_NO_HZ=y
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
# CONFIG_PREEMPT_RCU is not set
# CONFIG_HZ_100 is not set
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
CONFIG_HZ_1000=y
CONFIG_HZ=1000
CONFIG_MACHZ_WDT=m
CONFIG_DEBUG_PREEMPT=y
# CONFIG_PREEMPT_TRACER is not set

Our application still gets latency up to 260ms. If initially we set tlength
to 100 and maxlength with a big limit so that Pulse can freely increase
the latency to avoid glitches, it starts with small latency and underruns
and increases it up to 60ms or more again.

May 12 11:53:29 homer pulseaudio[27727]: protocol-native.c: Final 
latency 19,95 ms = 0,00 ms + 2*9,98 ms + 0,00 ms
May 12 11:53:29 homer pulseaudio[27727]: module-alsa-sink.c: Requesting 
rewind due to latency change.
May 12 11:53:30 homer pulseaudio[27727]: module-alsa-sink.c: Increasing 
minimal latency to 8,00 ms
May 12 11:53:30 homer pulseaudio[27727]: module-alsa-sink.c: Increasing 
minimal latency to 16,00 ms
May 12 11:53:32 homer pulseaudio[27727]: module-alsa-sink.c: Increasing 
minimal latency to 32,00 ms
May 12 11:53:35 homer pulseaudio[27727]: module-alsa-sink.c: Increasing 
minimal latency to 64,00 ms

The full log is here:
    http://www.freebsoft.org/~hanke/pulse1.log

If we limit the maxtargetlength to keep latency small the quality
of audio gets very bad (more or less expected) and response in
speakers still seems to be much slower than what we get with ALSA.

So why would the latency be so big? What does it mean the 2*9,98? If it 
is the trip
between app and pulse, why is it so big as well?

I also did
    alsa-time-test default

529066    529064    289138    1    4409    0    1    3
529077    529075    289160    1    4409    0    1    3
529086    529084    289138    0    4410    0    0    3
529121    529091    289138    0    4410    0    0    3

Looks ok, but I get similarly small differences in the first row
even with ordinary 2.6.28-11-generic as shipped with Ubuntu.

Thanks for your help,
Hynek Hanke







More information about the pulseaudio-discuss mailing list