Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 917637

Summary: media-video/pipewire: gentoo-pipewire-launcher restart bug
Product: Gentoo Linux Reporter: Joakim Tjernlund <joakim.tjernlund>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED INVALID    
Severity: normal CC: sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Joakim Tjernlund 2023-11-20 17:09:51 UTC
gentoo-pipewire-launcher has this snippet:

restart () {
    echo "Terminating PipeWire processes ..."
    pkill -u "${USER}" -x pipewire\|wireplumber 1>/dev/null 2>&1

    # pidwait was renamed to pwait w/ procps-4 (bug #914030)
    if command -v pidwait > /dev/null ; then
        pidwait -u "${USER}" -x pipewire\|wireplumber
    elif command -v pwait > /dev/null ; then
        pwait -u "${USER}" -x pipewire\|wireplumber
    fi

    echo "PipeWire terminated."
}

Above does not terminate pipewire-pulse and does not wait for each
daemon to die in sequence. I think something like this will
do better(modulo pidwait):
pkill -u "${USER}" -x wireplumber
pwait -u "${USER}" -x wireplumber
pkill -u "${USER}" -x pipewire-pulse
pwait -u "${USER}" -x pipewire-pulse
pkill -u "${USER}" -x pipewire
pwait -u "${USER}" -x pipewire
Comment 1 Joakim Tjernlund 2023-11-20 17:27:00 UTC
or if you think order is not important, change:
  -x pipewire\|wireplumber
to 
  -x wireplumber\|pipewire-pulse\|pipewire
Comment 2 Joakim Tjernlund 2023-11-23 18:38:34 UTC Comment hidden (spam)
Comment 3 Joakim Tjernlund 2023-11-25 14:44:16 UTC
I got confused by pipewire on systemd uses pipewire-pulse while
openrc uses /usr/bin/pipewire -c pipewire-pulse.conf

Current rule then does match I think