15 ms·
Snapcast – Synchronous multi-room audio player
- geekuillaume 7y agoNot 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.
- zer00eyz 7y agoDo you have the PIs hooked to amps? If so what are you doing for volume control?
- Havoc 7y agoWorth 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 7y agoPimoroni 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 7y agoI 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 7y agoDid you find a solution to the remote mopidy instance yet? I'd like to do the same thing.
- mbreese 7y agoI ended up using a (cheap) USB DAC to get around the RPi’s onboard audio. It’s a bit cheaper than a HAT, but can be hit or miss for compatibility.
- mongol 7y agoFor snapclient, I used a USB DAC at first, but turning it off and then on meant that snapclient lost its connection. I could not resolve that so I purchased a DAC HAT instead.
- PunksATawnyFill 7y agoI assume this is only for the analog output, right? Obviously if you're just using a cheap or old amp it won't have HDMI, but if you're amping with an A/V receiver you can just use the HDMI out and get perfectly good quality.
- kingosticks 7y agoIt was really bad when launched, but to call it really bad now (or in 2018) is not fair. A lot of poeple waste their money on these hats when they don't need to.
- ghostpepper 7y agoHas the hardware improved or just software? I have a DAC-Hat and it definitely picks up some sort of digital noise from the pi. I can literally hear SSH when large amounts of text are being dumped across the wire.
- kingosticks 7y agoThe Pi 1 B+ was improved with a dedicated power supply and I think that might have been it on the hardware side. The big improvement came with the software, details of which are linked elsewhere in this thread.
- akeck 7y agoPi native audio has gotten a bit better. https://www.raspberrypi.org/forums/viewtopic.php?t=195178 https://www.raspberrypi.org/forums/viewtopic.php?t=195178
- fyfy18 7y ago500ms sounds like quite a lot. What causes the latency and are there any improvements that can be done to improve it?
- t34543 7y agoMy use case for whole home audio is to play audio of a sports game that’s playing on TV in the living room. 500ms of latency is far too much. Even Sonos suffers from this with port/connect
- mbreese 7y agoIsn’t this a case where you delay the video on the TV side to match the latency of the audio? I assume your TV has an option for audio delay. The problem that I’d see is that you probably don’t have this setup all the time, so switching your TV back and forth for an audio delay would be annoying. That and 500 ms might be more of a delay than your TV can handle.
- t34543 7y agoAudio source is my receiver which does not offer this functionality. You’re right, config management will be painful. Receiver runs Linux and I did get a shell on it, but to be honest this is something I would rather just pay for. I don’t want to risk bricking it.
- ghostpepper 7y agoI'm curious which receiver(s) run Linux
- t34543 7y agoEmotiva XMC-1
- wolrah 7y agoThe majority of receivers above a certain point have streaming radio, "cast", and/or "smart TV" features. Just like so much of the rest of the appliance world, most of those are powered by some random ARM or MIPS SoC running some flavor of Linux. A modern networked AV receiver is sort of analogous to a managed switch, there's a fairly generic CPU running a general purpose OS presenting the user-facing interfaces, managing configuration, and handling some housekeeping tasks, then there's specialized hardware that actually deals with the signals and does the real heavy lifting after being set up by the general purpose processor..
- vinw 7y agoI couldn't get Librespot to work, will have to give it another go. What I ended up doing was running the Spotify desktop app, sinking it to the snapcast pipe via pulseaudio.
- ghostpepper 7y agoI don't think librespot is maintained anymore. If you try again, maybe give spotifyd a shot. It works well for me in a basic setup (not using Snapcast) edit: forgot link https://github.com/Spotifyd/spotifyd https://github.com/Spotifyd/spotifyd
- kingosticks 7y agoIt is maintained at https://github.com/librespot-org/librespot https://github.com/librespot-org/librespot I don't know why the original author never merged the PRs pointing to the new repo.
- fizixer 7y agoI 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 7y agoIt 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
- RosanaAnaDana 7y agoI'm so excited to try this.
- brayhite 7y agoHow does this compare to something like Airfoil?
- vinw 7y agoJust 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 7y agoThere'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/
- alias_neo 7y agoSnapcast needs you to run its own client. This means it handles the synchronisation perfectly, but sadly you can't connect things like internet radio players (like the LaMetric Time) using a web steam.
- tracerbulletx 7y agoI wonder if the client could be built for web assembly
- jrobn 7y agoI 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 7y agoDenon’s HEOS is an alternative which I can attest works, it’s far from perfect, but it does tick majority of your boxes.
- core-questions 7y agoI have an incredible set of privacy focused speakers. The only way my privacy can be invaded using them is if I inadvertently turn up the Styx too loud and everyone finds out my secret 80s love.
- milesward 7y agoNow 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.
- mr_sturd 7y agoGot 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!
- federico3 7y agoI 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 7y agoYou 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 7y agoI 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.
- n3k5 7y agoThis has existed (at scale, not just experimental prototypes) for over 10 years. I can't recommend anything in particular as I don't use it myself, but the very first search term I tried ("online jamming") turned up some useful leads. Direct integration with DAWs seems quite easy to set up nowadays.
- DaniFong 7y agoIt takes about 134 ms for a signal moving at the speed of light to go around the Earth. You can do no better if you have to cross such distances (unless you want to bore through the earth somehow). So making it possible for people to jam together across such distances is an interesting challenge indeed. Such a delay makes a naive approach incredibly awkward! Good musicians can get around it with practice and using drones, for example. However, if you're synced to a shared reference /background track, you could play in time to that. The problem is that you can't hear any of the contributions of the other players while you're playing -- the signal is too far away. But you could imagine sort of controlling an AI mimic which would stand in for you in the ears of the other players, and your contribution would be patched in to the final mix. As a minimal step you could just represent your playing with a couple of loops (A and B pieces) and your improvisations can get auditioned and patched in for later contributions later on in the song. Some things to think about. It's easier to imagine doing it all in the same area! And you can do in in real space, so that's a plus :D
- ProfessorLayton 7y agoThis 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 7y agoAnd 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 7y agoI'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-airpods-and-beats-headphones-iph8ad1f667b/ios https://support.apple.com/guide/iphone/share-audio-with-airp... Very smooth UX and useful when watching a movie on a plane on an iPad.
- PunksATawnyFill 7y agoThanks 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.
- apazzolini 7y ago
- reggieband 7y ago> 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 7y agoSome elaborations here https://github.com/badaix/snapcast/issues/305 https://github.com/badaix/snapcast/issues/305
- mypalmike 7y agoRTP with RTCP is designed for streaming but not specifically multi listener synchronisation. They are not transport protocols - UDP and TCP are both commonly used for transport.
- thomas536 7y agoThere 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/
- matthew-wegner 7y agoI'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)
- mongol 7y agoDo you have details about your RF remotes?
- mongol 7y agoI 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 7y agoIs it possible it’s the encoding of the episodes? Some audio workflows get all confused with VBR for example.
- amflare 7y agoI'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
- Ice_cream_suit 7y agoHow long before Snapchat's lawyers send a letter, insisting that the name be changed to something less misleading?
- capableweb 7y agoBad 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.
- toomim 7y agoThis 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.
- paul7986 7y agoOut 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 7y agoAll your questions are answered in the README.
- hippich 7y agoAny1 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 7y agoAll 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.
- genericacct 7y agoYou 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
- ww520 7y agoThe project looks good. Would multicast be good for this kind of applications? How much support do routers have for multicast these days?
- iforgotpassword 7y agoIf 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.
- jakobegger 7y agoCan 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