Required packages
sudo apt-get install build-essential git xmltoman autoconf automake libtool libdaemon-dev libpopt-dev libconfig-dev libasound2-dev avahi-daemon libavahi-client-dev libssl-dev
Get and install ALAC for better audio.
git clone https://github.com/mikebrady/alac.git
cd alac
autoreconf -fi
./configure
make
make install
sudo make install
sudo ldconfig
cd ../
rm -rf alac/
Get and install Shairport
git clone https://github.com/mikebrady/shairport-sync.git
cd shairport-sync/
./configure --with-alsa --with-metadata --with-apple-alac --with-systemd --sysconfdir=/etc --with-avahi --with-ssl=openssl
make
sudo make install
sudo systemctl enable shairport-sync
cd ../
rm -rf shairport-sync/
Edit the config
sudo nano /etc/shairport-sync.conf
Enter the following config
general =
{
name = "Airplay naampje";
password = "wachtwoordje";
volume_range_db = 40 ;
}
Enable audio_pwm_mode = 2 by editing the folowing config
sudo echo "audio_pwm_mode=2" >> /boot/config.txt
Reboot sudo reboot now