What does HackerNews think of shairport-sync?

AirPlay and AirPlay 2 audio player

Language: C

I host a Mastodon instance, a Matrix server (using synapse and coturn), a Minecraft server for the kids, a server for an esoteric mod of Ultima Online called Ruins & Riches, and a Web server. I use Nginx for reverse proxying and Wireguard for VPN.

I also run a bunch of Raspberry Pis around the house connected to stereos to stream audio using AirPlay (with https://github.com/mikebrady/shairport-sync).

I used something different. Basic details for your entertainment/edification/comedy source material follow mostly so you can shortcut a comparison if you're building something at your place.

1) Pi-zero running shairport-sync (couldn't get them, got orange-pi zero 2 which works great) https://github.com/mikebrady/shairport-sync. I have a few of these.

2) Class D amp, Aiyima, Fosi, Loxjie etc Aliexpress is one place to get these. I've used and like Aiyima A03 and their ali store delivers fast.

3) Some nice, high-quality, 2nd hand speakers you like. Wharfedale, JBL, B&W, Acoustic Research, Yamaha. (Or get some active speakers you like and skip #2, eg B&O beolab 6000)

4) owntone (formerly known as forked-daapd) https://owntone.github.io/owntone-server/

5) configure owntone with your spotify premium, takes less than a minute. (And with your music that you own - takes longer because you take more care).

You now have a multiroom setup with fantastic sound that you can control with http://owntone.local:3689/ including with your phone. And/or you can use the "Retune" app on droid and apple's "itunes remote" app on ios. Better sound than most alternatives for less dollars.

All integrates well with Homeasistant because of course it does.

I really like how mine turned out. Having half a dozen sets of speakers all playing the same music in perfect sync as you move from one room to another while doing chores on the weekend fills me with more joy that I would have guessed. YMMV.

Yes, you wouldn't get this running on an existing smart speaker (without first rooting it and some serious hacking).

If you'r in the Apple ecosystem and are using AirPlay with your smart speaker(s), it's however possible to also play synchronized audio across to your own DIY speaker setup, using another open source project.

https://github.com/mikebrady/shairport-sync

Or you could of course choose to only use your old dumb speakers with this, and they will pop up as easily selectable sound output devices on all Apple devices connected to your network.

Or combine it (and librespot[2], owntone[3]...) with Snapcast to create a virtual speaker for your whole house that shows up everywhere.

[2] https://github.com/librespot-org/librespot

[3] https://github.com/owntone/owntone-server

This looks cool. I'm not sure if they are intending to go all the way to room correction but it can really do wonders. A good while back my music setup used filters calculated by an open source FIR tool with playback driven by an older version of Shairport (emulating an AirPort express) using BruteFIR as a convolver. Fiddly to set up but it sounded really good.

1. http://drc-fir.sourceforge.net

2. https://github.com/mikebrady/shairport-sync

3. https://torger.se/anders/brutefir.html

There is Airplay 1, which is the only widely supported protocol I'm aware of. See for example https://github.com/mikebrady/shairport-sync.

There is also DLNA, which is actually a standard. I think it's rarely supported for push audio streaming since the protocol is poorly specified.

It's a convoluted setup I'm not sure I'd recommend to anyone else! :) Still tinkering on it, but current rig is a Respeaker Core [0] running voice2json [1], which sends MQTT commands to a Mac Mini running mopidy [2], and the audio is routed through Airfoil [3] to multiple AirPlay speakers. (In theory, a Pi could drive all that directly, using shairport [4] rather than Airfoil.)

The major shortcoming is that Airfoil doesn't support Airplay 2, so it doesn't take full advantage of HomePod stereo pairing; and while the sync is perfect, it comes at the cost of massive lag (5+ seconds). Sounds great though!

[0] https://respeaker.io/rk3229_core/

[1] https://voice2json.org/

[2] https://mopidy.com/

[3] https://rogueamoeba.com/airfoil/

[4] https://github.com/mikebrady/shairport-sync

Heh, the thoughts are similar but not that similar.

https://github.com/mikebrady/shairport-sync

It actually does implement multi-room synchronized audio. This was the one thing keeping me from running an OSS audio solution using RPis. I like that it runs AirPlay, so it can "just work" using existing devices, and not a crazy uncle solution.

I successfully used shareport-sync and forked-daapd back a while ago with PogoPlugs and USB audio interfaces for multiroom audio. It worked without too much effort.

https://github.com/mikebrady/shairport-sync

http://ejurgensen.github.io/forked-daapd/

Ah, you're in luck. Shairport-Sync [0] should be exactly what you're looking for.

Anyone know an alternative that works with (non-rooted) Android devices?

[0] https://github.com/mikebrady/shairport-sync

