nVidia HDMI audio mhwd-prime-powermanagement.rules

Continuing the discussion from [Stable Update] 2021-09-04 - Kernels, Wine, Deepin, KDE Gear, Maui-Kit, Plasma:

The forum post you linked to has a link to Manjaro Gitlab patch to disable the udev rule
bad60808 - [hybrid-nvidia] disable disabling HDMI-Audio

Some users could edit the file /etc/udev/rules.d/90-mhwd-prime-powermanagement.rules
and add a comment tag ‘#’ , but less experienced users might need a more reliable solution

Please post response to this command to show the rule

grep -A1 'Remove NVIDIA Audio`  /etc/udev/rules.d/90-mhwd-prime-powermanagement.rules

A sed command would be able to search for the text of this rule and prepend a comment tag

2 Likes

That rule is not the only one that should be disabled (as said by nvidia itself here), but also the ones that disable the usb functionalities.

In particular, these lines (from /etc/udev/rules.d/90-mhwd-prime-powermanagement.rules):


# 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"

must becomes:


# 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"

PS: this is the output to that grep you asked

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

This command will prepend a comment tag to the rule for HDMI audio

sudo sed -Ei '/ "0x40300"/s/^/#/' /etc/udev/rules.d/90-mhwd-prime-powermanagement.rules

If you want to add comment tags to the other 2 rules you could change the PCI Class ID number in the sed command to match class ID number for the other rules.
But changing other rules not mentioned in the commit is your responsibility

While this should definitely be changed, isn’t a moot point until prime supports HDMI output without optimus-manager?

Update: Actually, systems with only Nvidia card (not a dGPU like in laptops) would be affected too, so it makes sense to have this change sooner rather than later.

The wait for the HDMI output for laptops running in prime mode rather than using optimus-manager is separate issue.

I have a desktop system with nVidia GPU – NVIDIA GK208B [GeForce GT 730] driver: nvidia v: 470.63.01
linux-nvidia package for desktop GPU does not have any udev rules for nVidia and sound works no problem
(but I keep it muted because the monitor speakers sound awful)

It does. optimus-manager is simply a convenience utility to set the appropriate Xorg configuration. It is not required by any means.

1 Like

Fair enough. By default laptops with dGPU are unable to use HDMI with the laptop’s display off with massive lag (known issue). With the utility is convenient to switch to Nvidia only mode to not have the issue.

Without the udev rules sound will be disabled until manually changed

I don’t have optimus-manager (only the nvidia-prime package) and my laptop (intel igpu + rtx 2060) works totally fine (i can connect any hdmi display like on windows without having to change any settings). Commenting those lines allows also the audio to work, otherwise only the video will be available.

You specifically have to disable the laptops display. As in, only project to the monitors/TVs.
This causes the lag

I don’t, it just work for me, but I usually use the external screen as a duplicate of the laptop one, so maybe that’s the difference (I’ll try to use the second screen to extend my desktop to see what happen)

Both of those work fine. It’s specifically ‘use external screen only’ (as in turn off the laptop display).
It’s a known bug in the driver

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.