From 666c0caddafe0cf9ba0d8753f415a8931497fe89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?= Date: Sat, 11 May 2024 13:05:20 +0200 Subject: [PATCH] Improve load of modules for dynamic switch --- rootfs/init | 6 +----- rootfs/qubes.SetAudioVM | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/rootfs/init b/rootfs/init index 9208b2b..2c15f21 100755 --- a/rootfs/init +++ b/rootfs/init @@ -51,11 +51,7 @@ if [ -n "$audio_model" ] ; then if [ "$domid" -ge 0 ]; then pulseaudio --use-pid-file=no --daemonize=no --exit-idle-time=-1 -n \ -L "module-native-protocol-unix auth-anonymous=1 socket=/tmp/pa.sock" \ - -L "module-vchan-sink domid=$domid" \ - -L "module-always-sink" \ - -L "module-always-source" \ - -L "module-null-sink" \ - -L "module-null-source" & + -L "module-vchan-sink domid=$domid" & else pulseaudio --use-pid-file=no --daemonize=no --exit-idle-time=-1 -n \ -L "module-native-protocol-unix auth-anonymous=1 socket=/tmp/pa.sock" \ diff --git a/rootfs/qubes.SetAudioVM b/rootfs/qubes.SetAudioVM index 398cdd6..0aafddf 100755 --- a/rootfs/qubes.SetAudioVM +++ b/rootfs/qubes.SetAudioVM @@ -7,6 +7,9 @@ domid="${1:-0}" export PULSE_SERVER=unix:/tmp/pa.sock +for module in module-always-sink module-always-source module-null-sink module-null-source; do + pactl load-module $module || true +done pactl unload-module module-vchan-sink if [ "$domid" -ge 0 ]; then