VM Audio has a crackling/pop sound.

whocaresuserame

New Member
Jun 4, 2024
5
1
3
Hi all, it seems that this is a common problem with no solution? or I may be reading it wrong.

I have a Windows 11 VM with GPU and two USB cards as PCI pass-through. Everything works flawlessly except for 1 thing. The audio.
Everything I play will playback without pause or latency, but I hear constant crackling and popping sounds as the audio plays.

I have tried to move the headphones over to another PCI pass-through device as well as the monitor's headphone jack just in case the issue was a singular USB PCI device.
However, the results have been all the same. I tried different headphones as well.

I have no idea what could be causing the issue especially if I am giving a dedicated PCI pass-through. Of course, I may not be unaware of a specific reason that may be causing this.

Any help and insight would be appreciated.

Also, all PCI passt-hroughs are done through the Proxmox web interface and Proxmox is installed on bare metal.


The issue was fixed, follow the thread to see what I did.
 
Last edited:
Last edited:
This provides the answer to doing it https://forum.proxmox.com/threads/usb-keyboard-and-audio-issues.104472/

I enabled MSI on my USB PCI devices and audio devices and restarted the VM and there is still some static and pops however its not as bad. I'm sure if I spent more time trying to find what all devices do and are I will be able to figure it out. for now this is good enough.
 
  • Like
Reactions: leesteken
This provides the answer to doing it https://forum.proxmox.com/threads/usb-keyboard-and-audio-issues.104472/

I enabled MSI on my USB PCI devices and audio devices and restarted the VM and there is still some static and pops however its not as bad. I'm sure if I spent more time trying to find what all devices do and are I will be able to figure it out. for now this is good enough.
Did you already do all the other best practices to improve Windows on Proxmox like the VirtIO drivers, using VirtIO SCSI Single and enabling IO thread?
Also, don't give the VM more virtual cores then you have real cores (don't count Hyperthreads!) and preferably a little less, to improve latency.
 
  • Like
Reactions: whocaresuserame
Did you already do all the other best practices to improve Windows on Proxmox like the VirtIO drivers, using VirtIO SCSI Single and enabling IO thread?
Also, don't give the VM more virtual cores then you have real cores (don't count Hyperthreads!) and preferably a little less, to improve latency.
Here is some info on the device

hostpci1: 0000:07:00 is the USB card where I have an audio adapter.
The CPU is under 60% on average its resides between 13%-20%. So I believe its fine. I have an i9 13900k

agent: 1
bios: ovmf
boot: order=ide0;scsi0
cores: 4
cpu: host
efidisk0: VM-Storage:101/vm-101-disk-0.qcow2,efitype=4m,pre-enrolled-keys=1,size=528K
hostpci0: 0000:0a:00,pcie=1,x-vga=1
hostpci1: 0000:07:00
machine: pc-q35-8.1,viommu=virtio
memory: 12288
meta: creation-qemu=8.1.5,ctime=1714690890
name: Win11-Main
net0: virtio=BC:24:11:C6:40:28,bridge=vmbr0
numa: 0
onboot: 1
ostype: win11
scsi0: VM-Storage:101/vm-101-disk-1.qcow2,size=150G
scsi1: Extra-Storage:101/vm-101-disk-0.qcow2,size=500G
scsihw: virtio-scsi-pci
smbios1: uuid=8f979966-c54c-4c68-904f-d1031b928ca3
sockets: 1
tpmstate0: VM-Storage:101/vm-101-disk-2.raw,size=4M,version=v2.0
vmgenid: e44eeacf-d00d-4998-be66-353175099cf7

as for "VirtIO drivers, using VirtIO SCSI Single and enabling IO thread?" Yes, except for "enabling IO thread" I am not 100% sure on that one. looking at the virtio drivers from the iso I had to use from https://pve.proxmox.com/wiki/Windows_VirtIO_Drivers I dont see any that relates to sound.

But for the basic best practices I'm sure I got it all.
 
Hi to anyone who reads this.

I did as leesteken had mentioned about MSI and what this post mentioned as well https://forum.proxmox.com/threads/usb-keyboard-and-audio-issues.104472/post-506649

I did it to my USB PCI pass-through, the HD audio for my Nvidia GPU. When I went to the Register edit the first time and enabled MSI on the devices, and if they didn't have it enabled I added it.
I want to note that after I did everything I restarted the VM and wanted to confirm that the changes I made worked, However, I noticed that there are 2 new locations to get to the devices
Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet
and
Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet0001