If you're in the Apple ecosystem already, Shairport can provide multiroom audio if you don't already have an Airplay setup: https://github.com/mikebrady/shairport-sync
I am using raspberry pis with shairport (https://github.com/mikebrady/shairport-sync) works like a charm and at 15$ bucks impossible to beat price wise.
Can someone explain why I would use this over Shairport Sync [1]? Setting up shairport is so easy, and it works great with iPhones and Macs as audio sources (which happens to be what I use).

Is Snapcast just more compatible with Linux clients, or are there any other advantages?

[1]: https://github.com/mikebrady/shairport-sync

With the Raspberry Pi:

I've made a four wheel drive robot called Rover that uses brushless motors and 3d printed planetary gears. It's all CC0 open source:

https://www.youtube.com/watch?v=pwCkX6bLY3E&t=4s

https://github.com/tlalexander/rover_control

https://reboot.love/t/rover-and-skittles-cad-design-files-he...

https://imgur.com/a/GqXD2Zj

I've made a smaller classroom style robot named Skittles that also uses brushless + planetary and is open source:

https://www.youtube.com/watch?v=Y2-zIUY_kww

I taught a robotics class using the robot Skittles, and the students did a great job picking up Raspberry Pi. There's a lot of tutorials on the web they found to do their work!

https://www.youtube.com/watch?v=4pql6ZbPVog

I've made a "fake Philips Hue" light out of a SK6812 RGBW LED strip to go with my existing Philips Hue system. That uses this github project:

https://github.com/diyhue/diyHue

I made a humidity controlled chamber for mushroom cultivation:

https://github.com/tlalexander/humidity_controller

I've made an RTK GPS system using two raspberry pis and two $75 GPS receivers to make a GPS system that so far looks to be accurate to within a few centimeters (when you have clear sky).

http://rtkexplorer.com/how-to/posts-getting-started/

I replaced our dodgy bluetooth audio sink on our stereo with an Airplay node using this software:

https://github.com/mikebrady/shairport-sync

I've added a wireless front end to some of my 3D printers using Octoprint:

https://octoprint.org/

What else? Well I just keep going. Professionally I'm a robotics prototyping engineer and I cannot tell you how much joy I get from the Pi and the things I can make with it. :)

At the risk of being a bit off topic … A lot of people interested in Airplay will be looking at this post wondering how to use AirPlay with UPnP or ChromeCast devices. shairport-sync [1] (used in the article) only works directly with audio hardware, so won't work with Chromecast or UPnP compatible systems. I've tried many many different open-source bridges and finally found AirConnect [2] which is by far the most reliable, active and well-maintained bridge. philippe44 responds to every issue filed (as far as I can tell). Works great with my Sonos PLAY:1 & XBox.

[1] https://github.com/mikebrady/shairport-sync [2] https://github.com/philippe44/AirConnect

Just had a quick browse of the repositories - they're quite out of date compared to the master/s.

e.g. https://github.com/volumio/shairport-sync compared to https://github.com/mikebrady/shairport-sync

But thank you - this lead to finding https://github.com/badaix/snapcast

To repurpose your old stereo with a raspberry today, just run https://github.com/mikebrady/shairport-sync on it :-)

This way you can send any audio from laptop/phone to the stereo over lan.

Not sure why you would want to limit yourself to the service of a single provider. (What value does Spotify Connect add, if any?)

Keep things modular: get something like a Raspberry Pi with a USB soundcard and plug that into your good ol' amp.

Using that with shairport-sync to cast to a Woburn speaker gives me more than adequate results and I'm not even using a USB DAC nor digital audio output via HDMI, just the Pi's basic line-out.

https://github.com/mikebrady/shairport-sync

MUJI 0.5mm gel ink pens [0] - I've used these pens for so long that my handwriting goes haywire when using a different make. Perfect balance of smoothness and scratchiness - with fast drying ink, which as a lefty is vital.

Harmon Kardon Soundsticks II – had mine for over a decade and they still sound and look great.

Gaggia Colour espresso machine – looks great, built like a tank, simple to repair, and still produces fantastic coffee after years of benign neglect.

Chromecast – it just works. Feels like the future to use my phone to stream video from the Raspberry Pi to the TV.

AirPlay – it also just works. Recently set up a multi-room audio streaming thing, like a budget alternative to Sonos, using a few Raspberry Pis I had lying about and Shairport Sync [1]. Works much better than I anticipated.

[0] https://www.muji.eu/pages/online.asp?Sec=13&Sub=52&PID=5162 [1] https://github.com/mikebrady/shairport-sync

Linux has had network audio support in various forms for a long time.

The default sound server for most distros (PulseAudio) supports TCP or RTP streaming. RTP supports multicast (and multiple multicast groups so you can break down your endpoints into multiple groups).

If you want airplay streaming, then there's shairport-sync ( https://github.com/mikebrady/shairport-sync ) that also has multi-room support; each room can map to an ALSA target (which could be a virtual PulseAudio device pointing to a network target). Reportedly (at least when I last checked a few years back) there were some issues experienced compiling with PulseAudio - alternatively you could just run shairport-sync and native ALSA on each of your targets.

Just add a few Raspberry Pis, (and maybe some dedicated DAC boards if you're bothered about sound quality) and you're good to go.