[Arch] No sound in windows 10 64bit vm

So I decided my current arch/windows gpu passtrough setup was not good enough and wiped the whole drive to start fresh. The old configuration was just a qemu script with windows 8.1 and ran great. But managing was a bit of a pain sometimes. So I switched over to libvirt with virt-manager and windows 10 still on arch. Everything works except for the sound. This is the current config:


<domain type='kvm'>
<name>win8.1</name>
<uuid>0631e753-a69d-4da0-ae8f-833e695da2d3</uuid>
<memory unit='KiB'>8388608</memory>
<currentMemory unit='KiB'>8388608</currentMemory>
<vcpu placement='static'>4</vcpu>
<os>
<type arch='x86_64' machine='pc-i440fx-2.6'>hvm</type>
<loader readonly='yes' type='pflash'>/usr/share/ovmf/x64/ovmf_x64.bin</loader>
<nvram>/var/lib/libvirt/qemu/nvram/win8.1_VARS.fd</nvram>
<boot dev='hd'/>
<bootmenu enable='no'/>
</os>
<features>
<acpi/>
<apic/>
<hyperv>
<relaxed state='on'/>
<vapic state='on'/>
<spinlocks state='on' retries='8191'/>
<vendor_id state='on' value='whatever'/>
</hyperv>
<kvm>
<hidden state='on'/>
</kvm>
<vmport state='off'/>
</features>
<cpu mode='host-model'>
<model fallback='allow'/>
</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='native'/>
<source dev='/dev/sdb1'/>
<target dev='sda' bus='sata'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/home/miel/Downloads/virtio-win-0.1.118.iso'/>
<target dev='hda' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='usb' index='0' model='ich9-ehci1'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x7'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci1'>
<master startport='0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0' multifunction='on'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci2'>
<master startport='2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x1'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci3'>
<master startport='4'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' 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='0x05' function='0x0'/>
</controller>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</controller>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
**<sound model='ich6'>**
** <codec type='duplex'/>**
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</hostdev>
<redirdev bus='usb' type='spicevmc'>
</redirdev>
<redirdev bus='usb' type='spicevmc'>
</redirdev>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</memballoon>
</devices>
</domain>

Google taught me that i wanted a virtual sound card so I tried using the add hardware -> sound with ac97 and ich6. ac97 had driver issues and ich6 appears to work with windows but doesn't appear in pulseaudio and there is no sound from the vm. I edited the /etc/libvirt/qemu.conf file to vnc_enable_audio_backend = 1 with the same result. I can't seem to find anything that solves it.

I'm not the best at reading KVM XML configurations. For your display, are you running VNC or Spice? I've not run VNC since using KVM+libvirt, but I imagine that because VNC doesn't really do audio, there needs to be additional configuration (or at least additional steps for the machine) to get VM audio talking to Pulse.

I remember hearing somewhere that virtual box and virtualization software requires additional software specifically for audio with arch

dont know much about arch but if you have a pcie sound card windows 10 wont pick it up unless you manually install drivers

at least in my experiance

Sorry for the late response, I did have the sound working on a simple qemu script. (-soundhw hda). But with virtlib setting up a virtual sound card does not work. Windows thinks its working but there is no sound. I have installed all the related drivers and it appears in the device manager. I use the hdmi for windows sound at the moment (nvidia hd audio). It works after 2 attempts every time you try to boot the vm but yeay.

My other guess is that its not really windows but linux. Tried messing around with pulseaudio and even running it on systemlvl but nothing worked so far. Tried reading the redhad documentation about libvirt but the didn't have anything intresting to say about the audio. So im still stuck :p

I'm using a passtroughed gpu and a normal monitor for the display. And I did came across that VNC problem. But the problem might be related. I've edited the pulseaudio conf 20 times at least but could not get it working.