Skip to content

Instantly share code, notes, and snippets.

@corysolovewicz
Last active September 21, 2024 18:48
Show Gist options
  • Save corysolovewicz/c1c8cf4394dc2988fcd9f23cd4a62a99 to your computer and use it in GitHub Desktop.
Save corysolovewicz/c1c8cf4394dc2988fcd9f23cd4a62a99 to your computer and use it in GitHub Desktop.
############ gist usage instructions ############
# clone gist
# git clone https://gist.github.com/corysolovewicz/c1c8cf4394dc2988fcd9f23cd4a62a99.git
# cd c1c8cf4394dc2988fcd9f23cd4a62a99
# chmod 755 shairport-sync_install.sh
# ./shairport-sync_install.sh
#################################################
###############################################################
# Steps for building and installing shairport-sync on a raspi 3
# Note, some steps require sudo
###############################################################
# Enable script to exit if any command fails
set -e
############# nqptp #############
# update packages
sudo apt update
sudo apt upgrade -y
# install pre-requisites
sudo apt install --no-install-recommends -y build-essential git autoconf automake libtool \
libpopt-dev libconfig-dev libasound2-dev avahi-daemon libavahi-client-dev libssl-dev libsoxr-dev \
libplist-dev libsodium-dev libavutil-dev libavcodec-dev libavformat-dev uuid-dev libgcrypt-dev xxd
cd ~
# clone nqptp repo if not already cloned
if [ ! -d "nqptp" ]; then
git clone https://github.com/mikebrady/nqptp.git
fi
# build project
cd ~/nqptp
autoreconf -fi
./configure --with-systemd-startup
make && sudo make install
# configure and start systemd service
sudo systemctl enable nqptp
sudo systemctl start nqptp
echo "nqptp status:"
sudo systemctl is-active nqptp
############# shairport-sync #############
cd ~
# clone shairport sync repo if not already cloned
if [ ! -d "shairport-sync" ]; then
git clone https://github.com/mikebrady/shairport-sync.git
fi
# build project
cd shairport-sync
autoreconf -fi
./configure --sysconfdir=/etc --with-alsa \
--with-soxr --with-avahi --with-ssl=openssl --with-systemd --with-airplay-2
make && sudo make install
# configure and start systemd service
sudo systemctl enable shairport-sync
sudo systemctl start shairport-sync
echo "shairport-sync status:"
sudo systemctl is-active shairport-sync
echo "Build and installation completed successfully."
echo "*** If installing on a pi5 with hdmi audio out ***"
echo "Comment out dtparam=audio=on in /boot/firmware/config.txt"
echo "Also you may have to uncomment and update output_device=\"hdmi:vc4hdmi1\"; in /etc/shairport-sync.conf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment