Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Snapcast – Synchronous multi-room audio player (github.com/badaix)
110 points by mafro on May 25, 2022 | hide | past | favorite | 30 comments


Snapcast is awesome, especially when bundled together with Iris and Mopidy [1], which includes the links to Youtube, Soundcloud, Funkwhale, podcasts, streams (etc). I wrote a blog post on how to build a small Raspi Zero Image for Snapcast [2] that directly connects to the Snapserver included in (e.g.) the Iris Docker [3]. I added a modified Docker Image for Iris that includes the Funkwhale extension here [4]. Works flawlessly since 2 years, almost zero maintenance and great music experience. My synchronized Snapcast extents through several rooms and two houses (120km apart), through IPSEC with a very small bandwidth (5000kbit up). Many thanks to all the maintainers of this stunning stack of OSS.

[1]: https://github.com/jaedb/Iris

[2]: https://du.nkel.dev/blog/2021-04-10_buildroot-snapos/

[3]: https://github.com/jaedb/Iris/blob/master/docker-compose.exa...

[4]: https://dev.funkwhale.audio/Grom/iris-funkwhale


Same. Really happy with my music setup now. Throw in beets for retagging old mp3s and openvpn for on the go and it's pretty fancy. I can even get audio notifications from home assistant remotely this way.


I use musicbrainz, but beets is on my list! Thanks.


I'm always confused by what people connect to the pi zero to play the music. Is there something both cheap and on par with, for example, a sonos three or five with a similar space profile?


I use the first Pi-Zero with the HiFiBerry DAC+ Zero Hat to connect to a Boombox Xtreme that I had around already. For connecting another Pi-Zero to my Hifi, I used the `HiFiBerry DAC2 HD` for its really good sound quality - however, that was around USD 50.00.


Can you control volume with the DAC+ Zero? Their website says no but maybe that means you control it some other way?

Can you control which snapcast outputs get what from mpd/mopidy? Watching videos on youtube it looks like there is just a snapcast output in mpd/mopidy and you then have to go into the snapcast app to change where it goes?


Yes, you can control the volume on the Pi Zero. But usually, you will turn it to max output and then adjust through your Snapcast-Stream (in my case, I turn the volume up or down in the Iris Web App, which forwards the signal to Mopidy and then to Snapcast server and to the Snapcast client on the Pi Zero).

I am not sure if I understand you correctly.

Snapcast is directly integrated in the Mopidy docker-compose in Iris (see my link above). No need to do anything, simply enable Snapserver output in the mopidy.conf.

Usually, you will have all your clients connect to a single music source. If you want separate music played on separate clients, then simply add another Mopidy/Snapcast/Iris stack.



It has no hardware volume control, but you can adjust the volume via software, e.g. ASLA on the Pi Zero [1] or amixer [2]

I know I fumbled around with this when testing the Pi Zero, but left it at 100% because I control software volume centrally via the web interface.

[1]: https://support.hifiberry.com/hc/en-us/community/posts/20184...

[2]: https://raspberrypi.stackexchange.com/a/68072


This is so weird, a few weeks ago I was trying to work out (with little knowledge of the technologies involved) how to do almost exactly this, only with video. Right down to a control "frontend" and a "play" frontend. Specifically, how to forward a video from X source (say, YouTube or via invidious, but the idea would be that any source could be chosen on the fly) to some kind of HTTP stream that could then be picked up by a device (or multiple devices simultaneously) of choice.

Maybe looking at how this is built will give me some pointers


This is what videolan player (also known als vlc) was originally built for. They built a solution to serve an internal television problem over LAN.


you want an RTMP or FTL server. a source (e.g. something like obs studio, or gstreamer/ffmpeg from command line, or even directly from some action cams like gopro) can publish a video stream, and clients (vlc player, for instance) receive the video as a broadcast (UDP RTP/RTCP, ideally). the protocol handles codecs and keeping the clients in sync (the clients will usually lag slightly behind the source, though -- FTL tries to minimize this). this is how live streams work on twitch/youtube/facebook/etc (except they have to do the media over HTTPS with something like HLS or WebRTC).

for instance, project lightspeed (unaffiliated) is a batteries-included self-hosted FTL streaming server and web client that was posted as a "show hn" some time back.

https://github.com/GRVYDEV/Project-Lightspeed


How does this get around Sonos‘ patents[0] in this space? They appear to be pretty broad. Sonos is even mentioned as a comparable product, so I hope the creators took their patents into account.

[0] see https://news.ycombinator.com/item?id=28273131


I am always surprised how many of these projects have been created. The logitech media server (former squeezebox server) has solved this problem and many others a long time ago and most other projects fall well short of its functionality.

It really was well ahead of it's time and I'm still amazed that it was made open source and that logitech supported it for quite a while. I just don't understand why is not a much bigger community around it, instead of all these projects that try to reproduce its functionality.


It doesn't look like Logitech media server can run on (or stream to) a Raspi Pi Zero, which was an important feature to me, given the current electricity prices. A Raspi will consume 0.7 Watt, which is hard to beat. Most of the devices seem to be proprietary from Logitech [1], not open source or self-built.

[1]: https://wiki.slimdevices.com/index.php/Squeezebox_Family_Ove...


I'm running squeezelite on a raspi zero right now! there's even a premade image that makes everything very easy.

https://www.picoreplayer.org/

Most clients these days are raspis.


There's quite a few pi distributions that can run LMS, for example picoreplayer [1]. I've never run it on a pi zero, but I suspect it works. What I do is run the server on a pi3 and have a pi (1?) running squeezelite for remote control.

[1] https://www.picoreplayer.org/


Sorry I realised this is a bit unclear. I should not have said remote control, but remote player. Squeezelite is a player and they definitely run on a pi. So with an LMS running on a one pi with a disk attached to it, and several other pis (possible with screens attached) you can run a fully synchronized home system that can run your own music, but also spotify and many of the other services as well as online radios (e.g. BBC) and podcasts, there are a lot of plugins.


Great, thank you for the clarification!


Protip: If you try lms, get the material skin so you have a UI. that's usable to 2022 users.


Does anyone know how tight the Sonos protocol is in terms of station-to-station delay? This looks interesting, just curious how it compares.


For line-in there is a minimum 75ms delay, which can be bumped up to 2s for poor environments.


I meant more like in the scenario where I use the line-in on one Sonos to play audio on several Sonos players around my house. Is their synchronization better, worse, or same as claimed .2ms skew from this project? That's 10 samples, which strikes me as noticeable.


What is the experience like using this vs Sonos?


Definitely more "hands on", but it was a workable solution for me.


More hands on but also more flexible. I used snapcast to have synchronised audio to a portable speaker years before sonos sold their Roam speaker.


I've been using Snapcast for a while. Great support for windows, Linux, x86 and ARM.


Is this better than Chromecast Audio?


Works surprisingly well!


I used snapcast with a projection mapping system (for synchronous light/sound). It is surprisingly extensible.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: