1 |
commit: d2d6ff0a99a795e07bbfb19f501db28584fb7481 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Dec 30 06:59:22 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Dec 30 06:59:22 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2d6ff0a |
7 |
|
8 |
media-video/pipewire: backport more patches to 0.3.63 |
9 |
|
10 |
Bug: https://bugs.gentoo.org/888643 |
11 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
12 |
|
13 |
.../files/pipewire-0.3.63-alsa-node-target.patch | 28 ++ |
14 |
.../files/pipewire-0.3.63-rate-update.patch | 39 ++ |
15 |
media-video/pipewire/pipewire-0.3.63-r2.ebuild | 443 +++++++++++++++++++++ |
16 |
3 files changed, 510 insertions(+) |
17 |
|
18 |
diff --git a/media-video/pipewire/files/pipewire-0.3.63-alsa-node-target.patch b/media-video/pipewire/files/pipewire-0.3.63-alsa-node-target.patch |
19 |
new file mode 100644 |
20 |
index 000000000000..8a4169b57af5 |
21 |
--- /dev/null |
22 |
+++ b/media-video/pipewire/files/pipewire-0.3.63-alsa-node-target.patch |
23 |
@@ -0,0 +1,28 @@ |
24 |
+https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/89ac6b353521fb9a6d6eb6bb74724c4fa968f75c |
25 |
+https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2893 |
26 |
+ |
27 |
+From 89ac6b353521fb9a6d6eb6bb74724c4fa968f75c Mon Sep 17 00:00:00 2001 |
28 |
+From: Wim Taymans <wtaymans@××××××.com> |
29 |
+Date: Sat, 17 Dec 2022 18:17:33 +0100 |
30 |
+Subject: [PATCH] =?UTF-8?q?alsa:=20don=C2=B4t=20set=20-1=20as=20node.targe?= |
31 |
+ =?UTF-8?q?t?= |
32 |
+MIME-Version: 1.0 |
33 |
+Content-Type: text/plain; charset=UTF-8 |
34 |
+Content-Transfer-Encoding: 8bit |
35 |
+ |
36 |
+Leave the target unset when -1, just like what pw-stream does. |
37 |
+ |
38 |
+See #2893 |
39 |
+--- a/pipewire-alsa/alsa-plugins/pcm_pipewire.c |
40 |
++++ b/pipewire-alsa/alsa-plugins/pcm_pipewire.c |
41 |
+@@ -579,7 +579,7 @@ static int snd_pcm_pipewire_prepare(snd_pcm_ioplug_t *io) |
42 |
+ pw_properties_setf(props, PW_KEY_NODE_LATENCY, "%lu/%u", pw->min_avail, io->rate); |
43 |
+ if (pw_properties_get(props, PW_KEY_NODE_RATE) == NULL) |
44 |
+ pw_properties_setf(props, PW_KEY_NODE_RATE, "1/%u", io->rate); |
45 |
+- if (pw->target != NULL && |
46 |
++ if (pw->target != NULL && !spa_streq(pw->target, "-1") && |
47 |
+ pw_properties_get(props, PW_KEY_NODE_TARGET) == NULL) |
48 |
+ pw_properties_setf(props, PW_KEY_NODE_TARGET, "%s", pw->target); |
49 |
+ |
50 |
+-- |
51 |
+GitLab |
52 |
|
53 |
diff --git a/media-video/pipewire/files/pipewire-0.3.63-rate-update.patch b/media-video/pipewire/files/pipewire-0.3.63-rate-update.patch |
54 |
new file mode 100644 |
55 |
index 000000000000..91487def58e2 |
56 |
--- /dev/null |
57 |
+++ b/media-video/pipewire/files/pipewire-0.3.63-rate-update.patch |
58 |
@@ -0,0 +1,39 @@ |
59 |
+https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/860b8fc27ffbfd0a095e3fa4b0cd125d536283d3 |
60 |
+https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2915 |
61 |
+https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2891 |
62 |
+ |
63 |
+From 860b8fc27ffbfd0a095e3fa4b0cd125d536283d3 Mon Sep 17 00:00:00 2001 |
64 |
+From: Wim Taymans <wtaymans@××××××.com> |
65 |
+Date: Thu, 29 Dec 2022 12:22:56 +0100 |
66 |
+Subject: [PATCH] modules: fix rate update |
67 |
+ |
68 |
+Setting the rate with the PROP_rate would actually result in a rate |
69 |
+adjustment of 1.0f / rate, so do the same here. |
70 |
+ |
71 |
+See #2891 |
72 |
+--- a/src/modules/module-pulse-tunnel.c |
73 |
++++ b/src/modules/module-pulse-tunnel.c |
74 |
+@@ -270,7 +270,7 @@ static void update_rate(struct impl *impl, bool playback) |
75 |
+ impl->current_latency, impl->target_latency); |
76 |
+ |
77 |
+ SPA_FLAG_SET(impl->rate_match->flags, SPA_IO_RATE_MATCH_FLAG_ACTIVE); |
78 |
+- impl->rate_match->rate = corr; |
79 |
++ impl->rate_match->rate = 1.0f / corr; |
80 |
+ } |
81 |
+ |
82 |
+ static void playback_stream_process(void *d) |
83 |
+--- a/src/modules/module-rtp-source.c |
84 |
++++ b/src/modules/module-rtp-source.c |
85 |
+@@ -272,7 +272,7 @@ static void stream_process(void *data) |
86 |
+ |
87 |
+ if (sess->rate_match) { |
88 |
+ SPA_FLAG_SET(sess->rate_match->flags, SPA_IO_RATE_MATCH_FLAG_ACTIVE); |
89 |
+- sess->rate_match->rate = corr; |
90 |
++ sess->rate_match->rate = 1.0f / corr; |
91 |
+ } |
92 |
+ } |
93 |
+ spa_ringbuffer_read_data(&sess->ring, |
94 |
+-- |
95 |
+GitLab |
96 |
+ |
97 |
+ |
98 |
|
99 |
diff --git a/media-video/pipewire/pipewire-0.3.63-r2.ebuild b/media-video/pipewire/pipewire-0.3.63-r2.ebuild |
100 |
new file mode 100644 |
101 |
index 000000000000..c73900f8e6fb |
102 |
--- /dev/null |
103 |
+++ b/media-video/pipewire/pipewire-0.3.63-r2.ebuild |
104 |
@@ -0,0 +1,443 @@ |
105 |
+# Copyright 1999-2022 Gentoo Authors |
106 |
+# Distributed under the terms of the GNU General Public License v2 |
107 |
+ |
108 |
+EAPI=8 |
109 |
+ |
110 |
+# 1. Please regularly check (even at the point of bumping) Fedora's packaging |
111 |
+# for needed backports at https://src.fedoraproject.org/rpms/pipewire/tree/rawhide. |
112 |
+# |
113 |
+# 2. Upstream also sometimes amend release notes for the previous release to mention |
114 |
+# needed patches, e.g. https://gitlab.freedesktop.org/pipewire/pipewire/-/tags/0.3.55#distros |
115 |
+# |
116 |
+# 3. Keep an eye on git master (for both PipeWire and WirePlumber) as things |
117 |
+# continue to move quickly. It's not uncommon for fixes to be made shortly |
118 |
+# after releases. |
119 |
+ |
120 |
+PYTHON_COMPAT=( python3_{8..11} ) |
121 |
+ |
122 |
+inherit flag-o-matic meson-multilib optfeature prefix python-any-r1 systemd udev |
123 |
+ |
124 |
+if [[ ${PV} == 9999 ]]; then |
125 |
+ EGIT_REPO_URI="https://gitlab.freedesktop.org/${PN}/${PN}.git" |
126 |
+ inherit git-r3 |
127 |
+else |
128 |
+ if [[ ${PV} == *_p* ]] ; then |
129 |
+ MY_COMMIT="" |
130 |
+ SRC_URI="https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/${MY_COMMIT}/pipewire-${MY_COMMIT}.tar.bz2 -> ${P}.tar.bz2" |
131 |
+ S="${WORKDIR}"/${PN}-${MY_COMMIT} |
132 |
+ else |
133 |
+ SRC_URI="https://gitlab.freedesktop.org/${PN}/${PN}/-/archive/${PV}/${P}.tar.bz2" |
134 |
+ fi |
135 |
+ |
136 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86" |
137 |
+fi |
138 |
+ |
139 |
+DESCRIPTION="Multimedia processing graphs" |
140 |
+HOMEPAGE="https://pipewire.org/" |
141 |
+ |
142 |
+LICENSE="MIT LGPL-2.1+ GPL-2" |
143 |
+# ABI was broken in 0.3.42 for https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/49 |
144 |
+SLOT="0/0.4" |
145 |
+IUSE="bluetooth dbus doc echo-cancel extra flatpak gstreamer gsettings jack-client jack-sdk lv2 |
146 |
+modemmanager pipewire-alsa readline sound-server ssl system-service systemd test udev v4l X zeroconf" |
147 |
+ |
148 |
+# Once replacing system JACK libraries is possible, it's likely that |
149 |
+# jack-client IUSE will need blocking to avoid users accidentally |
150 |
+# configuring their systems to send PW sink output to the emulated |
151 |
+# JACK's sink - doing so is likely to yield no audio, cause a CPU |
152 |
+# cycles consuming loop (and may even cause GUI crashes)! |
153 |
+ |
154 |
+# TODO: There should be "sound-server? ( || ( alsa bluetooth ) )" here, but ALSA is always enabled |
155 |
+# TODO: Pulseaudio alsa plugin performs runtime check that pulseaudio server connection will work |
156 |
+# which provides adequate guarantee that alsa-lib will be able to provide audio services. |
157 |
+# If that works, pulseaudio defaults are loaded into alsa-lib runtime replacing default PCM and CTL. |
158 |
+# When pipewire-alsa will be able to perform similar check, pipewire-alsa can be enabled unconditionally. |
159 |
+REQUIRED_USE=" |
160 |
+ jack-sdk? ( !jack-client ) |
161 |
+ modemmanager? ( bluetooth ) |
162 |
+ system-service? ( systemd ) |
163 |
+ !sound-server? ( !pipewire-alsa ) |
164 |
+ jack-client? ( dbus ) |
165 |
+" |
166 |
+ |
167 |
+RESTRICT="!test? ( test )" |
168 |
+ |
169 |
+BDEPEND=" |
170 |
+ >=dev-util/meson-0.59 |
171 |
+ virtual/pkgconfig |
172 |
+ ${PYTHON_DEPS} |
173 |
+ $(python_gen_any_dep 'dev-python/docutils[${PYTHON_USEDEP}]') |
174 |
+ doc? ( |
175 |
+ app-doc/doxygen |
176 |
+ media-gfx/graphviz |
177 |
+ ) |
178 |
+" |
179 |
+RDEPEND=" |
180 |
+ acct-group/audio |
181 |
+ media-libs/alsa-lib |
182 |
+ sys-libs/ncurses:=[unicode(+)] |
183 |
+ virtual/libintl[${MULTILIB_USEDEP}] |
184 |
+ bluetooth? ( |
185 |
+ media-libs/fdk-aac |
186 |
+ media-libs/libldac |
187 |
+ media-libs/libfreeaptx |
188 |
+ media-libs/opus |
189 |
+ media-libs/sbc |
190 |
+ >=net-wireless/bluez-4.101:= |
191 |
+ virtual/libusb:1 |
192 |
+ ) |
193 |
+ dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] ) |
194 |
+ echo-cancel? ( media-libs/webrtc-audio-processing:0 ) |
195 |
+ extra? ( |
196 |
+ >=media-libs/libsndfile-1.0.20 |
197 |
+ ) |
198 |
+ flatpak? ( |
199 |
+ dev-libs/glib |
200 |
+ ) |
201 |
+ gstreamer? ( |
202 |
+ >=dev-libs/glib-2.32.0:2 |
203 |
+ >=media-libs/gstreamer-1.10.0:1.0 |
204 |
+ media-libs/gst-plugins-base:1.0 |
205 |
+ ) |
206 |
+ gsettings? ( |
207 |
+ >=dev-libs/glib-2.26.0:2 |
208 |
+ ) |
209 |
+ jack-client? ( >=media-sound/jack2-1.9.10:2[dbus] ) |
210 |
+ jack-sdk? ( |
211 |
+ !media-sound/jack-audio-connection-kit |
212 |
+ !media-sound/jack2 |
213 |
+ ) |
214 |
+ lv2? ( media-libs/lilv ) |
215 |
+ modemmanager? ( >=net-misc/modemmanager-1.10.0 ) |
216 |
+ pipewire-alsa? ( |
217 |
+ >=media-libs/alsa-lib-1.1.7[${MULTILIB_USEDEP}] |
218 |
+ ) |
219 |
+ sound-server? ( |
220 |
+ !media-sound/pulseaudio[daemon(+)] |
221 |
+ !media-sound/pulseaudio-daemon |
222 |
+ ) |
223 |
+ readline? ( sys-libs/readline:= ) |
224 |
+ ssl? ( dev-libs/openssl:= ) |
225 |
+ systemd? ( sys-apps/systemd ) |
226 |
+ system-service? ( |
227 |
+ acct-user/pipewire |
228 |
+ acct-group/pipewire |
229 |
+ ) |
230 |
+ udev? ( virtual/libudev[${MULTILIB_USEDEP}] ) |
231 |
+ v4l? ( media-libs/libv4l ) |
232 |
+ X? ( |
233 |
+ media-libs/libcanberra |
234 |
+ x11-libs/libX11 |
235 |
+ x11-libs/libXfixes |
236 |
+ ) |
237 |
+ zeroconf? ( net-dns/avahi ) |
238 |
+" |
239 |
+ |
240 |
+DEPEND="${RDEPEND}" |
241 |
+ |
242 |
+# TODO: Consider use cases where pipewire is not used for driving audio |
243 |
+# Doing so with WirePlumber currently involves editing Lua scripts |
244 |
+PDEPEND=">=media-video/wireplumber-0.4.8-r3" |
245 |
+ |
246 |
+# Present RDEPEND that are currently always disabled due to the PW |
247 |
+# code using them being required to be disabled by Gentoo guidelines |
248 |
+# (i.e. developer binaries not meant for users) and unready code |
249 |
+# media-video/ffmpeg:= |
250 |
+# media-libs/libsdl2 |
251 |
+# >=media-libs/vulkan-loader-1.1.69 |
252 |
+# |
253 |
+# Ditto for DEPEND |
254 |
+# >=dev-util/vulkan-headers-1.1.69 |
255 |
+ |
256 |
+DOCS=( {README,INSTALL}.md NEWS ) |
257 |
+ |
258 |
+PATCHES=( |
259 |
+ "${FILESDIR}"/${PN}-0.3.25-enable-failed-mlock-warning.patch |
260 |
+ "${FILESDIR}"/${P}-alsa-node-target.patch |
261 |
+ "${FILESDIR}"/${P}-bluez-ldac_abr.patch |
262 |
+ "${FILESDIR}"/${P}-bluetooth-typo.patch |
263 |
+ "${FILESDIR}"/${P}-rate-update.patch |
264 |
+) |
265 |
+ |
266 |
+# limitsdfile related code taken from =sys-auth/realtime-base-0.1 |
267 |
+# with changes as necessary. |
268 |
+limitsdfile=40-${PN}.conf |
269 |
+ |
270 |
+python_check_deps() { |
271 |
+ python_has_version "dev-python/docutils[${PYTHON_USEDEP}]" |
272 |
+} |
273 |
+ |
274 |
+src_prepare() { |
275 |
+ default |
276 |
+ |
277 |
+ einfo "Generating ${limitsdfile}" |
278 |
+ cat > ${limitsdfile} <<- EOF || die |
279 |
+ # Start of ${limitsdfile} from ${P} |
280 |
+ |
281 |
+ @audio - memlock 256 |
282 |
+ |
283 |
+ $(use system-service && { |
284 |
+ echo @pipewire - rtprio 95 |
285 |
+ echo @pipewire - nice -19 |
286 |
+ echo @pipewire - memlock 4194304 |
287 |
+ }) |
288 |
+ |
289 |
+ # End of ${limitsdfile} from ${P} |
290 |
+ EOF |
291 |
+} |
292 |
+ |
293 |
+multilib_src_configure() { |
294 |
+ # https://bugs.gentoo.org/838301 |
295 |
+ filter-flags -fno-semantic-interposition |
296 |
+ |
297 |
+ local emesonargs=( |
298 |
+ -Ddocdir="${EPREFIX}"/usr/share/doc/${PF} |
299 |
+ |
300 |
+ $(meson_feature dbus) |
301 |
+ $(meson_native_use_feature zeroconf avahi) |
302 |
+ $(meson_native_use_feature doc docs) |
303 |
+ $(meson_native_enabled examples) # TODO: Figure out if this is still important now that media-session gone |
304 |
+ $(meson_native_enabled man) |
305 |
+ $(meson_feature test tests) |
306 |
+ -Dinstalled_tests=disabled # Matches upstream; Gentoo never installs tests |
307 |
+ $(meson_native_use_feature gstreamer) |
308 |
+ $(meson_native_use_feature gstreamer gstreamer-device-provider) |
309 |
+ $(meson_native_use_feature gsettings) |
310 |
+ $(meson_native_use_feature systemd) |
311 |
+ |
312 |
+ $(meson_native_use_feature system-service systemd-system-service) |
313 |
+ -Dsystemd-system-unit-dir="$(systemd_get_systemunitdir)" |
314 |
+ -Dsystemd-user-unit-dir="$(systemd_get_userunitdir)" |
315 |
+ |
316 |
+ $(meson_native_use_feature systemd systemd-user-service) |
317 |
+ $(meson_feature pipewire-alsa) # Allows integrating ALSA apps into PW graph |
318 |
+ -Dspa-plugins=enabled |
319 |
+ -Dalsa=enabled # Allows using kernel ALSA for sound I/O (NOTE: media-session is gone so IUSE=alsa/spa_alsa/alsa-backend might be possible) |
320 |
+ -Daudiomixer=enabled # Matches upstream |
321 |
+ -Daudioconvert=enabled # Matches upstream |
322 |
+ $(meson_native_use_feature bluetooth bluez5) |
323 |
+ $(meson_native_use_feature bluetooth bluez5-backend-hsp-native) |
324 |
+ $(meson_native_use_feature bluetooth bluez5-backend-hfp-native) |
325 |
+ # https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/1379 |
326 |
+ $(meson_native_use_feature modemmanager bluez5-backend-native-mm) |
327 |
+ $(meson_native_use_feature bluetooth bluez5-backend-ofono) |
328 |
+ $(meson_native_use_feature bluetooth bluez5-backend-hsphfpd) |
329 |
+ $(meson_native_use_feature bluetooth bluez5-codec-aac) |
330 |
+ $(meson_native_use_feature bluetooth bluez5-codec-aptx) |
331 |
+ $(meson_native_use_feature bluetooth bluez5-codec-ldac) |
332 |
+ $(meson_native_use_feature bluetooth bluez5-codec-opus) |
333 |
+ $(meson_native_use_feature bluetooth libusb) # At least for now only used by bluez5 native (quirk detection of adapters) |
334 |
+ $(meson_native_use_feature echo-cancel echo-cancel-webrtc) #807889 |
335 |
+ # Not yet packaged. |
336 |
+ -Dbluez5-codec-lc3=disabled |
337 |
+ -Dbluez5-codec-lc3plus=disabled |
338 |
+ -Dcontrol=enabled # Matches upstream |
339 |
+ -Daudiotestsrc=enabled # Matches upstream |
340 |
+ -Dffmpeg=disabled # Disabled by upstream and no major developments to spa/plugins/ffmpeg/ since May 2020 |
341 |
+ $(meson_native_use_feature flatpak) |
342 |
+ -Dpipewire-jack=enabled # Allows integrating JACK apps into PW graph |
343 |
+ $(meson_native_use_feature jack-client jack) # Allows PW to act as a JACK client |
344 |
+ $(meson_use jack-sdk jack-devel) |
345 |
+ $(usex jack-sdk "-Dlibjack-path=${EPREFIX}/usr/$(get_libdir)" '') |
346 |
+ -Dsupport=enabled # Miscellaneous/common plugins, such as null sink |
347 |
+ -Devl=disabled # Matches upstream |
348 |
+ -Dtest=disabled # fakesink and fakesource plugins |
349 |
+ $(meson_native_use_feature lv2) |
350 |
+ $(meson_native_use_feature v4l v4l2) |
351 |
+ -Dlibcamera=disabled # libcamera is not in Portage tree |
352 |
+ $(meson_native_use_feature readline) |
353 |
+ $(meson_native_use_feature ssl raop) |
354 |
+ -Dvideoconvert=enabled # Matches upstream |
355 |
+ -Dvideotestsrc=enabled # Matches upstream |
356 |
+ -Dvolume=enabled # Matches upstream |
357 |
+ -Dvulkan=disabled # Uses pre-compiled Vulkan compute shader to provide a CGI video source (dev thing; disabled by upstream) |
358 |
+ $(meson_native_use_feature extra pw-cat) |
359 |
+ $(meson_feature udev) |
360 |
+ -Dudevrulesdir="${EPREFIX}$(get_udevdir)/rules.d" |
361 |
+ -Dsdl2=disabled # Controls SDL2 dependent code (currently only examples when -Dinstalled_tests=enabled which we never install) |
362 |
+ $(meson_native_use_feature extra sndfile) # Enables libsndfile dependent code (currently only pw-cat) |
363 |
+ -Dsession-managers="[]" # All available session managers are now their own projects, so there's nothing to build |
364 |
+ |
365 |
+ # Just for bell sounds in X11 right now. |
366 |
+ $(meson_native_use_feature X x11) |
367 |
+ $(meson_native_use_feature X x11-xfixes) |
368 |
+ $(meson_native_use_feature X libcanberra) |
369 |
+ ) |
370 |
+ |
371 |
+ meson_src_configure |
372 |
+} |
373 |
+ |
374 |
+multilib_src_install() { |
375 |
+ # Our custom DOCS do not exist in multilib source directory |
376 |
+ DOCS= meson_src_install |
377 |
+} |
378 |
+ |
379 |
+multilib_src_install_all() { |
380 |
+ einstalldocs |
381 |
+ |
382 |
+ insinto /etc/security/limits.d |
383 |
+ doins ${limitsdfile} |
384 |
+ |
385 |
+ if use pipewire-alsa; then |
386 |
+ dodir /etc/alsa/conf.d |
387 |
+ |
388 |
+ # Install pipewire conf loader hook |
389 |
+ insinto /usr/share/alsa/alsa.conf.d |
390 |
+ doins "${FILESDIR}"/99-pipewire-default-hook.conf |
391 |
+ eprefixify "${ED}"/usr/share/alsa/alsa.conf.d/99-pipewire-default-hook.conf |
392 |
+ |
393 |
+ # These will break if someone has /etc that is a symbolic link to a subfolder! See #724222 |
394 |
+ # And the current dosym8 -r implementation is likely affected by the same issue, too. |
395 |
+ dosym ../../../usr/share/alsa/alsa.conf.d/50-pipewire.conf /etc/alsa/conf.d/50-pipewire.conf |
396 |
+ dosym ../../../usr/share/alsa/alsa.conf.d/99-pipewire-default-hook.conf /etc/alsa/conf.d/99-pipewire-default-hook.conf |
397 |
+ fi |
398 |
+ |
399 |
+ # Enable required wireplumber alsa and bluez monitors |
400 |
+ if use sound-server; then |
401 |
+ dodir /etc/wireplumber/main.lua.d |
402 |
+ echo "alsa_monitor.enabled = true" > "${ED}"/etc/wireplumber/main.lua.d/89-gentoo-sound-server-enable-alsa-monitor.lua || die |
403 |
+ |
404 |
+ dodir /etc/wireplumber/bluetooth.lua.d |
405 |
+ echo "bluez_monitor.enabled = true" > "${ED}"/etc/wireplumber/bluetooth.lua.d/89-gentoo-sound-server-enable-bluez-monitor.lua || die |
406 |
+ fi |
407 |
+ |
408 |
+ if ! use systemd; then |
409 |
+ insinto /etc/xdg/autostart |
410 |
+ newins "${FILESDIR}"/pipewire.desktop-r1 pipewire.desktop |
411 |
+ |
412 |
+ exeinto /usr/bin |
413 |
+ newexe "${FILESDIR}"/gentoo-pipewire-launcher.in gentoo-pipewire-launcher |
414 |
+ |
415 |
+ # Disable pipewire-pulse if sound-server is disabled. |
416 |
+ if ! use sound-server ; then |
417 |
+ sed -i -s '/pipewire -c pipewire-pulse.conf/s/^/#/' "${ED}"/usr/bin/gentoo-pipewire-launcher || die |
418 |
+ fi |
419 |
+ |
420 |
+ eprefixify "${ED}"/usr/bin/gentoo-pipewire-launcher |
421 |
+ fi |
422 |
+} |
423 |
+ |
424 |
+pkg_postrm() { |
425 |
+ use udev && udev_reload |
426 |
+} |
427 |
+ |
428 |
+pkg_postinst() { |
429 |
+ use udev && udev_reload |
430 |
+ |
431 |
+ elog "It is recommended to raise RLIMIT_MEMLOCK to 256 for users" |
432 |
+ elog "using PipeWire. Do it either manually or add yourself" |
433 |
+ elog "to the 'audio' group:" |
434 |
+ elog |
435 |
+ elog " usermod -aG audio <youruser>" |
436 |
+ elog |
437 |
+ |
438 |
+ local ver |
439 |
+ for ver in ${REPLACING_VERSIONS} ; do |
440 |
+ if ver_test ${ver} -le 0.3.53-r1 && ! use sound-server ; then |
441 |
+ ewarn "USE=sound-server is disabled! If you want PipeWire to provide" |
442 |
+ ewarn "your sound, please enable it. See the wiki at" |
443 |
+ ewarn "https://wiki.gentoo.org/wiki/PipeWire#Replacing_PulseAudio" |
444 |
+ ewarn "for more details." |
445 |
+ |
446 |
+ break |
447 |
+ fi |
448 |
+ done |
449 |
+ |
450 |
+ if ! use jack-sdk; then |
451 |
+ elog "JACK emulation is incomplete and not all programs will work. PipeWire's" |
452 |
+ elog "alternative libraries have been installed to a non-default location." |
453 |
+ elog "To use them, put pw-jack <application> before every JACK application." |
454 |
+ elog "When using pw-jack, do not run jackd/jackdbus. However, a virtual/jack" |
455 |
+ elog "provider is still needed to compile the JACK applications themselves." |
456 |
+ elog |
457 |
+ fi |
458 |
+ |
459 |
+ if use systemd; then |
460 |
+ elog "When switching from PulseAudio, you may need to disable PulseAudio:" |
461 |
+ elog |
462 |
+ elog " systemctl --user disable pulseaudio.service pulseaudio.socket" |
463 |
+ elog |
464 |
+ elog "To use PipeWire, the user units must be manually enabled" |
465 |
+ elog "by running this command as each user you use for desktop activities:" |
466 |
+ elog |
467 |
+ elog " systemctl --user enable pipewire.socket pipewire-pulse.socket" |
468 |
+ elog |
469 |
+ elog "A reboot is recommended to avoid interferences from still running" |
470 |
+ elog "PulseAudio daemon." |
471 |
+ elog |
472 |
+ elog "Both new users and those upgrading need to enable WirePlumber" |
473 |
+ elog "for relevant users:" |
474 |
+ elog |
475 |
+ elog " systemctl --user disable pipewire-media-session.service" |
476 |
+ elog " systemctl --user --force enable wireplumber.service" |
477 |
+ elog |
478 |
+ elog "Root user may replace --user with --global to change system default" |
479 |
+ elog "configuration for all of the above commands." |
480 |
+ else |
481 |
+ ewarn "PipeWire daemon startup has been moved to a launcher script!" |
482 |
+ ewarn "Make sure that ${EROOT}/etc/pipewire/pipewire.conf either does not exist or no" |
483 |
+ ewarn "longer is set to start a session manager or PulseAudio compatibility daemon (all" |
484 |
+ ewarn "lines similar to '{ path = /usr/bin/pipewire*' should be commented out)" |
485 |
+ ewarn |
486 |
+ ewarn "Those manually starting /usr/bin/pipewire via .xinitrc or similar _must_ from" |
487 |
+ ewarn "now on start ${EROOT}/usr/bin/gentoo-pipewire-launcher instead! It is highly" |
488 |
+ ewarn "advised that a D-Bus user session is set up before starting the script." |
489 |
+ ewarn |
490 |
+ |
491 |
+ if use sound-server && ( has_version 'media-sound/pulseaudio[daemon]' || has_version 'media-sound/pulseaudio-daemon' ) ; then |
492 |
+ elog "This ebuild auto-enables PulseAudio replacement. Because of that, users" |
493 |
+ elog "are recommended to edit pulseaudio client configuration files:" |
494 |
+ elog "${EROOT}/etc/pulse/client.conf and ${EROOT}/etc/pulse/client.conf.d/enable-autospawn.conf" |
495 |
+ elog "if it exists, and disable autospawning of the original daemon by setting:" |
496 |
+ elog |
497 |
+ elog " autospawn = no" |
498 |
+ elog |
499 |
+ elog "Please note that the semicolon (;) must _NOT_ be at the beginning of the line!" |
500 |
+ elog |
501 |
+ elog "Alternatively, if replacing PulseAudio daemon is not desired, edit" |
502 |
+ elog "${EROOT}/usr/bin/gentoo-pipewire-launcher by commenting out the relevant" |
503 |
+ elog "command:" |
504 |
+ elog |
505 |
+ elog "#${EROOT}/usr/bin/pipewire -c pipewire-pulse.conf &" |
506 |
+ elog |
507 |
+ fi |
508 |
+ elog "NOTE:" |
509 |
+ elog "Starting with PipeWire-0.3.30, this package is no longer installing its config" |
510 |
+ elog "into ${EROOT}/etc/pipewire by default. In case you need to change" |
511 |
+ elog "its config, please start by copying default config from ${EROOT}/usr/share/pipewire" |
512 |
+ elog "and just override the sections you want to change." |
513 |
+ fi |
514 |
+ elog |
515 |
+ |
516 |
+ elog "For latest tips and tricks, troubleshooting information and documentation" |
517 |
+ elog "in general, please refer to https://wiki.gentoo.org/wiki/PipeWire" |
518 |
+ elog |
519 |
+ |
520 |
+ optfeature_header "The following can be installed for optional runtime features:" |
521 |
+ optfeature "restricted realtime capabilities via D-Bus" sys-auth/rtkit |
522 |
+ |
523 |
+ if use sound-server && ! use pipewire-alsa; then |
524 |
+ optfeature "ALSA plugin to use PulseAudio interface for output" "media-plugins/alsa-plugins[pulseaudio]" |
525 |
+ fi |
526 |
+ |
527 |
+ if has_version 'net-misc/ofono' ; then |
528 |
+ ewarn "Native backend has become default. Please disable oFono via:" |
529 |
+ if systemd_is_booted ; then |
530 |
+ ewarn "systemctl disable ofono" |
531 |
+ else |
532 |
+ ewarn "rc-update delete ofono" |
533 |
+ fi |
534 |
+ ewarn |
535 |
+ fi |
536 |
+ |
537 |
+ if use system-service; then |
538 |
+ ewarn |
539 |
+ ewarn "WARNING: you have enabled the system-service USE flag, which installs" |
540 |
+ ewarn "the system-wide systemd units that enable PipeWire to run as a system" |
541 |
+ ewarn "service. This is more than likely NOT what you want. You are strongly" |
542 |
+ ewarn "advised not to enable this mode and instead stick with systemd user" |
543 |
+ ewarn "units. The default configuration files will likely not work out of" |
544 |
+ ewarn "box, and you are on your own with configuration." |
545 |
+ ewarn |
546 |
+ fi |
547 |
+} |