From 6fcdefeedc2ebb1645b7f0af01d298a25a495775 Mon Sep 17 00:00:00 2001 From: Alexis Date: Mon, 5 Jun 2023 19:43:26 +1000 Subject: [PATCH] media-video/pipewire: Add logging support to gentoo-pipewire-launcher. Signed-off-by: Alexis --- .../files/gentoo-pipewire-launcher.in-r1 | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/media-video/pipewire/files/gentoo-pipewire-launcher.in-r1 b/media-video/pipewire/files/gentoo-pipewire-launcher.in-r1 index 51f70293c..05eeabb31 100644 --- a/media-video/pipewire/files/gentoo-pipewire-launcher.in-r1 +++ b/media-video/pipewire/files/gentoo-pipewire-launcher.in-r1 @@ -9,6 +9,23 @@ # which means D-Bus session instance is expected to be correctly set up # prior to this script starting. If that is not true, things may break! +CONF="${XDG_CONFIG_HOME}/gentoo-pipewire-launcher.conf" +if [ -f "${CONF}" ] +then + . "${CONF}" +else + PIPEWIRE_LOG='/dev/null' + PIPEWIRE_PULSE_LOG='/dev/null' + WIREPLUMBER_LOG='/dev/null' +fi +for L in "${PIPEWIRE_LOG}" "${PIPEWIRE_PULSE_LOG}" "${WIREPLUMBER_LOG}" +do + if [ ! -e "${L}" ] + then + touch "${L}" + fi +done + restart () { echo "Terminating PipeWire processes ..." pkill -u "${USER}" -x pipewire\|wireplumber 1>/dev/null 2>&1 @@ -36,17 +53,20 @@ then fi # The core daemon which by itself does probably nothing. -@GENTOO_PORTAGE_EPREFIX@/usr/bin/pipewire & +echo "[$(@GENTOO_PORTAGE_EPREFIX@/bin/date --iso-8601=seconds)] Starting PipeWire." 1>>${PIPEWIRE_LOG} +@GENTOO_PORTAGE_EPREFIX@/usr/bin/pipewire 1>>${PIPEWIRE_LOG} 2>&1 & # The so called pipewire-pulse daemon used for PulseAudio compatibility. # Commenting this out will stop the PA proxying daemon from starting, # however ALSA (with pipewire-alsa), JACK (with jack-sdk) and PW API using # clients will still have access to audio and may end up clashing with # non-PW apps over HW control (most notably, /usr/bin/pulseaudio daemon). -@GENTOO_PORTAGE_EPREFIX@/usr/bin/pipewire -c pipewire-pulse.conf & +echo "[$(@GENTOO_PORTAGE_EPREFIX@/bin/date --iso-8601=seconds)] Starting PipeWire-Pulse." 1>>${PIPEWIRE_PULSE_LOG} +@GENTOO_PORTAGE_EPREFIX@/usr/bin/pipewire -c pipewire-pulse.conf 1>>${PIPEWIRE_PULSE_LOG} 2>&1 & # Hack for bug #822498 sleep 1 # Finally a session manager is required for PipeWire to do anything. -exec @GENTOO_PORTAGE_EPREFIX@/usr/bin/wireplumber +echo "[$(@GENTOO_PORTAGE_EPREFIX@/bin/date --iso-8601=seconds)] Starting WirePlumber." 1>>${WIREPLUMBER_LOG} +exec @GENTOO_PORTAGE_EPREFIX@/usr/bin/wireplumber 1>>${WIREPLUMBER_LOG} 2>&1 -- 2.39.3