[Openal-devel] Default buffer size
Chris Robinson
chris.kcat at gmail.com
Thu Oct 16 07:50:32 PDT 2008
On Sunday 12 October 2008 05:29:24 am you wrote:
> One more thing then. Why mmap has no effect? What should it do anyway? I
> assume that with it there should be less statics. So the fact that on
> 2048 and with some background job I experience statics can be cause by
> poor implementation in emu10k1 driver (but to be honest if its poorly
> implemented here where would it be better?) or by the OAL loop?
Turning on mmap should just reduce latency (the amount of time between a
function getting called and being processed, then subsequently played by the
card). With mmap, it writes directly to the sound card/ALSA buffer when it
needs an update. Without, it writes to an intermediary buffer which itself is
written to ALSA.
As for increasing the periods not helping, I'm stumped. I have OpenAL Soft
configured with a 4096 refresh, default periods, mmap on, and ALSA itself
uses an 8192 buffer for dmix, and I don't hear an apparent delay.
Does your app happen to rest at all (Sleep on Windows, usleep/nanosleep
elsewhere, or alutSleep with ALUT)? If you rest once in a while in your main
loop (say, after rendering a frame, or while your waiting for a logic tic to
occur), that could help with static, particularly on single-core machines as
it'll let the mixing loop be more responsive to sound card updates.
More information about the Openal-devel
mailing list