I have a well-working PCI-passthrough setup with NixOS using libvirt, where audio from the guest is piped into Pulseaudio. This works, just only not during a reboot where the state of the guest is resumed; if the host is restarted without first shutting down the guest I’m unable to properly start Pulseaudio — the guest must first be shut down before restarting the host.
If this is not done, manual invocation of Pulseaudio yields “bind(): Address already in use”. Running
pulseaudio -k yields “No such process”.
As a work-around I tried to apply
virtualisation.libvirtd.onShutdown = "shutdown" but this, oddly enough, had no effect.
I figure I could resolve this by making sure guests aren’t resumed until Pulseaudio have been fully started. How would I do this?