Discussion:
[LAD] Headless RME HDSP/HDSPM mixer settings
raf
2013-11-27 17:41:01 UTC
Permalink
hello,

tested successfully with a HDSP 9652.
great usefull tool !

notice that if hdspmixer has not been started after bootup (means the card is not initialized in some way), hdspdump throw no error, and creates a dump file filled with 0. It means that alsa is not throwing errors either as your programs goes nicely to the end.

I've been looking at hdspmixer code for some days now to make it console only, removing FLTK dependencies. Your program gives me motivation to go on with this hard task.

Raphaël
Re: Headless RME HDSP/HDSPM mixer settings
Paul Davis
2013-11-27 17:49:41 UTC
Permalink
Post by raf
hello,
tested successfully with a HDSP 9652.
great usefull tool !
notice that if hdspmixer has not been started after bootup (means the card
is not initialized in some way), hdspdump throw no error, and creates a
dump file filled with 0. It means that alsa is not throwing errors either
as your programs goes nicely to the end.
I've been looking at hdspmixer code for some days now to make it console
only, removing FLTK dependencies. Your program gives me motivation to go on
with this hard task.
i have no idea what a "console-only" version of hdspmixer would actually
do, but perhaps you could consider the following as inspiration also (which
uses amixer(1) to control the hdsp matrix mixer from the cmd line):

#!/bin/bash

AMIXER="amixer -q"
CARD="-c 1"

if [ x$1 = xon ] ; then
gain=32768
verb="route"
else
gain=0
verb="mute"
fi

shift;

#input_source : 0-25 (physical channels),
# 26-51 (software playback)
#output_source : 0-25 (physical channels),
# 26-27 (line out)

case $1 in
play)
for chn in $(seq 26 51);do
$AMIXER $CARD cset numid=5 $chn,$(($chn-26)),$gain
done
;;

thru)
for input in $(seq 0 25);do
for output in $(seq 0 25); do
if [ $input != $output ]; then
$AMIXER $CARD cset numid=5 $input,$output,$gain
fi
done
done
;;

thru12)
$AMIXER $CARD cset numid=5 0,0,$gain
$AMIXER $CARD cset numid=5 1,1,$gain
;;

mon)
for chn in $(seq 26 51);do
if [ $(($chn % 2)) -eq 0 ] ; then
$AMIXER $CARD cset numid=5 $chn,26,$gain
else
$AMIXER $CARD cset numid=5 $chn,27,$gain
fi
done
;;

all)
for input in $(seq 0 51); do
for output in $(seq 0 27); do
echo -n "."
if [ $gain = 0 -o $input != $output ]; then
$AMIXER $CARD cset numid=5 $input,$output,$gain
fi
done
echo
done
;;

off)
for input in $(seq 0 51); do
for output in $(seq 0 27); do
echo -n "."
if [ $gain = 0 -o $input != $output ]; then
$AMIXER $CARD cset numid=5 $input,$output,$gain
fi
done
echo
done
;;
esac
Fons Adriaensen
2013-11-27 23:39:24 UTC
Permalink
Post by Paul Davis
i have no idea what a "console-only" version of hdspmixer would actually
do, but perhaps you could consider the following as inspiration also (which
#!/bin/bash
AMIXER="amixer -q"
CARD="-c 1"
...
Very similar to the script I use to init a Multiface:


#!/bin/bash

# Multiface II mixer
#
# inputs: 0-7 (analog), 16-23 (adat), 24-25 (spdif) 26-33, 42..51 (playback channels)
# outputs: 0-7 (analog), 16-23 (adat) 24-25 (spdif), 26-27 (phones)

device=hw:DSP
gain=32768

function set_gain ()
{
amixer -D $device cset numid=5 $1,$2,$3 > /dev/null 2>&1
}

function reset_matrix ()
{
for out in $(seq 0 27); do
for inp in $(seq 0 51); do
set_gain $inp $out 0
done
done
}

echo Clearing matrix mixer ...

# Reset all
reset_matrix

echo Setting default connections ...

# Playback 1..8 to analog outs
set_gain 26 0 $gain
set_gain 27 1 $gain
set_gain 28 2 $gain
set_gain 29 3 $gain
set_gain 30 4 $gain
set_gain 31 5 $gain
set_gain 32 6 $gain
set_gain 33 7 $gain

# Playback 9..16 to ADAT outs
set_gain 42 16 $gain
set_gain 43 17 $gain
set_gain 44 18 $gain
set_gain 45 19 $gain
set_gain 46 20 $gain
set_gain 47 23 $gain
set_gain 48 24 $gain
set_gain 49 25 $gain

# Playback 17,18 to headphone amp
set_gain 50 26 $gain
set_gain 51 27 $gain

amixer -D$device sset 'Preferred Sync Reference' 'ADAT1'
amixer -D$device sset 'Sample Clock Source' 'AutoSync'

echo Done.

exit 0


Ciao,
--
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)
raf
2013-12-01 20:13:46 UTC
Permalink
thanks for sharing your scripts, very useful to me !

In fact i've been fooled myself with system messages doing this :
[***@localhost ~]$ amixer -D hw:DSP cset numid=5 0,8,12222
Could not find the specified element

Seeing these messages, i though it wasn't working, as by this time i hadn't speakers connected to the soundcard to verify that the sound was actually coming through... So this this actually works despite the error message... my fault !

[***@localhost ~]$ lspci
...
05:00.0 Multimedia audio controller: Xilinx Corporation RME Hammerfall DSP (rev 6a)

Raphaël
Post by Paul Davis
Post by Paul Davis
i have no idea what a "console-only" version of hdspmixer would actually
do, but perhaps you could consider the following as inspiration also (which
#!/bin/bash
AMIXER="amixer -q"
CARD="-c 1"
...
#!/bin/bash
# Multiface II mixer
#
# inputs: 0-7 (analog), 16-23 (adat), 24-25 (spdif) 26-33, 42..51 (playback channels)
# outputs: 0-7 (analog), 16-23 (adat) 24-25 (spdif), 26-27 (phones)
device=hw:DSP
gain=32768
function set_gain ()
{
amixer -D $device cset numid=5 $1,$2,$3 > /dev/null 2>&1
}
function reset_matrix ()
{
for out in $(seq 0 27); do
for inp in $(seq 0 51); do
set_gain $inp $out 0
done
done
}
echo Clearing matrix mixer ...
# Reset all
reset_matrix
echo Setting default connections ...
# Playback 1..8 to analog outs
set_gain 26 0 $gain
set_gain 27 1 $gain
set_gain 28 2 $gain
set_gain 29 3 $gain
set_gain 30 4 $gain
set_gain 31 5 $gain
set_gain 32 6 $gain
set_gain 33 7 $gain
# Playback 9..16 to ADAT outs
set_gain 42 16 $gain
set_gain 43 17 $gain
set_gain 44 18 $gain
set_gain 45 19 $gain
set_gain 46 20 $gain
set_gain 47 23 $gain
set_gain 48 24 $gain
set_gain 49 25 $gain
# Playback 17,18 to headphone amp
set_gain 50 26 $gain
set_gain 51 27 $gain
amixer -D$device sset 'Preferred Sync Reference' 'ADAT1'
amixer -D$device sset 'Sample Clock Source' 'AutoSync'
echo Done.
exit 0
Ciao,
--
FA
A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)
_______________________________________________
Linux-audio-dev mailing list
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Fons Adriaensen
2013-12-01 22:34:36 UTC
Permalink
Post by raf
thanks for sharing your scripts, very useful to me !
Could not find the specified element
For a Multiface the error would make sense as there is no mixer
output with index 8.

Ciao,
--
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)
Raphaël Mouneyres
2013-12-02 08:57:47 UTC
Permalink
i always have the warning message, and to me it is related to using
"numid=5", whatever the output index i use

[***@localhost ~]$ amixer -D hw:DSP cset numid=5 0,0,12222
Could not find the specified element
[***@localhost ~]$ ./hdspdump hw:DSP > mix6
[***@localhost ~]$ diff mix5 mix6
0a1
Post by Fons Adriaensen
12222
8,9c9
< 0
< 0
---
Post by Fons Adriaensen
12222
3336c3336
< 0
---
Post by Fons Adriaensen
12222
6663c6663
< 0
---
Post by Fons Adriaensen
12222
[***@localhost ~]$ amixer -D hw:DSP cset numid=5 0,8,4321
Could not find the specified element
[***@localhost ~]$ ./hdspdump hw:DSP > mix7
[***@localhost ~]$ diff mix6 mix7
9c9
< 12222
---
Post by Fons Adriaensen
4321
3336c3336
< 12222
---
Post by Fons Adriaensen
4321
6663c6663
< 12222
---
Post by Fons Adriaensen
4321
[***@localhost ~]$ amixer -D hw:DSP
Simple mixer control 'Line Out',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'IEC958 Emphasis Bit',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'IEC958 Input Connector',0
Capabilities: enum
Items: 'Optical' 'Coaxial' 'Internal'
Item0: 'Coaxial'
Simple mixer control 'IEC958 Non-audio Bit',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'IEC958 Output also on ADAT1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'IEC958 Professional Bit',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'ADAT Lock Status',1
Capabilities: enum
Items: 'No Lock' 'Lock' 'Sync'
Item0: 'No Lock'
Simple mixer control 'ADAT Lock Status',2
Capabilities: enum
Items: 'No Lock' 'Lock' 'Sync'
Item0: 'No Lock'
Simple mixer control 'ADAT Lock Status',3
Capabilities: enum
Items: 'No Lock' 'Lock' 'Sync'
Item0: 'No Lock'
Simple mixer control 'ADAT Sync Lock Status',0
Capabilities: enum
Items: 'No Lock' 'Lock' 'Sync'
Item0: 'No Lock'
Simple mixer control 'Analog Extension Board',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'AutoSync Reference',0
Capabilities: enum
Items: 'Word' 'ADAT Sync' 'IEC958' 'None' 'ADAT1' 'ADAT2' 'ADAT3'
Item0: 'None'
Simple mixer control 'External Rate',0
Capabilities: enum
Items: '32000' '44100' '48000' '64000' '88200' '96000' 'None'
Item0: 'None'
Simple mixer control 'Preferred Sync Reference',0
Capabilities: enum
Items: 'Word' 'IEC958' 'ADAT1' 'ADAT Sync' 'ADAT2' 'ADAT3'
Item0: 'ADAT1'
Simple mixer control 'SPDIF Lock Status',0
Capabilities: enum
Items: 'No Lock' 'Lock' 'Sync'
Item0: 'No Lock'
Simple mixer control 'SPDIF Sample Rate',0
Capabilities: enum
Items: '32000' '44100' '48000' '64000' '88200' '96000' 'None'
Item0: 'None'
Simple mixer control 'Sample Clock Source',0
Capabilities: enum
Items: 'AutoSync' 'Internal 32.0 kHz' 'Internal 44.1 kHz' 'Internal
48.0 kHz' 'Internal 64.0 kHz' 'Internal 88.2 kHz' 'Internal 96.0 kHz'
Item0: 'Internal 48.0 kHz'
Simple mixer control 'Sample Clock Source Locking',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'System Clock Mode',0
Capabilities: enum
Items: 'Master' 'Slave'
Item0: 'Master'
Simple mixer control 'System Sample Rate',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 0
Mono: 0 [0%]
Simple mixer control 'Word Clock Lock Status',0
Capabilities: enum
Items: 'No Lock' 'Lock' 'Sync'
Item0: 'No Lock'
Post by Fons Adriaensen
Post by raf
thanks for sharing your scripts, very useful to me !
Could not find the specified element
For a Multiface the error would make sense as there is no mixer
output with index 8.
Ciao,
--
FA
A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)
Mario Lang
2013-12-03 23:15:11 UTC
Permalink
Post by Paul Davis
Post by Paul Davis
i have no idea what a "console-only" version of hdspmixer would actually
do, but perhaps you could consider the following as inspiration also (which
#!/bin/bash
AMIXER="amixer -q"
CARD="-c 1"
...
#!/bin/bash
# Multiface II mixer
I once knew how to set double rate (96khz) on a multiface with amixer,
but I unfortunately lost that line and was recently not able to google
it up myself. Can anyone refresh my memory please?
--
CYa,
⡍⠁⠗⠊⠕
Adrian Knoth
2013-12-04 14:59:39 UTC
Permalink
Post by Mario Lang
I once knew how to set double rate (96khz) on a multiface with amixer,
but I unfortunately lost that line and was recently not able to google
it up myself. Can anyone refresh my memory please?
amixer -D hw:DSP cset numid=11 6

Or you simply start jackd with -r 96000 ;)



