From 78c69c09c7c31e87b720c505e60097297b1d53e4 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 28 Oct 2021 16:28:38 +0200 Subject: [run-virt] Add PulseAudio support --- .../data/opt/openslx/vmchooser/run-virt.d/setup_sound.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'core/modules/run-virt/data/opt/openslx') diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_sound.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_sound.inc index e596b0f2..5c8e2870 100644 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_sound.inc +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_sound.inc @@ -19,10 +19,12 @@ setup_sound() { # Default to maximum volume notempty VOL || VOL="100%" - if ! check_dep pactl || [ "$(amixer | grep -c '^Simple mixer' )" -gt 3 ]; then - check_dep amixer && set_sound_alsa + # If we don't have pulse, or more than three output devices, try to set up alsa + if ! command -v pactl > /dev/null || [ "$(amixer | grep -c '^Simple mixer' )" -gt 3 ]; then + command -v amixer > /dev/null && set_sound_alsa fi - if check_dep pactl; then + # pactl exists, assume we're running PA + if command -v pactl > /dev/null; then set_sound_pulse fi writelog --quiet "Done setting up volume." -- cgit v1.2.3-55-g7522