x96lee15
x96lee15

Reputation: 121

Use OpenAL to playback to specific channel

I have a system that currently uses two Dolby 7.1 sound cards, each uses OpenAL/alsoft to play different stereo output to different sets of speakers.

Since I do not need all the output channels on both cards, I'm looking to remove one of the sound cards in the system.

I've proven the hardware supports it by modifying my ALSA configuration files and I am able to play a sound to only one set of speakers using aplay -D setA /tmp/sound.wav and an ALSA PCM and the same sound to only the other set of speakers using another PCM: aplay -D setB /tmp/sound.wav. setA and setB are defined in the asound.conf file.

The playback devices that are available when I query OpenAL/alsoft are:

ALSA Software on Xonar DX [Multichannel] (hw:0,0)
ALSA Software on Xonar DX [Digital] (hw:0,1)

I'd love to be able to create "virtual" OpenAL devices that map to specific ALSA PCMs. Is that possible?

I can specify an ALSA PCM in the alsoft.conf file (via the device = tag), but don't see anywhere else that maps alsoft and ALSA devices.

Upvotes: 0

Views: 658

Answers (1)

x96lee15
x96lee15

Reputation: 121

The latest trunk of OpenAL has the exact feature I'm looking for.

From the OpenAL maintainer: https://openal.org/pipermail/openal/2017-May/000639.html

In the latest version, you can specify a mapping of ALSA PCM channels to OpenAL devices as follows:

[alsa]
custom-devices = Stereo Set 1=setA;Stereo Set 2=setB

The format is <OpenAL device name>=<ALSA device name>, with each entry separated by semicolons (note that pre- and post-spaces are preserved, not stripped). These add to the list of devices that are normally provided, and appear after the ALSA Default device. It also doesn't currently verify that the ALSA device is actually valid, the related OpenAL device will just fail to open if it's not.

It appears that the official OpenAL release 1.18 with this feature will be released in June 2017.

Upvotes: 1

Related Questions