Hi Georg and others.<br><br>Find enclosed my HDSPscan script. I wrote it to identify the channels ids for using it with amixer.<br><br>It connects each in- to output, which makes it easy for you to identify the routing you're looking for. <br>
<br>It is a two-stage approach to reduce the number of test cases. <br>First it will connect every single input - one after another - to "all outputs" to identify the input you're looking for.<br>Then it'll connect the chosen input to every single output one after another.<br>
<br>The test tone is generated by the script (sox) itself.<br><br>Hope some of you guys find it beneficial.<br><br>It saved me a hell lot of time.<br><br>Have fun<br><br>\Klaus<br><br>HDSPscan<br>------------------------------------------------------------------------------<br>
#!/bin/bash<br>#<br># written by Klaus Schulz 10/25/2009 <br>#<br># This script scans the matrix mixer of RME HDSP 9632 for input/output connections by using amixer<br># Your current setting will be removed. Use the script at your own risk.<br>
#<br># RME HDSP 9632 ( as per definition)<br># inputs: 0-7 (analog), 16-23 (adat), 24-25 (spdif) 26-43 (playback channels)<br># output: 0-7 (analog), 16-23 (adat) 24-25 (spdif), 26-27 (line out)<br><br>track="/dev/shm/play.wav" # will be generated by the script!!!!!!!!!<br>
alsainterface="plughw:0,0"<br><br>inputs_left=( 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 )<br>inputs_right=( 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 )<br>let cnt_i=${#inputs_left[@]}-1<br>
<br>outputs_left=( 0 2 4 6 8 10 12 14 16 18 20 22 24 26 )<br>outputs_right=( 1 3 5 7 9 11 13 15 17 19 21 23 25 27 )<br>let cnt_o=${#outputs_left[@]}-1<br><br><br><br>function generate_track () {<br>which sox > /dev/null 2>&1 || { echo "Please install sox first!"; exit 1 ; } ;<br>
sox -r 44100 -b 16 -c 2 -n $track synth 2 sine 300-3300 gain -18 # gain in db<br>}<br><br>function init_matrix () {<br> echo -n "Initializing hdsp-matrix..."<br> for output in $(seq 0 27); do<br> for input in $(seq 0 43); do<br>
echo -n "."<br> amixer cset numid=5 $input,$output,0 > /dev/null 2>&1<br> done<br> done<br>echo<br>}<br><br><br>function scaninputs () {<br>for i in $(seq 0 $cnt_i) ; do <br>
in_l=${inputs_left[$i]}<br> in_r=${inputs_right[$i]} <br> for y in $(seq 0 $cnt_o) ; do<br> out_l=${outputs_left[$y]}<br> out_r=${outputs_right[$y]}<br> echo "Connecting input:$in_l/$in_r to output: $out_l/$out_r"<br>
amixer cset numid=5 $in_l,$out_l,32768 > /dev/null 2>&1<br> amixer cset numid=5 $in_r,$out_r,32768 > /dev/null 2>&1<br> done<br> aplay -D$alsainterface -fcd "$track" > /dev/null 2>&1 &<br>
echo "Playback started..."<br> echo -n "Any sound ? (y/(N)):"<br> read z<br> if [ "$z" == "y" ] ; then echo "Identified inputs: $in_l/$in_r" ; break ; fi <br>
<br> for y in $(seq 0 $cnt_o) ; do <br> out_l=${outputs_left[$y]}<br> out_r=${outputs_right[$y]}<br> echo "Connecting input:$in_l/$in_r to output: $out_l/$out_r"<br>
amixer cset numid=5 $in_l,$out_l,0 > /dev/null 2>&1<br> amixer cset numid=5 $in_r,$out_r,0 > /dev/null 2>&1<br> done <br>done<br>if [ "$z" != "y" ] ; then echo "No working connection identified..." ; exit 1 ; fi<br>
}<br><br><br>function scanoutputs () {<br>for k in $(seq 0 $cnt_o) ; do<br> out_l=${outputs_left[$k]}<br> out_r=${outputs_right[$k]}<br> echo "Connecting input:$in_l/$in_r to output: $out_l/$out_r"<br>
amixer cset numid=5 $in_l,$out_l,32768 > /dev/null 2>&1<br> amixer cset numid=5 $in_r,$out_r,32768 > /dev/null 2>&1<br> aplay -D$alsainterface -fcd "$track" > /dev/null 2>&1 &<br>
echo "Playback started..."<br> echo -n "Any sound ? (y/(N)):" <br> read z<br> if [ "$z" == "y" ] ; then echo "Identified outputs: $out_l/$out_r" ; break ; fi <br>
amixer cset numid=5 $in_l,$out_l,0 > /dev/null 2>&1<br> amixer cset numid=5 $in_r,$out_r,0 > /dev/null 2>&1 <br>done<br>}<br><br><br>echo "Generating test-track..."<br>generate_track<br>
init_matrix <br>echo "Scan inputs..."<br>scaninputs<br>init_matrix <br>echo "Scan outputs..."<br>scanoutputs<br>echo<br>echo "Result: inputs: $in_l/$in_r outputs: $out_l/$out_r"<br><br><br><br>
exit 0<br><br><br><br><br>------------------------------------------------------------------------------<br><br><br><br> <br><br><br><div class="gmail_quote">On Sun, Oct 25, 2009 at 9:53 AM, Georg Rudolph <span dir="ltr"><<a href="mailto:georg.rudolph@schwaben.de">georg.rudolph@schwaben.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Klaus Schulz schrieb:<br>
<div class="im">> Hi Giso and others.<br>
><br>
> I managed to get a basic routing working! I wrote a script which<br>
> initializes the entire matrix, connects one after another every input<br>
> to every output and plays a sound per setting.<br>
> I identified my alsainputs on 16/17 and analog outputs on 12/13 for my<br>
> analog extension board (out1 out2).<br>
><br>
> This has not very much to do with the channel assignment I've seen<br>
> everywhere.<br>
><br>
> With the script I can easily scan my setup now.<br>
><br>
> Finally I need to find out how to get more then 2 channels from Alsa<br>
> to the same card without using Jack.<br>
><br>
> The pity is really that I can not control the attenuation on the<br>
> hw-outputs with amixer. I'll do that on the application side.<br>
><br>
> THX for all the hints so far.<br>
><br>
> Cheers<br>
> \Klaus<br>
><br>
</div>Hallo Klaus,<br>
<br>
thanks for sharing this effort. I'm a happy user of a multiface II and<br>
would be very much interested in controlling remotely the submix<br>
(hardware mixer). This especially can't be substituted be software<br>
mixing with jackminimix for example. Would it be okay if you send me<br>
your script, so I could do a test too, and report back?<br>
<br>
I use perl scripts to control ardour, gtklick, jackminimix, once<br>
sooperlooper too, per osc, per an infrared remote, the mceusb2.<br>
<br>
If the hdsp could be controlled by amixer commans it wouldn't be so much<br>
needed to add an osc interface. Although, I like the osc interfaces.<br>
<br>
Best Regards,<br>
<font color="#888888">Georg Rudolph<br>
<br>
</font></blockquote></div><br>