Skip to content

Instantly share code, notes, and snippets.

@jal25jal25
Last active February 18, 2021 12:47
Show Gist options
  • Save jal25jal25/2eec77b36adb2f852c227dcecf67e184 to your computer and use it in GitHub Desktop.
Save jal25jal25/2eec77b36adb2f852c227dcecf67e184 to your computer and use it in GitHub Desktop.
Simple /home/pi/lcv_startall.sh for Jamulus client on Raspberry Pi
#!/bin/bash
# Log last invocation to file for debugging
LOGFILE=/home/pi/lcv_startall.log
exec > ${LOGFILE} 2>&1
JAMULUS_SERVER="your_jamulus_server_hostname_or_ip_address"
JACKD_CMD="/usr/bin/jackd -R -dalsa -dhw:1 -r48000 -p128 -n2"
JAMULUS_CMD="Jamulus -c ${JAMULUS_SERVER}"
# Start jackd if it is not already running
if ps -ef |grep "[ ]/usr/bin/jackd" >/dev/null; then
echo "*** jackd already running - not attempting to start"
else
echo "*** Starting jackd: ${JACKD_CMD}"
${JACKD_CMD} &
if [ $? != 0 ]; then
echo "*** Failed to start jackd - exiting"
exit 1
fi
# Give everything a chance to settle
sleep 5
fi
# Start Jamulus if it is not already running
if ps -ef |grep "[J]amulus" >/dev/null; then
echo "*** Jamulus already running - not attempting to start"
else
echo "*** Starting Jamulus: ${JAMULUS_CMD}"
${JAMULUS_CMD} &
if [ $? == 0 ]; then
echo "*** Successfully started Jamulus"
else
echo "*** Jamulus failed to start"
exit 2
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment