[vfio-users] No hdmi audio on AMD R7 370 w/ libvirt

Brian Chow brianchow at digitaldescent.net
Wed Nov 30 19:43:12 UTC 2016


Resending as I forgot to reply-all/include the mailing list.  The below
suggestions didn't work, unfortunately.  Does anyone have any other ideas?
---



On Sun, Nov 27, 2016 at 11:02 AM, Muted Bytes <mutedbytes at gmail.com> wrote:

> On Sun, Nov 27, 2016 at 1:38 AM, Brian Chow
> <brianchow at digitaldescent.net> wrote:
> > I converted my Win10 VM over to a full libvirt VM, removing qemu command
> > line args from the XML, and I no longer have functioning HDMI audio.  The
> > device shows up in device manager as OK, and it detects my monitor as the
> > speakers, which is also correct, but no audio plays, when and when I
> attempt
> > to to configure the speakers/test the audio, I get a message that the
> test
> > tone cannot be played.  Does anyone know what I need to tweak to get it
> > working again?  I moved off the qemu command args style because a
> > system/libvirt/qemu update a while ago changed how the permissions were
> > working and that broke passthrough for me.  I also saw Alex recommend not
> > using qemu command args a while back.  Video passthrough IS working.
> >
> > Thanks in advance!
> >
> > My XML is as follows:
> >
> > <domain type='kvm' id='3'>  <name>starscream</name>
> > <uuid>d18b5dce-5bdf-4db7-87b6-e0c6b2479b0f</uuid>  <memory
> > unit='KiB'>7813120</memory>  <currentMemory
> > unit='KiB'>7812500</currentMemory>  <memoryBacking>    <hugepages/>
> > </memoryBacking>  <vcpu placement='static' current='2'>4</vcpu>
> <cputune>
> > <vcpupin vcpu='0' cpuset='2'/>    <vcpupin vcpu='1' cpuset='3'/>
> <vcpupin
> > vcpu='2' cpuset='6'/>    <vcpupin vcpu='3' cpuset='7'/>  </cputune>
> > <resource>    <partition>/machine</partition>  </resource>  <os>
> <type
> > arch='x86_64' machine='pc-i440fx-2.4'>hvm</type>    <loader
> readonly='yes'
> > type='pflash'>/usr/share/OVMF/OVMF-pure-efi.fd</loader>    <nvram
> > template='/kvm/starscream/OVMF-starscream.fd'>/var/lib/
> libvirt/qemu/nvram/starscream_VARS.fd</nvram>
> > <bootmenu enable='yes'/>  </os>  <features>    <acpi/>    <hyperv>
> > <relaxed state='on'/>      <vapic state='on'/>      <spinlocks state='on'
> > retries='8191'/>    </hyperv>    <kvm>      <hidden state='on'/>
> </kvm>
> > </features>  <cpu mode='host-passthrough'>    <topology sockets='1'
> > cores='2' threads='2'/>  </cpu>  <clock offset='variable'
> > adjustment='-28801' basis='utc'>    <timer name='hypervclock'
> > present='yes'/>  </clock>  <on_poweroff>destroy</on_poweroff>
> > <on_reboot>restart</on_reboot>  <on_crash>destroy</on_crash>  <devices>
> > <emulator>/usr/bin/qemu-system-x86_64</emulator>    <disk type='block'
> > device='disk'>      <driver name='qemu' type='raw'/>      <source
> > dev='/dev/zvol/htpc/vm/starscream1'/>      <backingStore/>      <target
> > dev='vda' bus='virtio'/>      <boot order='1'/>      <alias
> > name='virtio-disk0'/>      <address type='pci' domain='0x0000' bus='0x00'
> > slot='0x07' function='0x0'/>    </disk>    <disk type='block'
> device='disk'>
> > <driver name='qemu' type='raw'/>      <source
> > dev='/dev/zvol/htpc/vm/starscream2'/>      <backingStore/>      <target
> > dev='vdb' bus='virtio'/>      <alias name='virtio-disk1'/>      <address
> > type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
> > </disk>    <disk type='file' device='cdrom'>      <driver name='qemu'
> > type='raw'/>      <backingStore/>      <target dev='hda' bus='ide'/>
> > <readonly/>      <alias name='ide0-0-0'/>      <address type='drive'
> > controller='0' bus='0' target='0' unit='0'/>    </disk>    <disk
> type='file'
> > device='cdrom'>      <driver name='qemu' type='raw'/>
> <backingStore/>
> > <target dev='hdb' bus='ide'/>      <readonly/>      <alias
> name='ide0-0-1'/>
> > <address type='drive' controller='0' bus='0' target='0' unit='1'/>
> > </disk>    <controller type='usb' index='0' model='piix3-uhci'>
> <alias
> > name='usb'/>      <address type='pci' domain='0x0000' bus='0x00'
> slot='0x01'
> > function='0x2'/>    </controller>    <controller type='pci' index='0'
> > model='pci-root'>      <alias name='pci.0'/>    </controller>
> <controller
> > type='ide' index='0'>      <alias name='ide'/>      <address type='pci'
> > domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>    </controller>
> > <controller type='virtio-serial' index='0'>      <alias
> > name='virtio-serial0'/>      <address type='pci' domain='0x0000'
> bus='0x00'
> > slot='0x02' function='0x0'/>    </controller>    <controller type='sata'
> > index='0'>      <alias name='sata0'/>      <address type='pci'
> > domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>    </controller>
> > <interface type='bridge'>      <mac address='52:54:00:f7:64:f4'/>
> > <source bridge='br0'/>      <target dev='vnet0'/>      <model
> > type='virtio'/>      <alias name='net0'/>      <address type='pci'
> > domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>    </interface>
> > <console type='pty' tty='/dev/pts/2'>      <source path='/dev/pts/2'/>
> > <target type='virtio' port='0'/>      <alias name='console0'/>
> </console>
> > <input type='mouse' bus='ps2'>      <alias name='input0'/>    </input>
> > <input type='keyboard' bus='ps2'>      <alias name='input1'/>    </input>
> > <hostdev mode='subsystem' type='pci' managed='yes'>      <driver
> > name='vfio'/>      <source>        <address domain='0x0000' bus='0x01'
> > slot='0x00' function='0x0'/>      </source>      <alias name='hostdev0'/>
> > <rom bar='on'/>      <address type='pci' domain='0x0000' bus='0x00'
> > slot='0x08' function='0x0' multifunction='on'/>    </hostdev>    <hostdev
> > mode='subsystem' type='pci' managed='yes'>      <driver name='vfio'/>
> > <source>        <address domain='0x0000' bus='0x01' slot='0x00'
> > function='0x1'/>      </source>      <alias name='hostdev1'/>      <rom
> > bar='on'/>      <address type='pci' domain='0x0000' bus='0x00'
> slot='0x09'
> > function='0x0' multifunction='on'/>    </hostdev>    <hostdev
> > mode='subsystem' type='pci' managed='yes'>      <driver name='vfio'/>
> > <source>        <address domain='0x0000' bus='0x05' slot='0x00'
> > function='0x0'/>      </source>      <alias name='hostdev2'/>
> <address
> > type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
> > </hostdev>    <memballoon model='virtio'>      <alias name='balloon0'/>
> > <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
> function='0x0'/>
> > </memballoon>  </devices>  <seclabel type='none' model='none'/>
> <seclabel
> > type='dynamic' model='dac' relabel='yes'>    <label>+1000:+78</label>
> > <imagelabel>+1000:+78</imagelabel>  </seclabel></domain>
> >
> >
> > _______________________________________________
> > vfio-users mailing list
> > vfio-users at redhat.com
> > https://www.redhat.com/mailman/listinfo/vfio-users
> >
>
> >I'm assuming this is the relevant gpu stuff, with gpu at 0000:01:00.0
> >and hdmi audio at 0000:01:00.1:
> >
> ><hostdev mode='subsystem' type='pci' managed='yes'>
> >  <driver name='vfio'/>
> >  <source>
> >    <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
> >  </source>
> >  <alias name='hostdev0'/>
> >  <rom bar='on'/>
> >  <address type='pci' domain='0x0000' bus='0x00' slot='0x08'
> >function='0x0' multifunction='on'/>
> ></hostdev>
> ><hostdev mode='subsystem' type='pci' managed='yes'>
> > <driver name='vfio'/>
> >  <source>
> >    <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
> >  </source>
> >  <alias name='hostdev1'/>
> >  <rom bar='on'/>
> >  <address type='pci' domain='0x0000' bus='0x00' slot='0x09'
> >function='0x0' multifunction='on'/>
> ></hostdev>
> >
> >On host, audio is defined as additional function in same slot, so I
> >usually assign to guest in the same way, so that yours would be at
> >slot='0x08' function='0x1', but not sure if this really matters or if
> >this is what your problem is. multifunction='on' would also be removed
> >for function 1.
>
> >You might also try virsh's domxml-to-native command to see the
> >generated qemu command + args to see if anything funny is happening in
> >the actual vm launch (audio related stuff etc).
>

