public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/pipewire/files/, media-video/pipewire/
Date: Tue, 15 Jul 2025 09:49:38 +0000 (UTC)	[thread overview]
Message-ID: <1752572828.295c67cebdfd7e7cf810c3ec7563e9bbfc903473.sam@gentoo> (raw)

commit:     295c67cebdfd7e7cf810c3ec7563e9bbfc903473
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 15 09:47:08 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jul 15 09:47:08 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=295c67ce

media-video/pipewire: fix gentoo-pipewire-launcher vs bad config file

With a config file defined that does *not* itself define GENTOO_PIPEWIRE_*,
we may fail to startup properly. Always set fallback values for the logging
dests, not just when a config doesn't exist.

Thanks-to: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../pipewire/files/gentoo-pipewire-launcher.in-r4  | 85 ++++++++++++++++++++++
 ...re-1.4.9999.ebuild => pipewire-1.4.6-r1.ebuild} |  0
 media-video/pipewire/pipewire-1.4.9999.ebuild      |  2 +-
 media-video/pipewire/pipewire-9999.ebuild          |  2 +-
 4 files changed, 87 insertions(+), 2 deletions(-)

diff --git a/media-video/pipewire/files/gentoo-pipewire-launcher.in-r4 b/media-video/pipewire/files/gentoo-pipewire-launcher.in-r4
new file mode 100644
index 000000000000..1804d5aad682
--- /dev/null
+++ b/media-video/pipewire/files/gentoo-pipewire-launcher.in-r4
@@ -0,0 +1,85 @@
+#!/bin/sh
+
+# PipeWire launcher script for XDG compliant desktops on OpenRC.
+#
+# systemd users are very _STRONGLY_ advised to use the much
+# more reliable and predictable user units instead.
+
+# WARNING: This script assumes being run inside XDG compliant session,
+# 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!
+
+DATE_FORMAT='+%Y-%m-%dT%H:%M:%S%Z'
+
+CONF="${XDG_CONFIG_HOME:-${HOME}/.config}/gentoo-pipewire-launcher.conf"
+if [ -f "${CONF}" ]
+then
+    . "${CONF}"
+fi
+
+: "${GENTOO_PIPEWIRE_LOG:='/dev/null'}"
+: "${GENTOO_PIPEWIRE_PULSE_LOG:='/dev/null'}"
+: "${GENTOO_WIREPLUMBER_LOG:='/dev/null'}"
+
+for L in \
+    "${GENTOO_PIPEWIRE_LOG}" \
+    "${GENTOO_PIPEWIRE_PULSE_LOG}" \
+    "${GENTOO_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
+
+    # 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."
+}
+
+if [ "${#}" -gt 0 ]
+then
+    if [ "${1}" = 'restart' ]
+    then
+	restart
+    else
+        echo "Unrecognised argument." >&2
+        echo "Usage: gentoo-pipewire-launcher [restart]" >&2
+	exit 1
+    fi
+fi
+
+if pgrep -u "${USER}" -x pipewire\|wireplumber 1>/dev/null 2>&1
+then
+    echo "PipeWire already running, exiting." >&2
+    echo "(Use 'gentoo-pipewire-launcher restart' to restart PipeWire and WirePlumber.)" >&2
+    exit 1
+fi
+
+# The core daemon which by itself does probably nothing.
+echo "[$(@GENTOO_PORTAGE_EPREFIX@/bin/date ${DATE_FORMAT})] Starting PipeWire." 1>>"${GENTOO_PIPEWIRE_LOG}"
+@GENTOO_PORTAGE_EPREFIX@/usr/bin/pipewire 1>>"${GENTOO_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).
+echo "[$(@GENTOO_PORTAGE_EPREFIX@/bin/date ${DATE_FORMAT})] Starting PipeWire-Pulse." 1>>"${GENTOO_PIPEWIRE_PULSE_LOG}"
+@GENTOO_PORTAGE_EPREFIX@/usr/bin/pipewire -c pipewire-pulse.conf 1>>"${GENTOO_PIPEWIRE_PULSE_LOG}" 2>&1 &
+
+# Hack for bug #822498
+sleep 1
+
+# Finally a session manager is required for PipeWire to do anything.
+echo "[$(@GENTOO_PORTAGE_EPREFIX@/bin/date ${DATE_FORMAT})] Starting WirePlumber." 1>>"${GENTOO_WIREPLUMBER_LOG}"
+exec @GENTOO_PORTAGE_EPREFIX@/usr/bin/wireplumber 1>>"${GENTOO_WIREPLUMBER_LOG}" 2>&1

diff --git a/media-video/pipewire/pipewire-1.4.9999.ebuild b/media-video/pipewire/pipewire-1.4.6-r1.ebuild
similarity index 100%
copy from media-video/pipewire/pipewire-1.4.9999.ebuild
copy to media-video/pipewire/pipewire-1.4.6-r1.ebuild

diff --git a/media-video/pipewire/pipewire-1.4.9999.ebuild b/media-video/pipewire/pipewire-1.4.9999.ebuild
index 91903abf7323..b6f2d947b3cb 100644
--- a/media-video/pipewire/pipewire-1.4.9999.ebuild
+++ b/media-video/pipewire/pipewire-1.4.9999.ebuild
@@ -370,7 +370,7 @@ multilib_src_install_all() {
 		newins "${FILESDIR}"/pipewire.desktop-r2 pipewire.desktop
 
 		exeinto /usr/bin
-		newexe "${FILESDIR}"/gentoo-pipewire-launcher.in-r3 gentoo-pipewire-launcher
+		newexe "${FILESDIR}"/gentoo-pipewire-launcher.in-r4 gentoo-pipewire-launcher
 
 		doman "${FILESDIR}"/gentoo-pipewire-launcher.1
 

diff --git a/media-video/pipewire/pipewire-9999.ebuild b/media-video/pipewire/pipewire-9999.ebuild
index 6d7d756e39c6..55f4a26c8bc2 100644
--- a/media-video/pipewire/pipewire-9999.ebuild
+++ b/media-video/pipewire/pipewire-9999.ebuild
@@ -368,7 +368,7 @@ multilib_src_install_all() {
 		newins "${FILESDIR}"/pipewire.desktop-r2 pipewire.desktop
 
 		exeinto /usr/bin
-		newexe "${FILESDIR}"/gentoo-pipewire-launcher.in-r3 gentoo-pipewire-launcher
+		newexe "${FILESDIR}"/gentoo-pipewire-launcher.in-r4 gentoo-pipewire-launcher
 
 		doman "${FILESDIR}"/gentoo-pipewire-launcher.1
 


             reply	other threads:[~2025-07-15  9:49 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-15  9:49 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-09-17 20:00 [gentoo-commits] repo/gentoo:master commit in: media-video/pipewire/files/, media-video/pipewire/ Andreas Sturmlechner
2024-07-01  8:19 Sam James
2023-08-24 19:42 Sam James
2023-06-17  2:49 Sam James
2023-06-07  9:52 Sam James
2023-06-07  9:52 Sam James
2023-05-05  8:35 Sam James
2022-12-30  6:59 Sam James
2022-12-27 14:17 Sam James
2022-12-16  4:56 Sam James
2022-12-10  4:35 Sam James
2022-11-11  4:25 Sam James
2022-11-11  4:25 Sam James
2022-07-19 21:18 Sam James
2022-07-10 20:23 Sam James
2022-07-09  1:12 Sam James
2022-07-04 23:53 Sam James
2022-06-15 21:56 Sam James
2022-06-10  0:38 Sam James
2022-04-21 22:03 Sam James
2022-04-21 21:57 Sam James
2022-04-17 16:44 Sam James
2022-04-15  7:59 Sam James
2022-01-29  0:49 Sam James
2022-01-06 20:53 Sam James
2021-12-18  6:39 Sam James
2021-11-11 22:09 Sam James
2021-10-26  9:03 Sam James
2021-10-26  8:59 Sam James
2021-10-25 17:12 Patrick McLean
2021-09-21  6:32 Miroslav Šulc
2021-09-19  1:18 Sam James
2021-08-27 10:50 Lars Wendler
2021-08-24 13:17 Thomas Deutschmann
2021-06-30 20:40 Lars Wendler
2021-06-30 20:16 Lars Wendler
2021-06-04  7:33 Thomas Deutschmann
2021-05-21 23:05 Thomas Deutschmann
2021-04-24 21:15 Thomas Deutschmann
2019-10-21 23:38 Andreas Sturmlechner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1752572828.295c67cebdfd7e7cf810c3ec7563e9bbfc903473.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox