Digital multichanel audio using AMD HDMI support problems

I discovered a big problem with Digital audio using AMD HDMI with KDE Neon.

My 3 miniPCs (all using AMD Ryzen 9 9740HS) doesn’t allow to use any multichanel Digital audio formats (AC-3, DD, DTS, DTS-HD,…).

When looking at the alsa devices by typing :
$ pactl list
Carte #0
Nom : alsa_card.pci-0000_c5_00.1
Pilote : module-alsa-card.c
Module propriétaire : 25
Propriétés :
alsa.card = “0”
alsa.card_name = “HD-Audio Generic”
alsa.long_card_name = “HD-Audio Generic at 0xdc5c8000 irq 131”
alsa.driver_name = “snd_hda_intel”
device.bus_path = “pci-0000:c5:00.1”
sysfs.path = “/devices/pci0000:00/0000:00:08.1/0000:c5:00.1/sound/card0”
device.bus = “pci”
device.vendor.id = “1002”
device.vendor.name = “Advanced Micro Devices, Inc. [AMD/ATI]”
device.product.id = “1640”
device.string = “0”
device.description = “HD-Audio Generic”
module-udev-detect.discovered = “1”
device.icon_name = “audio-card-pci”
Profils :
HiFi: Play HiFi quality Music (sorties : 4, sources : 0, priorité : 40768, disponible : oui)
off: Éteint (sorties : 0, sources : 0, priorité : 0, disponible : oui)
Profil actif : HiFi
Ports :
[Out] HDMI4: HDMI / DisplayPort 4 Output (type: HDMI, priority: 1400, latency offset: 0 usec, not available)
Partie du(des) profil(s) : HiFi
[Out] HDMI3: HDMI / DisplayPort 3 Output (type: HDMI, priority: 1300, latency offset: 0 usec, not available)
Partie du(des) profil(s) : HiFi
[Out] HDMI2: HDMI / DisplayPort 2 Output (type: HDMI, priority: 1200, latency offset: 0 usec, not available)
Partie du(des) profil(s) : HiFi
[Out] HDMI1: HDMI / DisplayPort 1 Output (type: HDMI, priority: 1100, latency offset: 0 usec, available)
Propriétés :
device.product.name = “HDMI2.0 1x2”
Partie du(des) profil(s) : HiFi

I see the AMD HDMI card is wrong, missing parameters or not correctly configured (device.product.ID, apabilities…).

Any ideas how to correct this?

DTS and the others are proprietary formats so you will need to install the 3rd party non-free addons found in the VLC extras package and so on. There are plenty of websites that tell you how to do this.

Thanks Shadow but I think there is a misunderstanding of the problem.
You are confusing hardware support for multichannel audio and multichannel codecs.

My problem is that no digital multichannel output is available nor in ALSA nor with PulseAudio with the HDMI output.

Don’t confuse Multichannel audio which mean support for ( at least) front left, front right, surround left, surround right, center and LFE speakers with Stereo which is just left and right channel speakers.

Currently, I have tried MPV, VLC, Jellyfin Media Player, and many other players and all say there’s only stereo available and no multichannel output.

When doing “$ pactl list” and “$ pacmd list” I see the AMD HDMI output is available but no multichannel profiles are seen (contrario of Intel HDMI and AMD HDMI on Kubuntu).

I know it is a configuration problem with Ubuntu and KDE Neon because, on this same PC I have this multichannel output with Kubuntu when using ALSA and PulseAudio (for some reasons, I prefer KDE Neon though).

My apologies. I see what you are saying now. You are not seeing any “surround” profiles.

Have you considered installing a custom kernel? While I could find little specific to your setup it seems similar problems have all come down to the kernel, particularly with AMD HDMI. Seems every other kernel breaks it. With AMD it seems the better solution is Display Port due to issues with IP licensing rules. I still suggest it might be a software issue. Kubuntu makes it easy to setup and configure proprietary driver/libs, where you need to do it manually with Neon.

