My old HiFi…
I assembled my hodge-podge HiFi over 20+ years. It was first put together back in the days of CD and DVD players. I eventually ended up with a NAS in the attic and a laptop for music and movies.
42” LG monitor (keep)
This was sold as “digital signage”, which means it’s just a big monitor. Its job is to display things and it does that well, so I’m keeping it.
Yamaha AV receiver (keep)
The Yamaha HTR-5630 is a nice low-profile stainless steel effect unit. It’s ~18 years old, but still sounds perfect! (You can pick one something like this on ebay for ~50 bucks!). Its job is to play sound to a 5.1 speaker system. The audio quality is great, so it stays.
Living room: 5.1 speakers (keep)
In the living room I’m using a Yamaha subwoofer and center speaker along with 4 wonderful Dali Oberon 1 speakers.
Denon stereo amp (keep)
The RCD-M39DAV is a compact 60W amp that sounds great.
ceiling car speakers (keep)
When we renovated the house 10 years ago I installed 4 Infinity Kappa 693 car speakers into the ceiling. I pciked them because they got rave reviews, and the low impedence of car speakers allowed me chain a pair in series for each of the stereo channels. These sound great.
Laptop (goodbye old friend…)
I had an old ThinkPad T430 directly connected to the system: VGA to the screen, and RCA line out to the Yamaha amp. No surround sound. Clunky to use. It has to go.
What do I want to achieve?
- Low cost
- Low waste (don’t throw out existing components, where possible)
- Low power consumption (ie: not a full PC or laptop, headless operation for music)
- Playback of media from a NAS or external disk
- Surround sound (if the media provides it)
- Invisible (VESA mount?)
- Easy to control remotely (VNC, Android app, Bluetooth controllers etc)
It would be great if I could also…
- Play the same (stereo) sound in the living room and kitchen
- Stream audio to it from phones and tablets.
Fail #1: Chromecast + HDMI audio extractor
Many years ago I bought a Chromecast and an expensive HDMI audio extractor, hoping that I could ditch the PC. I thought that I’d be able to stream anything to the Chromecast, split the audio and send it to the Yamaha over an optical connection. Smart, right?
Problem: Chromecast needs the TV on. All the time.
I didn’t see this written anywhere on the packaging. It sucked. Google released an audio-only version of the Chromecast later, but that didn’t do video, and I wanted both.
Can’t you use an EDID emulator, dummy?
Tried that. It didn’t work. Maybe I got a bad one, but no matter what way I chained things together, something failed because…
Problem: HDMI compat-a-$#%king-bility
HDMI is a ~20 year old technology, and in that time it has collected lots of features (HDR, 4K, ARC, eARC) and anti-features (HDCP). Just because the HDMI cable still connects your old amp to your new TV doesn’t mean they’ll work properly. Even with new, expensive cables you might find that some features don’t work. So adding splitters and emulators into the mix turns the whole thing into a dog’s breakfast. Argh.
So the expensive HDMI audio splitter didn’t work?
It worked, but didn’t do what I expected it to. TOSlink optical only supports ye olde compressed surround sound formats like Dolby Digital (AC3) and DTS. If that’s what your source puts out, everything is hunky dory. For example, DVD players and DD/DTS encoded movie files played with “AC3 passthrough” enabled on the media player work fine because the receiver knows how to decode those formats. But everything else either fails or comes out over two channels (including 5.1ch AAC and the newer DTS-X and Dolby TrueHD/Atmos).
Yay! Kitchen audio
So this worked. It had to, because it’s such a luddite solution: I connected the MiniDisc “record” output from the Yamaha to the line-in on the Denon. The only issue is that both amps need to be on, even if you’re just listening in the kitchen.
Fail #2: Raspberry Pi, 7.1 USB Audio, Bluetooth Audio Receiver
While trying to get the Chromecast and HDMI splitter working, I figured out that keeping the Yamaha AV receiver meant that I could forget about using HDMI for audio. Instead I’d use a multi-channel sound card with a low-powered, “general-purpose” computer. The Raspberry Pi 4 seemed like the perfect choice!
- Raspberry Pi 4B+ (…and extras like a cases, m2.SSD + caddy)
- StarTech 7.1 USB Audio
- Logitech Bluetooth Audio Receiver hooked into the USB Audio line-in
Yay! Kitchen audio without the Yamaha amp!
I have enough outputs on my StarTech USB 7.1 to send audio to the Yamaha AV receiver and the Denon. This means that the Denon is no longer getting its feed from the Yamaha’s MiniDisc record output, so they’re independent of each other.
Yay! 5.1 surround sound!
It no longer matters that the Yamaha can’t decode Dolby TrueHD or Atmos because mpv can! I connected the StarTech’s RCA outputs to the “6 channel input” on my Yamaha receiver, and connected the ‘spare’ side channels to the line-in on the Denon!
Uh… What about 7.1 channel stuff?
You’re right. While the 5.1 speaker test files (in a variety of encodings like HE-AAC, Dolby TrueHD 5.1, DTS) worked perfectly, the 7.1 speaker test files did not. The side channels played in my kitchen! I usually turn off the kitchen amp when I’m watching a movie, but the bigger problem is that I don’t hear those channels! But we can fix that…
Remapping the ‘missing’ side channels to the rear
After some trial-and-error I ended up with this a Pulseaudio remap configuration in
load-module module-remap-sink sink_name=surroundsound sink_properties="device.description='Surround Sound'" remix=yes master=alsa_output.usb-0d8c_USB_Sound_Device-00.analog-surround-71 channels=8 master_channel_map=front-left,front-center,front-right,side-right,rear-right,rear-left,side-left,lfe channel_map=front-left,front-center,front-right,rear-right,rear-right,rear-left,rear-left,lfe set-default-sink surroundsound
This creates a virtual sink called ‘surroundsound’, which maps the side channels into the rear channels. I use this as the default sink and run those 7.1 speaker tests again. It worked! All channels were now audible in the living room, and those Dolby Atmos trailers sound great!
What about stereo music?
I figured that this would be a problem but it wasn’t. Without having to do anything at all, stereo is “upmixed” to all channels. Music sounds great in both rooms.
Problem: No sleep, no Wake On LAN
While the Raspberry Pi 4 runs under 6W, it would still be nice to turn it off or put it to sleep at night. Unfortunately there’s no way to do that. Your only options is to fiddling with cables or toggling a power switch at the wall. It’s not a deal-breaker, but ugh.
Problem: No MusicBee (because ARM)
OH NO! I absolutely need MusicBee and have been using it as my music player for a decade. Even on Linux, via wine. Wine works on the Raspberry Pi, so what’s the problem? Well, I feel stupid for not realising this before trying it, but… wine on the Raspberry Pi emulates* Windows for ARM. Many Windows apps aren’t available for ARM, including MusicBee. Fuckity fuck. I ended up running MusicBee on a laptop and streaming the music to the Raspberry Pi using an awful hack.
*I know I know, wine is not an emulator. Why don’t you think of a better word to use and let me know.
Problem: No Bluetooth Audio
PulseAudio lets you select a profile for your audio device. To get the surround sound and kitchen audio working I had selected the profile “Analog Surround 7.1 Output”. But to play audio from the Logitech Bluetooth Audio adapter, I needed to use the profile “Analog Surround 7.1 Output + Analog Stereo Input”. Unfortunately, when I did that the Raspberry Pi completely froze up. The mouse stopped moving, the clock didn’t update… it was completely unresponsive! I was gonna reboot it, but then thought, “maybe I should plug out the USB audio?”. As soon as I did that, the Pi woke up from its trance and continued working. Nothing showed up in strace, dmesg or any of the usual places, making it impossible to troubleshoot. This issue wasn’t reported anywhere online. I was vexed.
Problem: No YouTube (…um, what?)
I was dumbfounded to find that YouTube, of all things, didn’t work properly on the Raspberry Pi 4. Two very annoying long-running bugs get in the way, one on Chromium and the other on Firefox:
- Chromium browser crashes when you visit YouTube link
- Firefox ESR can’t play audio on most YouTube videos link
You can fix this! You work in tech!
Yes. No. Maybe. Oh fuck it I don’t know! I’m so very tired of this now and I’m starting to hate the whole thing. While trying to fix this weird issue, I wasted time on forums where people helpfully suggested all the usual crap that doesn’t work:
- clear your cookies
- do it again!
- restart the browser
- tweak this or that setting
- installing this weird browser you never heard of before
Meanwhile my wife was in my face saying “FIX YOUTUBE! Everybody else gets to use Youtube, why can’t we?”. She’s right. I could have gone off installing a totally different OS on the Raspberry Pi, and probably discovered yet more shit that doesn’t work. Enough of this Raspberry Pi bullshit.
yt-dlp, DLNA and other sad hacks
To work around all of the weird brokenness I implemented a bunch of hacky solutions that only a techfool could hack together. They worked, but were so user-unfriendly that my wife wanted to stamp on the Pi. Here are some of them, so you can laugh at me:
yt-dlpis not www.youtube.com no matter how you wrap it up.
- DLNA renderer (gmrender-resurrect) and BubbleUPNP are not Bluetooth.
- Some things don’t DLNA so I wrote a two-part audio transmitter/receiver for my laptop. On the sending end, it recorded from from PulseAudio, compressed with FLAC and sent the stream to the Pi using netcat. On the Pi, I wrote a socket-activated systemd service that send input to
mpv. Cool. Laggy. Brittle.
3rd time lucky? Replace the Pi with an x86 SBC
This looks exactly like attempt 2, except that I used the a MeLE Quieter 3Q instead of the Raspberry Pi 4. There may be other x86 SBCs that are just as good, I’m just telling you that this thing beats the socks off the Raspberry Pi 4 in every way:
- You can actually buy one of these right now - no stock issues
- Modern x86 CPU with hardware encoders/decoders for most codecs
- WiFi6 (AX), Bluetooth 5.2, USB 3.1, m2.SSD slot, Gbit Ethernet, Dual 4K HDMI
- Fanless case that isn’t much larger than a Pi 4 case (comes with VESA mount!)
- 128GB of built-in eMMC storage
- When I run Windows apps in wine, they actually work.
- Can be powered off, put to sleep and remotely started using Wake On LAN
You might say “but the Pi beats it on price!”. Not when you factor in extra purchases (like a case, m2.ssd + m2 USB caddy) and the hours you’ll spend putting it together and working around problems that an x86 SBC won’t give you. And the grief.
Yay! Everything just works!
All of the stupid problems I ran into on the Raspberry Pi 4 were absent.
- YouTube just works!
- Surround sound just works!
- Bluetooth Audio just works! (The weird Pulseaudio profile issue disappeared)
- MusicBee just works!
- … you get the picture
Minor tweak: always play line-in source (Bluetooth)
Now that the line-in works, I discover that I need to make one small Pulseaudio change… In order to play the signal from the Logitech Bluetooth Audio, I need to tell PulseAudio to connect a loopback to USB Audio’s line-in. Oh, and we want to set the volume for line in so we don’t blow the speakers out!
set-source-volume alsa_input.usb-0d8c_USB_Sound_Device-00.analog-stereo 33500 load-module module-loopback source=alsa_input.usb-0d8c_USB_Sound_Device-00.analog-stereo latency_msec=1
You can experiment with the source volume. I picked 33500 because it matches perfectly with my other sources.
Extras: KDE Connect, VNC, MusicBee Remote, Kodi Remote
- Run pre-defined commands (start an app, power it off)
- Control media players and sound volume
- Function as a keyboard and mouse, all using [KDE Connect]
For much better control over MusicBee, there’s a dedicated MusicBee Remote app for android which lets me browse playlists, queue up tracks, rate them etc.
Same goes for Kodi, whi has the Kodi Remote
This whole setup is now an absolute joy to use, and it’s 100% wife-friendly. As an extra bonus, the tablet is paired to the Logitech Bluetooth Audio adapter. This means that audio from any app (eg, audiobook player) on the tablet comes out on the multi-room system.
I just want to finish up by saying that I don’t hate the Raspberry Pi, now that I’ve plugged it out and put it away for some undiscovered future use. But I’d never recommend it for building a home entertainment system. I’m sure some people get good mileage from things like the Chromecast, Roku, FireTV etc, but google “Dolby” along with any of those and you’ll find that surround sound comes with a lot of caveats, eg this Roku forum post. So if you’re thinking about using a tiny computer to modernize your ancient HiFi system, I seriously recommend that you consider using an x86 SBC device instead of a Raspberry Pi.