@@ -9,28 +9,28 @@ readonly NCORES
99
1010# install required packages
1111readonly pkgs=(alsamixergui build-essential qtbase5-dev qttools5-dev-tools libasound2-dev cmake libglib2.0-dev)
12- if ! dpkg -s " ${pkgs[@]} " > /dev/null 2>&1 ; then
13- read -p " Do you want to install missing packages? " -n 1 -r
14- echo
15- if [[ ${REPLY} =~ ^[Yy]$ ]]; then
16- sudo apt-get install " ${pkgs[@]} " -y
17- # Raspbian 10 needs qt5-default; Raspbian 11 doesn't need or provide it
18- if ! qtchooser -list-versions | grep -q default; then
19- sudo apt-get install qt5-default -y
12+ if ! dpkg -s " ${pkgs[@]} " > /dev/null 2>&1 ; then
13+ read -p " Do you want to install missing packages? " -n 1 -r
14+ echo
15+ if [[ ${REPLY} =~ ^[Yy]$ ]]; then
16+ sudo apt-get install " ${pkgs[@]} " -y
17+ # Raspbian 10 needs qt5-default; Raspbian 11 doesn't need or provide it
18+ if ! qtchooser -list-versions | grep -q default; then
19+ sudo apt-get install qt5-default -y
20+ fi
2021 fi
21- fi
2222fi
2323
2424# Opus audio codec, custom compilation with custom modes and fixed point support
2525if [ -d " ${OPUS} " ]; then
26- echo " The Opus directory is present, we assume it is compiled and ready to use. If not, delete the opus directory and call this script again."
26+ echo " The Opus directory is present, we assume it is compiled and ready to use. If not, delete the opus directory and call this script again."
2727else
28- wget https://archive.mozilla.org/pub/opus/" ${OPUS} .tar.gz"
29- tar -xzf " ${OPUS} .tar.gz"
30- rm " ${OPUS} .tar.gz"
31- cd " ${OPUS} " || exit 1
32- if [ " ${OPUS} " == " opus-1.3.1" ]; then
33- echo " @@ -117,13 +117,19 @@ void validate_celt_decoder(CELTDecoder *st)
28+ wget https://archive.mozilla.org/pub/opus/" ${OPUS} .tar.gz"
29+ tar -xzf " ${OPUS} .tar.gz"
30+ rm " ${OPUS} .tar.gz"
31+ cd " ${OPUS} " || exit 1
32+ if [ " ${OPUS} " == " opus-1.3.1" ]; then
33+ echo " @@ -117,13 +117,19 @@ void validate_celt_decoder(CELTDecoder *st)
3434 #ifndef CUSTOM_MODES
3535 celt_assert(st->mode == opus_custom_mode_create(48000, 960, NULL));
3636 celt_assert(st->overlap == 120);
5151 #ifdef OPUS_ARCHMASK
5252 celt_assert(st->arch >= 0);
5353 celt_assert(st->arch <= OPUS_ARCHMASK);" >> opus_patch_file.diff
54- patch celt/celt_decoder.c opus_patch_file.diff
55- fi
56- ./configure --enable-custom-modes --enable-fixed-point
57- make " -j${NCORES} "
58- mkdir include/opus
59- cp include/* .h include/opus
60- cd ..
54+ patch celt/celt_decoder.c opus_patch_file.diff
55+ fi
56+ ./configure --enable-custom-modes --enable-fixed-point
57+ make " -j${NCORES} "
58+ mkdir include/opus
59+ cp include/* .h include/opus
60+ cd ..
6161fi
6262
6363# Jack audio without DBUS support
6464if [ -d " jack2" ]; then
65- echo " The Jack2 directory is present, we assume it is compiled and ready to use. If not, delete the jack2 directory and call this script again."
65+ echo " The Jack2 directory is present, we assume it is compiled and ready to use. If not, delete the jack2 directory and call this script again."
6666else
67- git clone https://github.com/jackaudio/jack2.git
68- cd jack2 || exit 1
69- git checkout v1.9.20
70- ./waf configure --alsa --prefix=/usr/local " --libdir=$( pwd) /build"
71- ./waf " -j${NCORES} "
72- mkdir build/jack
73- cp build/* .so build/jack
74- cp build/common/* .so build/jack
75- cp build/example-clients/* .so build/jack
76- cd ..
67+ git clone https://github.com/jackaudio/jack2.git
68+ cd jack2 || exit 1
69+ git checkout v1.9.20
70+ ./waf configure --alsa --prefix=/usr/local " --libdir=$( pwd) /build"
71+ ./waf " -j${NCORES} "
72+ mkdir build/jack
73+ cp build/* .so build/jack
74+ cp build/common/* .so build/jack
75+ cp build/example-clients/* .so build/jack
76+ cd ..
7777
78- # give audio group rights to do realtime
79- if grep -Fq " @audio" /etc/security/limits.conf; then
80- echo " audio group already has realtime rights"
81- else
82- sudo sh -c ' echo "@audio - rtprio 95" >> /etc/security/limits.conf'
83- sudo sh -c ' echo "@audio - memlock unlimited" >> /etc/security/limits.conf'
84- fi
78+ # give audio group rights to do realtime
79+ if grep -Fq " @audio" /etc/security/limits.conf; then
80+ echo " audio group already has realtime rights"
81+ else
82+ sudo sh -c ' echo "@audio - rtprio 95" >> /etc/security/limits.conf'
83+ sudo sh -c ' echo "@audio - memlock unlimited" >> /etc/security/limits.conf'
84+ fi
8585fi
8686
8787# compile Jamulus with external Opus library
@@ -90,21 +90,21 @@ qmake "CONFIG+=opus_shared_lib raspijamulus headless" "INCLUDEPATH+=distribution
9090make " -j${NCORES} "
9191
9292# get first USB audio sound card device
93- ADEVICE=$( aplay -l| grep " USB Audio" | tail -1| cut -d' ' -f3)
93+ ADEVICE=$( aplay -l | grep " USB Audio" | tail -1 | cut -d' ' -f3)
9494echo " Using USB audio device: ${ADEVICE} "
9595
9696# write Jamulus ini file for setting the client name and buffer settings, if there is
9797# just one CPU core, we assume that we are running on a Raspberry Pi Zero
9898JAMULUSINIFILE=" Jamulus.ini"
99- NAME64=$( echo " Raspi $( hostname) " | cut -c -16| tr -d $' \n ' | base64)
99+ NAME64=$( echo " Raspi $( hostname) " | cut -c -16 | tr -d $' \n ' | base64)
100100if [ " $NCORES " -gt " 1" ]; then
101- echo -e " <client>\n <name_base64>${NAME64} </name_base64>" > ${JAMULUSINIFILE}
102- echo -e " <autojitbuf>1</autojitbuf>\n <jitbuf>3</jitbuf>\n <jitbufserver>3</jitbufserver>" >> ${JAMULUSINIFILE}
103- echo -e " <audiochannels>2</audiochannels>\n <audioquality>1</audioquality>\n</client>" >> ${JAMULUSINIFILE}
101+ echo -e " <client>\n <name_base64>${NAME64} </name_base64>" > ${JAMULUSINIFILE}
102+ echo -e " <autojitbuf>1</autojitbuf>\n <jitbuf>3</jitbuf>\n <jitbufserver>3</jitbufserver>" >> ${JAMULUSINIFILE}
103+ echo -e " <audiochannels>2</audiochannels>\n <audioquality>1</audioquality>\n</client>" >> ${JAMULUSINIFILE}
104104else
105- echo -e " <client>\n <name_base64>${NAME64} </name_base64>" > ${JAMULUSINIFILE}
106- echo -e " <autojitbuf>1</autojitbuf>\n <jitbuf>3</jitbuf>\n <jitbufserver>3</jitbufserver>" >> ${JAMULUSINIFILE}
107- echo -e " <audiochannels>0</audiochannels>\n <audioquality>1</audioquality>\n</client>" >> ${JAMULUSINIFILE}
105+ echo -e " <client>\n <name_base64>${NAME64} </name_base64>" > ${JAMULUSINIFILE}
106+ echo -e " <autojitbuf>1</autojitbuf>\n <jitbuf>3</jitbuf>\n <jitbufserver>3</jitbufserver>" >> ${JAMULUSINIFILE}
107+ echo -e " <audiochannels>0</audiochannels>\n <audioquality>1</audioquality>\n</client>" >> ${JAMULUSINIFILE}
108108fi
109109
110110# taken from "Raspberry Pi and realtime, low-latency audio" homepage at wiki.linuxaudio.org
0 commit comments