* [gentoo-commits] repo/gentoo:master commit in: media-video/pipewire/files/0.3.75/, media-video/pipewire/
@ 2023-07-23 17:41 Sam James
0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2023-07-23 17:41 UTC (permalink / raw
To: gentoo-commits
commit: e29598d80e5b6f0e45eccdcab2f920304f2ed0b7
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 23 17:39:52 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul 23 17:39:52 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e29598d8
media-video/pipewire: backport two fixes to 0.3.75
1. Crash fix for when can't connect to dbus (bug #910714)
2. Help out software misusing API, like older mpv (new fixed mpv will be in tree
shortly anyway) (https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3374)
Closes: https://bugs.gentoo.org/910714
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../0001-module-rt-error-out-on-load-no-bus.patch | 83 ++++++++++++++++++++++
...2-thread-loop-only-signal-when-option-set.patch | 68 ++++++++++++++++++
...ire-0.3.75.ebuild => pipewire-0.3.75-r1.ebuild} | 0
3 files changed, 151 insertions(+)
diff --git a/media-video/pipewire/files/0.3.75/0001-module-rt-error-out-on-load-no-bus.patch b/media-video/pipewire/files/0.3.75/0001-module-rt-error-out-on-load-no-bus.patch
new file mode 100644
index 000000000000..8885eb8a564f
--- /dev/null
+++ b/media-video/pipewire/files/0.3.75/0001-module-rt-error-out-on-load-no-bus.patch
@@ -0,0 +1,83 @@
+https://bugs.gentoo.org/910714
+https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/55812195ce3b77317e7a2dc642b78271f3a45c8e
+
+From 55812195ce3b77317e7a2dc642b78271f3a45c8e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram@gmail.com>
+Date: Sat, 22 Jul 2023 01:20:58 +0000
+Subject: [PATCH] module-rt: error out on load if no bus is available
+
+Since the recent changes to the RT module in Pipewire 0.3.75, some
+applications such as those using OpenAL-Soft crash on startup if
+neither the session nor the system bus is available. For example:
+
+ bwrap --dev-bind / / \
+ --bind /dev/null /run/dbus/system_bus_socket \
+ --bind /dev/null $XDG_RUNTIME_DIR/bus \
+ openal-info
+
+Will result in a crash with the following error message:
+
+ dbus[1626147]: arguments to dbus_message_new_method_call() were
+ incorrect, assertion "path != NULL" failed in file dbus-message.c
+ line 1373.
+ This is normally a bug in some application using the D-Bus library.
+
+The RT module previously failed to load if no bus was available, but
+after the recent changes, the init. logic runs in a thread, and failing
+to obtain the bus no longer causes the module to fail to load.
+
+Then, functions called later such as `pw_rtkit_make_realtime` assume
+the bus is available and try to use it, causing the error above.
+
+Put the logic for obtaining and checking the bus back to `module_init`,
+so the module fails to load again if no bus is available.
+--- a/src/modules/module-rt.c
++++ b/src/modules/module-rt.c
+@@ -923,14 +923,11 @@ static int check_rtkit(struct impl *impl, struct pw_context *context, bool *can_
+ return 0;
+ }
+
+-static int do_rtkit_setup(struct spa_loop *loop, bool async, uint32_t seq,
+- const void *data, size_t size, void *user_data)
++static int rtkit_get_bus(struct impl *impl)
+ {
+- struct impl *impl = user_data;
+ int res;
+- long long retval;
+
+- pw_log_debug("enter rtkit setup");
++ pw_log_debug("enter rtkit get bus");
+
+ /* Checking xdg-desktop-portal. It works fine in all situations. */
+ if (impl->rtportal_enabled)
+@@ -967,6 +964,18 @@ static int do_rtkit_setup(struct spa_loop *loop, bool async, uint32_t seq,
+ return res;
+ }
+ }
++
++ return 0;
++}
++
++static int do_rtkit_setup(struct spa_loop *loop, bool async, uint32_t seq,
++ const void *data, size_t size, void *user_data)
++{
++ struct impl *impl = user_data;
++ long long retval;
++
++ pw_log_debug("enter rtkit setup");
++
+ /* get some properties */
+ if (rtkit_get_int_property(impl, "MaxRealtimePriority", &retval) < 0) {
+ retval = 1;
+@@ -1076,6 +1085,9 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
+ #ifdef HAVE_DBUS
+ impl->use_rtkit = use_rtkit;
+ if (impl->use_rtkit) {
++ if ((res = rtkit_get_bus(impl)) < 0)
++ goto error;
++
+ impl->thread_loop = pw_thread_loop_new("module-rt", NULL);
+ if (impl->thread_loop == NULL) {
+ res = -errno;
+--
+GitLab
diff --git a/media-video/pipewire/files/0.3.75/0002-thread-loop-only-signal-when-option-set.patch b/media-video/pipewire/files/0.3.75/0002-thread-loop-only-signal-when-option-set.patch
new file mode 100644
index 000000000000..670847b2f86a
--- /dev/null
+++ b/media-video/pipewire/files/0.3.75/0002-thread-loop-only-signal-when-option-set.patch
@@ -0,0 +1,68 @@
+https://github.com/mpv-player/mpv/issues/11995
+https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3374
+https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/920bb7160e0be0ce5729d9538f6dea966f297603
+
+From 920bb7160e0be0ce5729d9538f6dea966f297603 Mon Sep 17 00:00:00 2001
+From: Wim Taymans <wtaymans@redhat.com>
+Date: Sun, 23 Jul 2023 18:16:00 +0200
+Subject: [PATCH] thread-loop: only signal when option is set
+
+Add a thead-loop.start-signal option that will do a signal before
+entering the thread loop. Doing the signal in all cases can confuse
+apps that don't expect the signal.
+
+Make module-rt use the thread-loop.start-signal.
+
+Fixes #3374
+--- a/src/modules/module-rt.c
++++ b/src/modules/module-rt.c
+@@ -1085,10 +1085,14 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
+ #ifdef HAVE_DBUS
+ impl->use_rtkit = use_rtkit;
+ if (impl->use_rtkit) {
++ struct spa_dict_item items[] = {
++ { "thread-loop.start-signal", "true" }
++ };
+ if ((res = rtkit_get_bus(impl)) < 0)
+ goto error;
+
+- impl->thread_loop = pw_thread_loop_new("module-rt", NULL);
++ impl->thread_loop = pw_thread_loop_new("module-rt",
++ &SPA_DICT_INIT_ARRAY(items));
+ if (impl->thread_loop == NULL) {
+ res = -errno;
+ goto error;
+--- a/src/pipewire/thread-loop.c
++++ b/src/pipewire/thread-loop.c
+@@ -43,6 +43,7 @@ struct pw_thread_loop {
+ int n_waiting_for_accept;
+ unsigned int created:1;
+ unsigned int running:1;
++ unsigned int start_signal:1;
+ };
+ /** \endcond */
+
+@@ -143,6 +144,11 @@ static struct pw_thread_loop *loop_new(struct pw_loop *loop,
+ return NULL;
+
+ pw_log_debug("%p: new name:%s", this, name);
++ if (props != NULL) {
++ const char *str = spa_dict_lookup(props, "thread-loop.start-signal");
++ if (str != NULL)
++ this->start_signal = spa_atob(str);
++ }
+
+ if (loop == NULL) {
+ loop = pw_loop_new(props);
+@@ -282,7 +288,8 @@ static void *do_loop(void *user_data)
+ pw_log_debug("%p: enter thread", this);
+ pw_loop_enter(this->loop);
+
+- pw_thread_loop_signal(this, false);
++ if (this->start_signal)
++ pw_thread_loop_signal(this, false);
+
+ while (this->running) {
+ if ((res = pw_loop_iterate(this->loop, -1)) < 0) {
+--
+GitLab
diff --git a/media-video/pipewire/pipewire-0.3.75.ebuild b/media-video/pipewire/pipewire-0.3.75-r1.ebuild
similarity index 100%
rename from media-video/pipewire/pipewire-0.3.75.ebuild
rename to media-video/pipewire/pipewire-0.3.75-r1.ebuild
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-video/pipewire/files/0.3.75/, media-video/pipewire/
@ 2023-07-27 9:19 Sam James
0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2023-07-27 9:19 UTC (permalink / raw
To: gentoo-commits
commit: c2351b1123866a33d58d60c4313464bb5bd1a6ba
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 27 09:18:49 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jul 27 09:18:49 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2351b11
media-video/pipewire: backport version.h include fix for 0.3.75
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../0.3.75/0003-missing-include-version.h.patch | 21 +++++++++++++++++++++
...e-0.3.75-r1.ebuild => pipewire-0.3.75-r2.ebuild} | 0
2 files changed, 21 insertions(+)
diff --git a/media-video/pipewire/files/0.3.75/0003-missing-include-version.h.patch b/media-video/pipewire/files/0.3.75/0003-missing-include-version.h.patch
new file mode 100644
index 000000000000..b1c688bba343
--- /dev/null
+++ b/media-video/pipewire/files/0.3.75/0003-missing-include-version.h.patch
@@ -0,0 +1,21 @@
+https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/193384b26aba3917d086ac3f009aa2cab9d197d2
+
+From 193384b26aba3917d086ac3f009aa2cab9d197d2 Mon Sep 17 00:00:00 2001
+From: "Tom A. Wagner" <tom.a.wagner@protonmail.com>
+Date: Mon, 24 Jul 2023 12:48:33 +0200
+Subject: [PATCH] pipewire: add missing stdbool.h include to version.h.in
+
+The header file only works when included in a file where stdbool.h was already included otherwise.
+--- a/src/pipewire/version.h.in
++++ b/src/pipewire/version.h.in
+@@ -11,6 +11,8 @@
+ extern "C" {
+ #endif
+
++#include <stdbool.h>
++
+ /** Return the version of the header files. Keep in mind that this is
+ a macro and not a function, so it is impossible to get the pointer of
+ it. */
+--
+GitLab
diff --git a/media-video/pipewire/pipewire-0.3.75-r1.ebuild b/media-video/pipewire/pipewire-0.3.75-r2.ebuild
similarity index 100%
rename from media-video/pipewire/pipewire-0.3.75-r1.ebuild
rename to media-video/pipewire/pipewire-0.3.75-r2.ebuild
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-27 9:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-27 9:19 [gentoo-commits] repo/gentoo:master commit in: media-video/pipewire/files/0.3.75/, media-video/pipewire/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2023-07-23 17:41 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox