Bug 46297

Summary: Need to limit PA's internal buffering/latency. How?
Product: PulseAudio Reporter: Jörg Höhle <Joerg-Cyril.Hoehle>
Component: alsaAssignee: pulseaudio-bugs
Status: RESOLVED MOVED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: aeikum, jjardon, lennart
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Jörg Höhle 2012-02-19 12:14:17 UTC
Hi,

PA's internal 2s buffering breaks many winmm apps in Wine because back when winmm was widely used, the difference between buffer position and speaker position was minimal.  The DAC immediately played what came out of the buffer.

We've been unsuccessful at trying to hint PA that Wine wants small latencies by using a small snd_pcm_hw_params_set_buffer_size, typically near 40ms, with a 10ms period.  Both are granted by PA, yet somehow PA still appears to fill some internal 2s buffer, introducing that much latency.

- When Wine reports true GetPosition information (speaker position) to winmm apps, they get crazy or hang because they are not prepared for buffering 2s of audio data.  Back then, a few hundred ms was largely enough.  A typical app plays ping pong with two 333ms audio buffers.

- When Wine limits the speaker position to not be too far away from written frames, the apps lose their ability to synchronize audio & video.
Yet this is preferable to hanging.

The latter may be acceptable for remote desktop settings, but it's not acceptable for local desktop scenarios just because one element in the audio chain insists on buffering 2s of data.

How can we tell PA or rather the alsa_plugin not to introduce such a huge latency?

Thank you for your help,
      Jörg Höhle
Comment 1 Arun Raghavan 2012-03-14 23:52:36 UTC
This is quite odd. Could you post the output of "pactl list sink-inputs" when you see this buffering happening?

When I do an "aplay -F 10000 -B 40000", I don't see the total buffer exceeding 40ms.
Comment 2 GitLab Migration User 2018-07-30 10:05:28 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/205.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.