[Openal] Do any implementations support alcSuspendContext correctly?
E. Wing
ewmailing at gmail.com
Wed Jul 22 18:55:23 PDT 2009
I am looking at the Mac OS X implementation of alcSuspendContext
(partly because I am trying to figure out the best way to handle a
phone call interruption on iPhone).
I discovered that it is a no-op. I found the following comment in the code:
// This code breaks Doom 3 [4554491] - The 1.0 implementation was a no op.
// Since alcProcessContext()/alcSuspendContext() are also no ops on
sound c ards with OpenAL imps, this should be ok
I was rather startled at the claim that nobody implemented this.
I skimmed through the OpenAL Soft code, and it looks like a no-op there too.
On iPhone, it seems to behave as a no-op. But interestingly, if I make
the current context NULL, the behavior acts like a SuspendContext,
where the audio state pauses. So if I was in the middle of a sound,
when I resume the context after some arbitrary amount of time, the
sound resumes from where it lefts off.
But thinking about this, this is really not the behavior I want from
switching contexts. I've been toying with a multiple view design
pattern for Mac desktop applications where I have multiple OpenGL
views (each with a separate context). I want to mirror that with each
having its own OpenAL context to go with each view. When the user
changes the active view focus, I want to switch OpenAL contexts to the
new active view. But if a sound was in the middle of playing on the
context that is being swapped out, I don't necessarily want the
context suspended. (The audio is likely coordinated with the visuals
and the visuals keep moving as they may be visualizing live data.)
Any how, I am wondering, do any implementations out there support
alcSuspendContext correctly? And do all the implementations suspend
the context if you swap out the current context?
Thanks,
Eric
More information about the Openal
mailing list