With the same branch to get to the PCI directory.. I wasn't sure why another directory was duplicated after the restart. However, I went to them and enabled MSI on all the devices I had mentioned since they were turned off in the duplicated directory while the old directory kept the changes I made.

After that, I used the Virtio ISO to follow the best practices of installing the drivers despite me believing that I had already done that because we are all human and we may be wrong, so it doesn't hurt, despite seeing the drivers installed in the device manager.

After all that I shut down the VM from proxmox, waited a bit then started it up again. The sound static/pop sound still continued for a bit, but it was dampened and less noticeable then before. However, after 1 hour I noticed that the annoying sound was completely gone. I'm not sure why the delay occurred, but I did fix the issue I was complaining about.
 
Hi to anyone who reads this.

I did as leesteken had mentioned about MSI and what this post mentioned as well https://forum.proxmox.com/threads/usb-keyboard-and-audio-issues.104472/post-506649

I did it to my USB PCI pass-through, the HD audio for my Nvidia GPU. When I went to the Register edit the first time and enabled MSI on the devices, and if they didn't have it enabled I added it.
I want to note that after I did everything I restarted the VM and wanted to confirm that the changes I made worked, However, I noticed that there are 2 new locations to get to the devices
Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet
and
Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet0001

With the same branch to get to the PCI directory.. I wasn't sure why another directory was duplicated after the restart. However, I went to them and enabled MSI on all the devices I had mentioned since they were turned off in the duplicated directory while the old directory kept the changes I made.

After that, I used the Virtio ISO to follow the best practices of installing the drivers despite me believing that I had already done that because we are all human and we may be wrong, so it doesn't hurt, despite seeing the drivers installed in the device manager.

After all that I shut down the VM from proxmox, waited a bit then started it up again. The sound static/pop sound still continued for a bit, but it was dampened and less noticeable then before. However, after 1 hour I noticed that the annoying sound was completely gone. I'm not sure why the delay occurred, but I did fix the issue I was complaining about.
Cant find anywhere to do the MSI solution, can u pls post a link on how to do the registry thing? cause im having the same issue with the graphic card hdmi sound :-(
 
I've been having issues with this for a while and it's slowly improved. I did a change recently that seems to have resolved most of my recent issues. Here are some of the changes I've made that improved hdmi GPU/audio passthrough on my box on top of the instructions provided by proxmox to prepare the host and VM. This is an NVIDIA gpu.

#Proxmox wiki on passthrough
https://pve.proxmox.com/wiki/PCI_Passthrough

#Add MSI on VM that is being passed the audio:
$ cat /etc/modprobe.d/snd-hda-intel.conf
options snd-hda-intel enable_msi=1

lspci -v
01:00.1 Audio device: NVIDIA Corporation GA106 High Definition Audio Controller (rev a1)
Subsystem: Hewlett-Packard Company Device 8903
Physical Slot: 0
Flags: bus master, fast devsel, latency 0, IRQ 43
Memory at fc020000 (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, IntMsgNum 0
Capabilities: [100] Advanced Error Reporting
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel

#disable memory ballooning
VM -> Hardware -> Memory

#enable numa for vm
VM -> Hardware -> Processors

#q35 downgrade to v3.1
VM -> Hardware -> Machine

Everything until the last one offered some level of improvement. The last one seems to have resolved all final issues. I have not tried other versions of q35 to see if others also work. I used this downgrade which was originally provided to fix a bug that prevent both audio and gpu from being passthrough. The latest version works, but I still have occasional audio glitches includes clicks, pops, distortion and silence. Also following a reboot audio and video are out of sync, but eventually will become in sync after running for some time. Once I moved to q35 v3.1, audio is immediately in sync following VM reboot and all audio glitches appear to be resolved.

I really only use this VM for streaming audio/video to my TV for various services, so I don't know what other impact downgrading q35 to v3.1 could have on the VM. I will report back any changes if problems return, but for now this is best working condition I've found.

(Sorry I realize you're talking Windows VM, but many of these same steps are OS independent, so hopefully this can provide help to you too)

Update: 2024-11-19
Audio still drops on occasions. Not sure how often, but maybe once every 60-90 minutes. Haven't tried any other fixes, but this still i the best configuration I've had since i've been using this environment.

Update: 2024-11-22
I went back through every single setting in the passthrough instructions and it looks like I missed vIOMMU setting. Audio drops are practically non-existent now. It still happens, but they are far less frequent to being almost unnoticeable. I still need to set q35 to v3.1 or I get out of sync audio following reboots of the VM for a period of time.
 
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!