Alternatively you may want make pipewire your default audio engine. I believe Ubuntu defaults to Pipewire while Neon is still on Pulse. I had written another reply about alsamixer, but then realized it was wrong, but just now remembered I needed to install Pulse Mixer in order to get 5.1 working back when Kubuntu was my daily driver as some channels were disabled.

I agree with you, I prefer Neon too, though I keep a working and updated portable copy of Kubuntu on an external SSD for testing and recovery reasons should Neon get borked for some reason.

Yes. That’s strange indeed. There’s something bad with the AMD drivers in the Kernel.
I just downloaded the new version of Ubuntu (24.04 LTS) and Neon and I have exactly the same problem.

I’ll try to re-install Pipewire on Neon to see what happens. But I don’t believe in miracles if it’s a kernel problem.

Unfortunately I’m a novice in Linux and I don’t know how to compile a new kernel and with which drivers?

My hope is an Linus audio expert (linux audio guru) will be able to reply. Else, if I can’t have at least screen auto-rotate for my tablet PCs and AMD multichannel audio support for my AMD based PCs, then I have no choice to go back to Windows where everything work out of the box.

This looks like a problem I used to have on a system with PulseAudio. Use the command pactl info and check the “Server Name” to see what sound system is being used. If it does not contain “on PipeWire” then yeah it is using PulseAudio which can have a bit of a problem with profiles if it is using ALSA UCM for configuration. So in this case it is best to make sure you are using PipeWire. But if you have to use PulseAudio you will need to open the file /etc/pulse/default.pa and there change to load-module module-udev-detect use_ucm=0 to disable UCM use. After restart PA profile management should be used and that one should have support for multichannel audio.

Many Thanks JLP for your kind help.
Doing pactl info it looks like I’m using PulseAudio.

I dont know if it’s better or not to use Pipewire since I’m not an expert. But if needed for my use, I’ll install it.

Meantime, I checked the /etc/pulse/default.pa file and I found the line which contains “load-module module-udev-detect”.
Do I need to replace the whole line to " “load-module module-udev-detect use_ucm=0”?

JLP, I want to share my experiments following your recomendations:

First, and without installing Pipewire (still with PulseAudio), I changed the line in /etc/pulse/default.pa file to “load-module module-udev-detect use_ucm=0”, restarted the PC.
Result : Yay… I can change the AMD HDMI audio output to multi-channel 5.1 or 7.1. Because my amp is only 5.1, I set it to 5.1. I then made some sound tests by using a true 5.1 audio test vob file (channel tests) and :

  1. the test sounds were/are horrible (crashing sounds or over saturated).
  2. No sounds on center, surround left,surround right and LFE speakers just on front right and front left speakers.

