[SOLVED] Audio on proxmox (host)

noobalaboomer

New Member
Oct 27, 2023
17
0
1
Hi!
I'm really new in proxmox. I just installed it. I have connected speakers to proxmox node (host) and I want to play music on them with snapclient. I created minimalistic VM with Ubuntu Server. On proxmox only available audio devices are dummy and SPICE. I understand SPICE is to transfer audio/video over VNC. I tried also command below on the host:
:~# apt install alsa-base alsa-tools Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package alsa-base :~# cat /etc/apt/sources.list deb [URL]http://ftp.pl.debian.org/debian[/URL] bookworm main contrib deb [URL]http://ftp.pl.debian.org/debian[/URL] bookworm-updates main contrib # security updates deb [URL]http://security.debian.org[/URL] bookworm-security main contrib

Searching on google gives me more options to transfer sound over the network and that's not my case. I'm also little bit scared of adding repositories to proxmox because I have no idea how to connect VM to host's device (soundcard in that case).

[SOLUTION]
I decided to do PCI Pass-through method and I used this guide: https://pve.proxmox.com/wiki/PCI(e)_Passthrough
Important things: intel_iommu=on is important and iommu=pt is not good.
Also be aware if aplay -l doesn't find any soundcard it still can work well. Snapclient workd w/o aplay working and if you want to use aplay or mplayer I found they are working if you log into VNC. Then it works also on SSH as long as you are logged to any Display. Check this issue here.
 
Last edited:
Proxmox VE is designed for enterprise servers without audio outputs. Either PCIe passthrough a (on-board) sound device or setup (Linux) audio via the (virtual) network. Both have pros and cons, and both have guides on the internet and on this forum. Maybe research both options and try them? Feel free to ask more specific questions.
 
PCIe Passthrough sounds good enough. Looks like my host have soundcard integrated with CPU, but using PCI(e) bus. Do you think that will work?
~# lspci | grep Audio 00:0e.0 Audio device: Intel Corporation Celeron/Pentium Silver Processor High Definition Audio (rev 03)

Now I know what to look for. Thank you!
 
Another option I forgot to mention is to use an USB sound device and use USB passthrough. but this also does not always work.
PCIe Passthrough sounds good enough. Looks like my host have soundcard integrated with CPU, but using PCI(e) bus. Do you think that will work?
~# lspci | grep Audio 00:0e.0 Audio device: Intel Corporation Celeron/Pentium Silver Processor High Definition Audio (rev 03)

