[vfio-users] Usb sound card passtrough - fail

Scott Herold scott at sherold.net
Wed Sep 16 20:23:42 UTC 2015


On Wed, Sep 16, 2015 at 1:04 PM, Mateusz Górczak <gorczak.mateusz at gmail.com>
wrote:

> Hello,
>
> I have been trying to passtrough my usb sound card (Creative Sound Blaster
> X-Fi Pro USB). My host is arch linux and my guest - win 8.1. I use qemu-kvm
> with ovmf.
>
> Windows recognize my sound card and works perfectly, but after a while
> (about 30 second of playing music), a lot of noises are occured. I also
> install windows 10 (just for compare) the problem are exactly the same. I
> also trying run ubuntu as a guest, but after passtrough my sound card *all
> usb devices turn off *- even the ones, which are not passtrough to guest
> (without passing sound card, ubuntu works perfectly).
>
> On my host (arch) card works great, so there are no problem with the card
> itself (I believe...; also on 'native' Windows there is no problem with the
> card).
>
> Any advice? Qemu doesn't print anything useful.
> If you need more information - just ask.
>
> my config (minimal - only mouse, keyboard and sound card are passtrough to
> guest):
>
> qemu-system-x86_64 -enable-kvm -m 5G -cpu host,kvm=off \
> -smp 4,sockets=1,cores=4,threads=2 \
> -drive
> if=pflash,format=raw,readonly,file=/usr/share/edk2.git/ovmf-x64/OVMF-pure-efi.fd
> \
> -drive
> if=pflash,format=raw,file=/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd
> \
> -device virtio-scsi-pci,id=scsi \
> -drive file=Downloads/virtio-win-0.1.96.iso,id=virtiocd,if=none -device
> ide-cd,bus=ide.1,drive=virtiocd \
> -drive file=ubuntu15.iso,id=isocd,if=none -device scsi-cd,drive=isocd \
> -vga none \
> -drive file=windowsUefi.img,id=disk,format=raw,if=none -device
> scsi-hd,drive=disk \
> -device vfio-pci,host=01:00.0 \
> -device vfio-pci,host=01:00.1 \
> -usb -usbdevice host:09da:1343 \
> -usb -usbdevice host:041e:3237 \
> -usb -usbdevice host:046d:c52b
>

I've spent the last week or so playing with an incredibly similar setup,
and what I've found is that USB Passthrough is simply not good for audio.
I've tried two alternate options, both of which work, one better than the
other.  First, I was able to assign my HDMI audio device from my GPU to my
guest with vfio-pci.  I then ran audio through my monitor (no integrated
speakers) and then to speaker output from my monitor.  I found the audio
levels to be extremely low with that option, with limited ways to increase
volume.

The second option was doing a PCI device assignment of my integrated audio
controller.  This option worked significantly better, as I didn't have to
reconnect any speakers in a different configuration.  Of course, you will
only have audio on either the host or the VM with this option.  There are
still slight pops and noise in the audio, but it's very infrequent, and
typically only in more intensive games at this point.  I found that I could
use the USB sound card on the host without issue in this configuration.

The only problem I've come across in option 2 is that occasionally on VM
poweroff, the PCI audio doesn't get properly recognized by pulseaudio and I
need to run "pulseaudio -k" as non-root user to reestablish sound on the
host.



>
>
> _______________________________________________
> vfio-users mailing list
> vfio-users at redhat.com
> https://www.redhat.com/mailman/listinfo/vfio-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/vfio-users/attachments/20150916/37ec31e1/attachment.htm>


More information about the vfio-users mailing list