
Snapcast – Synchronous multi-room audio player - geekuillaume
https://github.com/badaix/snapcast/
======
ProfessorLayton
This looks interesting!

A bit of a rant, but I long for a digital version of an FM transmitter. Multi-
speaker playback with basically no setup and perfect sync _that also_ fails
gracefully can already be done with an FM transmitter. I would love it if
there was a solution for the digital era.

I have been forced into the bluetooth era kicking and screaming with my iPhone
11 and I constantly feel like I've taken a step back by being forced to use
bluetooth. The constant pairing issues, even with Apple's AirPods (which are
the most reliable by far) has been a constant pain point for me. Pairing,
unpairing, and multiple device management is a UX nightmare for something as
simple as audio payback.

~~~
PunksATawnyFill
And people pretend that Bluetooth is a replacement for the headphone jack. Not
only is it a janky pain in the ass, but it can't be shared with a companion
(watching a movie on a plane, for example).

We ARE going backward, partly because spineless apologists defend anti-
consumer behavior instead of standing up for themselves and better.

~~~
nkristoffersen
I'll point out a new feature with iOS I recently discovered. It is now
possible to share audio to other apple headphones (with their customer BT
chip) [https://support.apple.com/guide/iphone/share-audio-with-
airp...](https://support.apple.com/guide/iphone/share-audio-with-airpods-and-
beats-headphones-iph8ad1f667b/ios)

Very smooth UX and useful when watching a movie on a plane on an iPad.

~~~
PunksATawnyFill
Thanks for that info.

Unfortunately useless for anyone not using Apple's mediocre-at-best listening
devices. Like the huge number of people with Bose wireless cans.

~~~
OGWhales
I really don't understand why we can't just have the headphone jack back. Did
it even take up any significant amount of space?

~~~
swinglock
Sure, it takes up some space. But so does having to carry dongles. If Apple
made an iPhone with the jack back again and a couple percent smaller battery,
I'd take the jack. The phones has already been getting thicker every year ever
since 6 (the 2nd last iPhone so far with a jack), so that's no argument.

~~~
OGWhales
Right? Not to mention the dongles break super easily and also I can't charge
my phone and listen to music at the same time :/

------
matthew-wegner
I've been running whole-home Snapcast for over a year now, controlled by Home
Assistant. Some quick info:

\- Previously, I would use Raspotify/etc and automatically change sources as I
moved between rooms. This is much cleaner

\- My automation server is a Linux VM, which is now my audio source for
Snapcast. This means I just use the native, 100% unmodified Spotify client (or
really, anything). Previously the various librespot/etc stuff would sometimes
break or require updates

\- I run two streams: Music + text to speech, and just TTS. Some rooms switch
to TTS-only when the room turns off. Other rooms mute completely. Really it
just depends how peripheral the room is. i.e. my garage mutes completely when
it's off, but more interior rooms still play TTS.

\- Pulseaudio junk is what manages the above routing. Linux audio really is
gross once you try to do anything past-minimum with it. You can do complicated
things, though--I duck music volume down a bit when house TTS is happening. I
still have to regularly and automatically restart pulseaudio completely when
nothing is playing, to avoid both horrid clock drift and/or crackle

\- Any audio you can play/handle on Linux, you can make into a stream. I could
easily add a third stream for an aux-in line dangling off the machine, for
people to plug in to for parties/hardware players/etc

\- Most clients are Raspberry Pis with USB audio DACs. My macOS machines also
run snapclient. I only have one Windows machine (my TV box) I wanted to
include, and ended up just running a Ubuntu VM with snapclient to make that
happen. (The other option is to use pulseaudio in a VM, and then also an
ancient Windows port of pulseaudio to actually take the pa data out to the
speakers, but ugh)

\- Including all computers, I have 8 clients, I think? You can enable "send
audio to muted clients" to avoid a re-buffer delay when rooms turn on and off

\- You can push latency quite low if you want, especially if everything in
your house is hardwired. My desktop audio is almost always Spotify now, out of
laziness, and really when I'm using the desktop client I'm actually
controlling the remotely-playing VM. The latency doesn't bother me, and I'm
pretty sensitive to that kind of thing

\- I use cheap 10-button RF remotes as "light switches" in all rooms. It's
nice to have that many buttons to standardize some things. For music, two
buttons are play/stop spotify, with some overloaded functions (pressing play
while music is already playing skips to next track)

~~~
joshspankit
Have you considered the possibility that your Spotify “laziness” is related to
the friction involved in playing your own music through Snapcast?

~~~
matthew-wegner
Oh, that isn't what I meant. I meant in contrast to hunting around for new
music more directly. I used to spend entire weekend afternoons looking for
music--reading forum threads, browsing weird labels, going down related-artist
rabbit holes in new genres. Lots of this was on OiNK and What.cd, which had
tremendous forums and metadata. There are modern replacements, but they aren't
equivalent. Lots of this is the diffusion of music lovers in general.

Spotify is reliably a B- source of music, once you've used it for awhile. My
Daily Mixes are...fine. Never great, but never awful. So I fall back to it as
background music.

But because it _isn 't_ awful, I'm not motivated to put in heaps of extra
effort to move from B-grade to A-grade. Moving up that curve is diminishing
returns.

On the technical front, it'd be quite easy to play your own files through
snapcast, in a variety of ways.

~~~
joshspankit
Yes I’m picking up what you’re putting down. I really wish What.cd had been
able to continue as a metadata service if nothing else: the discoverability of
music was at a level I have not seen anywhere else.

------
jrobn
I have an extensive sonos setup for my business. I’ve experienced a lot of
trouble with the system just cutting out, skipping tracks over and over, and
connecting to Apple Music. Every couple of weeks it just totally shits the
bed.

Would love speakers that could serve music off my Synology NAS reliably and
without microphones in my speakers to spy on me.

With the whole google/nest fiasco I don’t want to actively try to thwart a
_speaker_ from collecting data on me and my family. It’s exhausting.

Someone needs to start a company, like, Elgato Eve, where their primary
feature product is privacy focused products. They would have my money every
time.

~~~
baq
Denon’s HEOS is an alternative which I can attest works, it’s far from
perfect, but it does tick majority of your boxes.

------
geekuillaume
Not my project but I've been using it for a year on 3 Raspberry Pi and it has
been rock solid. I highly recommend it. The synchronization is perfect and it
only adds a small delay (500ms max) to the music. I've configured Librespot to
use this as a Spotify Play speaker and control it from the desktop or mobile
Spotify app.

~~~
Havoc
Worth pointing out that the raspberry audio out has quite a bad rep quality
wise:

[http://raspberrypimaker.com/cheap-quality-audio-raspberry-
pi...](http://raspberrypimaker.com/cheap-quality-audio-raspberry-pi/)

~~~
trynewideas
Pimoroni has a line of £20 hats that help solve that:
[https://shop.pimoroni.com/collections/pirate-
audio](https://shop.pimoroni.com/collections/pirate-audio)

~~~
alias_neo
I bought a couple, they're really good, my only dislike is that the screen
software is written as a Mopidy plugin, but I'd prefer a remote mopidy
instance and the pis and hats are just clients with controls.

~~~
7839284023
Did you find a solution to the remote mopidy instance yet? I'd like to do the
same thing.

------
reggieband
> The encoded chunk is sent via a TCP connection to the Snapclients.

I wonder why TCP? For streaming media I would expect UDP, RTP or even RTMP to
be better. Maybe even something newer like QUIC.

 _edit_ : in fact, isn't RTP/RTCP made for exactly this purpose? The
streaming/synchronization of media?

~~~
mongol
Some elaborations here

[https://github.com/badaix/snapcast/issues/305](https://github.com/badaix/snapcast/issues/305)

------
thomas536
There has also been some work on low latency audio this year via
[https://gavv.github.io/articles/roc-
tutorial/](https://gavv.github.io/articles/roc-tutorial/)

------
milesward
Now what we need is a method to hijack the phone-home process new Sonos
devices use, and have them controlled via this. It's amazing to me how glitchy
and fragile the native Sonos network is. I have lots of zones, but wow.

------
genericacct
You may also want to try airplayhub with shairport-sync

[https://github.com/noelhibbard/node-
airplayhub](https://github.com/noelhibbard/node-airplayhub)
[https://github.com/mikebrady/shairport-
sync](https://github.com/mikebrady/shairport-sync)

------
federico3
I always wondered why there aren't synchronous "audio conferencing" tools to
allow play music and even improvise over the Internet.

Of course they would have to introduce a fixed delay of a phrase (or multiple)
and people would have to play accordingly.

~~~
th0ma5
You can totally feel any delay above 5-10ms so that rules out quite a lot of
things. I hear people still do it in some fashion.

~~~
grawprog
I have trouble getting local latency below that at times with recording and
live playback. Trying to sync together multiple people and keeping it below
that is still a bit a ways off most current networks.

------
mr_sturd
Got two Raspberry Pi with HiFi Berry HATs, and have been trying to use RTP
over Pulseaudio, from my home server, but have never managed to get the
synchronisation right.

I'll be starring this project and giving it a go as soon as possible. Can't
wait!

------
toomim
This looks cool! Has anyone used it with Airplay? Can you report on how well
it works?

I'd love to be able to stream from laptops and phones -- without installing
additional software on them.

------
hippich
Any1 aware of any solutions to stream (let's say through pulseaudio) realtime
audio? I.e. matching what happens on the screen. Is it even possible?

~~~
joshspankit
All streaming will have delay built in. Exponentially so when multi-room is
involved. Audio has to be intercepted, encoded/transcoded, sent over the
network, possibly endure packet loss, be received, and decoded, before it can
be played through speakers.

------
jakobegger
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](https://github.com/mikebrady/shairport-sync)

------
amflare
I've just started getting into Sonos because I want the full house audio, but
I'm not sold yet. The worry I have with Snapcast is that sometimes it's worth
the money for things to JustWork(tm). I know Sonos is super janky sometimes,
but at least I don't have to build it from the ground up with a patchwork of
technologies across my various computers and phone

------
mongol
I use this in three ways: To stream from MPD, to stream from a DLNA renderer
(gmrender-resurrect) and to stream from Pulseaudio. It is generally great, but
the audio from Pulseaudio is not working well, quality-wise. The one remaining
problem is sometimes that podcasts that I stream via DLNA plays much too fast.
Seems to depend on circumstances in the podcast stream.

~~~
joshspankit
Is it possible it’s the encoding of the episodes? Some audio workflows get all
confused with VBR for example.

------
fizixer
I can't see any info of what clients are supported. I'm interested in serving
audio to both "speaker clients" as well as mobile-app clients.

For mobile setup, I currently use soundwire (it has an android app as a
client, and I serve audio from a linux server) but the sync is not very good.

~~~
alias_neo
It has it's own client binary, you can run it on anything you can build the
binary for,there is also an Android client app but the Android app has never
worked for me. You can't use standard clients with their own proprietary
software, e.g. Sonos speakers etc

------
paul7986
Out of the box Does this support syncing audio from web streams like YouTube?

Also, is this trivial to set up and is there a web app I can use to test it
out?

~~~
lm2s
All your questions are answered in the README.

------
ww520
The project looks good. Would multicast be good for this kind of applications?
How much support do routers have for multicast these days?

~~~
iforgotpassword
If you're talking home routers then I doubt you have multiple subnets at home,
so just use broadcasts, there's no difference then. But if you do, OpenWrt
should handle this.

------
Ice_cream_suit
How long before Snapchat's lawyers send a letter, insisting that the name be
changed to something less misleading?

~~~
capableweb
Bad lawyers if so, would take a stupid judge to agree they are at all doing
similar things. Only thing they have in common is the name.

------
brayhite
How does this compare to something like Airfoil?

~~~
vinw
Just quickly looked at Airfoil and it seems to pipe music to existing clients
(chromecast, sonos, etc) whereas Snapcast gives you both the server and client
software for you to run however you want. Also Snapcast is FOSS, so that's one
other difference.

~~~
lloeki
There's Airfoil Satellite and also Airfoil Speakers for Linux for the receiver
ends.

[https://www.rogueamoeba.com/airfoil/satellite/](https://www.rogueamoeba.com/airfoil/satellite/)

------
RosanaAnaDana
I'm so excited to try this.

