Alder Lake full iGPU passthrough - audio over HDMI stops working after VM reboot.

BDYB

New Member
Sep 27, 2024
5
3
3
Long story short - not really :),
Need help to reset devices after VM reboot.

I have a minisforum MS-01 with 12900H. The main purpose was to have a virtualized router and nas.
When putting it into the cabinet, I noticed that there is a ODROID HC4 running CoreELEC. I got an idea to move this functionality to MS-01 as VM as well.
Using THIS POST I was able to create a VM with full iGPU and audio access running LibreELEC.
At first it looked good, Watching my BDrips worked including HDR10 (HDR10+ and DV which are not supported under Linux) and DTS/Dolby passthrough.
MS-01 is connected to at TV (4K HDR) and a Denon receiver.
But then problems started to pop up.

Display capabilities identification:
If for whatever reason the boot order of the chain (TV AVR VM) was not in that order, I'd get weird refresh rates, no HDR support.
That was kinda easily solved by making persistent edid.

Sound issue:
Now here is the remaining issue. After restarting LibreELEC VM, it looses access to HDMI audio. Probably because some device is not reset properly.
It works again after host reboot.

By default, sound car shares IOMMU group with another 3 devices.
Bash:
for d in /sys/kernel/iommu_groups/*/devices/*; do n=${d#*/iommu_groups/*}; n=${n%%/*}; printf 'IOMMU group %s ' "$n"; lspci -nns "${d##*/}"; done |grep 1f
IOMMU group 12 00:1f.0 ISA bridge [0601]: Intel Corporation Alder Lake PCH eSPI Controller [8086:5182] (rev 01)
IOMMU group 12 00:1f.3 Audio device [0403]: Intel Corporation Alder Lake PCH-P High Definition Audio Controller [8086:51c8] (rev 01)
IOMMU group 12 00:1f.4 SMBus [0c05]: Intel Corporation Alder Lake PCH-P SMBus Host Controller [8086:51a3] (rev 01)
IOMMU group 12 00:1f.5 Serial bus controller [0c80]: Intel Corporation Alder Lake-P PCH SPI Controller [8086:51a4] (rev 01)

Itried to:
intel_iommu=on iommu=pt pcie_acs_override=downstream,multifunction,id:8086:51c8,id:8086:51b2 vfio_iommu_type1.allow_unsafe_interrupts=1 kvm.ignore_msrs=1
that didn't help, so I tried to manually reset devices
Bash:
/usr/bin/echo "1" > /sys/bus/pci/devices/{device id}/remove # for each device in group and GPU
/usr/bin/echo "1" > /sys/bus/pci/rescan

This puts the sound card into its own IOMMU group:
Bash:
for d in /sys/kernel/iommu_groups/*/devices/*; do n=${d#*/iommu_groups/*}; n=${n%%/*}; printf 'IOMMU group %s ' "$n"; lspci -nns "${d##*/}"; done
IOMMU group 0 00:02.0 VGA compatible controller [0300]: Intel Corporation Alder Lake-P Integrated Graphics Controller [8086:46a6] (rev 0c)
IOMMU group 10 00:1d.0 PCI bridge [0604]: Intel Corporation Device [8086:51b2] (rev 01)
IOMMU group 11 00:1d.3 PCI bridge [0604]: Intel Corporation Device [8086:51b3] (rev 01)
IOMMU group 12 00:1f.0 ISA bridge [0601]: Intel Corporation Alder Lake PCH eSPI Controller [8086:5182] (rev 01)
IOMMU group 13 01:00.0 Non-Volatile memory controller [0108]: Phison Electronics Corporation E12 NVMe Controller [1987:5012] (rev 01)
IOMMU group 14 02:00.0 Ethernet controller [0200]: Intel Corporation Ethernet Controller X710 for 10GbE SFP+ [8086:1572] (rev 02)
IOMMU group 15 02:00.1 Ethernet controller [0200]: Intel Corporation Ethernet Controller X710 for 10GbE SFP+ [8086:1572] (rev 02)
IOMMU group 16 57:00.0 Ethernet controller [0200]: Intel Corporation Ethernet Controller I226-V [8086:125c] (rev 04)
IOMMU group 17 58:00.0 Ethernet controller [0200]: Intel Corporation Ethernet Controller I226-LM [8086:125b] (rev 04)
IOMMU group 18 59:00.0 Network controller [0280]: MEDIATEK Corp. MT7922 802.11ax PCI Express Wireless Network Adapter [14c3:0616]
IOMMU group 19 00:1f.3 Audio device [0403]: Intel Corporation Alder Lake PCH-P High Definition Audio Controller [8086:51c8] (rev 01)
IOMMU group 1 00:00.0 Host bridge [0600]: Intel Corporation 12th Gen Core Processor Host Bridge/DRAM Registers [8086:4641] (rev 02)
IOMMU group 20 00:1f.4 SMBus [0c05]: Intel Corporation Alder Lake PCH-P SMBus Host Controller [8086:51a3] (rev 01)
IOMMU group 21 00:1f.5 Serial bus controller [0c80]: Intel Corporation Alder Lake-P PCH SPI Controller [8086:51a4] (rev 01)
IOMMU group 2 00:06.0 PCI bridge [0604]: Intel Corporation 12th Gen Core Processor PCI Express x4 Controller #0 [8086:464d] (rev 02)
IOMMU group 3 00:06.2 PCI bridge [0604]: Intel Corporation 12th Gen Core Processor PCI Express x4 Controller #2 [8086:463d] (rev 02)
IOMMU group 4 00:07.0 PCI bridge [0604]: Intel Corporation Alder Lake-P Thunderbolt 4 PCI Express Root Port #0 [8086:466e] (rev 02)
IOMMU group 5 00:07.2 PCI bridge [0604]: Intel Corporation Alder Lake-P Thunderbolt 4 PCI Express Root Port #2 [8086:462f] (rev 02)
IOMMU group 6 00:0d.0 USB controller [0c03]: Intel Corporation Alder Lake-P Thunderbolt 4 USB Controller [8086:461e] (rev 02)
IOMMU group 6 00:0d.2 USB controller [0c03]: Intel Corporation Alder Lake-P Thunderbolt 4 NHI #0 [8086:463e] (rev 02)
IOMMU group 6 00:0d.3 USB controller [0c03]: Intel Corporation Alder Lake-P Thunderbolt 4 NHI #1 [8086:466d] (rev 02)
IOMMU group 7 00:14.0 USB controller [0c03]: Intel Corporation Alder Lake PCH USB 3.2 xHCI Host Controller [8086:51ed] (rev 01)
IOMMU group 7 00:14.2 RAM memory [0500]: Intel Corporation Alder Lake PCH Shared SRAM [8086:51ef] (rev 01)
IOMMU group 8 00:16.0 Communication controller [0780]: Intel Corporation Alder Lake PCH HECI Controller [8086:51e0] (rev 01)
IOMMU group 8 00:16.3 Serial controller [0700]: Intel Corporation Alder Lake AMT SOL Redirection [8086:51e3] (rev 01)
IOMMU group 9 00:1c.0 PCI bridge [0604]: Intel Corporation Alder Lake-P PCH PCIe Root Port [8086:51bb] (rev 01)

