Automatic ES-9 setup

This commit is contained in:
Christian Colglazier 2021-02-19 09:19:33 -05:00
parent ed2ab233cd
commit 327f36cce4
3 changed files with 20 additions and 4 deletions

9
scripts/audio/es9start.sh Normal file → Executable file
View File

@ -3,15 +3,16 @@
# Script to add another audio interface if available.
# Import library
source $(dirname ${BASH_SOURCE[0]})/audio-lib.sh
source $(dirname $(realpath ${BASH_SOURCE[0]}))/audio-lib.sh
DEVICE_NAME='ES-9'
DEVICE_NUM=$(getCardNumber $DEVICE_NAME)
checkCard $DEVICE_NAME $DEVICE_NUM
echo $DEVICE_NUM
# Start up audio interface
alsa_in -d hw:$DEVICE_NUM -j "$DEVICE_NAME In" -c 16 -q 1 &
alsa_out -d hw:$DEVICE_NUM -j "$DEVICE_NAME Out" -c 16 -q 1 &
pkill es5jack || true
es5jack >/dev/null 2>/dev/null &
sleep 0.1
jack_connect ES-5:out "$DEVICE_NAME Out:playback_9" || true

1
scripts/audio/es9stop.sh Normal file → Executable file
View File

@ -4,3 +4,4 @@
pkill alsa_in
pkill alsa_out
pkill es5jack

14
systemd/user/es-9.service Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Description=ES-9 Audio Interface
BindsTo=dev-snd-by\x2did-usb\x2dExpert_Sleepers_Ltd_ES\x2d9\x2d01.device
After=dev-snd-by\x2did-usb\x2dExpert_Sleepers_Ltd_ES\x2d9\x2d01.device
Requisite=dev-snd-by\x2did-usb\x2dExpert_Sleepers_Ltd_ES\x2d9\x2d01.device
[Install]
WantedBy=dev-snd-by\x2did-usb\x2dExpert_Sleepers_Ltd_ES\x2d9\x2d01.device
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=%h/.config/scripts/audio/es9start.sh
ExecStop=%h/.config/scripts/audio/es9stop.sh