Virt Manager / QEMU audio patching

So, the question is, does anyone know how to have virtmanager/qemu automatically patch the VM audio to a specified host audio sink?

I’m using pipewire for my main system sound and it’s been working quite well so far. I’ve got a Virtual Machine up and running with PCI Passthrough and barrier to pass my mouse and keyboard back and forth.

I configured the sound via QEMU commandline arguments. No snaps, crackles, pops or lag so far that I’ve noticed. But I haven’t done extensive testing for latency because I’m not using it for audio dev.

Now, the issue I’m having is that I’m sending the VM audio to host using jack. And it’s working. But, It won’t automatically patch into my audio system until I run qjackctrl. When I run qjackctrl I can manually graph the VM audio out to the my audio sink. I can then add the patch permanently with the patchbay. Everything works. Except, The audio won’t patch through until I start qjacktrl everytime I start my VM. I can quit qjackctrl and the audio will still work just fine as it’s now patched. But, if I quit the VM and restart it I will have to re-open qjackctl to have it repatch my audio.

Here are my qemu commandline arguments. Let me know if any other system configs would be handy

  <qemu:commandline>
    <qemu:arg value="-device"/>
    <qemu:arg value="intel-hda,bus=pcie.0,addr=0x1b"/>
    <qemu:arg value="-device"/>
    <qemu:arg value="hda-micro,audiodev=ad0"/>
    <qemu:arg value="-audiodev"/>
    <qemu:arg value="jack,id=ad0"/>
    <qemu:env name="PIPEWIRE_RUNTIME_DIR" value="/run/user/1000"/>
    <qemu:env name="PIPEWIRE_LATENCY" value="512/48000"/>
  </qemu:commandline>

Does this have any relevance?

It doesn’t seem like it. It looks like that’s more to do about configuring the virtual audio devices themselves and is outdated.

I was thinking the issue is less to do with virtmanager/qemu settings and more to do with pipewire/jack settings. Because the audio does work. I just have to connect it by hand from vm-source/output to the sink/input or launch qjackctrl to have its patchbay automatically connect the the vm-source to sink.