-----
Yes, sorry, that is the relevant GPU part of the XML.  I tried removing the
multifunction attribute on the secondary function (hdmi audio) and that
didn't change anything.  I also tried changing the slot/function as you
mentioned.  The device re-enumerated and appears the same as before inn
device manager -- it does show up correctly.  Unfortunately, the same end
result of no audio, and windows saying it couldn't play the test sound.

I'm including what was in my old start script for comparison -- the
01:00.[0,1] device is the GPU., 05:00 is a usb controller:

qemu-system-x86_64 \
        -name starscream \
        -enable-kvm \
        -m 8192 \
        -cpu host,kvm=off \
        -smp 4,sockets=1,cores=4,threads=1 \
        -drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF-pure-efi.fd
\
        -drive if=pflash,format=raw,file=/kvm/starscream/OVMF-starscream.fd
\
        -drive file=/kvm/starscream/starscream.img,if=virtio,format=raw \
        -drive file="",format=raw,id=optical1,if=none -device
ide-cd,bus=ide.1,drive=optical1 \
        -net nic,macaddr=52:54:00:f7:64:f4,model=virtio \
        -net bridge,br=br0 \
        -device
ioh3420,bus=pci.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1
\
        -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,
\
        -device vfio-pci,host=01:00.1,bus=root.1,addr=00.1,multifunction=on
\
        -device vfio-pci,host=05:00.0 \
        -vga none \
        -boot menu=on \
        -nographic
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/vfio-users/attachments/20161130/8fe410b0/attachment.htm>


More information about the vfio-users mailing list