How To Get Back Surround Sound on Linux over HDMI
TL;DR
If your system uses pulseaudio, check this, if it uses pipewire, do this:
[ -d ~/.config/wireplumber/wireplumber.conf.d ] || mkdir -p ~/.config/wireplumber/wireplumber.conf.d
echo "monitor.alsa.properties = {\n alsa.use-ucm = false\n}" > ~/.config/wireplumber/wireplumber.conf.d/10-disable-ucm.conf
systemctl --user restart wireplumber pipewire pipewire-pulse
The Issue
This year, I bought a new laptop on AMD Ryzen 7 8845HS with Radeon 780M Graphics, and I was surprised to find out that the only sound profiles that are available are “Play HiFi quality Music” and “Pro Audio” when connected over HDMI. Neither of those used more than 2 channels. On my over a decade old desktop, there were corresponding profiles for surround sound, such as “Digital Stereo,” “Digital Surround 5.1,” and “Digital Surround 7.1.” On the newer system they were missing.
Brief googling led me to the corresponding article in the ArchLinux Wiki; while the issue description perfectly matched my case, the solution didn’t apply: when trying to restart pulseaudio I got an error from systemd that there was no such unit. “Well,” I thought, “pulseaudio was apparently out of fashion.” There was something else instead then, but what?
When trying to find pulseaudio in systemctl --user list-units output, something with “pulse” in its name popped up. I googled that “pipewire-pulse,” and it turned out that pipewire was the new pulseaudio, and it was even compatible with pulseaudio’s clients.
So, the issue was pinpointed, but apparently the fix had to be ported to pipewire/wireplumber. First, I spent about an hour trying to make ChatGPT solve my original problem, but that was hopeless. It spat convincingly looking stuff that seemed to could have been related but I was out of luck. Then I gave up and asked it to translate the very specific thing from arch wiki (pulseaudio config) into a pipewire-specific config. The first attempt was a failure (it tried to configure a module that didn’t exist) but then, when I pointed at the hallucination, it facepalmed itself and suggested that it should rather be wireplumber configuration that worked immediately. It’s at the top of the page; I hope that if you experience the same issue, you won’t spend as much time looking for a solution as I did.
Credits
I have also seen
this article, but removing a package in my case broke other dependecies: on my Arch system, alsa-lib depended on it, and in turn nearly everything else (Firefox, Thunderbird, gnome-settings-daemon, etc.), so just removing a package can be a solution but apparently not always. Thanks to that post’s author, though: his post convinced me that I’m on the right track when I was in doubt.
If you have anything to add, drop a comment below!