[Openal] Problem with alSourceUnqueueBuffers

Garin Hiebert garinh at cheesetoast.net
Wed Jun 3 08:11:52 PDT 2009


> You should also include code that
> checks that the Source is still playing, and if not, include logic  
> to start
> it playing again.

This is why there are no errors returned, by the way.  As far as  
OpenAL is concerned, everything is fine.  It runs out of data and then  
stops the source just like it should.  No error.   ;-)

In summary, make two changes:

1)  The implementation should be changed such that it has 100ms or so  
of data available in multiple buffers (four or so seems "reasonable,"  
but as few as two _should_ work).

2)  Detect an "under-run" by looking for streams which have stopped  
sources.  When detected, buffer up a full set of buffers for that  
source and do a Play on that source.  In most products, this should be  
a very rare occurrence, but may still happen during long disk access  
or some other operation which stalls the engine for a while.

Garin




More information about the Openal mailing list