|
Re: Streaming issues: msg#00006lib.openal.devel
Hi, > Is there a way to poll to see if a buffer is in use or not? There isn't a way to determine if a Buffer is in use. (Note the Buffer state entires in the header file are really pretty useless because one Buffer could be attached to multiple Sources and therefore could be 'Pending' on one Source, and 'Processed' on another.) It sounds like you are doing everything correctly in your streaming code ... can you check if your streaming logic works on different OpenAL devices ... e.g. the "Generic Software" device ? Thanks, Dan 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. LT <ltmt2k@xxxxxxxxx > To Sent by: openal-devel@xxxxxxxxxxxxxxxxxxxxxx openal-devel-boun m ces@xxxxxxxxxxxxx cc eative.com Subject [Openal-devel] Streaming issues 03/09/2007 07:22 PM Is there a way to poll to see if a buffer is in use or not? I took a peek into AL.h, and saw: /** * Buffer state. * * Not supported for public use (yet). */ #define AL_UNUSED 0x2010 #define AL_PENDING 0x2011 #define AL_PROCESSED 0x2012 Which (I think) is what I need, since what I am trying to do now, is not working out very well. I get very distorted sound. What I am trying to do is to stream memory buffers to openAL. I set up 20 buffers, ( alGenBuffers( NUMBUFFERS, uiBuffers );) then start feeding the buffers, ( alBufferData((...) ), and then doing alSourceQueueBuffers(...). The data size can be as low as 256 bytes, up to a max of 32k bytes, depending on the codec. If it is 256, then each read is also 256 bytes, never more, maybe less when reach the end of the video. I then check alGetSourcei(uiSource, AL_BUFFERS_PROCESSED, &iBuffersProcessed); to see if any buffers are 'processed/done', and if so, I unqueued them. I check alGetError() before & after all openAL calls just for testing now, to make sure it wasn't a error above the call I am doing now. However, I then get some AL_INVALID_OPERATION(0xA004) messages on alBufferData() call, which is not listed in the SDK for a proper return? Assuming it is supposed to be AL_INVALID_VALUE(0xA003), then I know the data is of the same type/frequency/samples & size, so the only other thing according to the SDK is "The size parameter is not valid for the format specified, the buffer is in use, or the data is a NULL pointer." That leaves the buffer is in use, but it was the buffer returned back from alSourceUnqueueBuffers(uiSource, 1, &uiBuffer). I then tracked the array myself, using another array, and marking it used if I would use it in alSourceQueueBuffers(), and then free it when alSourceUnqueueBuffers(). This resulted in : (nodes is just my array that tracks the buffers) nodes[00] = free nodes[01] = used nodes[02] = used nodes[03] = used nodes[04] = used nodes[05] = used nodes[06] = used nodes[07] = used nodes[08] = free nodes[09] = free nodes[10] = free nodes[11] = free nodes[12] = free nodes[13] = free nodes[14] = free nodes[15] = free nodes[16] = free nodes[17] = free nodes[18] = free nodes[19] = free ~~~~~~done dump~~~~ Using buffer nodes[00].. AL_INVALID_OPERATION call -->alBufferData : [0] (size=8144 bytes) [uiBuffers[0] is the translation] I should mention that I followed the SDK playstream sample program, but I do *NOT* fill up all buffers at once. I just can't do that with the media I am streaming in, I just get the audio data when available, then proceed to load it into a buffer. At max, it loads 1 buffer up per main loop, then checks if it is being processed, and if not, then add another buffer. I then thought maybe the queue used by openAL was moving entries up/down in the array, where once something is "processed", it moves the other entries in the array up (or down) but that isn't documented I don't think, so I didn't account for that. This is on windows XP, with onboard audio (Nvidia chipset). So I dunno what to do to fix this issue? Ideas? --Jake. p.s the repository is also down. :( _______________________________________________ Openal-devel mailing list Openal-devel@xxxxxxxxxxxxxxxxxxxxxxx http://opensource.creative.com/mailman/listinfo/openal-devel ForwardSourceID:NT0003E242 |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Streaming issues: 00006, LT |
|---|---|
| Next by Date: | Openal.org & repository down again?: 00006, D. |
| Previous by Thread: | Streaming issuesi: 00006, LT |
| Next by Thread: | Openal.org & repository down again?: 00006, D. |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |