[Openal] alSourceUnqueueBuffers failing

Fabian Mathews supagu at hotmail.com
Thu Apr 24 08:31:57 PDT 2008



my code is:


int queued = 0;
        alGetSourcei(mAlSource, AL_BUFFERS_QUEUED, &queued);
        
        while (queued--)
        {
            ALuint buffer;
            alSourceUnqueueBuffers(mAlSource, 1, &buffer);

            ALenum error = alGetError();
            if (error != AL_NO_ERROR)
                Log::Print("OpenAL Error: %s\n", alGetString(error));
        }

whats the difference between AL_BUFFERS_QUEUED and AL_BUFFERS_PROCESSED?
im pretty sure queued = 2 when i call this, then i get 2 errors. If ay any point i attempt to reuse this source for another streaming sound instead of having 2 buffers bound it says it has 4. I was thinking i may need to simply start playing the and then restop the source before i do this code (just as some hacky work around)

Date: Thu, 24 Apr 2008 10:51:03 -0400
From: jdaly at ist.ucf.edu
To: supagu at hotmail.com
CC: openal at opensource.creative.com
Subject: Re: [Openal] alSourceUnqueueBuffers failing






  
  


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"




_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://opensource.creative.com/pipermail/openal/attachments/20080424/59a194e8/attachment.html


More information about the Openal mailing list