airplay logoIn this tutorial, we’ll cover how to turn a Raspberry Pi with JustBoom HAT/pHAT into an AirPlay receiver.

Prerequisites

To create your own AirPlay receiver, you will need:


Raspberry Pi
JustBoom HAT or pHAT
microSD card with latest Raspbian Jessie (Lite)

Make sure you’ve followed section 1 and 2 of the Set Up Your JustBoom With Raspbian guide, before proceeding to the next step.

Shairport Sync

Shairport Sync is an AirPlay audio player capable of streaming audio from iTunes, iOS devices and other AirPlay sources. Synchronised multi-room audio is possible, as Shairport Sync-powered devices stay synchronised with the source.

The Shairport Sync project can be found on GitHub, and is what will be used in this tutorial to turn a Raspberry Pi into a JustBoom AirPlay receiver.

First, update the repositories and install the required dependencies:

sudo apt-get update && sudo apt-get dist-upgrade -y
sudo apt-get install -y build-essential git xmltoman autoconf automake libtool libdaemon-dev libasound2-dev libpopt-dev libconfig-dev avahi-daemon libavahi-client-dev libssl-dev libsoxr-dev

Clone the Shairport Sync repository:

git clone https://github.com/mikebrady/shairport-sync.git && cd shairport-sync

Then, configure and build Shairport Sync:

autoreconf -i -f
./configure --with-alsa --with-avahi --with-ssl=openssl --with-metadata --with-soxr --with-systemd
getent group shairport-sync &>/dev/null || sudo groupadd -r shairport-sync >/dev/null
getent passwd shairport-sync &> /dev/null || sudo useradd -r -M -g shairport-sync -s /usr/bin/nologin -G audio shairport-sync >/dev/null
sudo make install

Finally, enable Shairport-Sync to start at boot:

sudo systemctl enable shairport-sync

Reboot the Pi to finalise the installation:

sudo reboot

Test

With the software installed, start your AirPlay source, and search for your freshly installed AirPlay receiver. It should appear as its hostname.

iphone airplay

Repeating the installation for multiple JustBoom devices, you can create your own multi-room audio setup, selecting multiple AirPlay receivers.

First published at 12:40pm on August 3, 2017
Last updated at 9:00am on August 4, 2017