[vfio-users] Stuttering audio when passing through USB controller

Scott shewless at unleashed-web.org
Fri Feb 3 20:21:48 UTC 2017


So you're passing the entire usb controller through? Why not just pass the
USB device itself through?  Something like:

    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x045e'/>
        <product id='0x070f'/>
      </source>
    </hostdev>

That may not fix your issue but it's probably simpler.

Also did you change the sample rate to DVD quality (to match your host)?

On Fri, Feb 3, 2017 at 2:53 PM, Tmplt <tmplt at dragons.rocks> wrote:

> I saw on an older thread here that passing a USB controller through and
> using a USB soundcard through it solved that users audio issues. I tried
> that myself by adding
>
>     <hostdev mode='subsystem' type='pci' managed='no'>
>       <source>
>         <address domain='0x0000' bus='0x00' slot='0x14' function='0x0'/>
>       </source>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
> function='0x0'/>
>     </hostdev>
>
> to the .xml-file, but I can still hear frequent audio stutters akin to
> my quoted thread. Am I passing the controller incorrectly? The device
> I'm trying to play through is a FiiO e10k DAC which works without issue
> on the host and on bare-metal Windows 8.1.
>
> Here follows my windows-pciusb.xml:
>
> <domain type='kvm'>
>   <name>windows-pciusb</name>
>   <uuid>7353cd48-34ee-4a26-b8ac-7c5d1735777a</uuid>
>   <memory unit='KiB'>8388608</memory>
>   <currentMemory unit='KiB'>8388608</currentMemory>
>   <vcpu placement='static'>4</vcpu>
>   <iothreads>2</iothreads>
>   <cputune>
>     <vcpupin vcpu='0' cpuset='0'/>
>     <vcpupin vcpu='1' cpuset='1'/>
>     <vcpupin vcpu='2' cpuset='2'/>
>     <vcpupin vcpu='3' cpuset='3'/>
>   </cputune>
>   <os>
>     <type arch='x86_64' machine='pc-i440fx-2.7'>hvm</type>
>     <loader readonly='yes'
> type='pflash'>/usr/share/ovmf/x64/ovmf_x64.bin</loader>
>     <nvram>/var/lib/libvirt/qemu/nvram/windows_VARS.fd</nvram>
>     <bootmenu enable='no'/>
>   </os>
>   <features>
>     <acpi/>
>     <apic/>
>     <hyperv>
>       <relaxed state='on'/>
>       <vapic state='on'/>
>       <spinlocks state='on' retries='8191'/>
>     </hyperv>
>     <vmport state='off'/>
>   </features>
>   <cpu mode='host-passthrough'>
>     <topology sockets='1' cores='4' threads='1'/>
>   </cpu>
>   <clock offset='localtime'>
>     <timer name='rtc' tickpolicy='catchup'/>
>     <timer name='pit' tickpolicy='delay'/>
>     <timer name='hpet' present='no'/>
>     <timer name='hypervclock' present='yes'/>
>   </clock>
>   <on_poweroff>destroy</on_poweroff>
>   <on_reboot>restart</on_reboot>
>   <on_crash>restart</on_crash>
>   <pm>
>     <suspend-to-mem enabled='no'/>
>     <suspend-to-disk enabled='no'/>
>   </pm>
>   <devices>
>     <emulator>/usr/sbin/qemu-system-x86_64</emulator>
>     <disk type='block' device='disk'>
>       <driver name='qemu' type='raw' cache='none' io='threads'
> iothread='1'/>
>       <source dev='/dev/sda'/>
>       <target dev='vdb' bus='virtio'/>
>       <boot order='3'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x08'
> function='0x0'/>
>     </disk>
>     <disk type='block' device='disk'>
>       <driver name='qemu' type='raw' cache='none' io='threads'
> iothread='2'/>
>       <source dev='/dev/sde2'/>
>       <target dev='vdc' bus='virtio'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x0c'
> function='0x0'/>
>     </disk>
>     <controller type='usb' index='0' model='ich9-ehci1'>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x05'
> function='0x7'/>
>     </controller>
>     <controller type='usb' index='0' model='ich9-uhci1'>
>       <master startport='0'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x05'
> function='0x0' multifunction='on'/>
>     </controller>
>     <controller type='usb' index='0' model='ich9-uhci2'>
>       <master startport='2'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x05'
> function='0x1'/>
>     </controller>
>     <controller type='usb' index='0' model='ich9-uhci3'>
>       <master startport='4'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x05'
> function='0x2'/>
>     </controller>
>     <controller type='pci' index='0' model='pci-root'/>
>     <controller type='ide' index='0'>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
> function='0x1'/>
>     </controller>
>     <controller type='virtio-serial' index='0'>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x06'
> function='0x0'/>
>     </controller>
>     <interface type='network'>
>       <mac address='52:54:00:0d:18:bf'/>
>       <source network='default'/>
>       <model type='virtio'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
> function='0x0'/>
>     </interface>
>     <input type='mouse' bus='ps2'/>
>     <input type='keyboard' bus='ps2'/>
>     <sound model='ich6'>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x04'
> function='0x0'/>
>     </sound>
>     <hostdev mode='subsystem' type='pci' managed='yes'>
>       <source>
>         <address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
>       </source>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x09'
> function='0x0'/>
>     </hostdev>
>     <hostdev mode='subsystem' type='pci' managed='yes'>
>       <source>
>         <address domain='0x0000' bus='0x02' slot='0x00' function='0x1'/>
>       </source>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x0a'
> function='0x0'/>
>     </hostdev>
>     <hostdev mode='subsystem' type='pci' managed='yes'>
>       <source>
>         <address domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
>       </source>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x0b'
> function='0x0'/>
>     </hostdev>
>     <hostdev mode='subsystem' type='usb' managed='yes'>
>       <source>
>         <vendor id='0x045e'/>
>         <product id='0x028e'/>
>       </source>
>       <address type='usb' bus='0' port='1'/>
>     </hostdev>
>     <hostdev mode='subsystem' type='pci' managed='no'>
>       <source>
>         <address domain='0x0000' bus='0x00' slot='0x14' function='0x0'/>
>       </source>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
> function='0x0'/>
>     </hostdev>
>     <memballoon model='virtio'>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x07'
> function='0x0'/>
>     </memballoon>
>   </devices>
> </domain>
>
> lsusb reports that everything goes to the same, single USB controller,
> which is what I pass. Could that be the issue? I'm qouting my last
> thread in case any info there helps.
>
> Thanks in advance!
>
> On 01/29/2017 12:38 AM, Tmplt wrote:
> > I forgot to mention: I'm using the linux-vfio kernel, v4.8.13, and my
> > only kernel options are intel_iommu=on and pcie_acs_override=downstream.
> >
> > On 01/28/2017 06:13 AM, Tmplt wrote:
> >> Having spent some hours (unsucessfully) to get stutter-free audio via
> >> Pulseaudio (and ALSA) have left me with the options of either dual
> >> booting or letting dedicated hardware handle the audio, which I can then
> >> mix together into a single output.
> >>
> >> However, passing only the GPU as a soundcard and listening to the audio
> >> via my monitor's headphone jack, there is some noticable audio
> >> stuttering. While only noticable when running some more heavier games
> >> (e.g. Battlefield 1), I'm guessing this shouldn't be the case, and that
> >> I've configured something incorrectly. Especially since I've enabled
> >> MSIs for both the GPU and the GPUs audio device.
> >>
> >> Here is what my system is:
> >> CPU:  i5-6600k @ stock
> >> MOBO: ASUS Z170-A
> >> RAM:  16GB DDR4 at 2133Mhz (I think, could be 1600)
> >> GPU:  ASUS R9 290 (for the VM; reference card)
> >>
> >> HOST OS:  Arch Linux
> >> GUEST OS: Windows 8.1
> >>
> >> I run my VM via qemu (2.8.0) and libvirt (2.4.0).
> >>
> >> When Windows was installed it automatically enabled MSI for the GPU. I
> >> manually enabled it for the audio device, rebooted, and confirmed that
> >> they both appeared below the IRQ drop-down in the device manager.
> >>
> >> It can be worth of note that I flashed my card with a UEFI-bios some
> >> time ago so that it got passed-through without issue. I can't recall
> >> whether this was required for my qemu config at the time or if a
> >> non-UEFI card can't be passed through. I'm also not sure if both BIOSes
> >> (there is a switch to toggle between the two on my card) are overwritten
> >> during the flash, or just the current one. Either case, the topical
> >> issue is present on both settings.
>
> _______________________________________________
> 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/20170203/8cf886ca/attachment.htm>


More information about the vfio-users mailing list