Subject: [PATCH] community/pipewire: kill previous instance before launch

From: Pranjal Kole <[email-masked]>
Date: Fri, 25 Feb 2022 17:12:29 +0530

/usr/bin/pipewire was not being killed previously.

Additionally, the order in which the processes are killed has been
changed to avoid this error message from pipewire-media-session:

[W][77952.698669] ms.core      | [ media-session.c: 2211 core_error()] error id:0 seq:799 res:-32 (Broken pipe): connection error
---
 community/pipewire/pipewire-launcher.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/community/pipewire/pipewire-launcher.sh b/community/pipewire/pipewire-launcher.sh
index 95dcd5efc2..2ef1da3815 100644
--- a/community/pipewire/pipewire-launcher.sh
+++ b/community/pipewire/pipewire-launcher.sh
@@ -1,10 +1,10 @@
 #!/bin/sh
 
 # We need to kill any existing pipewire instance to restore sound
-pkill -u "${USER}" -x pipewire 1>/dev/null 2>&1
 pkill -u "${USER}" -fx "pipewire -c pipewire-pulse.conf" 1>/dev/null 2>&1
 pkill -u "${USER}" -fx /usr/bin/pipewire-media-session 1>/dev/null 2>&1
 pkill -u "${USER}" -fx /usr/bin/wireplumber 1>/dev/null 2>&1
+pkill -u "${USER}" -fx /usr/bin/pipewire 1>/dev/null 2>&1
 
 exec /usr/bin/pipewire &
 
-- 
2.35.1