QEMU+OVMF Win 8.1 VM no audio

Hello there!

I have successfully passed through a GPU to a Win 8.1 VM and everything works.
Except for audio.
The only audio drivers that Windows seems to recognize are the ich6 and ich9, but neither of them let me hear anything out of my host system.
15 minutes of duckduckgo have not helped me progress, I tried the vnc_allow_host_audio = 1 thing, nothing changed.
For the record, I am just using ALSA if that makes any big difference.

Help would be appreciated, as the whole project would be useless without audio.

Usually when doing GPU Passthrough, we don't use virtual sound drivers. That said, vnc_allow_host_audio = 1 only works if you're using VNC to connect to the system.

What I do, is pass my Logitech G35 headset to the VM or use the HDMI Audio from my 970.

You didn't mention if you are using qemu or virt-manager, so I going assume qemu since it is what I use.

I use the parameter -soundhw hda in qemu in order to windows to detect a intel high definition card.

I also use QEMU_AUDIO_DRV before the qemu command, since you use alsa you can use:

  • QEMU_ENV="QEMU_AUDIO_DRV=alsa QEMU_AUDIO_TIMER_PERIOD=0 qemu-system-x86_64 ...
  • QEMU_ENV="QEMU_AUDIO_DRV=alsa QEMU_ALSA_DAC_BUFFER_SIZE=4096 QEMU_ALSA_DAC_PERIOD_SIZE=0 qemu-system-x86_64 ...

You can use qemu-system-x86_64 -audio-help to know the current supported drivers and parameters.

If this didn't work or you are using virtmanager you can also:

  • Use the audio hdmi for you gpu (if you gpu as as one)
  • Pass pci soundcard and use it
  • Pass usb soundcard and use it (most common solution)

Using the latest version of virtmanager it will work. You have to enable the few options in the qemu.conf to allow host audio.

See here: