[Openal] Sound stuttering for small buffer sizes in hardware OpenAL implementation for Audigy SE

Tom Keresztes tom at shadowlightgames.com
Mon May 25 07:17:12 PDT 2009


Hi,
 
   Generally this is a result of the cpu not updating the buffers in 
time, probably the cpu load is too high and the sound update does not 
run often enough (i have a sound updates in a secondary thread which 
updates at 25 per sec / iPhone, and while cpu is capable of doing the 
mixing the flash is not fast enough to read enough data on time - while 
streaming vorbis audio). Running the sound thread as realtime was 
unnecessary.
   Also, please note that Audigy SE is not a true Audigy, as it lacks 
hardware mixing (though not sure it is the lack of hardware accelerated 
3d audio or hw acceleration in general) which might make the issue more 
audible. You can verify this when you query the the number of processed 
buffers, if it is larger than one, you definitely need to increase the 
frequency of updates (and guarantee that they happen).

Thats my 5 cents,
   Tom K.

Thilo Schulz wrote:
> Hello,
>
> I have a user who uses the "Sound Blaster Audigy SE".. when he uses one of the 
> two upper native devices:
>
> Lautsprecher (SB Audigy)
> Digitale Audioschnittstelle (SB Audigy)
> Generic Software
>
> the background music playing in the game stutters. Generic Software plays 
> fine.
>
> There are 4 buffers which are queued, unqueued, refilled with data and 
> requeued, and always chunks of 4096bytes of 44khz sampled 16 bit pcm stereo 
> data are fed to each buffer. The buffers should be refilled right on time, 
> there is always enough data available, there is only one or two buffers 
> consumed after each frame so all should be fine. Still, the sound stutters.
> It seems to me as though the hardware OpenAL device would not be able to 
> correctly switch in time to the next queued buffer if each buffer is only 
> 4096 bytes large (meaning 1024 samples). Doubling the buffer size to 8192 
> gets rid of the problem.
>
> Now I am left wondering: why does it work on Generic Software but not 
> Hardware? What would be a good buffer size to use to make sure that it works 
> on all hardware?
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> Openal mailing list
> Openal at opensource.creative.com
> http://opensource.creative.com/mailman/listinfo/openal
>   



More information about the Openal mailing list