support install of required packages, use ini file in Jamulus directory, bug fix

This commit is contained in:
Volker Fischer 2019-09-25 18:06:54 +02:00
parent 8d6b1e5712
commit ed5697bc46

View file

@ -4,7 +4,15 @@
OPUS="opus-1.1" OPUS="opus-1.1"
NCORES=$(nproc) NCORES=$(nproc)
echo "TODO: sudo apt-get install [needed libraries for compilation and runtime]" # install required packages
pkgs='build-essential qt5-default'
if ! dpkg -s $pkgs >/dev/null 2>&1; then
read -p "Do you want to install missing packages? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo apt-get install $pkgs -y
fi
fi
# Opus audio codec, custom compilation with custom modes and fixed point support # Opus audio codec, custom compilation with custom modes and fixed point support
if [ -d "${OPUS}" ]; then if [ -d "${OPUS}" ]; then
@ -67,18 +75,15 @@ echo "Using USB audio device: ${ADEVICE}"
# write Jamulus ini file for setting the client name # write Jamulus ini file for setting the client name
JAMULUSINIFILE="Jamulus.ini" JAMULUSINIFILE="Jamulus.ini"
if [ ! -f "$HOME/.config/Jamulus/$JAMULUSINIFILE" ]; then
NAME64=$(echo -n "Raspi $(hostname)"|base64) NAME64=$(echo -n "Raspi $(hostname)"|base64)
echo -e "<client>\n <name_base64>${NAME64}</name_base64>\n</client>" > ${JAMULUSINIFILE} echo -e "<client>\n <name_base64>${NAME64}</name_base64>\n</client>" > ${JAMULUSINIFILE}
mv ${JAMULUSINIFILE} ~/.config/Jamulus
fi
# start Jack2 and Jamulus in headless mode # start Jack2 and Jamulus in headless mode
export LD_LIBRARY_PATH="distributions/${OPUS}/.libs:distributions/jack2/build:distributions/jack2/build/common" export LD_LIBRARY_PATH="distributions/${OPUS}/.libs:distributions/jack2/build:distributions/jack2/build/common"
distributions/jack2/build/jackd -P70 -p16 -t2000 -d alsa -dhw:${ADEVICE} -p 128 -n 3 -r 48000 -s & distributions/jack2/build/jackd -P70 -p16 -t2000 -d alsa -dhw:${ADEVICE} -p 128 -n 3 -r 48000 -s &
if [ "$1" == "opt" ]; then if [ "$1" == "opt" ]; then
./Jamulus -n -j -c jamulus.fischvolk.de &>/dev/null & ./Jamulus -n -i ${JAMULUSINIFILE} -j -c jamulus.fischvolk.de &>/dev/null &
sleep 1 sleep 1
./distributions/fluidsynth/build/src/fluidsynth -o synth.polyphony=25 -s -i -a jack -g 1 distributions/fluidsynth/build/claudio_piano.sf2 &>/dev/null & ./distributions/fluidsynth/build/src/fluidsynth -o synth.polyphony=25 -s -i -a jack -g 1 distributions/fluidsynth/build/claudio_piano.sf2 &>/dev/null &
sleep 3 sleep 3
@ -97,8 +102,9 @@ if [ "$1" == "opt" ]; then
while [ ! -z "$(amidi -l|grep "USB-MIDI")" ]; do while [ ! -z "$(amidi -l|grep "USB-MIDI")" ]; do
sleep 1 sleep 1
done done
killall jackd killall Jamulus
killall fluidsynth killall fluidsynth
killall jackd
echo "Cleaned up jackd, Jamulus and fluidsynth" echo "Cleaned up jackd, Jamulus and fluidsynth"
# if hyperion is installed, reset color # if hyperion is installed, reset color
@ -108,7 +114,10 @@ if [ "$1" == "opt" ]; then
fi fi
else else
./Jamulus -n -c jamulus.fischvolk.de ./Jamulus -n -i ${JAMULUSINIFILE} -c jamulus.fischvolk.de &
echo "###---------- PRESS ANY KEY TO TERMINATE THE JAMULUS SESSION ---------###"
read -n 1 -s -r -p ""
killall Jamulus
killall jackd killall jackd
fi fi