Linux – No HDMI Audio Output – APLAY does not detect NVIDIA GPU

audiohdmilinux-mintnvidia

When plugging my home cinema setup into a new HP Omen 15 with Linux Mint 18.2, there is no option to set audio output to HDMI, despite the video signal working fine.

Other
Questions
have not
been
useful/successful.

Mostly it's the issue from this forum post, and none od the proposed solutions have worked.

PulseAudioVolumeControl shows only one device for which to pick profiles (this being the built-in audio). Still, there is an abundance of HDMI profiles I can pick for it.

None but the standard analog setting work.

Istalling the oem-audio-hda-daily-dkms does not change anything.

Using newer NVidia Drivers does not change anything.

aplay -l gives:

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC295 Analog [ALC295 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

The GPU does not show up as card 1 as it does in other, solved versions of this problem.

The GPU does not show up in alsamixer either.

I have found no way of making NVidia HDA drivers be recognized.

Edit: alternatively the problem may be that it's only PCH devices in the aplay output and no actual HDMI devices …
my old MSI notebook also shows no NVidida card, but HDMI and PCH Intel Cards in aplay -l, and with that one (also Linux Mint 18.2) the HDMI Sound works without problems.

Best Answer

Possibly relevant:

For some reason, a lot of recent laptops are set up to boot with the GPU's PCI audio function disabled. I haven't done much investigation, but you can turn on the audio function and make the kernel see it by setting the appropriate PCI configuration bit and then telling the kernel to rescan the PCI bus on the PCI bridge the GPU is connected to.

Unfortunately, the kernel won't see the audio function unless you remove the graphics function first, which temporarily breaks the console. Because of that, it works best if you write a script to do it so you don't have to SSH into the system or try to type the commands into the console blind. Obviously, you have to stop the X server first so that you can unload the NVIDIA drivers.

For example, on my system, the GPU is at 01:00.0 and its parent PCI bridge is 00:01.0. So the script I use is:

setpci -s 01:00.0 0x488.l=0x2000000:0x2000000
rmmod nvidia-drm nvidia-modeset nvidia
echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove
echo 1 > /sys/bus/pci/devices/0000:00:01.0/rescan
modprobe nvidia-drm
xinit -- -retro

You can figure out your PCI topology with "lspci -t" but interpreting the results is pretty tricky.

Aaron Plattner
NVIDIA Linux Graphics

Related Question