Hi there. I’d like to announce Shairport Sync, a version of Shairport with audio synchronisation.
This new version of Shairport – “Shairport Sync” - adds audio synchronisation: the audio output stays in sync with the source and with other AirPlay devices – it doesn’t drift in and out of sync, so it’s good for multi-speaker or multi-room audio. It has a few other improvements too – overall, it’s a bit more “housetrained”. It is for Linux only and requires ALSA and avahi to be installed.
Built and tested on Ubuntu, Raspian and OpenWrt with a variety of USB audio output devices – an original iMic, a “3D Sound” card, a Topping TP30 amplifier, the Raspberry Pi’s built-in sound card.
At this stage, it seems pretty robust. I’d appreciate any feedback.
I am giving this a try, I really appreciate what you did! This seems quite awesome and furthermore very well documented. If it proves to be robust and fulfill the requirements of Volumio, I will be more than happy to integrate it!
succesfully compiled and installed. If I make it start with its init script, it works flawlessly. However, I need to start it via custom shell script. What I have with the command:
shairport -a “Shairport 2.0” – -d hw:0
Can’t set the D/A converter to 44100 – set to 48000 instead./n
In the script above, you’re asking Shairport to use device hw:0, which doesn’t support the 44100 frames per second rate needed – it reports that the nearest frame it can support is 48000. However, if Shairport is working flawlessly in the init script, then it may be that you have more than one sound device on your system, and that a device other than hw:0 is the default. Does that seem possible? Try just:
Yes, with that it works. The problem is that I need to change output device accordingly with the user selected one… So, guess we can omit the hw, and use just 0,0 . What is the syntax?
Original shairport didn’t have this problem, with the same device. Can a on the fly resampling be applied?
That’s good! I don’t know what the exact rules for the syntax are. You can say -d default or -d hw:0 or -d hw:1 etc. This has been the case for all linux systems I’ve tried. I used alsamixer to discover the names to use.
Regarding the resampling, AFAIR that feature wasn’t available (or not enabled) in the previous version of Shairport that I started with on OpenWrt. I wanted to focus on getting synchronisation working well, so I was happy to disable it, as it complicates the timing calculations somewhat. Now that Shairport Sync seems (!) to be reasonably stable and robust, one could reintroduce it, but it won’t be too soon, I’m afraid.