diff --git a/media-video/pipewire/Manifest b/media-video/pipewire/Manifest new file mode 100644 index 0000000..b9a98a7 --- /dev/null +++ b/media-video/pipewire/Manifest @@ -0,0 +1,4 @@ +DIST pipewire-1.0.0-docs.tar.xz 33632 BLAKE2B be06aa7242f7d2f8627b3bf2a2ae491dbda456a24811a767218eb89b1fd5961a461697e5d8ae2782323fdb927985fa4fd5dd40c21268b1c7939f4cd3c9e1a9ab SHA512 14f794c4152d7d9a4a7d9d4d5c2ff381c2a8262deaff034f993c4d28629fca8cc3d71d3a7c02982703e449fae5f58257fea0c20db02bf95b5aed88a4d99d2c58 +DIST pipewire-1.0.4.tar.bz2 1698660 BLAKE2B 0842a5fca65c8a91eadd9f0594864ae0f0d428b3c03d2c5fecc3b7f62ff6f5d24fc1190eb351279c002e26596148b23b4b576551502be21beb2eeaa0d2ad4dac SHA512 42e8e28b1fd497f5329b5966abd5cfb7d7976fb0ca9f8f39bccf44195dd11f227cdec2448ba7db4559e866ea2dccf64b8172a2ae069c5204cd8f66c0f8a9e2d9 +DIST pipewire-1.0.5.tar.bz2 1698291 BLAKE2B 0f919a01b5f84060fb2ce560a7790a0d59374671f52a941492930fe21ac39178688f27f00cad649d239901f88b392e16895648efae2ec2785c394c1f6d186ddf SHA512 18fbbe36c8752eb0f1df5ee3f3fffee279addcec9825281bd165ad8316f17af7e91bb5759f63c16139c074b03e5a77ef9d596a87f584d1580bbb754101b70a0f +DIST pipewire-1.0.6.tar.bz2 1698889 BLAKE2B f782efa2aa8fa0976fd3025f58041f450505c63acd9028c3d79368d0c41465a51b4472059a1c13092aa72dc6110fc12589b03de653d7eac3c93bc5498cc17154 SHA512 09e5c951c835dcc2654ec284aaaad6be4254744e943f95556c494cd22a4fc67bdc481982856f2aa439e33ec84e7fbdb6df45a1d4b9ced261b01cd91b0ee4d2ed diff --git a/media-video/pipewire/files/99-pipewire-default-hook.conf b/media-video/pipewire/files/99-pipewire-default-hook.conf new file mode 100644 index 0000000..7145acc --- /dev/null +++ b/media-video/pipewire/files/99-pipewire-default-hook.conf @@ -0,0 +1,17 @@ +# Load pipewire configuration at conf hook processing time. This allows to +# override pulseaudio defaults configuration which is also applied via hook. +# +# Note since hooks are run after @GENTOO_PORTAGE_EPREFIX@/etc/asound.conf and ~/.asoundrc are applied, +# we load these again here make sure that user configuration takes precedence. + +@hooks [ + { + func load + files [ + "@GENTOO_PORTAGE_EPREFIX@/usr/share/alsa/alsa.conf.d/99-pipewire-default.conf" + "@GENTOO_PORTAGE_EPREFIX@/etc/asound.conf" + "~/.asoundrc" + ] + errors false + } +] diff --git a/media-video/pipewire/files/gentoo-pipewire-launcher.1 b/media-video/pipewire/files/gentoo-pipewire-launcher.1 new file mode 100644 index 0000000..36e697c --- /dev/null +++ b/media-video/pipewire/files/gentoo-pipewire-launcher.1 @@ -0,0 +1,52 @@ +.TH "gentoo-pipewire-launcher" "1" "2023-06-15" +.SH "NAME" +gentoo\-pipewire\-launcher \- start instances of PipeWire, PipeWire-Pulse and WirePlumber +.SH "SYNOPSIS" +.BR gentoo\-pipewire\-launcher +[restart] +.SH "DESCRIPTION" +\fIgentoo\-pipewire\-launcher\fR starts instances of PipeWire and +WirePlumber. +Two instances of PipeWire are started: one as the core sound-server, and +one for PulseAudio emulation (cf.\& +.BR pipewire-pulse (1)\fR). +.PP +It must be run in an environment with an active D-Bus session bus, +i.e. one in which the +.B DBUS_SESSION_BUS_ADDRESS +environment variable is set appropriately. +.PP +\fIgentoo\-pipewire\-launcher\fR +tries to avoid restarting, in order to avoid audio dropouts. +However, a restart can be forced by calling +\fIgentoo\-pipewire\-launcher\fR +with an argument of \(oqrestart\(cq. +.PP +.B ${XDG_CONFIG_HOME}/gentoo\-pipewire\-launcher.conf +(or, if +.B ${XDG_CONFIG_HOME} +is not set, +.BR ${HOME}/.config/gentoo\-pipewire\-launcher.conf ) +can be used to specify absolute paths of files to which log output +should be sent, by specifying values for one or more of the +.B GENTOO_PIPEWIRE_LOG\fR, +.B GENTOO_PIPEWIRE_PULSE_LOG\fR, +and +.B GENTOO_WIREPLUMBER_LOG +variables, one per line. +.SH "REPORTING BUGS" +Please report bugs via https://bugs.gentoo.org/ +.SH "FILES" +.TP +.B ${XDG_CONFIG_HOME}/gentoo\-pipewire\-launcher.conf +configures locations of files for log output. +.TP +.B ${HOME}/.config/gentoo\-pipewire\-launcher.conf +configures locations of files for log output if +.B ${XDG_CONFIG_HOME} +is not set. +.SH "SEE ALSO" +.BR pipewire (1), +.BR pipewire-pulse (1), +.BR wireplumber (1), +.BR pipewire.conf (5) diff --git a/media-video/pipewire/files/gentoo-pipewire-launcher.in-r3 b/media-video/pipewire/files/gentoo-pipewire-launcher.in-r3 new file mode 100644 index 0000000..abe9174 --- /dev/null +++ b/media-video/pipewire/files/gentoo-pipewire-launcher.in-r3 @@ -0,0 +1,84 @@ +#!/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}" +else + GENTOO_PIPEWIRE_LOG='/dev/null' + GENTOO_PIPEWIRE_PULSE_LOG='/dev/null' + GENTOO_WIREPLUMBER_LOG='/dev/null' +fi +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/files/gentoo-sound-server-enable-audio-bluetooth.conf b/media-video/pipewire/files/gentoo-sound-server-enable-audio-bluetooth.conf new file mode 100644 index 0000000..c5b4f80 --- /dev/null +++ b/media-video/pipewire/files/gentoo-sound-server-enable-audio-bluetooth.conf @@ -0,0 +1,6 @@ +wireplumber.profiles = { + main = { + hardware.audio = required + hardware.bluetooth = required + } +} diff --git a/media-video/pipewire/files/pipewire-0.3.25-enable-failed-mlock-warning.patch b/media-video/pipewire/files/pipewire-0.3.25-enable-failed-mlock-warning.patch new file mode 100644 index 0000000..bdb43fe --- /dev/null +++ b/media-video/pipewire/files/pipewire-0.3.25-enable-failed-mlock-warning.patch @@ -0,0 +1,12 @@ +diff --git a/src/daemon/pipewire.conf.in b/src/daemon/pipewire.conf.in +--- a/src/daemon/pipewire.conf.in ++++ b/src/daemon/pipewire.conf.in +@@ -6,7 +6,7 @@ context.properties = { + #support.dbus = true + #link.max-buffers = 64 + link.max-buffers = 16 # version < 3 clients can't handle more +- #mem.warn-mlock = false ++ mem.warn-mlock = true # Gentoo should have good RLIMITs now + #mem.allow-mlock = true + #mem.mlock-all = false + #clock.power-of-two-quantum = true diff --git a/media-video/pipewire/files/pipewire.desktop-r2 b/media-video/pipewire/files/pipewire.desktop-r2 new file mode 100644 index 0000000..1e8564d --- /dev/null +++ b/media-video/pipewire/files/pipewire.desktop-r2 @@ -0,0 +1,12 @@ +[Desktop Entry] +Version=1.0 +Name[de]=PipeWire Mediensystem +Name=PipeWire Media System +Comment[de]=Das PipeWire Mediensystem starten +Comment=Start the PipeWire Media System +Exec=/usr/bin/gentoo-pipewire-launcher restart +Terminal=false +Type=Application +X-GNOME-HiddenUnderSystemd=true +X-KDE-HiddenUnderSystemd=true +X-systemd-skip=true