DEV Community

Cover image for Fix No Video and Sound Output Through HDMI In Linux
Swastik Dwivedi
Swastik Dwivedi

Posted on

Fix No Video and Sound Output Through HDMI In Linux

The other day, I connected my Asus Rog G531-GT running Opensuse Tumbleweed with my TV to watch a movie. To my surprise, there was no output through HDMI in TV. The laptop couldn't detect any connected HDMI output device. After fixing the HDMI output device detection, my HDMI sound device showed as unplugged. So I decided to write a blog about it as I had to search a lot to find the fix for it.

Unplugged

Why this happens:

For Video

This usually happens in optimus systems(Has two GPUs: Integrated intel gpu and dedicated Nvidia gpu)
In such machines, the HDMI port is connected directly to the dedicated GPU. Therefore, when u turn off your D-GPU either from the BIOS or using gfx tools such as bb-switch, pop-graphics-switch, asusctl, optimus-manager etc, the HDMI port gets turned off. Therefore, no output device is detected.

For Sound

This happens due to an old set of rules for Dynamic power management of Nvidia audio device. The latest kernel now manages those parts fine and doesn't need the explicit rule anymore.

Fix

For Video

To fix no video output you need to turn on your D-GPU either from BIOS(if your motherboard supports it) or using any gfx tool that you use to switch to hybrid or dedicated GPU mode.

For Sound

The rule file would exist either here :

/usr/lib/udev/rules.d/90-nvidia-udev-pm-G05.rules
Enter fullscreen mode Exit fullscreen mode

or

/etc/udev/rules.d/90-nvidia-udev-pm-G05.rules
Enter fullscreen mode Exit fullscreen mode

Open this file with your favourite editor and search for these entries:

# Remove NVIDIA USB xHCI Host Controller devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{remove}="1"

# Remove NVIDIA USB Type-C UCSI devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{remove}="1"

# Remove NVIDIA Audio devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{remove}="1"

Enter fullscreen mode Exit fullscreen mode

Comment these lines by adding a "#" infront of these lines like this :

# Remove NVIDIA USB xHCI Host Controller devices, if present
#ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{remove}="1"

# Remove NVIDIA USB Type-C UCSI devices, if present
#ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{remove}="1"

# Remove NVIDIA Audio devices, if present
#ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{remove}="1"
Enter fullscreen mode Exit fullscreen mode

Save the file and reboot. After reboot open settings and go into sound and select HDMI from output devices
HDMI SOUND
And you should have both video and sound output through your HDMI.

Hope it helps someone.

Want to buy me a coffee : Paypal || Crypto(preferred)

Discussion (0)