Volumio 2 + Airplay 2

I have been able to update shairport-sync on Volumio 2 (System Version: 2.917, RP 4), so that I can use Airplay 2 (multi-room support).

I thought I’d share the process.

There is only one problem at the moment: the ui on Volumio does not show artwork/album when using Airplay 2. I am not sure if that worked with Airplay 1.
Maybe someone out there can help with that.

Plugins I have installed (that are still working after the update)

  • Nanosound CD
  • Volumio Spotify Connect2

Process

Login

ssh volumio@volumio.local

Turn off WiFi power management

sudo iwconfig wlan0 power off

Update Dependencies

sudo apt-get update
sudo apt-get install --only-upgrade dhcpcd5 e2fslibs e2fsprogs libblas-common libblas3 libbluray1 libcairo2 libcomerr2 libdrm2 libfreetype6 liblapack3 liborc-0.4-0 libpam-modules libpam-modules-bin libpam-runtime libpam0g libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0 libss2 libva-drm1 libva-x11-1 libva1 x11-common

NOTE: I have here skipped updating dependencies firmware-ralink and libsdl1.2debian because they broke the OS for me.

Remove old version

# backup
mv /usr/local/bin/shairport-sync /usr/local/bin/shairport-sync.old
# remove services (see https://github.com/mikebrady/shairport-sync/blob/master/BUILD.md#1-prepare)
sudo rm /lib/systemd/system/shairport-sync.service
sudo rm /etc/dbus-1/system.d/shairport-sync-dbus.conf

Install build-essential

  1. Edit file /etc/apt/sources.list
  2. Add a new line at the bottom with the following deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
  3. Save
  4. Then:
sudo apt-get update
sudo apt-get -y install binutils
sudo apt-get -y install libstdc++-4.9-dev
sudo apt-get -y install gcc-4.9 gcc g++-4.9 g++ dpkg-dev
  1. Remove line from /etc/apt/sources.list
  2. Then:
sudo apt-get update

NOTE For reference on this step, check out 2aCD’s post.

Install Airplay 2 Dependencies

sudo apt install --no-install-recommends git xxd xmltoman autoconf automake libtool
sudo apt install --no-install-recommends libpopt-dev libconfig-dev
sudo apt install --no-install-recommends avahi-daemon libavahi-client-dev libssl-dev libsoxr-dev
sudo apt install --no-install-recommends libplist-dev libsodium-dev libavutil-dev libavcodec-dev libavformat-dev uuid-dev libgcrypt-dev

NOTE I skipped installing dependecies libasound2-dev because it broke the OS and build-essential because we have already installed it on previous step.

Install NQPTP

NQPTP Is needed for Airplay 2 functionality. More info here.

# Make a temporary folder
mkdir temp
cd temp

# Clone nqptp repository
git clone https://github.com/mikebrady/nqptp.git
cd nqptp

# Install
autoreconf -fi
./configure --with-systemd-startup
make
sudo make install

# Enable service
sudo systemctl enable nqptp
sudo systemctl start nqptp 
cd ..

NOTE: For NQPTP to work properly, port 319 and 320 should be open.
Check with netstat --listen that the ports are open.

Update libplist-dev

Shairport sync uses libplist-dev version 2.2.0-6.
In order to update it:

  1. Edit file /etc/apt/sources.list
  2. Add new line at the bottom deb http://deb.debian.org/debian bullseye main contrib non-free
  3. Save
  4. Then:
sudo apt-get update
sudo apt-get install libplist-dev=2.2.0-6
  1. Remove line from file /etc/apt/sources.list
  2. Then:
sudo apt-get update

Install Shairport-sync

# Clone repo
git clone https://github.com/mikebrady/shairport-sync.git
cd shairport-sync
git checkout tags/4.1-rc2

NOTE : The previous command is checking out tag 4.1-rc2 which is were Airplay 2 support is at the moment. Be sure to checkout the right tag/branch for your case. Hopefully it will just be released on main soon.

# Install
autoreconf -fi
./configure --sysconfdir=/etc --with-alsa --with-soxr --with-avahi --with-ssl=openssl --with-metadata  --with-systemd --with-airplay-2  
make -j
sudo make install

# Enable service
sudo systemctl enable shairport-sync

NOTE: The ./configure command has many options. Be sure to apply the correct flags for your specific system (more info here)

Configuration of output device

  1. Launch command shairport-sync -h to list all system’s output devices.
  2. Edit configuration file /etc/shairport-sync.conf and add the correct output_device.
  3. Reboot

You will notice Airplay 2 is working because of the different icon (tick within a circle) displayed closed to device name when streaming to Volumio from iOS or MacOS.