[LAU] RME HDSP 9632 - amixer control

Klaus Schulz kls.schlz at googlemail.com
Sun Oct 25 09:29:28 EDT 2009


Hi Georg and others.

Find enclosed my HDSPscan script. I wrote it to identify the channels ids
for using it with amixer.

It connects each in- to output, which makes it easy for you to identify the
routing you're looking for.

It is a two-stage approach to reduce the number of test cases.
First it will connect every single input - one after another - to "all
outputs" to identify the input you're looking for.
Then it'll connect the chosen input to every single output one after
another.

The test tone is generated by the script (sox) itself.

Hope some of you guys find it beneficial.

It saved me a hell lot of time.

Have fun

\Klaus

HDSPscan
------------------------------------------------------------------------------
#!/bin/bash
#
# written by Klaus Schulz 10/25/2009
#
# This script scans the matrix mixer of RME HDSP 9632 for input/output
connections by using amixer
# Your current setting will be removed. Use the script at your own risk.
#
# RME HDSP 9632 ( as per definition)
# inputs: 0-7 (analog), 16-23 (adat), 24-25 (spdif)  26-43 (playback
channels)
# output: 0-7 (analog), 16-23 (adat)  24-25 (spdif), 26-27 (line out)

track="/dev/shm/play.wav"  # will be generated by the script!!!!!!!!!
alsainterface="plughw:0,0"

inputs_left=( 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 )
inputs_right=( 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43
)
let cnt_i=${#inputs_left[@]}-1

outputs_left=( 0 2 4 6 8 10 12 14 16 18 20 22 24 26 )
outputs_right=( 1 3 5 7 9 11 13 15 17 19 21 23 25 27 )
let cnt_o=${#outputs_left[@]}-1



function generate_track () {
which sox  > /dev/null 2>&1 || { echo "Please install sox first!"; exit 1 ;
} ;
sox -r 44100 -b 16 -c 2 -n $track synth 2 sine 300-3300 gain -18  # gain in
db
}

function init_matrix () {
    echo -n "Initializing hdsp-matrix..."
    for output in $(seq 0 27); do
        for input in $(seq 0 43); do
            echo -n "."
            amixer cset numid=5 $input,$output,0 > /dev/null 2>&1
        done
    done
echo
}


function scaninputs () {
for i in  $(seq 0 $cnt_i) ; do
          in_l=${inputs_left[$i]}
          in_r=${inputs_right[$i]}
          for y in  $(seq 0 $cnt_o) ; do
                    out_l=${outputs_left[$y]}
                    out_r=${outputs_right[$y]}
                    echo  "Connecting input:$in_l/$in_r to output:
$out_l/$out_r"
                    amixer cset numid=5 $in_l,$out_l,32768 > /dev/null 2>&1
                    amixer cset numid=5 $in_r,$out_r,32768 > /dev/null 2>&1
          done
          aplay  -D$alsainterface -fcd "$track" > /dev/null 2>&1 &
          echo "Playback started..."
          echo -n "Any sound ? (y/(N)):"
          read z
          if [ "$z" == "y" ] ; then echo "Identified inputs: $in_l/$in_r" ;
break ; fi

          for y in  $(seq 0 $cnt_o) ; do
                    out_l=${outputs_left[$y]}
                    out_r=${outputs_right[$y]}
                    echo  "Connecting input:$in_l/$in_r to output:
$out_l/$out_r"
                    amixer cset numid=5 $in_l,$out_l,0 > /dev/null 2>&1
                    amixer cset numid=5 $in_r,$out_r,0 > /dev/null 2>&1
          done
done
if [ "$z" != "y" ] ; then echo "No working connection identified..." ; exit
1 ; fi
}


function scanoutputs () {
for k in  $(seq 0 $cnt_o) ; do
     out_l=${outputs_left[$k]}
     out_r=${outputs_right[$k]}
     echo  "Connecting input:$in_l/$in_r to output: $out_l/$out_r"
     amixer cset numid=5 $in_l,$out_l,32768 > /dev/null 2>&1
     amixer cset numid=5 $in_r,$out_r,32768 > /dev/null 2>&1
     aplay  -D$alsainterface -fcd "$track" > /dev/null 2>&1 &
     echo "Playback started..."
     echo -n "Any sound ? (y/(N)):"
     read z
     if [ "$z" == "y" ] ; then echo "Identified outputs: $out_l/$out_r" ;
break ; fi
     amixer cset numid=5 $in_l,$out_l,0 > /dev/null 2>&1
     amixer cset numid=5 $in_r,$out_r,0 > /dev/null 2>&1
done
}


echo "Generating test-track..."
generate_track
init_matrix
echo "Scan inputs..."
scaninputs
init_matrix
echo "Scan outputs..."
scanoutputs
echo
echo "Result: inputs: $in_l/$in_r outputs: $out_l/$out_r"



exit 0




------------------------------------------------------------------------------






On Sun, Oct 25, 2009 at 9:53 AM, Georg Rudolph <georg.rudolph at schwaben.de>wrote:

> Klaus Schulz schrieb:
> > Hi Giso and others.
> >
> > I managed to get a basic routing working! I wrote a script which
> > initializes the entire matrix, connects one after another every input
> > to every output and plays a sound per setting.
> > I identified my alsainputs on 16/17 and analog outputs on 12/13 for my
> > analog extension board (out1 out2).
> >
> > This has not very much to do with the channel assignment I've seen
> > everywhere.
> >
> > With the script I can easily scan my setup now.
> >
> > Finally I need to find out how to get more then 2 channels from Alsa
> > to the same card without using Jack.
> >
> > The pity is really that I can not control the attenuation on the
> > hw-outputs with amixer. I'll do that on the application side.
> >
> > THX for all the hints so far.
> >
> > Cheers
> > \Klaus
> >
> Hallo Klaus,
>
> thanks for sharing this effort. I'm a happy user of a multiface II and
> would be very much interested in controlling remotely the submix
> (hardware mixer). This especially can't be substituted be software
> mixing with jackminimix for example. Would it be okay if you send me
> your script, so I could do a test too, and report back?
>
> I use perl scripts to control ardour, gtklick, jackminimix, once
> sooperlooper too, per osc, per an infrared remote, the mceusb2.
>
> If the hdsp could be controlled by amixer commans it wouldn't be so much
> needed to add an osc interface. Although, I like the osc interfaces.
>
> Best Regards,
> Georg Rudolph
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linuxaudio.org/pipermail/linux-audio-user/attachments/20091025/1094b464/attachment.htm 


More information about the Linux-audio-user mailing list