No option for audio over DisplayPort / HDMI

Okay
So I’m fairly new to Linux, but I’ve tried mostly everything and still can’t seem to enable audio over DisplayPort on my MSI laptop with a GTX 1060 and Intel iGPU. Could someone please help me with this?

OS - Ubuntu 20.10
Kernel - 5.8.0
Driver - 460.56
Prime - Nvidia (Performance Mode)
Setup - Laptop with an external Monitor over DP connected on the side

In sound settings, I only see options for Speakers/Headphones and SPDIF output, nothing for DP.


aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC898 Analog [ALC898 Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC898 Digital [ALC898 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0


lspci | grep -i audio

00:1f.3 Audio device: Intel Corporation CM238 HD Audio Controller (rev 31)
01:00.1 Audio device: NVIDIA Corporation GP106 High Definition Audio Controller (rev ff)


lspci | grep -i nvidia

01:00.0 VGA compatible controller: NVIDIA Corporation GP106M [GeForce GTX 1060 Mobile] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GP106 High Definition Audio Controller (rev ff)


aplay -L

null
Discard all samples (playback) or generate zero samples (capture)
default
Playback/recording through the PulseAudio sound server
samplerate
Rate Converter Plugin Using Samplerate Library
speexrate
Rate Converter Plugin Using Speex Resampler
jack
JACK Audio Connection Kit
oss
Open Sound System
pulse
PulseAudio Sound Server
upmix
Plugin for channel upmix (4,6,8)
vdownmix
Plugin for channel downmix (stereo) with a simple spacialization
hw:CARD=PCH,DEV=0
HDA Intel PCH, ALC898 Analog
Direct hardware device without any conversions
hw:CARD=PCH,DEV=1
HDA Intel PCH, ALC898 Digital
Direct hardware device without any conversions
plughw:CARD=PCH,DEV=0
HDA Intel PCH, ALC898 Analog
Hardware device with all software conversions
plughw:CARD=PCH,DEV=1
HDA Intel PCH, ALC898 Digital
Hardware device with all software conversions
sysdefault:CARD=PCH
HDA Intel PCH, ALC898 Analog
Default Audio Device
front:CARD=PCH,DEV=0
HDA Intel PCH, ALC898 Analog
Front output / input
surround21:CARD=PCH,DEV=0
HDA Intel PCH, ALC898 Analog
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
HDA Intel PCH, ALC898 Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
HDA Intel PCH, ALC898 Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
HDA Intel PCH, ALC898 Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
HDA Intel PCH, ALC898 Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
HDA Intel PCH, ALC898 Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=PCH,DEV=0
HDA Intel PCH, ALC898 Digital
IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=PCH,DEV=0
HDA Intel PCH, ALC898 Analog
Direct sample mixing device
dmix:CARD=PCH,DEV=1
HDA Intel PCH, ALC898 Digital
Direct sample mixing device
usbstream:CARD=PCH
HDA Intel PCH
USB Stream Output
usbstream:CARD=Device
USB PnP Audio Device
USB Stream Output


I tried this but it crashed my laptop on the login screen if I had DP connected. If I removed DP and then turned it on, then I could log in and connect the DP cable back and 01:00.1 Audio device: NVIDIA Corporation GP106 High Definition Audio Controller (rev ff) in lspci changed to 01:00.1 Audio device: NVIDIA Corporation GP106 High Definition Audio Controller (rev a1) but there was still no option to change audio output to DisplayPort.

I also tried pulseaudio volume control but even that has no outputs.

I don’t understand what’s wrong here. BIOS has no setting to permanently keep Nvidia GPU on, nor does it have any settings to change/disable onboard/external audio. I’ve tried everything I could search for, so I’m posting this for help.

If you need any more info, please let me know.

Thanks!

nvidia-bug-report.log.gz (437.5 KB)

Your audio device is turned off and can’t be turned on due to a bios bug. It’s turned off due to runtime power management settings. Please post the output of

grep 10de /lib/udev/rules.d/*

Here’s the output for

grep 10de /lib/udev/rules.d/*

/lib/udev/rules.d/71-nvidia.rules:SUBSYSTEM==“pci”, ATTRS{vendor}==“0x10de”, DRIVERS==“nvidia”, TAG+=“seat”, TAG+=“master-of-seat”
/lib/udev/rules.d/71-nvidia.rules:ACTION==“add”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x03[0-9]*”, TEST==“power/control”, ATTR{power/control}=“auto”
/lib/udev/rules.d/71-nvidia.rules:ACTION==“add”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x040300”, TEST==“power/control”, ATTR{power/control}=“auto”
/lib/udev/rules.d/71-nvidia.rules:ACTION==“add”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x0c0330”, TEST==“power/control”, ATTR{power/control}=“auto”
/lib/udev/rules.d/71-nvidia.rules:ACTION==“add”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x0c8000”, TEST==“power/control”, ATTR{power/control}=“auto”

I remember reading another post where this was mentioned. I have already tried going into 71-nvidia-rules and commenting out the action for runtime PM for NVIDIA Audio devices rule but that didn’t solve the issue.

Is the BIOS bug a separate issue than this?
Do both this and the BIOS workaround have to be implemented together?
Is there even a workaround to the BIOS bug?

EDIT: Forgot to mention, it works flawlessly in Windows 10, if that helps solve something.
EDIT 2: I haven’t tried deleting the 71-nvidia-rules file altogether, would you suggest I try that?

Thanks

The fix would be to check for a bios update that fixes it. The workaround is to change the file to not use runtime pm: please change the lines with “auto” at the end to “on” instead and run
sudo update-initramfs -u

1 Like

Ah alright.
BIOS update would be wishful thinking since this laptop is quite old, but that’s fine.

As for the workaround, I have four lines with auto at the end:


# Enable runtime PM for NVIDIA VGA/3D controller devices
ACTION==“add”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x03[0-9]*”, TEST==“power/control”, ATTR{power/control}=“auto”

# Enable runtime PM for NVIDIA Audio devices
ACTION==“add”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x040300”, TEST==“power/control”, ATTR{power/control}=“auto”

# Enable runtime PM for NVIDIA USB xHCI Host Controller devices
ACTION==“add”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x0c0330”, TEST==“power/control”, ATTR{power/control}=“auto”

# Enable runtime PM fo NVIDIA USB Type-C UCSI devices
ACTION==“add”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x0c8000”, TEST==“power/control”, ATTR{power/control}=“auto”


Do you want me to change them to ON for all four or just the Audio devices one?
Also, what’s the trade-off of doing this? I just wanted to know if it’s something drastic or not.

Just change all lines. The tradeoff would be (in theory) higher power consumption on idle but in pratice, your notebook doesn’t support this anyway (too old). So for you, no downside.

1 Like

Alright!
Did a little reboot and it works! Thank you so much!!

So from what I understand now, I’d need to do this everytime there’s a mainline kernel upgrade right?
Would I have to do this for the minor patches too?

The file is provided by the nvidia driver package so you’ll have to do this on driver update.
Backup the file and just copy it in case of driver update. Maybe report a bug with ubuntu so it’s only installed on new notebooks (e.g. by bios date) that actually support this.
https://bugs.launchpad.net/ubuntu

1 Like

Oh okay got it.
I’ll try and report this to Ubuntu.

Thanks for all the help!