Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# See https://editorconfig.org/
# This file is used by editors, but also by automation such as `shfmt`.

# This is the top-most .editorconfig file
root = true
Expand All @@ -16,5 +17,13 @@ indent_size = 4
indent_style = space
indent_size = 2

[*.sh]
shell_variant = bash
binary_next_line = false
switch_case_indent = true
space_redirects = true
keep_padding = true
function_next_line = false

[libs/**]
ignore = true
1 change: 1 addition & 0 deletions .github/autobuild/android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,5 @@ case "${1:-}" in
*)
echo "Unknown stage '${1:-}'"
exit 1
;;
esac
1 change: 1 addition & 0 deletions .github/autobuild/ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ case "${1:-}" in
*)
echo "Unknown stage '${1:-}'"
exit 1
;;
esac
4 changes: 3 additions & 1 deletion .github/autobuild/linux_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ case "${TARGET_ARCH}" in
*)
echo "Unsupported TARGET_ARCH ${TARGET_ARCH}"
exit 1
;;
esac

setup() {
Expand All @@ -33,7 +34,7 @@ setup() {

setup_cross_compilation_apt_sources() {
if [[ "${TARGET_ARCH}" == amd64 ]]; then
return
return
fi
sudo dpkg --add-architecture "${TARGET_ARCH}"
sed -rne "s|^deb.*/ ([^ -]+(-updates)?) main.*|deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports \1 main universe multiverse restricted|p" /etc/apt/sources.list | sudo dd of=/etc/apt/sources.list.d/"${TARGET_ARCH}".list
Expand Down Expand Up @@ -88,4 +89,5 @@ case "${1:-}" in
*)
echo "Unknown stage '${1:-}'"
exit 1
;;
esac
1 change: 1 addition & 0 deletions .github/autobuild/mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@ case "${1:-}" in
*)
echo "Unknown stage '${1:-}'"
exit 1
;;
esac
98 changes: 49 additions & 49 deletions distributions/raspijamulus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@ readonly NCORES

# install required packages
readonly pkgs=(alsamixergui build-essential qtbase5-dev qttools5-dev-tools libasound2-dev cmake libglib2.0-dev)
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
# Raspbian 10 needs qt5-default; Raspbian 11 doesn't need or provide it
if ! qtchooser -list-versions | grep -q default; then
sudo apt-get install qt5-default -y
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
# Raspbian 10 needs qt5-default; Raspbian 11 doesn't need or provide it
if ! qtchooser -list-versions | grep -q default; then
sudo apt-get install qt5-default -y
fi
fi
fi
fi

