
The Advantages
I loved the idea of the Merus audio amplifier hats ever since I first heard of them. It’s a high-performance HiFi Class D amplifier module using the Infineon MA12070. It delivers 2×80W of power along with a power supply for your Pi while being very power-efficient. All you need is an old-style 19-volt laptop power supply, a Pi, and some speakers. Moreover, it takes up very little space and is very easy to wire together.
I’ve been using a Pi 4 to run my Kodi box since forever, but the Pi was always connected to a simple amp via the headphones output, so the sound was … less than optimal. Slight background hissing during stopped playback was the biggest issue, but it was an all-around second-rate setup, even with my decent-quality speakers. This hat (you can get it on AliExpress for less than 50€) uses I2S, so hissing is history. There is plenty of power available too, so I can really enjoy the concerts on medici.tv now.
The Setup
I set up my new Kodi box using a 2 GB Pi 5, the hat, a 25V 4A PSU, and my existing 120W speakers with a woofer. It took me literally 15 minutes to connect everything to the existing setup. I installed LibreELEC, set it up, and started watching.
The Issue
After watching a few streams, the sound dropped out, and I had to reboot. Two more shows, and it drops out again. Sometimes it worked for hours; sometimes it would not survive 5 minutes. A little pop and silence—please reboot now.
Troubleshooting
After noodling around with my Lurus Code AI tool for a while, it seems the Linux driver for the chip simply gives up on any error and never resets the card afterward (latched protection fault). It also doesn’t log the reason for the fault, and there were several candidates, from the PSU voltage dipping to speaker impedance issues to digital signal input losing sync, etc. I built a script that managed to reset the audio card on dropout, but this still required Kodi to restart, a less than ideal solution, and it sometimes crashed the whole Pi.
The Cause
I started looking into the candidate causes. The most obvious one to test was the digital input sync loss theory. Most of the time, the sound would drop out on playback start. It turns out that Kodi uses an optimized audio stream system that changes the I2S bitstream depending on sample rate and other properties of the audio stream. So each time the properties would change, the bitstream would too and sometimes this switch would cause the card to crash.
The Solution
The fix was very simple: just go to the Settings > System > Audio:
- First set Keep audio device alive to Always.
- Then turn on Send low volume noise.
- Finally, set Output configuration to Fixed. (This might cause the card to crash and the sound to stop, but don’t worry, just apply the changes and reboot.)
These settings prevent the bitstream config from ever changing after startup and entirely solved the problem for me. LFMF, as they say :)
Happy watching!
If you found this article useful, you can buy me a beer here.