2010-08-18 08:29:03 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#DBG="gdb --args "
|
|
|
|
#DBG="strace"
|
2010-10-08 22:23:05 +02:00
|
|
|
#DBG="valgrind --leak-check=full"
|
2010-10-11 10:24:14 +02:00
|
|
|
ARGS=
|
2010-08-18 08:29:03 +02:00
|
|
|
CFGFILE="/tmp/alsaloop.test.cfg"
|
|
|
|
|
|
|
|
test1() {
|
|
|
|
echo "TEST1"
|
2010-10-07 20:38:36 +02:00
|
|
|
$DBG ./alsaloop -C hw:1,0 -P plughw:0,0 \
|
2010-08-18 08:29:03 +02:00
|
|
|
--tlatency 50000 \
|
|
|
|
--mixer "name='Master Playback Volume'@name='Master Playback Volume'" \
|
|
|
|
--mixer "name='Master Playback Switch'@name='Master Playback Switch'" \
|
2010-10-08 15:10:23 +02:00
|
|
|
--mixer "name='PCM Playback Volume'" \
|
|
|
|
--ossmixer "Master@VOLUME" \
|
2010-10-11 10:24:14 +02:00
|
|
|
--ossmixer "PCM@PCM" \
|
|
|
|
$ARGS
|
2010-08-18 08:29:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
test2() {
|
|
|
|
echo "TEST2"
|
|
|
|
cat > $CFGFILE <<EOF
|
|
|
|
# first job
|
|
|
|
-C hw:1,0,0 -P hw:0,0,0 --tlatency 50000 --thread 1 \
|
|
|
|
--mixer "name='Master Playback Volume'@name='Master Playback Volume'" \
|
|
|
|
--mixer "name='Master Playback Switch'@name='Master Playback Switch'" \
|
|
|
|
--mixer "name='PCM Playback Volume'"
|
|
|
|
# next line - second job
|
|
|
|
-C hw:1,0,1 -P hw:0,1,0 --tlatency 50000 --thread 2
|
|
|
|
EOF
|
2010-10-11 10:24:14 +02:00
|
|
|
$DBG ./alsaloop -d --config $CFGFILE $ARGS
|
2010-08-18 08:29:03 +02:00
|
|
|
}
|
|
|
|
|
2010-10-06 18:51:29 +02:00
|
|
|
test3() {
|
2010-10-06 20:34:03 +02:00
|
|
|
echo "TEST3"
|
2010-10-14 11:17:25 +02:00
|
|
|
LATENCY=180000
|
2010-10-06 18:51:29 +02:00
|
|
|
cat > $CFGFILE <<EOF
|
2010-10-14 11:17:25 +02:00
|
|
|
-C hw:1,0,0 -P plug:dmix:0 --tlatency $LATENCY --thread 0 \
|
2010-10-06 18:51:29 +02:00
|
|
|
--mixer "name='Master Playback Volume'@name='Master Playback Volume'" \
|
|
|
|
--mixer "name='Master Playback Switch'@name='Master Playback Switch'" \
|
2010-10-08 22:23:05 +02:00
|
|
|
--mixer "name='PCM Playback Volume'" \
|
|
|
|
--ossmixer "name=Master@VOLUME"
|
2010-10-14 11:17:25 +02:00
|
|
|
-C hw:1,0,1 -P plug:dmix:0 --tlatency $LATENCY --thread 1
|
|
|
|
-C hw:1,0,2 -P plug:dmix:0 --tlatency $LATENCY --thread 2
|
|
|
|
-C hw:1,0,3 -P plug:dmix:0 --tlatency $LATENCY --thread 3
|
|
|
|
-C hw:1,0,4 -P plug:dmix:0 --tlatency $LATENCY --thread 4
|
|
|
|
-C hw:1,0,5 -P plug:dmix:0 --tlatency $LATENCY --thread 5
|
|
|
|
-C hw:1,0,6 -P plug:dmix:0 --tlatency $LATENCY --thread 6
|
|
|
|
-C hw:1,0,7 -P plug:dmix:0 --tlatency $LATENCY --thread 7
|
2010-10-06 18:51:29 +02:00
|
|
|
EOF
|
2010-10-11 10:24:14 +02:00
|
|
|
$DBG ./alsaloop --config $CFGFILE $ARGS
|
2010-10-06 18:51:29 +02:00
|
|
|
}
|
|
|
|
|
2010-10-07 20:38:36 +02:00
|
|
|
test4() {
|
|
|
|
echo "TEST4"
|
|
|
|
$DBG ./alsaloop -C hw:1,0 -P plughw:0,0 -a off -r 11025 \
|
|
|
|
--tlatency 50000 \
|
|
|
|
--mixer "name='Master Playback Volume'@name='Master Playback Volume'" \
|
|
|
|
--mixer "name='Master Playback Switch'@name='Master Playback Switch'" \
|
2010-10-11 10:24:14 +02:00
|
|
|
--mixer "name='PCM Playback Volume'" \
|
|
|
|
$ARGS
|
2010-10-07 20:38:36 +02:00
|
|
|
}
|
|
|
|
|
2010-10-08 22:23:05 +02:00
|
|
|
test5() {
|
|
|
|
echo "TEST5"
|
|
|
|
cat > $CFGFILE <<EOF
|
|
|
|
-C hw:1,0,0 -P plughw:0,0 --tlatency 50000 --thread 1 \
|
|
|
|
--mixer "name='Master Playback Volume'@name='Master Playback Volume'" \
|
|
|
|
--mixer "name='Master Playback Switch'@name='Master Playback Switch'" \
|
|
|
|
--mixer "name='PCM Playback Volume'" \
|
|
|
|
--ossmixer "name=Master@VOLUME"
|
|
|
|
-C hw:1,0,1 -P plughw:0,1 --tlatency 50000 --thread 2
|
|
|
|
EOF
|
2010-10-11 10:24:14 +02:00
|
|
|
$DBG ./alsaloop --config $CFGFILE $ARGS
|
2010-10-08 22:23:05 +02:00
|
|
|
}
|
|
|
|
|
2010-10-13 23:39:36 +02:00
|
|
|
sigusr1() {
|
|
|
|
pid=$(ps ax | grep alsaloop | grep -v grep | colrm 7 255)
|
|
|
|
if test -n "$pid"; then
|
|
|
|
echo "Killing alsaloop $pid..."
|
|
|
|
kill -SIGUSR1 $pid
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2010-08-18 08:29:03 +02:00
|
|
|
case "$1" in
|
2010-10-11 10:24:14 +02:00
|
|
|
test1) shift; ARGS="$@"; test1 ;;
|
|
|
|
test2) shift; ARGS="$@"; test2 ;;
|
|
|
|
test3) shift; ARGS="$@"; test3 ;;
|
|
|
|
test4) shift; ARGS="$@"; test4 ;;
|
|
|
|
test5) shift; ARGS="$@"; test5 ;;
|
2010-10-13 23:39:36 +02:00
|
|
|
usr|sig*) sigusr1 ;;
|
2010-10-11 10:24:14 +02:00
|
|
|
*) ARGS="$@"; test1 ;;
|
2010-08-18 08:29:03 +02:00
|
|
|
esac
|