From 9063458094cb841badb6b76f423693e28a2b41a11c8b6e8d487017c5085a8117 Mon Sep 17 00:00:00 2001 From: Antonio Larrosa Date: Tue, 29 Mar 2022 16:03:31 +0000 Subject: [PATCH 1/2] Accepting request 965724 from home:alarrosa:branches:multimedia:libs - Add patch from upstream to set locale in apps now that pw_init doesn't call it by itself anymore in pipewire 0.3.49: * 0001-src-setlocale-in-main-for-tools-and-the-daemon.patch OBS-URL: https://build.opensuse.org/request/show/965724 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=39 --- ...ale-in-main-for-tools-and-the-daemon.patch | 85 +++++++++++++++++++ wireplumber.changes | 7 ++ wireplumber.spec | 2 + 3 files changed, 94 insertions(+) create mode 100644 0001-src-setlocale-in-main-for-tools-and-the-daemon.patch diff --git a/0001-src-setlocale-in-main-for-tools-and-the-daemon.patch b/0001-src-setlocale-in-main-for-tools-and-the-daemon.patch new file mode 100644 index 0000000..8c8738a --- /dev/null +++ b/0001-src-setlocale-in-main-for-tools-and-the-daemon.patch @@ -0,0 +1,85 @@ +From 7e6e0e9ba044ca95365f6ceb9f8ae301aac994ae Mon Sep 17 00:00:00 2001 +From: Pauli Virtanen +Date: Tue, 22 Mar 2022 20:51:02 +0200 +Subject: [PATCH] src: setlocale in main() for tools and the daemon + +Previously, pw_init calls setlocale(), but this will change in future. +Setting the locale should be done by the main application, and is needed +in wireplumber for e.g. for translated UI elements. + +Set the locale in main() for wireplumber daemon and tools, to have the +locale set also with the new pw_init behavior. + +Set also LC_NUMERIC to C, to match old pw_init behavior. +--- + src/main.c | 3 +++ + src/tools/wpctl.c | 3 +++ + src/tools/wpexec.c | 3 +++ + 3 files changed, 9 insertions(+) + +diff --git a/src/main.c b/src/main.c +index 3bfaf98e..7e12d29e 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + #define WP_DOMAIN_DAEMON (wp_domain_daemon_quark ()) + static G_DEFINE_QUARK (wireplumber-daemon, wp_domain_daemon); +@@ -402,6 +403,8 @@ main (gint argc, gchar **argv) + g_autoptr (WpProperties) properties = NULL; + g_autofree gchar *config_file_path = NULL; + ++ setlocale (LC_ALL, ""); ++ setlocale (LC_NUMERIC, "C"); + wp_init (WP_INIT_ALL); + + context = g_option_context_new ("- PipeWire Session/Policy Manager"); +diff --git a/src/tools/wpctl.c b/src/tools/wpctl.c +index 8b0fe0aa..81aa936f 100644 +--- a/src/tools/wpctl.c ++++ b/src/tools/wpctl.c +@@ -8,6 +8,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -1114,6 +1115,8 @@ main (gint argc, gchar **argv) + g_autoptr (GError) error = NULL; + g_autofree gchar *summary = NULL; + ++ setlocale (LC_ALL, ""); ++ setlocale (LC_NUMERIC, "C"); + wp_init (WP_INIT_ALL); + + ctl.context = g_option_context_new ( +diff --git a/src/tools/wpexec.c b/src/tools/wpexec.c +index 5e7a4b52..79d90e51 100644 +--- a/src/tools/wpexec.c ++++ b/src/tools/wpexec.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + #define WP_DOMAIN_DAEMON (wp_domain_daemon_quark ()) + static G_DEFINE_QUARK (wireplumber-daemon, wp_domain_daemon); +@@ -219,6 +220,8 @@ main (gint argc, gchar **argv) + g_autoptr (GOptionContext) context = NULL; + g_autoptr (GError) error = NULL; + ++ setlocale (LC_ALL, ""); ++ setlocale (LC_NUMERIC, "C"); + wp_init (WP_INIT_ALL); + + context = g_option_context_new ("- WirePlumber script interpreter"); +-- +GitLab + diff --git a/wireplumber.changes b/wireplumber.changes index b050882..f5b9d9f 100644 --- a/wireplumber.changes +++ b/wireplumber.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Mar 29 12:04:24 UTC 2022 - Antonio Larrosa + +- Add patch from upstream to set locale in apps now that pw_init + doesn't call it by itself anymore in pipewire 0.3.49: + * 0001-src-setlocale-in-main-for-tools-and-the-daemon.patch + ------------------------------------------------------------------- Fri Mar 25 07:47:09 UTC 2022 - Antonio Larrosa diff --git a/wireplumber.spec b/wireplumber.spec index ccce7d4..47fcb28 100644 --- a/wireplumber.spec +++ b/wireplumber.spec @@ -30,6 +30,8 @@ Group: Development/Libraries/C and C++ URL: https://gitlab.freedesktop.org/pipewire/wireplumber Source0: wireplumber-%{version}.tar.xz Source1: split-config-file.py +# PATCH-FIX-UPSTREAM +Patch0: 0001-src-setlocale-in-main-for-tools-and-the-daemon.patch # PATCH-FIX-OPENSUSE reduce-meson-dependency.patch Patch100: reduce-meson-required-version.patch # docs From a6e37ec93c2f0f21d5d7399ab24abd58428632807d08bd7c07b367350008a39b Mon Sep 17 00:00:00 2001 From: Antonio Larrosa Date: Wed, 30 Mar 2022 16:19:47 +0000 Subject: [PATCH 2/2] Accepting request 966060 from home:alarrosa:branches:multimedia:libs - Add patch from upstream to fix no sound on reconnection of bluetooth device (glfo#pipewire/wireplumber#234): * 0001-scripts-policy-device-profile-clear-tables-when-devices-removed.patch OBS-URL: https://build.opensuse.org/request/show/966060 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=40 --- ...le-clear-tables-when-devices-removed.patch | 31 +++++++++++++++++++ wireplumber.changes | 7 +++++ wireplumber.spec | 2 ++ 3 files changed, 40 insertions(+) create mode 100644 0001-scripts-policy-device-profile-clear-tables-when-devices-removed.patch diff --git a/0001-scripts-policy-device-profile-clear-tables-when-devices-removed.patch b/0001-scripts-policy-device-profile-clear-tables-when-devices-removed.patch new file mode 100644 index 0000000..ddcb328 --- /dev/null +++ b/0001-scripts-policy-device-profile-clear-tables-when-devices-removed.patch @@ -0,0 +1,31 @@ +From 82856f8643402d56b62d62b0eea4debfae1cd16e Mon Sep 17 00:00:00 2001 +From: Pauli Virtanen +Date: Mon, 28 Mar 2022 20:16:52 +0300 +Subject: [PATCH] scripts: policy-device-profile: clear tables when devices + removed + +When device ids are invalidated, clear all local tables about them, +because the id may be reused by different object, or the same object +reappearing. +--- + src/scripts/policy-device-profile.lua | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/scripts/policy-device-profile.lua b/src/scripts/policy-device-profile.lua +index d0aa2696..9daeafaa 100644 +--- a/src/scripts/policy-device-profile.lua ++++ b/src/scripts/policy-device-profile.lua +@@ -229,4 +229,10 @@ self.om:connect("object-added", function (_, device) + handleProfiles (device, true) + end) + ++self.om:connect("object-removed", function (_, device) ++ local dev_id = device["bound-id"] ++ self.active_profiles[dev_id] = nil ++ self.best_profiles[dev_id] = nil ++end) ++ + self.om:activate() +-- +GitLab + diff --git a/wireplumber.changes b/wireplumber.changes index f5b9d9f..f707cfc 100644 --- a/wireplumber.changes +++ b/wireplumber.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Mar 30 16:12:03 UTC 2022 - Antonio Larrosa + +- Add patch from upstream to fix no sound on reconnection of + bluetooth device (glfo#pipewire/wireplumber#234): + * 0001-scripts-policy-device-profile-clear-tables-when-devices-removed.patch + ------------------------------------------------------------------- Tue Mar 29 12:04:24 UTC 2022 - Antonio Larrosa diff --git a/wireplumber.spec b/wireplumber.spec index 47fcb28..ed47974 100644 --- a/wireplumber.spec +++ b/wireplumber.spec @@ -32,6 +32,8 @@ Source0: wireplumber-%{version}.tar.xz Source1: split-config-file.py # PATCH-FIX-UPSTREAM Patch0: 0001-src-setlocale-in-main-for-tools-and-the-daemon.patch +# PATCH-FIX-UPSTREAM +Patch1: 0001-scripts-policy-device-profile-clear-tables-when-devices-removed.patch # PATCH-FIX-OPENSUSE reduce-meson-dependency.patch Patch100: reduce-meson-required-version.patch # docs