[Openal] alSourceUnqueueBuffers failing

Daniel PEACOCK dpeacock at creativelabs.com
Thu Apr 24 09:14:39 PDT 2008





Hi,

Buffers Queued is just that - the number of buffer in the Source's queue.
Buffers Processed is the number of processed buffers in the Source's queue.
You are doing the right thing - calling "stop" on the Source should mark
all the Buffers in the queue as processed (whether they had been played or
not) - so this likely a bug in the OpenAL implementation (which one are you
using?)

I would try Jason's recommendation and inserting ...

alGetSourcei(mAlSource, AL_BUFFERS_PROCESSED, &processed)

after your "stop" call.  It shouldn't be necessary - but may work around a
bug.

Dan
Creative Labs, Inc.

Notice
The information in this message is confidential and may be legally
privileged.  It is intended solely for the addressee.  Access to this
message by anyone else is unauthorized.  If you are not the intended
recipient,  any disclosure,  copying or distribution of the message,  or
any action taken by you in reliance on it,  is prohibited and may be
unlawful.  If you have received this message in error,  please delete it
and contact the sender immediately.  Thank you.




                                                                           
             Fabian Mathews                                                
             <supagu at hotmail.c                                             
             om>                                                        To 
             Sent by:                  Jason Daly <jdaly at ist.ucf.edu>      
             openal-bounces at op                                          cc 
             ensource.creative         "openal at opensource.creative.com"    
             .com                      <openal at opensource.creative.com>    
                                                                   Subject 
                                       RE: [Openal] alSourceUnqueueBuffers 
             04/24/2008 08:31          failing                             
             AM                                                            
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           





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 Learn more!
_______________________________________________
Openal mailing list
Openal at opensource.creative.com
http://opensource.creative.com/mailman/listinfo/openal

ForwardSourceID:NT0005F9BA



More information about the Openal mailing list