RME cards: ADAT interface as multiple analog channels (Howto)
From the ALSA wiki
m (Make one large code block) |
(Add hint how to achieve the splitting also for input) |
||
| Line 15: | Line 15: | ||
Now, beautiful but difficult ALSA configuration, makes it possible to provide software mixing controls for those ADAT channels, since the RME card does not provide hardware mixing for ADAT (which makes sense for its intended usage). | Now, beautiful but difficult ALSA configuration, makes it possible to provide software mixing controls for those ADAT channels, since the RME card does not provide hardware mixing for ADAT (which makes sense for its intended usage). | ||
| - | |||
== asound.conf, ~/asoundrc example == | == asound.conf, ~/asoundrc example == | ||
| Line 126: | Line 125: | ||
</code> | </code> | ||
| + | To split the devices for input instead for output, replace <code>dmix</code> with <code>dsnoop</code>. See also [http://article.gmane.org/gmane.linux.alsa.user/34317]. | ||
== Using the new, virtual channels == | == Using the new, virtual channels == | ||
| Line 143: | Line 143: | ||
('''Caution:''' Do not confuse the virtual devices "softvol1" with "stereo1", because using "stereo1" directly will ignore the volume settings adjusted using e.g. alsamixer) | ('''Caution:''' Do not confuse the virtual devices "softvol1" with "stereo1", because using "stereo1" directly will ignore the volume settings adjusted using e.g. alsamixer) | ||
<code>speaker-test -c 2 -D softvol1</code> | <code>speaker-test -c 2 -D softvol1</code> | ||
| - | |||
== Additional information == | == Additional information == | ||
Latest revision as of 09:43, 11 May 2010
Contents |
Introduction
Whoever owns an RME Digi96 (or similar RME-) soundcard and wants to use its multiple output channels not for multitrack recording/mixing, but as separate stereo outputs in regular applications like mplayer, amarok or any other audio app that handles ALSA, might have stumbled over 2 questions:
- Where the f**k are these multiple outputs? Don't see anything in my mixer application (e.g. alsamixer)
- qjackctl shows 8 outputs alright, but how can I use them with a non-jack-aware, plain-alsa application with regular stereo output?
This HowTo describes how to configure ALSA to handle that. It is based on a "Digi96/8 PAD" card, but should apply to others as well.
Technical background
The 8 input/output channels are available as ADAT only. Alsa registers them as hw 0, device 1. The other output "hw0,device0" is the single stereo in/out on the card itself, which is the one that shows up in mixer apps.
If you want to have analog outputs, you require additional hardware to translate the digital ADAT signal into analog. So you can either get an AEB 4/8 extension board from RME, or an ADAT converter device from any manufacturer. I'd prefer the 2nd option, since it's compatible to any ADAT capable device.
Now, beautiful but difficult ALSA configuration, makes it possible to provide software mixing controls for those ADAT channels, since the RME card does not provide hardware mixing for ADAT (which makes sense for its intended usage).
asound.conf, ~/asoundrc example
The following /etc/asound.conf (or ~/.asoundrc) groups the 8 mono ADAT channels into 4 stereo outputs with software mixing (using alsa's "softvol"). The great thing is, that they actually register as soundcard controls and are therefore listed in any application like regular outputs and volume controls.
This is a copy of our configuration file:
pcm.snd-card {
type hw
card 0
device 1
}
ctl.snd-card {
type hw
card 0
device 1
}
pcm.dmixer {
type dmix
ipc_key 1024
ipc_perm 0666
slave.pcm "snd-card"
slave {
period_time 1000
period_size 64
buffer_size 4096
rate 44100
channels 8
}
bindings {
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
}
}
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm.stereo1 {
type plug
slave {
pcm "dmixer"
channels 8
}
ttable.0.0 1
ttable.1.1 1
}
pcm.stereo2 {
type plug
slave {
pcm "dmixer"
channels 8
}
ttable.0.2 1
ttable.1.3 1
}
pcm.stereo3 {
type plug
slave {
pcm "dmixer"
channels 8
}
ttable.0.4 1
ttable.1.5 1
}
pcm.stereo4 {
type plug
slave {
pcm "dmixer"
channels 8
}
ttable.0.6 1
ttable.1.7 1
}
pcm.softvol1 {
type softvol
slave {
pcm "stereo1"
}
control {
name "Stereo_1"
card 0
}
}
pcm.softvol2 {
type softvol
slave {
pcm "stereo2"
}
control {
name "Stereo_2"
card 0
}
}
To split the devices for input instead for output, replace dmix with dsnoop. See also [1].
Using the new, virtual channels
With the above configuration, ALSA is aware of the following new device names:
- stereo1
- stereo2
- stereo3
- stereo4
- softvol1
- softvol2
You can now use any of these virtual ALSA devices with any ALSA-enabled application (mplayer, amarok, ...).
However, in order to test the output, you can use the "speaker-test" command:
(Caution: Do not confuse the virtual devices "softvol1" with "stereo1", because using "stereo1" directly will ignore the volume settings adjusted using e.g. alsamixer)
speaker-test -c 2 -D softvol1
Additional information
- If you want to use all 8 ADAT channels as analog outputs, simply copy/paste the "pcm.softvol" blocks and rename them to "stereo3"/"stereo4" respectively.
Note: For an "AEB 4-O" expansion board, only 2 stereo channels are physically available. - If you have multiple soundcards in your PC and the RME is not the first one, change all lines with "card 0" to the correct value (e.g. "card 1" if it's the 2nd card).
- Important: It seems that the settings take effect (possibly after calling "/etc/init.d/alsa-utils restart" and the virtual softvol-channels are available - even (!) if they don't show up in alsamixer.
Troubleshooting
In case you're having problem with "zombie" softvol channels showing up in e.g. alsamixer, see this article about how to reset and clean alsactl settings.