Then, I installed Pipewire by following a howto guide found on the web (can’t post the URL here). All the install went well but after restart of the server, all the digital outs went back to stereo only with no choice to play anything in multi-channel 5.1 (even after PC restart. In audio configuration parameters (and in pavu control) I only can choose “Play HiFi quality music” (which mean it’s stereo). Hopefully, I use “Ghost” in order to go back to a previous known situation.

Players I used for testings : MPV, VLC, Jellyfin Media Player.

Questions : MPV (and all the ffmpeg based players) use (only ?) ALSA, Pulse or any audio layer in Linux?

To resume : modifying of default.pa gave me multichannel output but with bad quality and missing sounding channels and Pipewire reverted back to simple stereo analog over HDMI configuration.

Since I can quickly revert to a known state, I’m OK to be a tester for this audio configurations to help improve the Linux experience on KDE Neon (and Ubuntu user community).

Can’t say about bad sound quality as I have never experienced this when using HDMI for audio, neither with PulseAudio nor Pipewire.

ALSA is the driver and low-level audi infrastructure of Linux kernel, also providing the drivers. Yes many programs can use it directly but it brings problems doing so (e.g. usually only one application could use the sound card and block others). That’s why sound servers like PW and PA were made so they sat on top of ALSA and mediated the access of applications to sound cards and do the mixing of all the sound sources and similar. There are also servers for professional audio use like JACK, that are quite complicated to set up but provide very low latency and flexibility of routing sound around needed in such a setup. PipeWire is a modern sound server that in a very good way combines the best of both worlds (PA for consumer audio and JACK for professional) in one sound server. Some applications even allow you to chose which way to play the sound, e.g. directly via ALSA, or via PulseAudio, …

That is why it would be great if you could make PipeWire to work, or just use a modern GNU/Linux distribution that uses and configures PipeWire properly out of the box (openSUSE does a very good job here, as one of the main Linux sound infrastructure developers, Takashi Iwai, works for SUSE).

Why multichannel disappeared when you switched to Pipewire, can’t say but it definitely is strange. I would guess that WirePlumber was not installed ro configured correctly. WirePlumber is the PW’s manager that handles outputs and inputs and such and some more things. maybe that /etc/pulse/default.pa change is still needed when using PW. But I do not even see this file on my systems with PW.

Now why do you get the bad sound quality with PA and multichannel over HDMI, can’t say. First thing I would check are the mixer settings for channels and other settings for sound. Is everything set correctly there, are some channels set to low or zero volume. And this includes checking the low-level mixer for ALSA itself: alsamixer.

If you will not be able to solve the quality/MC problems you have, I would suggest yeah first trying some Live distro of GNU/Linux, possibly some rolling release one that has all the latest Linux kernel and ALSA and PA and all (e.g. openSUSE Tumbleweed) and run it from an USB key and see if everything works there. If not then I would file a bug report with the distro you use and take it from there.

1 Like

JLP,

On a newly restored (virgen) Neon and with the pulse.so modified (to get multichannel) :
When I type mpv --audio-device=help I get this list :
mpv --audio-device=help
List of detected audio devices:
‘auto’ (Autoselect device)
‘pulse/alsa_output.pci-0000_c5_00.1.hdmi-surround71’ (HD-Audio Generic Digital Surround 7.1 (HDMI))
‘alsa’ (Default (alsa))
‘alsa/samplerate’ (Rate Converter Plugin Using Samplerate Library)
‘alsa/speexrate’ (Rate Converter Plugin Using Speex Resampler)
‘alsa/jack’ (JACK Audio Connection Kit)
‘alsa/oss’ (Open Sound System)
‘alsa/upmix’ (Plugin for channel upmix (4,6,8))
‘alsa/vdownmix’ (Plugin for channel downmix (stereo) with a simple spacialization)
‘alsa/plughw:CARD=Generic,DEV=3’ (HD-Audio Generic, HDMI 0/Hardware device with all software conversions)
‘alsa/plughw:CARD=Generic,DEV=7’ (HD-Audio Generic, HDMI 1/Hardware device with all software conversions)
‘alsa/plughw:CARD=Generic,DEV=8’ (HD-Audio Generic, HDMI 2/Hardware device with all software conversions)
‘alsa/plughw:CARD=Generic,DEV=9’ (HD-Audio Generic, HDMI 3/Hardware device with all software conversions)
‘alsa/hdmi:CARD=Generic,DEV=0’ (HD-Audio Generic, HDMI 0/HDMI Audio Output)
‘alsa/hdmi:CARD=Generic,DEV=1’ (HD-Audio Generic, HDMI 1/HDMI Audio Output)
‘alsa/hdmi:CARD=Generic,DEV=2’ (HD-Audio Generic, HDMI 2/HDMI Audio Output)
‘alsa/hdmi:CARD=Generic,DEV=3’ (HD-Audio Generic, HDMI 3/HDMI Audio Output)
‘alsa/dmix:CARD=Generic,DEV=3’ (HD-Audio Generic, HDMI 0/Direct sample mixing device)
‘alsa/dmix:CARD=Generic,DEV=7’ (HD-Audio Generic, HDMI 1/Direct sample mixing device)
‘alsa/dmix:CARD=Generic,DEV=8’ (HD-Audio Generic, HDMI 2/Direct sample mixing device)
‘alsa/dmix:CARD=Generic,DEV=9’ (HD-Audio Generic, HDMI 3/Direct sample mixing device)
‘alsa/usbstream:CARD=Generic’ (HD-Audio Generic/USB Stream Output)
‘alsa/plughw:CARD=Generic_1,DEV=0’ (HD-Audio Generic, ALC269VB Analog/Hardware device with all software conversions)
‘alsa/sysdefault:CARD=Generic_1’ (HD-Audio Generic, ALC269VB Analog/Default Audio Device)
‘alsa/front:CARD=Generic_1,DEV=0’ (HD-Audio Generic, ALC269VB Analog/Front output / input)
‘alsa/surround21:CARD=Generic_1,DEV=0’ (HD-Audio Generic, ALC269VB Analog/2.1 Surround output to Front and Subwoofer speakers)
‘alsa/surround40:CARD=Generic_1,DEV=0’ (HD-Audio Generic, ALC269VB Analog/4.0 Surround output to Front and Rear speakers)
‘alsa/surround41:CARD=Generic_1,DEV=0’ (HD-Audio Generic, ALC269VB Analog/4.1 Surround output to Front, Rear and Subwoofer speakers)
‘alsa/surround50:CARD=Generic_1,DEV=0’ (HD-Audio Generic, ALC269VB Analog/5.0 Surround output to Front, Center and Rear speakers)
‘alsa/surround51:CARD=Generic_1,DEV=0’ (HD-Audio Generic, ALC269VB Analog/5.1 Surround output to Front, Center, Rear and Subwoofer speakers)
‘alsa/surround71:CARD=Generic_1,DEV=0’ (HD-Audio Generic, ALC269VB Analog/7.1 Surround output to Front, Center, Side, Rear and Woofer speakers)
‘alsa/dmix:CARD=Generic_1,DEV=0’ (HD-Audio Generic, ALC269VB Analog/Direct sample mixing device)
‘alsa/usbstream:CARD=Generic_1’ (HD-Audio Generic/USB Stream Output)
‘alsa/usbstream:CARD=acp63’ (acp63/USB Stream Output)
‘jack’ (Default (jack))
‘sdl’ (Default (sdl))

When I play a 5.1ch test file with MPV I get :
mpv AC3-TEST.vob
[ffmpeg/demuxer] mpeg: pes_ext DB is invalid
[ffmpeg/demuxer] mpeg: stream 1 : no PTS found at end of file, duration not set
[ffmpeg/demuxer] mpeg: stream 3 : no TS found at start of file, duration not set
[ffmpeg/demuxer] mpeg: Could not find codec parameters for stream 3 (Audio: mp2, 0 channels): unspecified frame size
[ffmpeg/demuxer] Consider increasing the value for the ‘analyzeduration’ (0) and ‘probesize’ (5000000) options
(+) Video --vid=1 (mpeg2video 720x480)
(+) Audio --aid=1 (ac3 6ch 48000Hz)
Audio --aid=2 (mp2)
AO: [pulse] 48000Hz 5.1(side) 6ch float
VO: [gpu] 720x480 => 720x540 yuv420p
AV: 00:00:12 / 00:01:00 (21%) Cache: 47s/3MB

Exiting… (Quit)

meaning I use pulse by default.
If I force MPV to output to ALSA through a configured mpv.conf to any ALSA option in the list, I get a frozen video (and no sound of course)

JLP,
Concerning OpenSuse I heard it’s not Debian based and does it support (provide) screen autorotate for Tablet PCs (Microsoft, Dell, HP,…) ? If no, it’ a no go for me.

Or, better… Knowing Kubuntu works with Digital audio over HDMI but lacks in screen auto-rotate for my tablet PCs, perhaps you know a method to re-activate this auto-rotate feature in Kubuntu?

Rotation support should not be dependent on the family of the distribution, at least not directly. It is probably more of a case that some specific distribution (in your case Kubuntu, which BTW is based on Ubuntu which is based on Debian) is just missing some packages because the dependencies are not set right. Usually the missing packages are named something like iio-sensor-proxy, monitor-sensor, libQt5Sensors5, qt5-sensors, libQt6Sensors6 and qt6-sensors. So if you search for “sensor” in Kubuntu package manager and install those if they are missing it should work if I am not mistaken. As for openSUSE, the link I gave you was a link to live image so if you make a live USB using it you can boot your computer without installing it and this way just test it how it all works.

I already installed some of these packages and for sure *iio-sensor-proxy* and (almost) worked with screen-rotator and screen-rotate.sh (based on xrandr). But they are far to be perfect since they always miss something and it’s not native.
I even installed Ubuntu 22.04 LTS (gnome) which natively recognized the tablet PC sensors and rotation but as soon as I upgraded it to KDE, everything concerning the screen rotation was lost and no way to retrieve it (except with screen rotator). I tested almost every distro based on Debian with KDE and almost all were unable to do screen auto-rotate.
This experiment made me think it was a KDE related limitation and when I discovered KDE Neon, it was almost a miracle for my tablets PC except for the AMD Digital audio over HDMI (look like we can’t have all in one package LOL).

As a KDE dev, If you can help me to re-enable screen auto-rotate, I can then use Kubuntu instead ot KDE Neon.

Just made an inventory using muon in my Kubuntu :

  • iiso-sensor-proxy : installed
  • monitor-sensor : Not avail in the list for dl
  • libQt5Sensors5 : installed
  • qt5-sensors : Not avail in the list for dl
  • libQt6Sensors6 : not installed
  • qt6-sensors : Not avail in the list for dl

I think it would be best to separate this rotation problem into separate thread in this forum and leave this thread on topic for MultiChannel audio only. Also you should probably also use the Kubuntu one of the support channels to get help more relevant and exact for Kubuntu.

You’re right. I’ll open another thread on this screen auto-rotate problem.

Meantime, I bought an external Audio card on USB which include a S/PDIF output.
Don’t laugh but I have the exact same problem as the AMD HDMI. Let me be more precise:
Thanks to the modified line in pulse.pa I can see all the outputs Digital and Analog ones. But on the S/PDIF (and configured to be 5.1) I can get only left and right speakers working with the same test files as I used before.

I have a dual boot (sort of) and booted on Windows to see if it works and worked fine on all the speakers.

Note : With this external usb audio card, under KDE Neon, there was not bad quality of sound just only 2 of the 6 speakers sounding.

I tried using the same media players (MPV, VLC, JMP). For MPV I tried on every available profile (alsa and pulse) displayed by the command :
$ mpv --audio-device=help

Here is my typical mpv.conf file :

hwdec=vaapi
audio-device=‘alsa/hdmi:CARD=Generic,DEV=0’ # selects specific HDMI or S/PDIF output
audio-spdif=ac3,dts,eac3
audio-channels=5.1
af=scaletempo,lavcac3enc=yes:640:2 # Re-encode multi-channel AAC to AC-3 if necessary

Just installed, for digital audio over HDMI testings purposes, a fresh KDE neon-testing-20240627-1611. All my tests were made using default settings and no special hand made configurations (ex : default.pa).

Results are strange, plenty of lessons and depend on the PC (intel / AMD) :

  • Tests on an (old) Intel based PC with Intel iGPU : The digital audio over HDMI is well managed and I can choose between all the audio outputs and modes from analog stereo to multi-channel digital audio (all modes : stereo, 5.1, 7.1).
  • With the exact same KDE Neon build on an AMD mini desktop PC (based on Ryzen 9 9740HS), the sound output is only stereo over HDMI. No multi-channel audio over HDMI support available!
  • I also tested, with a newly bought, an external USB sound card which offer S/PDIF out / in, Analog outputs for stereo and 5.1 and mic input. I was never able to use multi-channel on S/PDIF but stereo only even if it’s allowed to do multi-channel audio. Wasted some money here… Perhaps it’s because of an not yet supported sound card?

With these tests, I’m more and more sure it’s due to the way the AMD chipsets / HDMI audio are managed at the kernel level on KDE Neon (based on the stable and testing branch). And / Or lack of configuration at the kernel level.

All this annoys me because I thought I would find a friendly serious alternative to Windows without thinking to install some obscure audio layers not so easy to understand at user level (pulseaudio, pipewire, wireplumber, jack, … ) or to re-compile the kernel for each new driver just to play music, midi files or to play a movie.

I’m surprised to see none of these problems raised, yet, before, from the community about these AMD HDMI problems, even if we find tons of posts about these problem on the web. The era of the 2 tiny sized stereo speakers and a CD-ROM is over and people want more from a multi-media OS.

I think it should be pointed to the linux kernel devs since more and more users use AMD CPUs into PCs, laptops, 2 in 1 tablet PCs , handhelds, and mini-PC (and multi-channel audio over HDMI of course).

I will wait for an (my) universal Linux build which matches all my needs. Until this problem will not be fixed, I’ll stay, like many, under Windows where almost everything works OOB.

But, still, I’m positive (I must be after a year to test / bench on every Linux distro no?) and I can help the devs for testings if needed to make Linux better.

Thing is, often the problem’s solution is simple, once we figure out what is going wrong. Linux is friendly, its just selective who its friends are. :wink: HDMI audio is a closed, heavily IP encumbered protocol with AMD officially stating that they cannot support the latest 2.1 protocol in open source due to licensing.

One question I was going to ask is whether or not you have updated the mini-pc bios firmware? What version of agesa are you on? AMD bioses tend to be immature when a new chipset or cpu is released and need to be constantly updated (this is true for all OSes).

WRT the rotation problem, install libqtsensors and qt6-sensors. Don’t use muon, its depreciated. Use Synaptic, or simply install it from the command line. It is indeed available to be installed. If you are not seeing it, then check which mirror you are on.

Hi Shadow.
As I said, I have the luck (or not) to own many PCs in the family. The one I used lately is a mini-PC from Minis Forum (UM790Pro 32GB RAM 4TB capacity in 3 RAID SSDs) I care since 1 year. That one is my main unit acting as a Media-center / DB server / VM server. It’s on the last available BIOS and latest AGESA for mobile AMD CPUs (the Ryzen 9 9740HS is a mobile CPU / APU wich include a Radeon 780m iGPU). I own 3 of these and they work fine under Windows. So, Yes, it’s up to date regarding the firmware and never had a glitch since I bought them.
I have also a Desktop PC based on Intel with an old AMD Radeon 580, 3*Intel Dell 5175 Tablet PCs (2 in 1) fully on intel CPU/chipsets, A Lenovo laptop based on AMD Ryzen, and my son’s laptop (intel N100) and handheld (AMD Z1 extreme)… to do all the tests. All of them have HDMI ports and only the AMD ones (all of them) having problems with milti-channel digital audio.
Yes I know, it’s too much but hopefully my job is working with computers.

I was not aware muon was deprecated (my Linux knowledge is still very limited).

I assume the files you talk about are for restoring the auto-rotate feature. if it’s the case, and since JPL asked me to separate my problem into 2 subjects, I opened a dedicated thread [Screen auto-rotate for tablet PCs on Kubuntu]

Can you share a method (howto URL) or a manual on how to install and configure Synaptic, QT6-Sensors and libqtsensors?

open a terminal and type

sudo apt install synaptic

Then find it in your start menu and launch it. Wait a few minutes while it rebuilds the search index (watch the search input box at the top, it will tell you when its done when it switches to “quick filter”).

Then simply type libqt6sensors6 and it will show you the file. Click the checkbox and select “mark for installation”. Then in the search box type qt6-sensors, and mark it as well. Then click apply on the toolbar.

Alternatively you can type

sudo apt install libqt6sensor6

then

sudo apt install qt6sensors

Here is a link that will walk you through installing pipewire. This has been tested and used successfully with Neon that is based on Ubuntu 22.04.

Thanks Shadow.

But all the install process to install pipewire was already done previously.

BTW, I installed a new copy of KDE Neon and followed the exact process written on the site (in case of).
After install and reboot, I’m on pipewire but still no multichanel digital audio available for output. Just (like prviously) Stereo on HDMI (play HiFi quality Music) profile. when looking at the available profiles, no available surround profile available (just like before).

Like I said, I think it’s NOT a pulseaudio or wireplumber problem it’s at the upstream of these layers. I better think it’s at ALSA or driver level.

It would be simple to see if it’s at driver level by installing the AMD drivers but because the ID of KDE Neon is not the ID of Ubuntu, we can’t install the AMD drivers… sigh… another problem.