Debian-minimal template for sys-audio

I managed to configure a deb11-min-audio template, as the template of sys-audio.

Name one copy of debian-11-minimal deb11-min-audio.Run these commands in it:

  1. apt install qubes-usb-proxy qubes-input-proxy-sender gnome-keyring alsa-utils alsa-oss alsa-ucm-conf alsa-firmware-loaders
  2. apt install pavucontrol pulseaudio qubes-core-admin-client qubes-gui-daemon-pulseaudio pulseaudio-qubes —no-install-recommends

Then, create sys-audio based on deb11-min-audio.

Edit 50-sys-audio.policy in dom0 at /etc/qubes/policy.d/, enter these lines:

admin.Events * sys-audio sys-audio allow target=dom0
admin.Events * sys-audio @adminvm allow target=dom0
admin.Events * sys-audio @tag:audiovm-sys-audio allow target=dom0
admin.vm.CurrentState * sys-audio 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 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.property.Get +stubdom_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 +keyboard_layout sys-audio @tag:audiovm-sys-audio allow target=dom0
admin.vm.property.GetAll * sys-audio sys-audio allow target=dom0
admin.vm.property.GetAll * sys-audio @tag:audiovm-sys-audio allow target=dom0
admin.vm.property.GetAll * sys-audio @adminvm allow target=dom0
admin.vm.property.Set +keyboard_layout sys-audio * allow target=dom0

Note that perhaps not all of these lines are needed. But these are sufficient.

Then run qubes-prefs default_audiovm sys-audio in dom0.
In Qubes-Settings of sys-audio, turn to “Services” page, “Add” a “(custom…)” service called “audiovm”.

Start sys-audio, make pulseaudio autostart in it.
Also add qvm-start-daemon --all --watch to autostart.
(These two actions may or may not be necessary.)

Then it works like magic.

If you encounter problem with your soundcard, try these:
sudo alsactl init in sys-audio.
Make a file called “snd.conf” in deb11-min-audio at /etc/modprobe.d/, add the line
options snd_hda_intel power_save=0

6 Likes