How can I play audio from a QEMU guest on RHEL 9?

Posted on

I need to get audio output from a Windows 10 guest on RHEL 9. Using virt-manager, I've added the following to the guest's XML (primarily following directions from here:

<sound model="ich9">
  <address type="pci" domain="0x0000" bus="0x00" slot="0x1b" function="0x0"/>
<audio id="1" type="jack">
  <input mixingEngine="yes" fixedSettings="yes" clientName="win10" connectPorts="capture_*">
    <settings frequency="48000" channels="2" format="f32"/>
  <output mixingEngine="yes" fixedSettings="yes" clientName="win10" connectPorts="playback_*">
    <settings frequency="48000" channels="2" format="f32"/>

This results in a "Sound ich9" card being added in the devices list. I've also gone through the other directions on that page for giving QEMU access to my pipewire socket. I'm still getting no sound though, both with the XML above and with the sound/audio tags copied verbatim (with corresponding changes to the connectPorts names, which for me are capture_FL, capture_FR, output_FL, and output_FR). For some reason, if I add

<alias name='sound0'/>

to the XML and save it, that line gets deleted.

Using the Helvum flatpak, I'm able to verify that connections are made when sounds are played on the host system, but virt-manager and qemu don't even show up. How can I get audio output working?