[openal] Multiple Output Devices

Patrick Baggett baggett.patrick at gmail.com
Mon May 18 16:54:05 EDT 2020


Thanks Chris, that is clear.

I'll try it out and if I run into any issues, I'll ask here again!

The batching of OpenAL commands per context seems like a pain though. I see
OpenAL-soft has an extension for per-thread contexts which also looks
pretty useful.

--Patrick

On Sat, May 16, 2020 at 2:48 AM Chris Robinson <chris.kcat at gmail.com> wrote:

> On Fri, 15 May 2020 15:44:05 -0500
> Patrick Baggett <baggett.patrick at gmail.com> wrote:
>
> > I've been planning out a split-screen video game. I have a plan for
> > supporting split-screen via a single sound card. Is whether it is
> > possible to have OpenAL render sound to two different sound cards
> > *simultaneously*.
> >
> > Use case: split screen with two players each having headphones and
> > hearing only *their* sounds.
> >
> > There is a limit of one active context per process - but does that
> > mean I can create only one context? Or does it mean that I can create
> > multiple and I just need to constantly use alcMakeCurrent() to switch
> > between them to issue commands? Or would making a context not-current
> > disable all processing? Any idea of the overhead of constantly
> > swapping contexts?
>
> With OpenAL Soft, it's definitely possible to create multiple contexts,
> with multiple devices. Changing the context would only change which one
> commands are issued to, and doesn't stop processing/output for
> non-current contexts. There's not too much overhead with changing
> contexts, though it would be a good idea to minimize changes by
> updating the sounds, environments, and listener for each player
> together. e.g.
>
> alcMakeContextCurrent(Player1Ctx);
> updatePlayer1Sounds();
> updatePlayer1Listener();
>
> alcMakeContextCurrent(Player2Ctx);
> updatePlayer2Sounds();
> updatePlayer2Listener();
>
> ... etc ...
>
> Just be aware each context with each device will be completely
> separate. Each one will have its own list of sources and buffers and
> the like, so if the same sound is heard by multiple players, each one
> would need its own buffer to hold the sound and its own source to play
> it.
>
> > In my testing machine, I have two separate sound cards. The first is a
> > Creative X-FI card that is supported by Creative's OpenAL hardware
> > implementation. The second is an on-board Realtek chip that is
> > supported by the OpenAL-soft (v1.20.1).
>
> Using two separate implementations would depend on using the router. It
> might still work with the router, but I'm not familiar enough with it's
> or the hardware driver's inner workings to know for sure.
> _______________________________________________
> openal mailing list
> openal at openal.org
> http://openal.org/mailman/listinfo/openal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openal.org/pipermail/openal/attachments/20200518/201521a5/attachment.htm>


More information about the openal mailing list