[Openal] alSourceUnqueueBuffers failing

Jason Daly jdaly at ist.ucf.edu
Thu Apr 24 07:51:03 PDT 2008


Fabian Mathews wrote:
> I have a situation where when im finished streaming ogg, i reset it to 
> the beginning so its ready to play again
>
> the steps i do is this:
>
> 1. stop the source
> 2. call alSourceUnqueueBuffers to unqueue any buffers
> 3. re-open the ogg file
> 4.  queue buffers using alSourceQueueBuffers
>
> the problem is, if i decide i dont want to play the streaming ogg 
> again, i then attempt to release the sound which does this:
>
> 1. stop the source
> 2. call alSourceUnqueueBuffers to unqueue any buffers
>
> problem is that step 2, alSourceUnqueueBuffers results in an invalid 
> operation error.
> any ideas on why this is?


What OpenAL implementation/audio hardware are you using?

How exactly are you calling alSourceUnqueueBuffers in your "release" code?

One thought I have is that you may effectively be trying to unqueue zero 
buffers.  Unfortunately, the spec isn't clear on what is supposed to 
happen here, so your implementation might just be throwing an 
AL_INVALID_OPERATION simply because you're trying to unqueue zero 
buffers.  A workaround is to check the number of processed buffers after 
you call alSourceStop():

alGetIntegerv(sourceID, AL_BUFFERS_PROCESSED, &numBuffers);

...and then only call alSourceUnqueueBuffers() when there are buffers to 
unqueue.

--"J"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://opensource.creative.com/pipermail/openal/attachments/20080424/e2989b89/attachment.html


More information about the Openal mailing list