AirPlay support in Kodi is hit and miss (nothing appears to work with iOS10). These instructions will get an AirPlay audio server up and running on OSMC using the excellent
shairport-sync package from Mike Brady (GitHub link). Most of these instructions are covered in his
README.md file, but I got confused with Linux audio – this write-up covers all steps in the setup in one place.
This is tested and working on a Raspberry Pi 3 running OSMC (2016-10) and iOS 10 devices. AirPlay audio is output from the 3.5mm jack on the Raspberry Pi, which can then be connected to an external speaker (I use the aux input on an old Bose SoundDock).
Firstly, if you have AirPlay enabled from within Kodi, disable it (
Settings > Services > AirPlay).
shairport-sync package is not available in the main Debian Jessie repository, but it is available in the Jessie backports repository. Apparently it will be included in the main repo for the next Debian release. So, you need to add the Jessie backports repo to OSMC:
sudo nano /etc/apt/sources.list
Add the following line to this file at the bottom:
deb http://ftp.debian.org/debian jessie-backports main
sudo apt-get update to refresh the package lists.
Important: Per Sam’s comment below, remove the backports repository from your sources list once you have finished the installation process.
sudo apt-get install shairport-sync
sudo nano /etc/shairport-sync.conf
Edit this file so that the following parameters are set (un-comment the lines as required):
name = “Your Airport Server Name";
drift = 352;
volume_range_db = 30;
run_this_before_playback_begins = “/usr/bin/amixer cset numid=3 1”;
run_this_after_playback_ends = “/usr/bin/amixer cset numid=3 0”;
wait_for_completion = “yes”;
output_device = “hw:0”;
mixer_control_name = “PCM”;
Enable and start the
sudo systemctl enable shairport-sync
sudo systemctl start shairport-sync
You should now see a new AirPlay target called whatever you named your server, and AirPlay audio should be output from the 3.5mm jack.
A couple of other notes:
- If you want to stream from your Windows PC you can install TuneBlade, which is free to use when streaming to a
shairport device. Note: Version 1.8.4 of shairport-sync is incorrectly recognised by TuneBlade as a genuine AirPlay receiver, as a result TuneBlade will only operate in trial mode. To fix this you need to install shairport-sync 2.8.6. However, 2.8.6 is not yet in the backports repository so you need to build it from scratch using the README.md instructions at the shairport-sync GitHub page.
- If you want AirPlay audio to come out of HDMI instead of the 3.5mm jack, don’t add the
wait_for_completion lines to the config file.
- You can plug a standard 3.5mm stereo plug into the Raspberry Pi 3.5mm socket to get audio out (i.e. there is no need to use a special 4-pole jack and adapter).