Skip to content

Instantly share code, notes, and snippets.

@f1yn
Created November 30, 2022 20:07
Show Gist options
  • Select an option

  • Save f1yn/a4e4d61b45e7a6cb68649469b29eb66f to your computer and use it in GitHub Desktop.

Select an option

Save f1yn/a4e4d61b45e7a6cb68649469b29eb66f to your computer and use it in GitHub Desktop.
QEMU HDMI audio fix (for Nvidia cards)

Sources: ArchLinux Wiki and Nvidia Developer Fourms

Get Bus ID of audio device

sudo lspci
...
[busid] Audio device: NVIDIA Corporation Device 228e (rev a1)
...

Check for flag

lspci -vs [busid]
[busid] Audio device: NVIDIA Corporation Device 228e (rev a1)
	Subsystem: ASUSTeK Computer Inc. Device 881d
	Physical Slot: 0-6
	Flags: bus master, fast devsel, latency 0, IRQ 66
	Memory at c2000000 (32-bit, non-prefetchable) [size=16K]
	Capabilities: [60] Power Management version 3
	Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
	Capabilities: [78] Express Endpoint, MSI 00
	Capabilities: [100] Advanced Error Reporting
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel

MSI: Enable- means it's disabled

Add driver flag for Linux hosts without Secureboot

sudo vim /etc/modprobe.d/pci-vm.conf
...
options snd-hda-intel enable_msi=1
...

Reboot, then check the flag again

lspci -vs [busid]
[busid] Audio device: NVIDIA Corporation Device 228e (rev a1)
	Subsystem: ASUSTeK Computer Inc. Device 881d
	Physical Slot: 0-6
	Flags: bus master, fast devsel, latency 0, IRQ 66
	Memory at c2000000 (32-bit, non-prefetchable) [size=16K]
	Capabilities: [60] Power Management version 3
	Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
	Capabilities: [78] Express Endpoint, MSI 00
	Capabilities: [100] Advanced Error Reporting
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel

MSI: Enable+ means it's enabled - audio wont sound demonic anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment