1 |
commit: 6773cae240f67b63545aad170a8ce49222379296 |
2 |
Author: Niklāvs Koļesņikovs <89q1r14hd <AT> relay <DOT> firefox <DOT> com> |
3 |
AuthorDate: Sun May 29 14:05:25 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 30 04:42:28 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6773cae2 |
7 |
|
8 |
media-video/wireplumber: fix a bad mistake in 0.4.10-r2 by doing -r3 |
9 |
|
10 |
Somehow git format-patch ended up producing a revert for an unrelated |
11 |
commit which either randomly or perhaps via some copy and paste error |
12 |
happened to be a revert of the only patch that 0.4.10-r1 was applying. |
13 |
|
14 |
Because of that wireplumber-0.4.10-r2 incorrectly dropped it. This is |
15 |
now fixed in 0.4.10-r3 by reinstating the removed patch as well as |
16 |
adding in the one that was meant to be present in -r2 but had been |
17 |
incorrectly generated due to probably wrong git format-patch command. |
18 |
|
19 |
Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd <AT> relay.firefox.com> |
20 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
21 |
|
22 |
...nodes-don-t-check-if-all-device-nodes-are.patch | 187 +++++++++++++++++++++ |
23 |
.../wireplumber/wireplumber-0.4.10-r3.ebuild | 126 ++++++++++++++ |
24 |
2 files changed, 313 insertions(+) |
25 |
|
26 |
diff --git a/media-video/wireplumber/files/wireplumber-0.4.10-m-default-nodes-don-t-check-if-all-device-nodes-are.patch b/media-video/wireplumber/files/wireplumber-0.4.10-m-default-nodes-don-t-check-if-all-device-nodes-are.patch |
27 |
new file mode 100644 |
28 |
index 000000000000..d9c51489a893 |
29 |
--- /dev/null |
30 |
+++ b/media-video/wireplumber/files/wireplumber-0.4.10-m-default-nodes-don-t-check-if-all-device-nodes-are.patch |
31 |
@@ -0,0 +1,187 @@ |
32 |
+https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/392cce2136e81ac3146078eacbbae85b694c917a |
33 |
+ |
34 |
+From 392cce2136e81ac3146078eacbbae85b694c917a Mon Sep 17 00:00:00 2001 |
35 |
+From: Julian Bouzas <julian.bouzas@×××××××××.com> |
36 |
+Date: Fri, 20 May 2022 07:38:24 -0400 |
37 |
+Subject: [PATCH] m-default-nodes: don't check if all device nodes are ready |
38 |
+ when finding default node |
39 |
+ |
40 |
+This check was originally added to avoid a small audio glitch when changing |
41 |
+default nodes while also changing the device profile (eg Gnome Sound Settings). |
42 |
+The check is removed because it causes issues when disabling alsa nodes. There |
43 |
+are plans to fix the audio glitch issue in the future with the planned |
44 |
+event-dispatcher architecture. |
45 |
+ |
46 |
+Fixes #279 |
47 |
+--- |
48 |
+ modules/module-default-nodes.c | 136 --------------------------------- |
49 |
+ 1 file changed, 136 deletions(-) |
50 |
+ |
51 |
+diff --git a/modules/module-default-nodes.c b/modules/module-default-nodes.c |
52 |
+index 0fdaed5..577f9bb 100644 |
53 |
+--- a/modules/module-default-nodes.c |
54 |
++++ b/modules/module-default-nodes.c |
55 |
+@@ -345,135 +345,6 @@ reevaluate_default_node (WpDefaultNodes * self, WpMetadata *m, gint node_t) |
56 |
+ } |
57 |
+ } |
58 |
+ |
59 |
+-static guint |
60 |
+-get_device_total_nodes (WpPipewireObject * proxy) |
61 |
+-{ |
62 |
+- g_autoptr (WpIterator) profiles = NULL; |
63 |
+- g_auto (GValue) item = G_VALUE_INIT; |
64 |
+- |
65 |
+- profiles = wp_pipewire_object_enum_params_sync (proxy, "Profile", NULL); |
66 |
+- if (!profiles) |
67 |
+- return 0; |
68 |
+- |
69 |
+- for (; wp_iterator_next (profiles, &item); g_value_unset (&item)) { |
70 |
+- WpSpaPod *pod = g_value_get_boxed (&item); |
71 |
+- gint idx = -1; |
72 |
+- const gchar *name = NULL; |
73 |
+- g_autoptr (WpSpaPod) classes = NULL; |
74 |
+- |
75 |
+- /* Parse */ |
76 |
+- if (!wp_spa_pod_get_object (pod, NULL, |
77 |
+- "index", "i", &idx, |
78 |
+- "name", "s", &name, |
79 |
+- "classes", "?P", &classes, |
80 |
+- NULL)) |
81 |
+- continue; |
82 |
+- if (!classes) |
83 |
+- continue; |
84 |
+- |
85 |
+- /* Parse profile classes */ |
86 |
+- { |
87 |
+- g_autoptr (WpIterator) it = wp_spa_pod_new_iterator (classes); |
88 |
+- g_auto (GValue) v = G_VALUE_INIT; |
89 |
+- gint total_nodes = 0; |
90 |
+- for (; wp_iterator_next (it, &v); g_value_unset (&v)) { |
91 |
+- WpSpaPod *entry = g_value_get_boxed (&v); |
92 |
+- g_autoptr (WpSpaPodParser) pp = NULL; |
93 |
+- const gchar *media_class = NULL; |
94 |
+- gint n_nodes = 0; |
95 |
+- g_return_val_if_fail (entry, 0); |
96 |
+- if (!wp_spa_pod_is_struct (entry)) |
97 |
+- continue; |
98 |
+- pp = wp_spa_pod_parser_new_struct (entry); |
99 |
+- g_return_val_if_fail (pp, 0); |
100 |
+- g_return_val_if_fail (wp_spa_pod_parser_get_string (pp, &media_class), 0); |
101 |
+- g_return_val_if_fail (wp_spa_pod_parser_get_int (pp, &n_nodes), 0); |
102 |
+- wp_spa_pod_parser_end (pp); |
103 |
+- |
104 |
+- total_nodes += n_nodes; |
105 |
+- } |
106 |
+- |
107 |
+- if (total_nodes > 0) |
108 |
+- return total_nodes; |
109 |
+- } |
110 |
+- } |
111 |
+- |
112 |
+- return 0; |
113 |
+-} |
114 |
+- |
115 |
+-static gboolean |
116 |
+-nodes_ready (WpDefaultNodes * self) |
117 |
+-{ |
118 |
+- g_autoptr (WpIterator) it = NULL; |
119 |
+- g_auto (GValue) val = G_VALUE_INIT; |
120 |
+- |
121 |
+- /* Get the total number of nodes for each device and make sure they exist |
122 |
+- * and have at least 1 port */ |
123 |
+- it = wp_object_manager_new_filtered_iterator (self->rescan_om, |
124 |
+- WP_TYPE_DEVICE, NULL); |
125 |
+- for (; wp_iterator_next (it, &val); g_value_unset (&val)) { |
126 |
+- WpPipewireObject *device = g_value_get_object (&val); |
127 |
+- guint total_nodes = get_device_total_nodes (device); |
128 |
+- if (total_nodes > 0) { |
129 |
+- guint32 device_id = wp_proxy_get_bound_id (WP_PROXY (device)); |
130 |
+- g_autoptr (WpIterator) node_it = NULL; |
131 |
+- g_auto (GValue) node_val = G_VALUE_INIT; |
132 |
+- guint ready_nodes = 0; |
133 |
+- |
134 |
+- node_it = wp_object_manager_new_filtered_iterator (self->rescan_om, |
135 |
+- WP_TYPE_NODE, WP_CONSTRAINT_TYPE_PW_PROPERTY, |
136 |
+- PW_KEY_DEVICE_ID, "=i", device_id, NULL); |
137 |
+- for (; wp_iterator_next (node_it, &node_val); g_value_unset (&node_val)) { |
138 |
+- WpPipewireObject *node = g_value_get_object (&node_val); |
139 |
+- g_autoptr (WpPort) port = |
140 |
+- wp_object_manager_lookup (self->rescan_om, |
141 |
+- WP_TYPE_PORT, WP_CONSTRAINT_TYPE_PW_PROPERTY, |
142 |
+- PW_KEY_NODE_ID, "=u", wp_proxy_get_bound_id (WP_PROXY (node)), |
143 |
+- NULL); |
144 |
+- if (port) |
145 |
+- ready_nodes++; |
146 |
+- } |
147 |
+- |
148 |
+- if (ready_nodes < total_nodes) { |
149 |
+- const gchar *device_name = wp_pipewire_object_get_property ( |
150 |
+- WP_PIPEWIRE_OBJECT (device), PW_KEY_DEVICE_NAME); |
151 |
+- wp_debug_object (self, "device '%s' is not ready (%d/%d)", device_name, |
152 |
+- ready_nodes, total_nodes); |
153 |
+- return FALSE; |
154 |
+- } |
155 |
+- } |
156 |
+- } |
157 |
+- |
158 |
+- /* Make sure Audio and Video virtual sources have ports */ |
159 |
+- { |
160 |
+- g_autoptr (WpIterator) node_it = NULL; |
161 |
+- g_auto (GValue) node_val = G_VALUE_INIT; |
162 |
+- node_it = wp_object_manager_new_filtered_iterator (self->rescan_om, |
163 |
+- WP_TYPE_NODE, WP_CONSTRAINT_TYPE_PW_PROPERTY, PW_KEY_DEVICE_ID, "-", |
164 |
+- NULL); |
165 |
+- for (; wp_iterator_next (node_it, &node_val); g_value_unset (&node_val)) { |
166 |
+- WpPipewireObject *node = g_value_get_object (&node_val); |
167 |
+- const gchar *media_class = wp_pipewire_object_get_property ( |
168 |
+- WP_PIPEWIRE_OBJECT (node), PW_KEY_MEDIA_CLASS); |
169 |
+- g_autoptr (WpPort) port = |
170 |
+- wp_object_manager_lookup (self->rescan_om, |
171 |
+- WP_TYPE_PORT, WP_CONSTRAINT_TYPE_PW_PROPERTY, |
172 |
+- PW_KEY_NODE_ID, "=u", wp_proxy_get_bound_id (WP_PROXY (node)), |
173 |
+- NULL); |
174 |
+- if (!port && |
175 |
+- (g_strcmp0 ("Audio/Source/Virtual", media_class) == 0 || |
176 |
+- g_strcmp0 ("Video/Source/Virtual", media_class) == 0)) { |
177 |
+- const gchar *node_name = wp_pipewire_object_get_property ( |
178 |
+- WP_PIPEWIRE_OBJECT (node), PW_KEY_NODE_NAME); |
179 |
+- wp_debug_object (self, "virtual node '%s' is not ready", node_name); |
180 |
+- return FALSE; |
181 |
+- } |
182 |
+- } |
183 |
+- } |
184 |
+- |
185 |
+- return TRUE; |
186 |
+-} |
187 |
+- |
188 |
+ static void |
189 |
+ sync_rescan (WpCore * core, GAsyncResult * res, WpDefaultNodes * self) |
190 |
+ { |
191 |
+@@ -491,10 +362,6 @@ sync_rescan (WpCore * core, GAsyncResult * res, WpDefaultNodes * self) |
192 |
+ if (!metadata) |
193 |
+ return; |
194 |
+ |
195 |
+- /* Make sure nodes are ready for current profile */ |
196 |
+- if (!nodes_ready (self)) |
197 |
+- return; |
198 |
+- |
199 |
+ wp_trace_object (self, "re-evaluating defaults"); |
200 |
+ reevaluate_default_node (self, metadata, AUDIO_SINK); |
201 |
+ reevaluate_default_node (self, metadata, AUDIO_SOURCE); |
202 |
+@@ -584,13 +451,10 @@ on_metadata_added (WpObjectManager *om, WpMetadata *metadata, gpointer d) |
203 |
+ self->rescan_om = wp_object_manager_new (); |
204 |
+ wp_object_manager_add_interest (self->rescan_om, WP_TYPE_DEVICE, NULL); |
205 |
+ wp_object_manager_add_interest (self->rescan_om, WP_TYPE_NODE, NULL); |
206 |
+- wp_object_manager_add_interest (self->rescan_om, WP_TYPE_PORT, NULL); |
207 |
+ wp_object_manager_request_object_features (self->rescan_om, WP_TYPE_DEVICE, |
208 |
+ WP_OBJECT_FEATURES_ALL); |
209 |
+ wp_object_manager_request_object_features (self->rescan_om, WP_TYPE_NODE, |
210 |
+ WP_OBJECT_FEATURES_ALL); |
211 |
+- wp_object_manager_request_object_features (self->rescan_om, WP_TYPE_PORT, |
212 |
+- WP_OBJECT_FEATURES_ALL); |
213 |
+ g_signal_connect_object (self->rescan_om, "objects-changed", |
214 |
+ G_CALLBACK (schedule_rescan), self, G_CONNECT_SWAPPED); |
215 |
+ g_signal_connect_object (self->rescan_om, "object-added", |
216 |
+-- |
217 |
+2.35.1 |
218 |
+ |
219 |
|
220 |
diff --git a/media-video/wireplumber/wireplumber-0.4.10-r3.ebuild b/media-video/wireplumber/wireplumber-0.4.10-r3.ebuild |
221 |
new file mode 100644 |
222 |
index 000000000000..f5d48d6fca34 |
223 |
--- /dev/null |
224 |
+++ b/media-video/wireplumber/wireplumber-0.4.10-r3.ebuild |
225 |
@@ -0,0 +1,126 @@ |
226 |
+# Copyright 1999-2022 Gentoo Authors |
227 |
+# Distributed under the terms of the GNU General Public License v2 |
228 |
+ |
229 |
+EAPI=8 |
230 |
+ |
231 |
+LUA_COMPAT=( lua5-{3,4} ) |
232 |
+ |
233 |
+inherit lua-single meson systemd |
234 |
+ |
235 |
+if [[ ${PV} == 9999 ]]; then |
236 |
+ EGIT_REPO_URI="https://gitlab.freedesktop.org/pipewire/${PN}.git" |
237 |
+ EGIT_BRANCH="master" |
238 |
+ inherit git-r3 |
239 |
+else |
240 |
+ SRC_URI="https://gitlab.freedesktop.org/pipewire/${PN}/-/archive/${PV}/${P}.tar.gz" |
241 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86" |
242 |
+fi |
243 |
+ |
244 |
+DESCRIPTION="Replacement for pipewire-media-session" |
245 |
+HOMEPAGE="https://gitlab.freedesktop.org/pipewire/wireplumber" |
246 |
+ |
247 |
+LICENSE="MIT" |
248 |
+SLOT="0/0.4" |
249 |
+IUSE="elogind system-service systemd test" |
250 |
+ |
251 |
+REQUIRED_USE=" |
252 |
+ ${LUA_REQUIRED_USE} |
253 |
+ ?? ( elogind systemd ) |
254 |
+ system-service? ( systemd ) |
255 |
+" |
256 |
+ |
257 |
+RESTRICT="!test? ( test )" |
258 |
+ |
259 |
+# introspection? ( dev-libs/gobject-introspection ) is valid but likely only used for doc building |
260 |
+BDEPEND=" |
261 |
+ dev-libs/glib |
262 |
+ dev-util/gdbus-codegen |
263 |
+ dev-util/glib-utils |
264 |
+ sys-devel/gettext |
265 |
+" |
266 |
+ |
267 |
+DEPEND=" |
268 |
+ ${LUA_DEPS} |
269 |
+ >=dev-libs/glib-2.62 |
270 |
+ >=media-video/pipewire-0.3.48:= |
271 |
+ virtual/libc |
272 |
+ virtual/libintl |
273 |
+ elogind? ( sys-auth/elogind ) |
274 |
+ systemd? ( sys-apps/systemd ) |
275 |
+" |
276 |
+ |
277 |
+# Any dev-lua/* deps get declared like this inside RDEPEND: |
278 |
+# $(lua_gen_cond_dep ' |
279 |
+# dev-lua/<NAME>[${LUA_USEDEP}] |
280 |
+# ') |
281 |
+RDEPEND="${DEPEND} |
282 |
+ system-service? ( |
283 |
+ acct-user/pipewire |
284 |
+ acct-group/pipewire |
285 |
+ ) |
286 |
+" |
287 |
+ |
288 |
+DOCS=( {NEWS,README}.rst ) |
289 |
+ |
290 |
+PATCHES=( |
291 |
+ "${FILESDIR}"/${P}-config-fix-enabled-property-to-default-to-true-when.patch |
292 |
+ "${FILESDIR}"/${P}-m-lua-scripting-allow-converting-GValue-holding-NUL.patch |
293 |
+ "${FILESDIR}"/${P}-alsa.lua-fix-device-name-deduplication-when-reserva.patch |
294 |
+ "${FILESDIR}"/${P}-m-default-nodes-don-t-check-if-all-device-nodes-are.patch |
295 |
+ "${FILESDIR}"/${P}-m-lua-scripting-fix-object-refcounting.patch |
296 |
+) |
297 |
+ |
298 |
+src_configure() { |
299 |
+ local emesonargs=( |
300 |
+ -Ddoc=disabled # Ebuild not wired up yet (Sphinx, Doxygen?) |
301 |
+ -Dintrospection=disabled # Only used for Sphinx doc generation |
302 |
+ -Dsystem-lua=true # We always unbundle everything we can |
303 |
+ -Dsystem-lua-version=$(ver_cut 1-2 $(lua_get_version)) |
304 |
+ $(meson_feature elogind) |
305 |
+ $(meson_feature systemd) |
306 |
+ $(meson_use system-service systemd-system-service) |
307 |
+ $(meson_use systemd systemd-user-service) |
308 |
+ -Dsystemd-system-unit-dir=$(systemd_get_systemunitdir) |
309 |
+ -Dsystemd-user-unit-dir=$(systemd_get_userunitdir) |
310 |
+ $(meson_use test tests) |
311 |
+ ) |
312 |
+ |
313 |
+ meson_src_configure |
314 |
+} |
315 |
+ |
316 |
+src_install() { |
317 |
+ meson_src_install |
318 |
+ |
319 |
+ # We copy the default config, so that Gentoo tools can pick up on any |
320 |
+ # updates and /etc does not end up with stale overrides. |
321 |
+ # If a reflinking CoW filesystem is used (e.g. Btrfs), then the files |
322 |
+ # will not actually get stored twice until modified. |
323 |
+ insinto /etc |
324 |
+ doins -r ${ED}/usr/share/wireplumber |
325 |
+} |
326 |
+ |
327 |
+pkg_postinst() { |
328 |
+ if systemd_is_booted ; then |
329 |
+ ewarn "pipewire-media-session.service is no longer installed. You must switch" |
330 |
+ ewarn "to wireplumber.service user unit before your next logout/reboot:" |
331 |
+ ewarn "systemctl --user disable pipewire-media-session.service" |
332 |
+ ewarn "systemctl --user --force enable wireplumber.service" |
333 |
+ else |
334 |
+ ewarn "Switch to WirePlumber will happen the next time gentoo-pipewire-launcher" |
335 |
+ ewarn "is started (a replacement for directly calling pipewire binary)." |
336 |
+ ewarn |
337 |
+ ewarn "Please ensure that ${EROOT}/etc/pipewire/pipewire.conf either does not exist" |
338 |
+ ewarn "or, if it does exist, that any reference to" |
339 |
+ ewarn "${EROOT}/usr/bin/pipewire-media-session is commented out (begins with a #)." |
340 |
+ fi |
341 |
+ if use system-service; then |
342 |
+ ewarn |
343 |
+ ewarn "WARNING: you have enabled the system-service USE flag, which installs" |
344 |
+ ewarn "the system-wide systemd units that enable WirePlumber to run as a system" |
345 |
+ ewarn "service. This is more than likely NOT what you want. You are strongly" |
346 |
+ ewarn "advised not to enable this mode and instead stick with systemd user" |
347 |
+ ewarn "units. The default configuration files will likely not work out of" |
348 |
+ ewarn "box, and you are on your own with configuration." |
349 |
+ ewarn |
350 |
+ fi |
351 |
+} |