From: Bill Kendrick <nbs@so...> - 2009-01-15 02:49:07
We've had issues with Tux4Kids games on Pulseaudio, and it looks perhaps
to be SDL's fault when it talks to Pules's ALSA compat layer...
or something. I know nothing about this stuff. :)
----- Forwarded message from elupus <elupus@...> -----
Date: Wed, 14 Jan 2009 15:57:34 +0100
From: elupus <elupus@...>
Subject: [SDL] ALSA output doesn't set buffer size (likely fix for pulse
Reply-To: "A list for developers using the SDL library. (includes SDL-announce)" <sdl@...>
I just noticed that the alsa audio output never set the alsa hardware's
buffer size. I think this is why SDL has such latencies when pulse audio is
SDL has a notion of always writing data even when there is only silence,
this means that it will ALWAYS fill any buffer in the audio hardware to
For the pulse alsa "hardware", the default internal buffer size is probably
quite huge. This means that this get's filled, and any audio events
generated by SDL will get queued at the end of this huge buffer.
There is two solutions to this problem
* implement ALSA_WaitAudio(_THIS) and make it only return if the alsa
buffer size is less than two times the wanted SDL buffer size
* call snd_pcm_hw_params_set_buffer_size_near (should be set to two times
the period size
I haven't verified this yet, but i'm quite sure it should fix the issue.
SDL mailing list
----- End forwarded message -----
"Tux Paint" - free children's drawing software for Windows / Mac OS X / Linux!
Download it today! http://www.tuxpaint.org/