Raspberry Pi

Turn a Raspberry Pi into an Airplay Receiver

Want to turn Raspberry Pi into an Airplay-enabled device for streaming music on your Raspberry Pi speakers? Follow this article’s step-by-step guidelines to convert your Raspberry Pi device into an Airplay receiver so that you can start playing audio from your Apple device and listen to it on your Raspberry Pi speakers.

Turn a Raspberry Pi into an Airplay Receiver

Setting up Airplay on Raspberry Pi isn’t difficult; we will use an open-source application called ”Shairport Sync”. It implements Apple’s proprietary protocol on your Raspberry Pi system, allowing the users to stream music from their Apple devices to Raspberry Pi speakers. You should follow the step-by-step guidelines below that help you set up a Raspberry Pi Airplay receiver.

Step 1: Install Perquisites on Raspberry Pi

First, you should install some perquisites required for turning Raspberry Pi into an Airplay receiver and you can do so through below-given command:

$ sudo apt install autoconf libconfig-dev libtool libasound2-dev libpopt-dev libdaemon-dev avahi-daemon libavahi-client-dev libssl-dev -y

Step 2: Clone Shairport Sync Source Code on Raspberry Pi

Shairport Sync is an audio player used to play Airplay sound on Linux system and you can download its source code from the GitHub repository through the following command:

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

Step 3: Open Shairport Sync Directory

Completing the above step creates a directory with the name “shairport-sync” and places all the files inside the directory. To open this directory on your Raspberry Pi system, follow the below-given command:

$ cd shairport-sync

Step 3: Configure Shairport Sync

Now, to start configuring and setting up Shairport sync, you must first execute the following command to setup basic configuration files on Raspberry Pi:

$ autoreconf -i -f

Afterward, you must execute the below-mentioned command to configure Shairport-sync and allow it to use the perquisites like Alsa, Avahi and Open SSL.

$ ./configure --with-alsa --with-avahi --with-ssl=openssl --with-systemd --with-metadata

Step 4: Install Shairport Sync on Raspberry Pi

After the successful configuration, you can install Shairport sync on Raspberry Pi by first executing the make command to set up the installation.

$ make

Then, you can apply the following command to install Shairport sync on your Raspberry Pi system.

$ sudo make install

Step 5: Enable Shairport Sync Service on Raspberry Pi

After successful installation of Shairport sync, you should enable its service on your Raspberry Pi system from the following command:

$ sudo systemctl enable shairport-sync

Step 6: Start Shairport Sync Service on Raspberry Pi

Once you enable the Shairport sync service, you can execute the below-mentioned command to start its services on the Raspberry Pi system.

You can also confirm the Shairport sync running status from the following command:

$ sudo systemctl status shairport-sync

With an active (running) status, you have successfully set up an Airplay audio player on your Raspberry Pi system.

Step 7: Connect Airplay to Raspberry Pi

Now, open Airplay on your Apple device (from the control panel) and search for the devices; you will see your Raspberry Pi appears in the search. tap on the device to connect it with the Airplay.

After a successful connection, you can start playing sound from your Apple device and listen to it on your Raspberry Pi speakers.

Conclusion

Airplay is an application that allows Apple or Mac users to stream music, videos, and pictures on their Airplay-enabled smart TVs. You can turn your Raspberry Pi into an Airplay receiver using an open-source application called “Shairport Sync”, which can be set up using the guidelines mentioned above. After the successful setup, you can open Airplay on your Apple device and connect your Raspberry Pi device to start streaming music on your Raspberry Pi speakers.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.