No sound from QEMU vm

Issues related to applications and software problems and general support
Post Reply
rob153
Posts: 22
Joined: 2020/05/17 13:52:00

No sound from QEMU vm

Post by rob153 » 2020/05/17 14:36:50

Hello,

I've set up a CentOS 8 host and am using QEMU to run a Windows 10 VM with passthrough of a dedicated GPU. Everything works nicely except for sound: I can't manage to get any sound to play. The Windows guest seems to think there is a working sound device, everything inside the guest looks fine and there is a volume control there too. However, no sound plays on the host. PulseAudio Volume Control does not list a playback device for the corresponding VM.

I should add that on the same host, I am also running three Linux guests. All of those guests are listed as playback streams in PulseAudio Volume Control and produce sound output without problems. It appears to me it must either be the fact that this is a Windows guest, the fact that it uses GPU passthrough instead of a virtual display, or an interplay of both that creates this issue.

I've googled a lot already and tried all the solutions I came across:
  • Tried switching between the available virtual audio devices AC97, ich6 and ich9
  • Many sources suggest to add

    Code: Select all

    <qemu:commandline>
      <qemu:env name='QEMU_AUDIO_DRV' value='pa'/>
      <qemu:env name='QEMU_PA_SERVER' value='/run/user/1000/pulse/native'/>
    </qemu:commandline>
    
    to the guest's XML config. Although I dislike doing random things which I don't properly understand, I added this, but no change.
  • I've also tried what's suggested here:
    https://wiki.archlinux.org/index.php/Pu ... _same_time
  • I've also added to /etc/libvirt/qemu.conf the option

    Code: Select all

    nographics_allow_host_audio=1
    
So far I did all of this to no avail, there is no change to the symptoms. Any help would very much be appreciated!

rob153
Posts: 22
Joined: 2020/05/17 13:52:00

Re: No sound from QEMU vm

Post by rob153 » 2020/05/20 22:39:15

Update on this: I figured out why it can't possibly work the way I intended. With the setup shown, the log file contains the error

Code: Select all

audio: unknown audio driver `pa'
Running

Code: Select all

/usr/libexec/qemu-kvm -audio-help
lists all the available audio drivers and PulseAudio is not listed. After some more searching (see e.g. https://forum.level1techs.com/t/kvm-qem ... dio/135350), it seems that a package called "qemu-audio-pa" needs to be installed first, but this doesn't seem to be available for CentOS 8? Possibly, it's not compatible with the QEMU version that comes with CentOS 8?

Looks like I might have to resort to a hardware solution, i.e. get an extra sound card to pass through to the VM and connect to the line-in of the existing sound card.

Or does anyone have suggestions what else I might try?

Post Reply