2021-06-29 16:54:47 +01:00
2021-06-04 00:50:52 +01:00
2019-03-22 22:39:56 +00:00
2021-06-29 16:54:47 +01:00
2019-11-13 22:04:22 +00:00
2020-05-25 15:30:07 +01:00
2021-01-24 18:01:39 +00:00
2021-04-27 19:27:43 +01:00
2017-01-30 23:02:07 +00:00
2021-06-04 09:40:24 +01:00
2017-09-07 12:02:00 +01:00
2020-02-20 21:32:35 +00:00
2020-06-21 15:36:09 +01:00
2020-09-27 10:45:22 +01:00
2014-04-30 20:47:48 +01:00
2021-05-02 17:56:08 +01:00
2021-06-29 12:51:45 +01:00
2019-07-27 00:05:38 -03:00
2014-04-30 20:47:48 +01:00
2021-06-29 13:13:58 +01:00
2014-10-25 14:25:21 +01:00
2019-04-05 15:10:04 +01:00
2020-02-20 21:32:35 +00:00
2019-05-16 17:41:31 +01:00
2020-02-21 13:36:07 +00:00
2017-04-16 20:04:37 +01:00
2019-11-13 22:04:22 +00:00
2017-07-31 11:57:57 +02:00
2021-05-02 17:21:32 +01:00
2020-12-15 21:38:23 -05:00
2016-03-02 17:41:33 +00:00
2020-02-22 17:59:18 +00:00
2014-04-30 20:47:48 +01:00
2021-06-27 22:13:14 +01:00
2020-02-20 22:56:57 +00:00
2021-05-01 14:09:38 +01:00
2021-01-24 18:01:39 +00:00
2019-11-10 10:02:23 +00:00
2019-06-21 22:59:18 +01:00

Shairport Sync

  • Shairport Sync is an AirPlay audio player – it plays audio streamed from Apple devices and from AirPlay sources such ForkedDaapd.
  • Shairport Sync can be built to support AirPlay 1 only or it can be built to support Airplay 2, which includes AirPlay 1 support.

AirPlay 2 Matters

  • The AirPlay 2 build requires a good deal of extra library support and may not fit into smaller devices. It also requires more CPU power and more RAM -- the minimum recommended device is a Raspberry Pi 3.
  • AirPlay 2 support is experimental and incomplete. The focus of the development effort has been on getting the best possible audio performance. Many features outside that focus are missing or broken. So, for example, integration with Apple's Home app is missing; remote control doesn't work.
  • For AirPlay 2, Shairport Sync requires the services of another application called NQPTP ("Not Quite PTP") for timing and synchronisation. NQPTP must run as root and must have exclusive access to ports 319 and 320.
  • AirPlay 2 support is only available on recent Linux and FreeBSD builds. The FreeBSD implementation has not been extensively tested. OpenBSD and Cygwin are not supported. AirPlay 2 support will definitely not work on Mac OS X. The reason is that Shairport Sync needs to use NQPTP, which uses ports 319 and 320. These ports are already used by Mac OS X to support its implementation of AirPlay 2.

Did we mention AirPlay 2 support is experimental? You should also note that it is possible that changes could be made that would stop AirPlay 2 support from working. Let's hope that doesn't happen -- due to its limitations, there seems little prospect of it having any kind of commercial significance.

What Works

  • AirPlay 2 audio for players hosted on macOS and iOS.
  • AirPlay 2 audio for System Sound Output from macOS.
  • The ALSA, stdout and pipe backends definitely work, as does the sndio backend for FreeBSD.

What Does Not Work

  • Shairport Sync AirPlay 2 can not be used from a PC or from an Apple TV.
  • There is no integration with Siri or with the Home app or HomeKit, so nothing to do with the Home app works.
  • You can not run multiple instances of Shairport Sync on one device. This is because an instance of Shairport Sync requires exclusive access to NQPTP, and only one instance of that can run on a processor. (Docker may offer a workaround, but this has not been tested.)
  • Remote Control from Shairport Sync back to the player doesn't work. The D-Bus and MPRIS interfaces are working, but anything requiring sending commands to the player doesn't work.
  • Artwork is not downloaded.
  • Playing from certain Apple devices to Shairport Sync does not work as expected. For example:
    • When using a service with the ability to play directly on HomePod (e.g. Apple Music). If the music starts on the HomePod, or is the first device selected from the AirPlay list on iOS, when Shairport Sync is then selected iOS shows it as not connected (even though it is). Therefore the expected volume controls are not displayed. A workaround for this is to force an AirPlay stream to the HomePod (rather than just acting as a remote controller), this can be done by selected Shairport Sync before the HomePod. Note, this issue is not present for other services such as SoundCloud which do not integrate into the HomePod like Apple Music does.
    • The above example is true also when trying to select Shairport Sync from the AirPlay menu on the HomePod from the Home app.

More About What Works

  • Two types of audio are received -- "Realtime" streams of CD quality ALAC (like AirPlay 1) and "Buffered Audio" streams of AAC stereo at 44,100 frames per second. The selection of stream type is made by the player.
  • Audio is synchronised with other AirPlay 2 devices, including AirPlay 2 devices that have their own master clocks. (Limitation: This has not been tested with multiple nearly-identical master clock devices such as with two HomePod minis -- Shairport Sync may get confused about which is the current master.)
  • Shairport Sync continues to support AirPlay 1, and offers an AirPlay 1 compatibility mode for situations where iTunes or macOS Music plays to multiple speakers and one of more of them is compatible with AirPlay 1 only.

What You Need

  • A Raspberry Pi. See table below for tested devices, feel free to open an issue or pull request if you have Shairport Sync working on a device not listed here!
  • NQPTP is needed and must be run as root. It will use ports 319 and 320, normally reserved for PTP clocks. If you are using PTP clock services for something else, you can't install NQPTP and so you can't use Shairport Sync.(FYI, most computers do not have a PTP clock running -- instead, they may use a Network Timing Protocol (NTP) service to keep the system clock synchronised with world time. However, as noted above, macOS does use a PTP clock to support AirPlay 2.)
Device Native Docker Notes
Raspberry Pi 4 Working Working
Raspberry Pi 3 Working Working
Raspberry Pi Zero W Untested Mostly working Since the Pi Zero is low powered, issues can arise fairly quickly when trying to run additional programs, this currently includes quickly changing the volume repeatedly. Total CPU usage sits at around 75% when using Shairport Sync. Updates to Shairport Sync could make this better or worse.

Guides

  • A brief guide to building Shairport Sync for AirPlay 1 is available at BUILDFORAP1.md.
  • To build Shairport Sync for AirPlay 2 on Linux, please follow the guide at BUILDFORAP2.md.
  • A guide for building on FreeBSD is forthcoming.

Note

Shairport Sync does not support AirPlay video or photo streaming.

More Information

For more information, and for a more complete account of how to build Shairport Sync for AirPlay 1, please visit MOREINFO.md.

Acknowledgements

For the development of AirPlay 2 support, special thanks are due to:

And of course, thanks to everyone who has supported and improved Shairport Sync over the years.

S
Description
No description provided
Readme
14 MiB
Languages
C 92.2%
C++ 3.7%
Shell 1.6%
M4 1.4%
Makefile 0.6%
Other 0.5%