On Wed, Nov 27, 2013 at 12:41 PM, raf <rmouneyres@gmail.com> wrote:
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