Discussion:
Queueing Buffers question
t***@pegnsean.net
2012-11-30 02:55:32 UTC
Permalink
Quick question on alSourceQueueBuffers() ...

You can't queue the same buffer up more than once, can you?

- Mark
Chris Robinson
2012-11-30 07:26:25 UTC
Permalink
Post by t***@pegnsean.net
Quick question on alSourceQueueBuffers() ...
You can't queue the same buffer up more than once, can you?
You can. The same buffer can be queued multiple times to simulate
looping, or interspersed between other buffers for other effects.
However, as long as there's at least one instance queued onto a source,
the buffer can't normally be modified.
t***@pegnsean.net
2012-11-30 15:31:57 UTC
Permalink
Post by Chris Robinson
Post by t***@pegnsean.net
Quick question on alSourceQueueBuffers() ...
You can't queue the same buffer up more than once, can you?
You can. The same buffer can be queued multiple times to simulate
looping, or interspersed between other buffers for other effects.
However, as long as there's at least one instance queued onto a source,
the buffer can't normally be modified.
_______________________________________________
Openal mailing list
http://opensource.creative.com/mailman/listinfo/openal
Thanks, Chris. As I was writing a followup to my own question, to provide
more detail, I realized that my bug was actually unrelated - I wasn't
actually calling play() on the Source (it was being gated by some other
upstream logic I hadn't updated yet). So things are working now. Funny
how trying to explain a problem to someone tends to jog the old brain
cells.

A follow-up question, though. I have learned how to un-queue used
buffers, which is pretty easy.

Is there any way to un-queue *pending* buffers that have been queued but
haven't been played yet?

- Mark
Chris Robinson
2012-12-03 09:04:58 UTC
Permalink
Post by t***@pegnsean.net
A follow-up question, though. I have learned how to un-queue used
buffers, which is pretty easy.
Is there any way to un-queue *pending* buffers that have been queued but
haven't been played yet?
Unfortunately no, because that risks unqueueing a buffer that is being
processed. You'd have to stop the source, which marks all buffers as
processed and resets the source offset.
t***@pegnsean.net
2012-12-03 13:50:58 UTC
Permalink
Post by Chris Robinson
Post by t***@pegnsean.net
A follow-up question, though. I have learned how to un-queue used
buffers, which is pretty easy.
Is there any way to un-queue *pending* buffers that have been queued but
haven't been played yet?
Unfortunately no, because that risks unqueueing a buffer that is being
processed. You'd have to stop the source, which marks all buffers as
processed and resets the source offset.
_______________________________________________
Openal mailing list
http://opensource.creative.com/mailman/listinfo/openal
OK, thanks. Good to know. I don't believe this is a show-stopper, and I
do understand the concern there.

Chris Robinson
2012-11-30 09:59:10 UTC
Permalink
Hi
I'm porting some XAudio2 stuff (from PC/XBox) to the OpenAL (MAC, but I
may use OAL-SOFT as well) and I'm in need to use limiter
to dynamicaly adjust volumes of played sounds based on feedback
information from mixer itself.
In XAudio there is a XAPO filter 'volume meter' with returns Average and
Peak _UNCLIPPED_ volumes per channel from each mixer quantum, from that
feedback information
I could easily create limiter that eliminates audio clipping almost
completly.
How to acomplish this properly in OpenAL ? I do not see any extension
that could give me the feedback info of UNCLIPPED volumes.
There isn't, currently. It might be a good idea to make an extension
that provides the average and peak amplitudes for each channel, though.

Or I could add a compressor. EFX actually contains a compressor effect
(OpenAL Soft doesn't implement it yet), but it probably wouldn't be
useful without being able to apply it to the full mix so it handles the
combination of the direct path and any and all effects.

EFX really needs a way to connect multiple effects together into a
chain. I hope I'll be able to do something like that for OpenAL Soft
somewhat soon.
For now I'v implemented dirty hack in OpenAL-Soft that calculates MAX of
all samples produced by mixer before clipping (in each step (2048
samples or so)) and developer my extension from this ... but I want to
avoid custom OAL builds if it is possible at all (for maintance reasons
mainly).
An alternative may be to use the ALC_SOFT_loopback extension to get the
rendered samples, which you can then calculate the peaks and modify as
you need before writing out somehow (though this will limit output a
bit; HRTF won't work, and you'll be restricted with the speaker configs
compared to letting OpenAL handle it internally).
Mariusz 'MX' Szaflik
2012-11-30 08:35:10 UTC
Permalink
Hi

I'm porting some XAudio2 stuff (from PC/XBox) to the OpenAL (MAC, but I
may use OAL-SOFT as well) and I'm in need to use limiter
to dynamicaly adjust volumes of played sounds based on feedback
information from mixer itself.
In XAudio there is a XAPO filter 'volume meter' with returns Average and
Peak _UNCLIPPED_ volumes per channel from each mixer quantum, from that
feedback information
I could easily create limiter that eliminates audio clipping almost
completly.

How to acomplish this properly in OpenAL ? I do not see any extension
that could give me the feedback info of UNCLIPPED volumes.
For now I'v implemented dirty hack in OpenAL-Soft that calculates MAX of
all samples produced by mixer before clipping (in each step (2048
samples or so)) and developer my extension from this ... but I want to
avoid custom OAL builds if it is possible at all (for maintance reasons
mainly).

Thanks for any ideas.
Loading...