Created
June 15, 2018 05:22
-
-
Save sambler/67bf0b374d7b9c27e7cec1dd2befbcf2 to your computer and use it in GitHub Desktop.
shell script to start jackd and jack_umidi for available devices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# my machine seems to not work with jack -- realtime | |
# some audio progs allow specifying realtime but don't | |
# set --no-realtime without it | |
# so we start jack specifically with --no-realtime | |
if [ ! `pgrep -u $USER jackd | head -1` ] | |
then | |
echo "Starting Jackd..." | |
jackd --no-realtime -d oss & | |
sleep 5 | |
fi | |
getopts "qk" OPT | |
# stop any existing jack_umidi if requested | |
case ${OPT} in | |
q) # quit nicely | |
pkill -QUIT jack_umidi | |
;; | |
k) # force quit | |
pkill -9 jack_umidi | |
;; | |
esac | |
DEVLIST=`ls /dev | grep ^umidi | grep "\.0" | cut -c 6-9` | |
for DEV in ${DEVLIST} | |
do | |
if [ ! `ps aux | grep jack_umidi | grep "umidi${DEV}" | awk '{print $2}'` ] | |
then | |
jack_umidi -C /dev/umidi${DEV} -B | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment