Proper guide on how to use sys-audio (AudioVM) must be created

FINALLY figured it out! FINALLY getting some good quality audio on Qubes! It was indeed this bug that broke pulseaudio configuration on Qubes, so I dunno how y’all are getting your audio to work without patching? Anyway, as I use debian for services, I needed to patch /usr/lib/python3/dist-packages/qubesadmin/tools/qvm_start_daemon.py and then it all works even with sys-audio’s audiovm set to none.

So here’s my guide for sys-usb-audio:

  1. In debian-minimal template install the following packages:

    • qubes-audio-daemon
    • qubes-core-admin-client
    • qubes-usb-proxy
    • alsa-utils
    • pavucontrol
    • pasystray
  2. In dom0 create /etc/qubes/policy.d/40-sys-audio.policy file with the following content:

admin.Events   *                         sys-audio   @adminvm                 allow   target=dom0
admin.Events   +domain-stopped           sys-audio   @tag:audiovm-sys-audio   allow   target=dom0
admin.Events   +domain-shutdown          sys-audio   @tag:audiovm-sys-audio   allow   target=dom0
admin.Events   +domain-start             sys-audio   @tag:audiovm-sys-audio   allow   target=dom0
admin.Events   +connection-established   sys-audio   @tag:audiovm-sys-audio   allow   target=dom0

admin.vm.CurrentState   *   sys-audio   @adminvm                 allow   target=dom0
admin.vm.CurrentState   *   sys-audio   @tag:audiovm-sys-audio   allow   target=dom0
admin.vm.List           *   sys-audio   @adminvm                 allow   target=dom0
admin.vm.List           *   sys-audio   @tag:audiovm-sys-audio   allow   target=dom0

admin.vm.property.Get                +audiovm       sys-audio   @tag:audiovm-sys-audio   allow   target=dom0
admin.vm.property.Get                +xid           sys-audio   @tag:audiovm-sys-audio   allow   target=dom0
admin.vm.feature.CheckWithTemplate   +audio         sys-audio   @tag:audiovm-sys-audio   allow   target=dom0
admin.vm.feature.CheckWithTemplate   +audio-model   sys-audio   @tag:audiovm-sys-audio   allow   target=dom0
admin.vm.property.Get                +stubdom_xid   sys-audio   @tag:audiovm-sys-audio   allow   target=dom0
  1. Patch /usr/lib/python3/dist-packages/qubesadmin/tools/qvm_start_daemon.py in the template as described in the link above.
  2. Make a sys-usb-audio qube based on a debian-minimal template and add audiovm service in its services tab.
  3. Change sys-usb-audio audiovm property to none by running a command qvm-prefs sys-usb-audio audiovm none in dom0, so that you could restart it when needed.
  4. Change the default audiovm to sys-usb-audio by running a command qvm-prefs default_audiovm sys-usb-audio in dom0.
  5. Start sys-usb-audio and check that pavucontol is connected to pulseaudio and displays client audio streams even after restart of client vms, and redirects the output to dummy output (as we don’t have a connected audio device yet).
  6. Congratulations, your qubes pulseaudio configuration works as expected! Attach a usb audio card to your sys-usb-audio and the output should get redirected to it on the fly!

Side note: on debian all you really need is pipewire-pulse for audio to work.

Also, I have a question: how come policy file references @tag:audiovm-sys-audio even though qvm-tags doesn’t list this tag for my sys-usb-audio? Is this some hidden system tag that gets set automatically for each vm?

1 Like