VFIO 7900 XTX, Sound crackling on gpu DP output, windows 10 guest

I’m using 7900 XTX and passing it to VM. Everything works fine except for audio from gpu outputs (monitor and VR headset).

I’ve tried setting MSI interruption but it’s not helping. Only way I found to stop crackling is to change sample rate in windows audio settings but I can’t do it for Valve Index (it says it support exactly one sample rate) which is problem since I’ve set up this VM mainly for VR games.

Any idea how I can fix this?

Seconding this. My NVIDIA GPU also has the same issue. After a while, the sound sounds like it’s been filtered through a noisy radio channel. The problem doesn’t extend to my Bluetooth headphones (connected to the VM), but I can’t use the headphones 100% of the time.

So you switch to sampling rate B and fix the issue. But your Valve device only works with sampling rate A. Can’t you switch back to sampling rate A after switching to B and fixing the issue?

I could have misunderstood your description. Anyway it’s just a workaround at best. Have you also tried to eliminate VFIO passthrough out of the equation?

I can’t change Sample rate for Valve index in audio options, it says it support only 48000hz 16 bit. And this sample rate with this bit depth crackles.
For monitor I can change between some sample rates. Actually it seems 24 bit depth instead of 16 bit makes it work for monitor, but as I said, valve index don’t support it.

Audio from GPU works fine on host (both in headset and monitor) if that’s what you mean by “eliminate VFIO passthrough”.

Change your GPU’s DP audio to the monitor from 48kHz 16-bit to 24-bit and then back to 16-bit.

Does it help on the DP audio to Valve Index? I guess it doesn’t based on what you described so far.

Audio from GPU works fine on host (both in headset and monitor) if that’s what you mean by “eliminate VFIO passthrough”.

If the host is the same Windows, then it addressed my question. Or else try to boot into Windows on bare metal and see if you see the same audio issue.

Monitor and Valve Index are different audio devices in windows, changings settings for one doesn’t affect second.

I’ve installed windows just to check it. It works fine on bare metal.

I also noticed, when I pass USB audio interface with Spice USB redirect ( I use it for my headphones) sound from it is fine.
But when I pass same audio interface with libvirt (adding hostdev type=“usb”) it crackles horribly too.

Could it be something with vfio controllers?

If you can reproduce the issue easily and consistently in VFIO passthrough, but not on bare metal Windows, then likely limited to VFIO only. I’m afraid you’re on unchartered water, at least from my perspective. Keep us posted if you figure out anything.

You might try a better cable, shorter the better
Wendell has had good luck with cable matters brand cables

I can’t exactly try other cable with Valve Index

https://www.reddit.com/r/ValveIndex/comments/jo2d37/valve_index_audio_crackling_like_a_bad_vinyl/
Try changing the pci-e speed or slot or both

It seems this is happening because DPC latency. Latencymon shows it’s very high on amd and directx drivers.

What’s considered high DPC latency? Have you checked bare metal Windows to get a baseline? and compare?