Discussion:
2 context parallel on 2 devices
Christian Schäfer
2012-03-03 16:49:05 UTC
Permalink
Hey guys,
I've started woking on a 3D audio project at university. I'll try to build a 3D-Soundsystem with (at the moment) two 7.1 systems (one at the top of the room, 1 at the bottom).

My approach of thinking was to create 2 contexts (1soundcard per context) that are logically on top of each other. The bottom one should cover the negative y-axis, the other one should cover the positive y-axis. Every time a source is moved or created it is checked, if the y position value is negative or positive and the source added/moved to the matching context.

Now I realized, that it is only possible to have one current active context. Is my approach anyway possible?

Is there a way to have 2 contexts on different soundcards active and moving sources from one to the other?

Could it be possible to make only one context, that runs on two devices? How should I control, what is rendered with which device, in this case? I think this in't possible.


Do you have another approach for my project? Is OpenAL the right thing, to work with more than one soundcard?

It is very hard to find information about OpenAL on the internet that exceeds the introducing examples.


I hope to get an answer. Would be very nice.


Thank you!


Best,
Christian
Chris Robinson
2012-03-04 07:12:17 UTC
Permalink
Post by Christian Schäfer
My approach of thinking was to create 2 contexts (1soundcard per context)
that are logically on top of each other. The bottom one should cover the
negative y-axis, the other one should cover the positive y-axis. Every time
a source is moved or created it is checked, if the y position value is
negative or positive and the source added/moved to the matching context.
Now I realized, that it is only possible to have one current active context.
Is my approach anyway possible?
Hi Christian,

Theoretically it should be possible with OpenAL Soft, as it supports 7.1
output and multiple contexts. Using its (almost complete) loopback extension,
you can have fine control over how much gets rendered from each device and
when. You (your app) would be responsible for getting the rendered audio onto
actual soundcards though, and for making sure the streams stay synchronized,
particularly in case the timer on the two cards can drift.
Post by Christian Schäfer
Is there a way to have 2 contexts on different soundcards active and moving
sources from one to the other?
You can't move sources between contexts, but you can manually duplicate them.
For each source generated on context 1, also generate a source on context 2.
everytime you update a source on context 1, update it also on context 2, etc.
Jason Daly
2012-03-05 19:29:55 UTC
Permalink
Post by Christian Schäfer
Do you have another approach for my project? Is OpenAL the right thing, to work with more than one soundcard?
You might be able to get the parallel context approach working. It's a
bit of a kludge (separate contexts were never really meant to cooperate
in that way), but it could be workable.

If you're feeling ambitious and don't mind a bit of low-level
programming, another approach could be to use the OpenAL-Soft code as a
basis, and write a back-end that directly communicates with both sound
cards as a single context, effectively creating a "virtual" 14.2 channel
device. This way, you could ensure correct amplitude panning between
all 14.2 speakers, and your application code wouldn't have to be any
different from any other OpenAL application. It would work even if you
took it to another system with a "normal" speaker configuration.

--"J"

Continue reading on narkive:
Loading...