Further Adventures in Whole House Audio

I’ve switched a thing or two around with my whole-house audio setup – as previously detailed here – and I thought I’d update for y’all.

First, the CHIP single board computers I had eventually died, so I shifted to a 1GB Rock64 board. These are super-cheap (about $20 on eBay), super easy to set up, with the single drawback that many models don’t come with WiFi already onboard. This wasn’t a problem for me, but a simple USB WiFi dongle can help there if you want.

Well, super easy to set up once I figured out what I was doing. Which is why I’m detailing all this for you (and myself, for when I forget!).

One of the key important things – and the reason for this at all – is that Snapcast is very dependent on real-time processing. Which means that if your server is bound up with some other task, your audio suffers lags and such. But this $20 board can both feed a set of speakers and handle MPD, so let’s set this thing up!

So after getting a Rock64 board, I installed the Ayufan kernel using BalenaEtcher to an SD card. One of the nice things is that it’s based on Debian, so installation of other packages is super easy.

After installation, I updated and upgraded all packages:

sudo apt update && sudo apt upgrade

Then installed the packages I’d need:

sudo apt install mpd mpc 

You will configure MPD as per the documentation in my Whole House Audio post.

If you’re using mpdscribble (for last.fm or libre.fm scrobbling), install and configure it now:

sudo apt install mpdscribble

If you’re mounting music from an NFS mount, install NFS (if you don’t know what this means, then it probably doesn’t apply to you – just make sure MPD can get to your music!):

sudo apt install nfs-client

If you’re streaming using icecast for additional streaming, install icecast (and configure it appropriately!):

sudo apt install icecast2

If you’re using MPDQ – my autoqueue script – then install these dependencies:

sudo apt install ffmpeg grep detox bc

(See the post at https://ideatrash.net/2020/06/simple-smart-playlists-for-mpd-that-work.html for installing the whole program, natch.)

After installing everything, execute this command and follow the prompts:

sudo dpkg-reconfigure locales

The last tweak is getting sound to work properly. I found a solution and asound.rc. Take the file from this gistfile (embedded below) and use it to create /etc/asoundrc and /etc/asound.conf (I’m not certain if both are absolutely needed, but I had to have both to bring a new one up just now):

If you later find that you have audio stuttering, edit /etc/default/snapserver so that the line SNAPCLIENT_OPTS=”” instead reads SNAPCLIENT_OPTS="--player alsa:buffer_time=160,fragments=2 --mixer:none --sampleformat 48000:16:0"

From there, it’s a matter of making sure your systemd units do the following in this order:

  • Bring up the network
  • Bring up MPD
  • Bring up Icecast
  • Bring up MPDscribble (if used)
  • Bring up MPDQ (if used)

That’s pretty easily done, though if you need help with SystemD, check out other guides like this one. For example, my mpdq.service file is as follows:

The rest of the instructions are the same as running it with a full computer, as detailed in this post: https://ideatrash.net/2020/06/weekend-project-whole-house-and-streaming-audio-for-free-with-mpd.html

I’m now enjoying lag-free whole house audio, and it cost me $20 and a bit of sweat equity, and now you can too!

Photo by Kelly Sikkema on Unsplash

Was this post helpful or insightful? Buy me a coffee here or here and share this post with others!

Popular posts:

  • The difference between boundaries and rules
  • Two Ways to get CMYK Separation Using GIMP Instead of Photoshop in 2022
  • Weekend Project: Whole House and Streaming Audio for Free with MPD
  • If there's one Nazi (or a racist) at the table...
  • Word Porn Quotes
  • Odds and Ends: Optimizing SSHFS, moving files into subdirectories, and getting placeholder images

Recent Posts