by matthew-wegner · 6y ago · 0 comments
- 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)
Raspi3B+ HiFiBerry Amp+ (sits on top of raspi) Volumio software (free) Any speakers, $50 on Amazon does it
I use the snapcast plugin to pull music from my Synology NAS. Volumio has a nice http UI on computers and phones and Volumio also has a bunch of other great plugins (including ones that pull podcasts, YouTube audio, web radio). It’s been a very solid synchronized system, especially when the server and as many clients as possible are hardwired.
Each client is not necessarily much cheaper than a Sonos client but prevents proprietary lock-in and allows you full flexibility in your setup.
Which are 433mhz. It's a couple of dollars to wire a receiver into a Raspberry Pi to hear them. I don't have any issues with reception, even through the brick wall into my garage. I don't remember which script I started with, but at a glance this looks like the same one: https://www.youtube.com/watch?v=Xe5Bj_N4Crw
I have custom scripts now, to make it easier to add new remotes and handle them (I use Node-RED for automation logic). You can solder pads to change the IDs on the remote, if you don't happen to have matched remotes to use the same ones per-room.
The one downside is that the encoded information isn't complete if you very quickly press a button. It isn't an issue in practice, but I did give up on using a 433mhz doorbell because hurried delivery drivers would barely tap on it.
I live in spread out suburbs, so my radio spectrum is pretty clear. It might be an issue in a vertically-oriented city.
My primary automation network is ZigBee, which does have a (mild) layer of encryption and mechanisms to prevent replay attacks. There are ZigBee buttons and remotes, but nothing cheap enough that I could put two in every room. (And I had a bunch of these remotes previously, from when I just used them with the matching outlets).
At some point I unfortunately had to add a password because someone else used all the bandwidth...
The cheapest is a recent $10 portable bluetooth speaker (via aux in) for the shower. It turns on when the shower door closes.
I guess this comment is going to be a defining example of a useless HN comment, but I've been sitting here aghast and trying to express what I feel about this.
I did it because, well, I wanted music in the shower. And it is nice getting the house text-to-speech messages in there too.
(Also it changes the lights in the bathroom)
Home automation is pretty fun once you hit a critical mass of sensor data. You can usually implement new features with a single additional smart outlet or contact sensor. For instance: For awhile, I had a neighborhood cat coming by and marking my patio at night (my cats, who I let out during the day, immediately ran to smell it every morning, and I could verify that was indeed the problem with my security cameras).
I bought a powered, default-closed solonoid valve for my outdoor faucet. I already had everything else--a sprinkler/hose, an unused smart outlet, motion events from my patio cameras, I knew if my doors were closed, etc.
So I added automation to: If patio motion at night, and my doors are closed (so my cats aren't outside), and the bedroom is in night mode (extra check so I don't accidentally hit my cats), and it's above 45F outside (don't want to freeze a poor thing), and there's motion on my patio, turn on the sprinkler for 15 seconds. The outdoor cat got caught once, then learned to fear the click of the outlet engaging but would dodge in time, and then never came back.
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.
An example from my own audio life: I have airplay speakers and an IoT outlet for their power. When I watch video on my iPad I can get much better sound through the speakers, but because it involves pausing the video, pulling down the control centre, tapping the airplay icon, tapping the speakers as the output, then going in to Home and turning on the speakers, more than half the time I just skip the whole process and listen through the iPad.
It only takes 5-10 seconds total, but that’s still enough that I subconsciously avoid it. The subconscious part is that it just ‘slips my mind’ most of the time as opposed to consciously choosing.