New Article - Whole Home Audio with SnapCast (www.pragmaticcoding.ca)
from HamsterRage@lemmy.ca to selfhosted@lemmy.world on 23 May 21:06
https://lemmy.ca/post/65325739

For the past few years I’ve been building and maintaining website/blog at www.pragmaticcoding.ca. It has mostly about programming, and more specifically it’s ended up having a lot of content about JavaFX with Kotlin.

Lately, I’ve been spending all of my time building out my own homelab and self-hosting the services that I need. I’ve got a little stack of M910Q’s running in a Proxmox cluster with an HP T740 running OPNSense.

One of my big successes so far has been to replace my Google Home devices streaming music all over the house with a SnapCast network using RaspberryPi Zeros as the streaming clients. I’ve been working on documenting how to do this, and the result is a three part series that explains what SnapCast is, how it works and how to combine it with Mopidy to stream music around the house.

I have to admit that this one got away from me. It was all one article until I noticed that Jekyll was estimating it at oven 1/2 hour to read, which is way, way too long. So it became three parts, which also gives me the opportunity to release it over time, and make sure that each part is nice and clean before I post it live. Part I is an introduction to SnapCast and explains how it works and how to set up a SnapCast server in Proxmox.

If you’re interested, take a read and let me know what you think.

#selfhosted

threaded - newest

q7mJI7tk1@lemmy.world on 23 May 21:47 next collapse

Thanks for that. Read Pt1 and it all makes sense.

I’ve found that Music Assistant has worked well for group casting audio for me with Google Minis and Chromecast Audios. Although I’ve not had it running all day, but it has removed the hassle of it stopping from WiFi disconnects from my phone.

Always looking for new ways to do things, so will look out for pts 2 & 3.

mhzawadi@lemmy.horwood.cloud on 24 May 06:37 collapse

Music assistant has a snapcast server builtin, so you could replace all your Google devices with snapcast clients

q7mJI7tk1@lemmy.world on 24 May 09:30 collapse

Ah thanks. I know I have scratched the surface with what MA can do, and it is one of the more useful things I self host. Music Assistant and Immich are the absolute must haves.

thenextguy@lemmy.world on 23 May 21:47 next collapse

I wonder how this compares with lyrion.org, formerly Logitech SqueezeBox server.

HamsterRage@lemmy.ca on 24 May 15:31 collapse

It was in my list of options when I started. I liked the modularity of SnapCast, though. SnapCast just handles the whole-home aspect, and the you pair it with a music player that you like.

irmadlad@lemmy.world on 23 May 22:03 next collapse

I’ve got whole home audio. 150 watts…just crank that bitch up. LOL Never heard of SnapCast but I bookmarked the link for later on this evening. I like the site. Very clean and easily readable.

If you’re old enough and you live in North America, you probably remember Ronco

Ron Popeil…very interesting pitch man/entrepreneur. His infomercials were cheesier than Wisconsin, but you remember them.

Thank you for sharing

HamsterRage@lemmy.ca on 24 May 15:33 collapse

That reference is in one of the programming articles. You must have poked around a bit to find it. “Set it and forget it!”.

irmadlad@lemmy.world on 24 May 15:42 collapse

Yeah. Lots of good info there.

autonomous@lemmy.world on 24 May 04:30 next collapse

Snapcast is great, I use it with MPD for synced whole house audio

Cyber@feddit.uk on 24 May 05:08 next collapse

Thanks for sharing.

I’ll take a proper read if it later, but how well do your Pi0’s stay on the wifi?

I have 4 around my home acting as bluetooth trackers for Home Assistant, but they fall off the wifi often (signal strength / noise isn’t the issue)

It’s only for a few seconds, which is ok for BT tracking, but that would be terrible for audio.

mhzawadi@lemmy.horwood.cloud on 24 May 06:36 next collapse

Did you I know music assistant can use snapcast as media device and so can announce and play music?

HamsterRage@lemmy.ca on 24 May 15:25 collapse

Not specifically, but SnapCast will accept a range of input methods and should be capable of taking output from virtually anything that plays sound.

mhzawadi@lemmy.horwood.cloud on 24 May 15:44 collapse

if you run home assistant, you can setup music assistant that has snapcast builtin