# Opus audio codec, custom compilation with custom modes and fixed point support
if [ -d "${OPUS}" ]; then
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."
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."
else
wget https://archive.mozilla.org/pub/opus/"${OPUS}.tar.gz"
tar -xzf "${OPUS}.tar.gz"
rm "${OPUS}.tar.gz"
cd "${OPUS}" || exit 1
if [ "${OPUS}" == "opus-1.3.1" ]; then
echo "@@ -117,13 +117,19 @@ void validate_celt_decoder(CELTDecoder *st)
wget https://archive.mozilla.org/pub/opus/"${OPUS}.tar.gz"
tar -xzf "${OPUS}.tar.gz"
rm "${OPUS}.tar.gz"
cd "${OPUS}" || exit 1
if [ "${OPUS}" == "opus-1.3.1" ]; then
echo "@@ -117,13 +117,19 @@ void validate_celt_decoder(CELTDecoder *st)
#ifndef CUSTOM_MODES
celt_assert(st->mode == opus_custom_mode_create(48000, 960, NULL));
celt_assert(st->overlap == 120);
Expand All @@ -51,37 +51,37 @@ else
#ifdef OPUS_ARCHMASK
celt_assert(st->arch >= 0);
celt_assert(st->arch <= OPUS_ARCHMASK);" >> opus_patch_file.diff
patch celt/celt_decoder.c opus_patch_file.diff
fi
./configure --enable-custom-modes --enable-fixed-point
make "-j${NCORES}"
mkdir include/opus
cp include/*.h include/opus
cd ..
patch celt/celt_decoder.c opus_patch_file.diff
fi
./configure --enable-custom-modes --enable-fixed-point
make "-j${NCORES}"
mkdir include/opus
cp include/*.h include/opus
cd ..
fi

# Jack audio without DBUS support
if [ -d "jack2" ]; then
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."
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."
else
git clone https://github.com/jackaudio/jack2.git
cd jack2 || exit 1
git checkout v1.9.20
./waf configure --alsa --prefix=/usr/local "--libdir=$(pwd)/build"
./waf "-j${NCORES}"
mkdir build/jack
cp build/*.so build/jack
cp build/common/*.so build/jack
cp build/example-clients/*.so build/jack
cd ..
git clone https://github.com/jackaudio/jack2.git
cd jack2 || exit 1
git checkout v1.9.20
./waf configure --alsa --prefix=/usr/local "--libdir=$(pwd)/build"
./waf "-j${NCORES}"
mkdir build/jack
cp build/*.so build/jack
cp build/common/*.so build/jack
cp build/example-clients/*.so build/jack
cd ..

# give audio group rights to do realtime
if grep -Fq "@audio" /etc/security/limits.conf; then
echo "audio group already has realtime rights"
else
sudo sh -c 'echo "@audio - rtprio 95" >> /etc/security/limits.conf'
sudo sh -c 'echo "@audio - memlock unlimited" >> /etc/security/limits.conf'
fi
# give audio group rights to do realtime
if grep -Fq "@audio" /etc/security/limits.conf; then
echo "audio group already has realtime rights"
else
sudo sh -c 'echo "@audio - rtprio 95" >> /etc/security/limits.conf'
sudo sh -c 'echo "@audio - memlock unlimited" >> /etc/security/limits.conf'
fi
fi

# compile Jamulus with external Opus library
Expand All @@ -90,21 +90,21 @@ qmake "CONFIG+=opus_shared_lib raspijamulus headless" "INCLUDEPATH+=distribution
make "-j${NCORES}"

# get first USB audio sound card device
ADEVICE=$(aplay -l|grep "USB Audio"|tail -1|cut -d' ' -f3)
ADEVICE=$(aplay -l | grep "USB Audio" | tail -1 | cut -d' ' -f3)
echo "Using USB audio device: ${ADEVICE}"

# write Jamulus ini file for setting the client name and buffer settings, if there is
# just one CPU core, we assume that we are running on a Raspberry Pi Zero
JAMULUSINIFILE="Jamulus.ini"
NAME64=$(echo "Raspi $(hostname)"|cut -c -16|tr -d $'\n'|base64)
NAME64=$(echo "Raspi $(hostname)" | cut -c -16 | tr -d $'\n' | base64)
if [ "$NCORES" -gt "1" ]; then
echo -e "<client>\n <name_base64>${NAME64}</name_base64>" > ${JAMULUSINIFILE}
echo -e " <autojitbuf>1</autojitbuf>\n <jitbuf>3</jitbuf>\n <jitbufserver>3</jitbufserver>" >> ${JAMULUSINIFILE}
echo -e " <audiochannels>2</audiochannels>\n <audioquality>1</audioquality>\n</client>" >> ${JAMULUSINIFILE}
echo -e "<client>\n <name_base64>${NAME64}</name_base64>" > ${JAMULUSINIFILE}
echo -e " <autojitbuf>1</autojitbuf>\n <jitbuf>3</jitbuf>\n <jitbufserver>3</jitbufserver>" >> ${JAMULUSINIFILE}
echo -e " <audiochannels>2</audiochannels>\n <audioquality>1</audioquality>\n</client>" >> ${JAMULUSINIFILE}
else
echo -e "<client>\n <name_base64>${NAME64}</name_base64>" > ${JAMULUSINIFILE}
echo -e " <autojitbuf>1</autojitbuf>\n <jitbuf>3</jitbuf>\n <jitbufserver>3</jitbufserver>" >> ${JAMULUSINIFILE}
echo -e " <audiochannels>0</audiochannels>\n <audioquality>1</audioquality>\n</client>" >> ${JAMULUSINIFILE}
echo -e "<client>\n <name_base64>${NAME64}</name_base64>" > ${JAMULUSINIFILE}
echo -e " <autojitbuf>1</autojitbuf>\n <jitbuf>3</jitbuf>\n <jitbufserver>3</jitbufserver>" >> ${JAMULUSINIFILE}
echo -e " <audiochannels>0</audiochannels>\n <audioquality>1</audioquality>\n</client>" >> ${JAMULUSINIFILE}
fi

# taken from "Raspberry Pi and realtime, low-latency audio" homepage at wiki.linuxaudio.org
Expand Down
3 changes: 1 addition & 2 deletions linux/deploy_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ export DEBFULLNAME=GitHubActions DEBEMAIL=noemail@example.com
echo -n generating changelog
rm -f debian/changelog
dch --create --package jamulus --empty --newversion "${VERSION}" ''
perl .github/actions_scripts/getChangelog.pl ChangeLog "${VERSION}" --line-per-entry | while read -r entry
do
perl .github/actions_scripts/getChangelog.pl ChangeLog "${VERSION}" --line-per-entry | while read -r entry; do
echo -n .
dch "$entry"
done
Expand Down
35 changes: 16 additions & 19 deletions mac/deploy_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,15 @@ while getopts 'hs:' flag; do
esac
done

cleanup()
{
cleanup() {
# Clean up previous deployments
rm -rf "${build_path}"
rm -rf "${deploy_path}"
mkdir -p "${build_path}"
mkdir -p "${deploy_path}"
}


build_app()
{
build_app() {
local client_or_server="${1}"

# Build Jamulus
Expand Down Expand Up @@ -71,11 +68,11 @@ build_app()
*)
echo "build_app: invalid parameter '${client_or_server}'"
exit 1
;;
esac
}

build_installer_image()
{
build_installer_image() {
local client_target_name="${1}"
local server_target_name="${2}"

Expand All @@ -90,18 +87,18 @@ build_installer_image()
# Build installer image

create-dmg \
--volname "${client_target_name} Installer" \
--background "${resources_path}/installerbackground.png" \
--window-pos 200 400 \
--window-size 900 320 \
--app-drop-link 820 210 \
--text-size 12 \
--icon-size 72 \
--icon "${client_target_name}.app" 630 210 \
--icon "${server_target_name}.app" 530 210 \
--eula "${root_path}/COPYING" \
"${deploy_path}/${client_target_name}-${app_version}-installer-mac.dmg" \
"${deploy_path}/"
--volname "${client_target_name} Installer" \
--background "${resources_path}/installerbackground.png" \
--window-pos 200 400 \
--window-size 900 320 \
--app-drop-link 820 210 \
--text-size 12 \
--icon-size 72 \
--icon "${client_target_name}.app" 630 210 \
--icon "${server_target_name}.app" 530 210 \
--eula "${root_path}/COPYING" \
"${deploy_path}/${client_target_name}-${app_version}-installer-mac.dmg" \
"${deploy_path}/"
}

brew_install_pinned() {
Expand Down
Loading