GPU Passthrough Audio solution

So yesterday I configured PCI passthrough to a Windows 10 guest on an Arch Linux host in just under 8 hours. (Thanks @wendell). My problem is that passing through my USB DAC for audio in the Windows VM results in crackling and distorted audio with occasional driver crashes.

What I want is a way of either:
-Having clean and undistorted (USB) audio on my Windows VM
or
-Streaming all Windows audio over the network to my Linux host (similar to Synergy but for audio). Does such a program exist?

Full system specs:

CPU: Intel i5 4440
M/B: MSI B85 G43
RAM: 8GB DDR3 1600
GPU: MSI GTX 980
USB DAC: FiiO E10K

For my Linux host I'm running Arch with the 4.5.4-1-vfio Kernel and KDE as my desktop environment.

EDIT: I guess I should point out that I don't really want to use the HDMI audio from my GPU, as my monitor's headphone out really sucks.

For the best quality and lowest latency audio you could always passthrough a PCIe sound card

Yeah, thing is that I already have a nice USB DAC, seems a shame to let it go to waste. Do you think I would have more success passing through a PCI USB expansion card with my DAC plugged into that?

Sorry I should read posts properly the first time around ;) It sounds like a Windows problem, so try older/newer drivers etc. Even try booting up a windows install on a spare HDD/SSD and check if it's working right

DAC works fine on my bare metal windows install. Also im not entirely sure that it's driver related. It's a documented issue with Virtual Box:

https://www.virtualbox.org/ticket/15189
https://forums.virtualbox.org/viewtopic.php?f=7&t=44079

Ill try messing around with drivers for a bit anyway.

Well, the drivers that were causing system hangs earlier now apparrently work fine. Thanks Microsoft! /s

Now onto solving my next problem.

1 Like

Passthrough a pcie USB adapter ? E.g. buy one or use a mobo with asmedia

Assuming you are using qemu, you can try to use qemu audio parameters like QEMU_AUDIO_TIMER_PERIOD=10 qemu-system-x86_64 ... and try to shutdown any audio/cpu intensive (music player, file scanners, etc) on the linux side that might interfere withe your soundcard.

You can also try some of the tips from here.

@wendell @nakamura

Right, it would seem that all i need to do is pass the
-soundhw hda
argument to QEMU. This "should" allow me to get audio from my guest on my host? The problem is (because I'm lazy I configured my VM through virt-manager. I've tried editing the XML with
sudo virsh edit win10
and I added these lines to the bottom (but before </domain>)

<qemu:commandline>
   <qemu:arg value='-soundhw'/>
   <qemu:arg value='hda'/>
</qemu:commandline>

I also added <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> to the top of the XML

The problem is that I now get the error:
qemu-system-x86_64: -device vfio-pci,host=01:00.0,id=hostdev1,bus=pci.0,addr=0x2: PCI: slot 2 function 0 not available for vfio-pci, in use by intel-hda

I assume this is what @wendell talks about on the wiki but I'm still not entirely sure how to fix it. Can I somehow change the PCI slot that the "intel-hda" module uses?

Many thanks
R

You probably need to blacklist intel-hda, as long as your main sound card isn't using it.

Can I just do:
echo "blacklist intel-hda" >> /etc/modprobe.d/blacklist.conf ?

Yes, but do lspci - vv to make sure nothing else (IE your main sound output for Linux) is using intel-hda first!

After blacklisting intel-hda and reboot my main sound still works in linux but the error was not fixed.

You did blacklist it as root, right?

yup

Make sure the line is actually there, sudo cat /etc/modprobe.d/blacklist.conf. Then I guess run lspci - vv which will print what is loading what driver.

OK so I tried also blacklisting snd_intel_hda which seems to be what is used by my mobo onboard sound. This made no difference.

Then I replaced -soundhw hda in the XML to -device usb-audio as mentioned on the wiki. The VM now boots and I have an audio interface called "Speakers" which is defied as a USB audio device, but still no sound from the VM on the host.

EDIT: cat /etc/modprobe.d/blacklist.conf shows that the lines definately are being written

I find passing through audio hit and miss. Why not pass through your USB DAC to Windows and keep your motherboard sound for Linux?

I could do that. It's just that I'd like to be able to have sounds from both systems come through on one set of headphones without needing to change outputs.

Get an AUX cable from your DAC to your PCs line in (or vice versa)