From 50bdc3f1d1bfed97ee3904d3f38d18cbfa02e940 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 17 Nov 2021 18:58:18 +0000 Subject: [PATCH] kodi.sh.in: Disable pulse when launching --- tools/Linux/kodi.sh.in | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/Linux/kodi.sh.in b/tools/Linux/kodi.sh.in index 78117b5314903..d39cb9e3ecb04 100644 --- a/tools/Linux/kodi.sh.in +++ b/tools/Linux/kodi.sh.in @@ -49,6 +49,10 @@ do LIBDIR="$2" shift; shift ;; + --pulse) + WANT_PULSE=1 + shift + ;; --windowing) WINDOWING="$2" echo "$SAVED_ARGS" | sed "s/--windowing[ ]*$2//g" @@ -203,6 +207,12 @@ if command_exists gdb; then fi fi +if [ "$WANT_PULSE" != "1" ] && pactl list > /dev/null 2>&1 ; then + systemctl --user stop pulseaudio.socket + systemctl --user stop pulseaudio.service + PULSE_STOPPED=1 +fi + LOOP=1 while [ $(( $LOOP )) = "1" ] do @@ -225,5 +235,9 @@ done if [ -f "/usr/bin/cec-daemon" ]; then sudo service cec start >/dev/null 2>&1 fi +if [ "$PULSE_STOPPED" = "1" ]; then + systemctl --user start pulseaudio.service + systemctl --user start pulseaudio.socket +fi exit $RET