2023-02-22 08:31:38 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# cat /etc/rc.conf.local
|
2023-12-08 18:02:01 +01:00
|
|
|
# sndiod_flags=-f rsnd/0 -F rsnd/1 -F rsnd/2 -F rsnd/3 ...
|
2023-02-22 08:31:38 +01:00
|
|
|
|
2024-08-18 19:51:08 +02:00
|
|
|
cur="$(sndioctl -n server.device | cut -d"(" -f1)"
|
2023-02-22 08:31:38 +01:00
|
|
|
case $1 in
|
|
|
|
+) sndioctl server.device=$(( cur + 1 )) > /dev/null 2>&1 \
|
|
|
|
|| echo "Max device reached"; ;;
|
|
|
|
-) sndioctl server.device=$(( cur - 1 )) > /dev/null 2>&1 \
|
|
|
|
|| echo "Min device reached"; ;;
|
|
|
|
[0-9]) sndioctl server.device=$1 > /dev/null 2>&1 \
|
|
|
|
|| echo "Device $1 not available"; ;;
|
|
|
|
|
|
|
|
esac
|
2024-08-18 19:51:08 +02:00
|
|
|
now="$(sndioctl -n server.device | cut -d"(" -f1)"
|
2023-02-22 08:31:38 +01:00
|
|
|
|
|
|
|
echo "Active server.device=$now"
|
|
|
|
dmesg | grep -B2 ^audio$now | grep " at " | head -n 1
|