In an effort to simplify things in my life and reduce the overall number of computers in our new home, I decided to combine the HTPC and server machines I used to have into a single dual-purpose box.

I’m actually going to write a couple posts about this box because it has a lot going on inside, including the OpenVPN setup I described a couple posts ago.  Today however, I’m just going to do a quick guide to how I finally got surround sound working from it.

My receiver is a slightly older 5.1 Onkyo that still produces wonderful sound but doesn’t have any HDMI inputs - it’s all coax, optical, and good ‘ole RCA.  So to get any kind of digital surround sound, I had to make sure my new motherboard had optical or coaxial digital outputs.  Well, the one I chose was the ASRock Z87E-ITX - it had a great combination of the small Mini ITX form factor, latest intel CPU support, onboard video, and both optical audio and HDMI out - so I figured all would be well.

But of course it couldn’t be that easy.

After getting 14.04 on and successfully getting my 5-disk array built, (more on that in my next post) I noticed I had sound over my optical cable to my receiver coming in with standard PCM stereo.  That was good enough for me for quite a while with the HDMI driving a standard TV.  But when it came time to watch the latest Game of Thrones, that wasn’t good enough anymore.  Nothing I did exposed any options for additional channels, so I took to google and found several conflicting articles, including this and several like this which are designed for getting this to work over the audio on the HDMI output.

Finally thankfully, I found this forum thread, where someone literally walks you through compiling your own kernel module for alsa!

I followed the steps but was still getting some weirdness out of my speakers.  Then I saw the bit about pavucontrol so I installed that and found several selectable options - One mentioned ‘Digital Surround Sound 5.1’ which I tried first.  I was able to successfully run speaker test finally and hear distinct channels from each speaker, but as soon as I tried a video things fell apart and my receiver sounded like it was having a seizure.

Frustrated, I gave up for a few days, thinking I might just be better off getting a Roku and a newer receiver that had HDMI.

Today however, I decided to give it one more try, and I noticed in pavucontrol there was another option which said ‘Digital Surround Sound 5.1 with Analog’.  I had no sane reason to try this option since it sounded even more complicated than the one that didn’t work, but I did anyway and man, am I glad I did.  Everything started working.  Speaker test, playing videos, you name it, I was getting fully encoded pass through digital audio. Thank you crazy forum arguments and random desires to click on stuff and try all available options.  I chalk this one up to luck.