Cheers
--
mail: ***@thur.de http://adi.thur.de PGP/GPG: key via keyserver
Esben Stien
2013-12-04 19:53:47 UTC
Permalink
Post by Mario Lang
I once knew how to set double rate (96khz) on a multiface with amixer,
but I unfortunately lost that line and was recently not able to google
it up myself. Can anyone refresh my memory please?
amixer -c $1 cset numid=11,iface=PCM,name='Sample Clock Source' 6
--
Esben Stien is ***@e s a
http://www. s t n m
irc://irc. b - i . e/%23contact
sip:b0ef@ e e
jid:b0ef@ n n
Esben Stien
2013-12-04 19:58:05 UTC
Permalink
Post by Paul Davis
i have no idea what a "console-only" version of hdspmixer would
actually do
How about only working in console?

I'm pretty sure he means ncurses interface, which would be really nice.

I only initialize the card with a script, but having an ncurses version
would be nice.
--
Esben Stien is ***@e s a
http://www. s t n m
irc://irc. b - i . e/%23contact
sip:b0ef@ e e
jid:b0ef@ n n
Markus Seeber
2013-12-04 19:19:55 UTC
Permalink
Post by Esben Stien
Post by Paul Davis
i have no idea what a "console-only" version of hdspmixer would
actually do
How about only working in console?
I'm pretty sure he means ncurses interface, which would be really nice.
I only initialize the card with a script, but having an ncurses version
would be nice.
There is "alsamixer", which works with many RME cards i got into my
fingers so far and offers a ncurses user interface to control basic
settings like channel gains, but doesn't offer access to the routing
matrix AFAIK.

But maybe you could explain more in detail, what you expect and how it
would increase productivity, since setting 16 channels or most likely
more to the same gain value with alsamixer manually can take much longer
than setting them with a small script and might get very frustrating,
especially if you have to do it very often ;-)

Greetings

Markus

Adrian Knoth
2013-11-28 22:17:17 UTC
Permalink
Post by raf
notice that if hdspmixer has not been started after bootup (means the
card is not initialized in some way), hdspdump throw no error, and
creates a dump file filled with 0. It means that alsa is not throwing
errors either as your programs goes nicely to the end.
The card is always fully initialised, the driver (kernel) previously
wrote all these zeroes to mute all channels. It's the default state to
prevent unintended output on any channel.
Post by raf
I've been looking at hdspmixer code for some days now to make it
console only, removing FLTK dependencies.
Speaking of which, I'm currently hacking a matrix mixer for RME
cards:

Loading Image...


It's a toy project to improve my rotten C++ skills, so I chose gtkmm.

I still need to add support for double/quad speed modes and maybe polish
the GUI a bit, but otherwise, it's fully functional.

In contrast to hdspmixer, it doesn't duplicate the same
information/constants over and over again, every RME model is its own
C++ class inherited from a universal base class and only defining the
relevant bits (number of I/O/P channels, channel names).

In other words, it's a lot more readable, but since I wrote it, I'm
biased. ;)



Cheers
Arnold Krille
2013-11-28 22:43:15 UTC
Permalink
On Thu, 28 Nov 2013 23:17:17 +0100 Adrian Knoth
Post by Adrian Knoth
Speaking of which, I'm currently hacking a matrix mixer for RME
http://adi.loris.tv/xhdsp.png
It's a toy project to improve my rotten C++ skills, so I chose gtkmm.
I still need to add support for double/quad speed modes and maybe
polish the GUI a bit, but otherwise, it's fully functional.
Hehe, reminds me of a certain mixer-widget I once wrote:-)

Two comments:
- Nowadays you really should do the realtime-number-crunching in C/C++
and the frontend/gui in python/ruby. So much easier.
- Use a scale from black (-inf), blue (negative dB) to green (0dB)
over yellow to red. Yellow should be for values "hotter" then green.
Its what the color suggests and what probably all VU-meters since
the invention of color use.

Have fun,

Arnold
Ralf Mardorf
2013-11-29 10:25:10 UTC
Permalink
Post by Adrian Knoth
http://adi.loris.tv/xhdsp.png
That's what I'm missing for my RME card to get access to all ADAT IOs.
HDSPmixer does show a signal for all 8 ADAT channels, but by jack only 2
channels are available.

:)
Loading...