Now I know what to look for. Thank you!
Is the audio device alone in an IOMMU group (bridges don't count)? Otherwise PCIe passthrough of the device might cause the Proxmox host to crash.
Do you know of other people having success with passthrough of that device? Many PCI(e) devices don't reset properly and won't work inside a VM. But this you can just try.
 
Last edited:
# dmesg | grep -e DMAR -e IOMMU -e AMD-Vi [ 0.010872] ACPI: DMAR 0x00000000786E7D40 0000A8 (v01 INTEL GLK-SOC 00000003 BRXT 0100000D) [ 0.010945] ACPI: Reserving DMAR table memory at [mem 0x786e7d40-0x786e7de7] [ 0.136466] DMAR: Host address width 39 [ 0.136472] DMAR: DRHD base: 0x000000fed64000 flags: 0x0 [ 0.136490] DMAR: dmar0: reg_base_addr fed64000 ver 1:0 cap 1c0000c40660462 ecap 9e2ff0505e [ 0.136502] DMAR: DRHD base: 0x000000fed65000 flags: 0x1 [ 0.136517] DMAR: dmar1: reg_base_addr fed65000 ver 1:0 cap d2008c40660462 ecap f050da [ 0.136528] DMAR: RMRR base: 0x0000007866b000 end: 0x0000007868afff [ 0.136537] DMAR: RMRR base: 0x0000007d800000 end: 0x0000007fffffff [ 0.136546] DMAR-IR: IOAPIC id 1 under DRHD base 0xfed65000 IOMMU 1 [ 0.136553] DMAR-IR: HPET id 0 under DRHD base 0xfed65000 [ 0.136560] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping. [ 0.138709] DMAR-IR: Enabled IRQ remapping in x2apic mode

Looks promising. I have Fujitsu S940 with Pentium J5005.
 
Run pvesh get /nodes/{nodename}/hardware/pci --pci-class-blacklist "" to check if the soundcard got its own IOMMU group.
 
  • Like
Reactions: leesteken
Looks like good news:
│ 0x040300 │ 0x3198 │ 0000:00:0e.0 │ -1 │ 0x8086 │ Celeron/Pentium Silver Processor High Definition Audio │ │ 0x123f
I'm slowly going step-by-step through instruction linked by leesteken. Kids are sleeping, so maybe I finally do this :D
 
Looks like good news:
│ 0x040300 │ 0x3198 │ 0000:00:0e.0 │ -1 │ 0x8086 │ Celeron/Pentium Silver Processor High Definition Audio │ │ 0x123f
I'm slowly going step-by-step through instruction linked by leesteken. Kids are sleeping, so maybe I finally do this :D
The IOMMU group number is -1, which does not bode well as it appears to be in no group. Are you sure IOMMU is enabled? What is the entire output?
 
Your'e right. I'm too tired to not mess it now. Maybe tomorrow I'll do something better.

I'm also not sure if I done all good. The last line is suggesting me IOMMU is enabled:
# dmesg | grep -e DMAR -e IOMMU -e AMD-Vi [ 0.010587] ACPI: DMAR 0x00000000786E7D40 0000A8 (v01 INTEL GLK-SOC 00000003 BRXT 0100000D) [ 0.010661] ACPI: Reserving DMAR table memory at [mem 0x786e7d40-0x786e7de7] [ 0.135898] DMAR: Host address width 39 [ 0.135904] DMAR: DRHD base: 0x000000fed64000 flags: 0x0 [ 0.135922] DMAR: dmar0: reg_base_addr fed64000 ver 1:0 cap 1c0000c40660462 ecap 9e2ff0505e [ 0.135934] DMAR: DRHD base: 0x000000fed65000 flags: 0x1 [ 0.135948] DMAR: dmar1: reg_base_addr fed65000 ver 1:0 cap d2008c40660462 ecap f050da [ 0.135960] DMAR: RMRR base: 0x0000007866b000 end: 0x0000007868afff [ 0.135968] DMAR: RMRR base: 0x0000007d800000 end: 0x0000007fffffff [ 0.135978] DMAR-IR: IOAPIC id 1 under DRHD base 0xfed65000 IOMMU 1 [ 0.135985] DMAR-IR: HPET id 0 under DRHD base 0xfed65000 [ 0.135992] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping. [ 0.138128] DMAR-IR: Enabled IRQ remapping in x2apic mode

But # find /sys/kernel/iommu_groups/ -type l returns nothing.
 
That looks like IOMMU is not enabled (and therefore no groups). (...)
I agree. I was looking, but doesn't saw group = -1. It was too late for me I think :D

On BIOS all virtualization options are on, but I'll check. That's not so easy.

# cat /proc/cmdline BOOT_IMAGE=/boot/vmlinuz-6.2.16-3-pve root=/dev/mapper/pve-root ro iommu=pt
 
BOOT_IMAGE=/boot/vmlinuz-6.2.16-3-pve root=/dev/mapper/pve-root ro iommu=pt
As you can see intel_iommu=on is missing, which explains that lack of IOMMU groups. You need to always add that on Intel (even though the manual says that it's longer needed).
Note that iommu=pt does not do what most people seem to think it does. It only does something for devices that are not passed through.
 
I fixed that.
# cat /proc/cmdline BOOT_IMAGE=/boot/vmlinuz-6.2.16-3-pve root=/dev/mapper/pve-root ro iommu=on
But still no groups.
 
I fixed that.
# cat /proc/cmdline BOOT_IMAGE=/boot/vmlinuz-6.2.16-3-pve root=/dev/mapper/pve-root ro iommu=on
But still no groups.
It is still not correct. intel_iommu=on is still missing. Did I not type it correctly in my previous reply? Replace iommu=on with intel_iommu=on. I hope you can see the difference,.
 
Now it is really fixed, but please look at iommugroup

# pvesh get /nodes/proxmox1/hardware/pci --pci-class-blacklist "" | grep 14 │ 0x060100 │ 0x31e8 │ 0000:00:1f.0 │ 14 │ 0x8086 │ Celeron/Pentium Silver Processor LPC Controller │ │ 0x1240 │ │ 0x1734 │ Fujitsu Technology Solutions │ Intel Corporation │ │ 0x0c0500 │ 0x31d4 │ 0000:00:1f.1 │ 14 │ 0x8086 │ Celeron/Pentium Silver Processor Gaussian Mixture Model │ │ 0x1240 │ │ 0x1734 │ Fujitsu Technology Solutions │ Intel Corporation │
Also
# find /sys/kernel/iommu_groups/ -type l | grep 14 /sys/kernel/iommu_groups/8/devices/0000:00:14.0 /sys/kernel/iommu_groups/14/devices/0000:00:1f.0 /sys/kernel/iommu_groups/14/devices/0000:00:1f.1 /sys/kernel/iommu_groups/9/devices/0000:00:14.1
 
Last edited:
Now it is really fixed, but please look at iommugroup

# pvesh get /nodes/proxmox1/hardware/pci --pci-class-blacklist "" | grep 14 │ 0x060100 │ 0x31e8 │ 0000:00:1f.0 │ 14 │ 0x8086 │ Celeron/Pentium Silver Processor LPC Controller │ │ 0x1240 │ │ 0x1734 │ Fujitsu Technology Solutions │ Intel Corporation │ │ 0x0c0500 │ 0x31d4 │ 0000:00:1f.1 │ 14 │ 0x8086 │ Celeron/Pentium Silver Processor Gaussian Mixture Model │ │ 0x1240 │ │ 0x1734 │ Fujitsu Technology Solutions │ Intel Corporation │
Also
# find /sys/kernel/iommu_groups/ -type l | grep 14 /sys/kernel/iommu_groups/8/devices/0000:00:14.0 /sys/kernel/iommu_groups/14/devices/0000:00:1f.0 /sys/kernel/iommu_groups/14/devices/0000:00:1f.1 /sys/kernel/iommu_groups/9/devices/0000:00:14.1
I don't see the problem. Most functions of the same device will be in the same group. And often some devices are in the same group.
It's only relevant what's in the group of the device you want to pass through (0000:00:0e.0 was it?), which you unfortunately don't show.
 
It was looking good for me. I just wanted to show it looks like 2 functions are in one group. But now I have different issue.
In the VM I can see:
Zrzut ekranu z 2023-10-28 17-40-02.png
But now I have no Ethernet connection :/ I also added second network adapter with different configuration and not using the VLAN, but:
1698507898784.png
This is after ip link set enp6s18 up. Before s18 was similar to s19.

OK, I mixed 0f with 1f... Let me check after change...
 
Last edited:
It was looking good for me. I just wanted to show it looks like 2 functions are in one group. But now I have different issue.
In the VM I can see:
View attachment 57233
But now I have no Ethernet connection :/ I also added second network adapter with different configuration and not using the VLAN, but:
Check the IOMMU group of the audio device on the Proxmox host. Is the network controller in the same group?
View attachment 57234
This is after ip link set enp6s18 up. Before s18 was similar to s19.
You need to adjust the network configuration of the virtual bridge also in /etc/network/interfaces.
 
I changed "Machine" to q35 (I read that pcie=1 may be needed and it's only supported by q35). I had no sound and no network. Changing it back to i440fx fixed network but I can't run even alsamixer. Then I removed PCI device and added it again - now it's running! Thank you! Mopidy & cnapcast... here I go again...
 
Last edited:

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!