[Openal-devel] last call: ALC_EXT_disconnect
E. Wing
ewmailing at gmail.com
Wed Aug 26 01:07:02 PDT 2009
On 8/19/09, Chris Robinson <chris.kcat at gmail.com> wrote:
> On Wednesday 19 August 2009 6:19:05 am E. Wing wrote:
>> I also wanted to put this idea out there. What do people think of
>> having a callback function you can define (via function pointers) to
>> handle device changes? It seems that constantly polling for a device
>> change is awkward at best. I know OpenAL doesn't have any event
>> callbacks, but maybe looking forward to future revisions, maybe this
>> is desirable.
>
> Normally I wouldn't be for callbacks. However, as long as it's restricted to
> the system-level ALC API it may not be that bad. Only concern I would have
> is
> what kind of execution context could be said about the callback? Could it be
> in a real system-level interrupt (rest of the app is stopped)? A background
> thread (eg. the mixer)? The "main" thread (where the last app call to AL
> occurred)? And what about blocking and re-entrancy, given OpenAL's thread-
> safety?
These are all terrific questions. I thought about trying to answer
them, but on reflection, I don't think I'm qualified. I do think it
would interesting to see what other people and platforms do. Maybe
since we are mainly talking about USB device disconnects, do any of
the major platforms have callback APIs for their USB systems?
I have seen that Apple's Core Audio uses a callback system for their
Audio Queues. It might be interesting to know what their underlying
design decisions were. And Apple's Core Video has a callback system
called the display link which is synchronized to the video display's
refresh rate. I do know it runs on a separate high priority thread.
Thanks,
Eric
More information about the Openal-devel
mailing list