HamsterRage@lemmy.ca on 24 May 15:23 collapse

This was a little problematic at first. Part of my shift over to OPNSense was that I bricked my mesh WiFi when attempting to put it into AP mode. So I had to scramble around to get a WiFi AP. Initially it was upstairs and connected to a swtich that was connected to the homelab in the basement through a Powerline AV. The Pi0’s dropped out a lot.

My house is too old for Cat5 in the walls, but does have some coax for cable TV. So I got some MoCa adapters and a second WiFi AP and sorted the WiFi out. After that, no WiFi problems with the streaming. I think the Powerline AV was just too unstable for the SnapCast.

There still are some occasional brief outages, and from what I can see this is caused by buffer overflows or something of that ilk with the SnapCast client software. I’ve adjusted the parameters as much as I can, and it seems pretty stable. I’ll notice a 1 or 2 second outage somewhere in the house every day or so.

Last week the SnapCast in the bathroom was glitching a lot, so I rebooted it and it’s been stable ever since. The one in the front room, which is literally 6" from the WiFi AP has never glitched at all, and it’s been running for about 3 months now.

I have a section in one of the articles where I talk about recovering from glitches that halt the Mopidy stream itself. In those cases, the Mopidy service is still running, but stops streaming. Using the REST API you can get it running again, so I wrote a cron job that checks every 3 minutes and restarts the stream if required.

I just came back from a 3 week vacation and after 2 weeks the Mopidy service itself crashed. I was getting Gotify notifications every 3 minutes from that cron job as it attempted to restart the stream. If since modified the Mopidy service to restart if it crashes, but it could be months before that ever happens.

fonix232@fedia.io on 24 May 07:42 collapse

And you did it all in time just to have it be upended by SendSpin - which can even run on an ESP32 level MCU so you don't even need a Pi Zero.

Cyber@feddit.uk on 24 May 14:53 next collapse

Ooh, didn’t know about this one. Have you used it?

This seems like an end to Snapcast: github.com/orgs/music-assistant/discussions/3883

HamsterRage@lemmy.ca on 24 May 15:50 next collapse

Yes, I saw that comment. I wasn’t sure what “But… it has so many downsides…” meant, and the comment doesn’t clarify.

To me, the big question is how the “improvements” they are going to make would my installation better. I suspect that most of the improvements are ones that allow them to make Music Assistant better, or allow them to add tighter integration with Music Assistant.

As far as I know, they haven’t rolled it out yet. But that thread is almost a year old now.

I would be interested to see what they’ve done.

fonix232@fedia.io on 24 May 16:03 collapse

I am using it on a handful of devices (mainly voice interfaces), and it's quite seamless, even in the beta stage.

Not up to Sonos level controls yet, but it's getting there slowly. Music Assistant is gaining a lot of UX improvements recently, so it will be soon a viable alternative to not just SnapCast but Sonos too.

HamsterRage@lemmy.ca on 24 May 15:04 collapse

I’ll wait to see.

Apparently you can run SnapCast on an ESP32 also. For me, the Pi0’s cost about $20 CDN, and the DAC card about the same, and the delivery from PiShop.ca was about 3 days. ESP32 would have cost less, but then require some kind of housing because of the two components flopping around. The Pi DAC’s slip onto the GPIO pins and the pair are essentially 1 thing at that point. Mine are just tucked away behind whatever the amps are.

I point out in Part II or III that these are essentially appliances once they’re set up. As long as they do the job, I don’t expect to upgrading them on a regular basis or anything like that. SendSpin looks cool because it does other stuff besides just stream music, but I’m not looking for that. From what I can see, SendSpin runs on Pi’s too, so it should be fairly simple to add that to the Pi0’s in the future if that’s what I want.

fonix232@fedia.io on 24 May 16:06 collapse

You can buy ESP32 boards with built in DACs, just FYI.

Also there's a handful of Pi Zero shaped ESP3 boards as well, which you could use with the existing DACs.

But again my point was that Sendspin requires even less hardware than Snapcast (and while technically you can indeed run Snapcast on an ESP32, last I checked it uses up a lot of resources, making the ESPHome given extras like BT proxy and usage in real time BT based location, unusable).