I've noticed that after reboot, the snd_hda_codec_hdmi is not even loaded.

If anyone have an idea how to fix it, please share.

Configurations
lspci -l output in VM
Bash:
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01)
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Alder Lake-P GT2 [Iris Xe Graphics] (rev 0c)
00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon
00:05.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge
00:11.0 ISA bridge: Intel Corporation Alder Lake PCH eSPI Controller (rev 01)
00:11.1 Audio device: Intel Corporation Alder Lake PCH-P High Definition Audio Controller (rev 01)
00:11.2 SMBus: Intel Corporation Alder Lake PCH-P SMBus Host Controller (rev 01)
00:11.3 Serial bus controller: Intel Corporation Alder Lake-P PCH SPI Controller (rev 01)
00:12.0 Ethernet controller: Red Hat, Inc. Virtio network device
00:1e.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge
00:1f.0 ISA bridge: Intel Corporation Alder Lake PCH eSPI Controller (rev 01)
01:01.0 SCSI storage controller: Red Hat, Inc. Virtio SCSI
02:1b.0 USB controller: Red Hat, Inc. QEMU XHCI Host Controller (rev 01)
02:1e.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge

VM config:
Bash:
root@proxmox:~# cat /etc/pve/qemu-server/103.conf
args: -set device.hostpci0.addr=02.0 -set device.hostpci0.x-igd-gms=0x2 -set device.hostpci0.x-igd-opregion=on -debugcon file:/root/igd_debug.log -global isa-debugcon.iobase=0x402
bios: ovmf
boot: order=usb1;ide2;scsi0;net0
cores: 2
cpu: host
efidisk0: local-lvm:vm-103-disk-0,efitype=4m,size=4M
hostpci0: 0000:00:02,legacy-igd=1,romfile=gen12_igd.rom
hostpci1: 0000:00:1f.3,romfile=gen12_gop.rom
ide2: none,media=cdrom
machine: pc-i440fx-8.0
memory: 4096
meta: creation-qemu=8.1.5,ctime=1727558715
net0: virtio=BC:24:11:A1:92:F7,bridge=vmbr0,firewall=1
numa: 0
ostype: l26
scsi0: local-lvm:vm-103-disk-1,discard=on,iothread=1,size=32G
scsihw: virtio-scsi-single
smbios1: uuid=bf6915b2-1e98-4e96-b3e0-86385ab74766
sockets: 1
usb0: host=045e:0800
usb1: host=1e3d:2092,usb3=1
vga: none
vmgenid: a361706b-4d00-490b-bfa9-f58e9a49870f

aplay -l after host reboot
Code:
LibreELEC:~ # aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC269VC Analog [ALC269VC Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [DENON-AVR]
  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
card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

aplay -l after VM reboot
Code:
LibreELEC:~ # aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC269VC Analog [ALC269VC Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
 
Last edited:
Small update, I also tried to use mapped device for the audio controller which included all 00.1f.x devices. It didn't help.
It appears that all of them do not support PCIe reset.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!