[pulseaudio-discuss] Playback pauses

Tanu Kaskinen tanuk at iki.fi
Tue Feb 12 01:28:51 PST 2013


On Tue, 2013-02-12 at 10:22 +0100, David Henningsson wrote:
> On 02/12/2013 10:02 AM, Tanu Kaskinen wrote:
> > On Tue, 2013-02-12 at 08:54 +0100, David Henningsson wrote:
> >> On 02/11/2013 11:03 AM, Dmitri Paduchikh wrote:
> >>> Hello,
> >>>
> >>> When I play a sound using paplay (or aplay with ALSA configured to use
> >>> PulseAudio) there is a big pause between two successive runs. For
> >>> example:
> >>>
> >>> $ paplay sound1.wav; paplay sound2.wav
> >>>
> >>> The pause between these sounds is something about two seconds. I've
> >>> tried to adjust latency (through --latency-msec=50) but this doesn't
> >>> seem to change much.
> >>>
> >>> Couldn't you explain what is the cause of this pause? Is it possible to
> >>> eliminate it?
> >>>
> >>
> >> This is a well-known issue which we discussed briefly at PulseConf.
> >> Fixing it is not trivial, unfortunately.
> >>
> >> I did a quick test here; and for me the delay is 250 - 500 ms, which is
> >> consistent with the output of pacmd list-sinks:
> >>
> >> 	configured latency: 0.00 ms; range is 0.50 .. 371.52 ms
> >>
> >> Is your maximum latency going up to about 2000 ms? What distro are you
> >> running?
> >>
> >> There was some effort a while ago to try to increase this to 2000 ms in
> >> order to reduce power consumption, and I think we had that in Ubuntu too
> >> at some point? I don't know why this is now down to 371 ms, but given
> >> that gstreamer has a latency or similar magnitude (200 - 400 ms, IIRC)
> >> for media playback anyway, I see little reason to investigate it
> >> further. And in addition, it helps a bit against this bug. :-)
> >
> > In case you didn't know, the maximum hw buffer size for HDA is defined
> > by this kernel configuration option: CONFIG_SND_HDA_PREALLOC_SIZE. The
> > default is 64 (kB), which results in 271.52 ms with 2 ch, 16 bit, 44.1
> > kHz.
> 
> You probably meant 371.52 (not 271.25), or are we calculating differently?

My mistake.

> > It is recommended to change this value to e.g. 2048 on systems that
> > use PulseAudio. Since Debian still doesn't enable PulseAudio by default,
> > Debian's kernel uses the default value. Perhaps that has propagated to
> > Ubuntu by accident at some point?
> 
> No, Ubuntu has its own kernel packaging, unrelated of Debian's. But 
> upstream also has 64 as default.
> But, given the fact that this bug gets worse with a larger prealloc 
> size, and the gstreamer still doesn't use more than ~200 ms latency 
> anyway, should we really recommend this change of prealloc_size?

Perhaps not.

I would, however, recommend the change for PulseAudio developers. It
helps with noticing bugs.

-- 
Tanu



More information about the pulseaudio-discuss mailing list