[pulseaudio-tickets] [PulseAudio] #709: Difficult to get low latency playback using simple API and instructions provided

PulseAudio trac-noreply at tango.0pointer.de
Sat Nov 7 01:39:24 PST 2009


#709: Difficult to get low latency playback using simple API and instructions
provided
-------------------------+--------------------------------------------------
 Reporter:  jkillwinter  |       Owner:  lennart 
     Type:  defect       |      Status:  new     
Milestone:               |   Component:  libpulse
 Keywords:               |  
-------------------------+--------------------------------------------------
 It seems impossible to get low latency playback (suitable for a game)
 using the simple API and follwing the recommended instructions.

 First I tried with just setting tlength as suggested on the latency page.
 Well, you were supposed to set a flag too, but I guess that is not
 necessary when using the simple API as there are no flags there.

 {{{
     ba.tlength = pa_usec_to_bytes(50*1000, &ss);
     all else = -1;
 }}}

 This gave me about 1s latency instead of 50 ms, not good enough but a
 little better than the 2s default.


 Then I tried some different settings until I found something that worked:

 {{{
     ba.tlength = pa_usec_to_bytes(100*1000, &ss);
     ba.minreq = pa_usec_to_bytes(500, &ss);
     ba.maxlength = pa_usec_to_bytes(100*1000, &ss);
 }}}

 This setting worked fine, 50ms latency got stuttery, but 100 ms seems good
 enough. For some reason minreq must be very low, setting it to 2ms makes
 the playback extremely choppy.

 Anyway, the problem is that this seems like the wrong way to do if you
 read the instructions on the latency page. So it could be just a
 documentation bug. Or are you always supposed to use the complex API for
 games?

-- 
Ticket URL: <http://pulseaudio.org/ticket/709>
PulseAudio <http://pulseaudio.org/>
The PulseAudio Sound Server


More information about the pulseaudio-bugs mailing list