RME cards: ADAT interface as multiple analog channels (Howto)

From the ALSA wiki

Jump to: navigation, search

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:

  1. Where the f**k are these multiple outputs? Don't see anything in my mixer application (e.g. alsamixer)
  2. 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:

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


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.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox