RME HDSPe MADI and ALSA
The RME HDSPe MADI PCI Express card works with ALSA and Linux, but at the
time of writing hdspconf doesn't recognize it. Many of the control
values can be set using amixer and alsamixer.
Controls can be displayed using amixer:
amixer -c0 controls | less
and current control values:
amixer -c0 contents | less
where -c0 refers to the first sound card in the system (use -c1 for second card,
-c2 for third, etc.).
To display a specific value, eg. System Clock Mode
amixer -c0 cget iface=MIXER,name="System Clock Mode"
Clock Source
The default clock source is internal. To set the card to slave to an external
clock:
amixer -c0 cset iface=MIXER,name="System Clock Mode" 1
which sets the sample clock source to AutoSync (item 1 in the enumerated list).
This presupposes that there is a valid clock source plugged in and the Error
LED is green (and in the case of Word Clock input, the green Lock LED is lit).
IMPORTANT:
At time of writing, ALSA doesn't detect the external clock frequency
automatically at sample rates above 48kHz. The "Internal Clock" has to be set
manually to the same frequency as the external clock to notify ALSA and jackd.
External sync works correctly; the manual setting is just to
notify the software. If you forget this jackd will fail to start.
Problem With SSL Alpha-Link at 96kHz Sample Rate
The HDSPe MADI works fine with the Solid State Logic Alpha-Link MADI AX and
MADI SX at 44.1, 48 and 88.2 kHz in non-S/MUX mode, but it doesn't work at
96kHz. This is due to a bug in the Alpha-Link which causes it to incorrectly
switch the output to 48kHz frames when running at 96kHz in non-SMUX
mode. It needs to be set to SMUX mode in order to work at 96kHz.
To set the HDSPe MADI to run at 96kHz in SMUX mode:
amixer -c0 cset iface=MIXER,name="Internal Clock" 5
amixer -c0 cset iface=MIXER,name="MADI Speed Mode" 1
amixer -c0 cset iface=MIXER,name="Disable 96K frames" on
Note the upper-case 'K' in '96K' and lower-case 'f' in 'frames' in the third
command. Also note that the internal clock needs to be set to the correct
sample rate even if synchronised to an external clock.
Input Source
To change the MADI input from the default coaxial to optical:
amixer -c0 cset iface=MIXER,name="Input Select" 0
Note that this isn't necessary to get a valid clock signal from the optical
MADI input, as AutoSync will detect it whether selected or not.
Other controls
can be set using similar command syntax after looking at the information
displayed by `amixer -c0 controls'. Some of these are read-only and depend on
other writeable values being set; they are provided as indicators only.
Levels
Playback levels can be set from the text console using alsamixer.
The default playback
level is zero, so these need to be set to get any output.
Capture levels can not be altered
from unity gain, despite alsamixer showing movable faders when started with the
capture option (they don't do anything). To start alsamixer:
alsamixer -c0
which starts it with playback level faders displayed.
Values range linearly from 0 to 100, with 100 being +6dB and 50 being unity
gain.
Alternatively, starting hdspmixer (with X running) will
initialise the playback levels to unity gain.
Save Settings
To save the current settings:
/usr/sbin/alsactl -f asound.state store
This will store the current settings in the file asound.state. To restore
these settings next time they are needed:
/usr/sbin/alsactl -f asound.state restore
Here are a couple of working asound.state files which have been tested
on Debian 10 with 5.4 kernel. Both assume HDSPe MADI is the
default device, with clock synchronised to MADI input:
asound.state-hdspe-madi-48k
asound.state-hdspe-madi-96k