From 8fc7b977aa5315ca1ec58a89cee46d8a2275e2e296e081b378b36d61738b8eed Mon Sep 17 00:00:00 2001 From: Antonio Larrosa Date: Fri, 14 Jan 2022 16:07:09 +0000 Subject: [PATCH] Accepting request 946457 from home:alarrosa:branches:multimedia:libs - Add patch from upstream to fix a problem changing the default device: * 0001-default-nodes-increase-priority-if-node-has-available-routes.patch - Add patch from upstream to fix selection of Pro Audio nodes as default nodes: * 0002-default-nodes-handle-nodes-without-Routes.patch OBS-URL: https://build.opensuse.org/request/show/946457 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=20 --- ...riority-if-node-has-available-routes.patch | 32 +++++++++++++ ...lt-nodes-handle-nodes-without-Routes.patch | 47 +++++++++++++++++++ wireplumber.changes | 11 +++++ wireplumber.spec | 2 + 4 files changed, 92 insertions(+) create mode 100644 0001-default-nodes-increase-priority-if-node-has-available-routes.patch create mode 100644 0002-default-nodes-handle-nodes-without-Routes.patch diff --git a/0001-default-nodes-increase-priority-if-node-has-available-routes.patch b/0001-default-nodes-increase-priority-if-node-has-available-routes.patch new file mode 100644 index 0000000..2cdb792 --- /dev/null +++ b/0001-default-nodes-increase-priority-if-node-has-available-routes.patch @@ -0,0 +1,32 @@ +From ad80faaa8da75fd562cac4eb776312b83160c9d9 Mon Sep 17 00:00:00 2001 +From: Julian Bouzas +Date: Fri, 14 Jan 2022 07:24:52 -0500 +Subject: [PATCH] default-nodes: increase priority if node has available routes + +Fixes #163 +--- + modules/module-default-nodes.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/modules/module-default-nodes.c b/modules/module-default-nodes.c +index ac9a87bd..32b2725b 100644 +--- a/modules/module-default-nodes.c ++++ b/modules/module-default-nodes.c +@@ -206,11 +206,11 @@ find_best_media_class_node (WpDefaultNodes * self, const gchar *media_class, + WP_PIPEWIRE_OBJECT (node), PW_KEY_PRIORITY_SESSION); + gint prio = prio_str ? atoi (prio_str) : -1; + +- if (!node_has_available_routes (self, node)) +- continue; ++ if (node_has_available_routes (self, node)) ++ prio += 10000; + + if (name && node_name && g_strcmp0 (name, node_name) == 0) +- prio += 10000; ++ prio += 20000; + + if (prio > highest_prio || res == NULL) { + highest_prio = prio; +-- +GitLab + diff --git a/0002-default-nodes-handle-nodes-without-Routes.patch b/0002-default-nodes-handle-nodes-without-Routes.patch new file mode 100644 index 0000000..457c6e1 --- /dev/null +++ b/0002-default-nodes-handle-nodes-without-Routes.patch @@ -0,0 +1,47 @@ +From 211f1e6b6cd4898121e4c2b821fae4dea6cc3317 Mon Sep 17 00:00:00 2001 +From: Wim Taymans +Date: Fri, 14 Jan 2022 16:28:48 +0100 +Subject: [PATCH] default-nodes: handle nodes without Routes + +When a node has not part of any EnumRoute, we must assume it is +available. + +Fixes selection of Pro Audio nodes as default nodes. +--- + modules/module-default-nodes.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/modules/module-default-nodes.c b/modules/module-default-nodes.c +index 32b2725b..15aadeaa 100644 +--- a/modules/module-default-nodes.c ++++ b/modules/module-default-nodes.c +@@ -108,6 +108,7 @@ node_has_available_routes (WpDefaultNodes * self, WpNode *node) + gint dev_id = dev_id_str ? atoi (dev_id_str) : -1; + gint cpd = cpd_str ? atoi (cpd_str) : -1; + g_autoptr (WpDevice) device = NULL; ++ gint found = 0; + + if (dev_id == -1 || cpd == -1) + return TRUE; +@@ -168,6 +169,7 @@ node_has_available_routes (WpDefaultNodes * self, WpNode *node) + for (; wp_iterator_next (it, &v); g_value_unset (&v)) { + gint32 *d = (gint32 *)g_value_get_pointer (&v); + if (d && *d == cpd) { ++ found++; + if (route_avail != SPA_PARAM_AVAILABILITY_no) + return TRUE; + } +@@ -175,6 +177,10 @@ node_has_available_routes (WpDefaultNodes * self, WpNode *node) + } + } + } ++ /* The node is part of a profile without routes so we assume it ++ * is available. This can happen for Pro Audio profiles */ ++ if (found == 0) ++ return TRUE; + + return FALSE; + } +-- +GitLab + diff --git a/wireplumber.changes b/wireplumber.changes index c243370..0e5f5fc 100644 --- a/wireplumber.changes +++ b/wireplumber.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Fri Jan 14 15:59:55 UTC 2022 - Antonio Larrosa + +- Add patch from upstream to fix a problem changing the default + device: + * 0001-default-nodes-increase-priority-if-node-has-available-routes.patch + +- Add patch from upstream to fix selection of Pro Audio nodes + as default nodes: + * 0002-default-nodes-handle-nodes-without-Routes.patch + ------------------------------------------------------------------- Thu Jan 13 09:56:28 UTC 2022 - Antonio Larrosa diff --git a/wireplumber.spec b/wireplumber.spec index 5554e75..95dbca4 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 +Patch0: 0001-default-nodes-increase-priority-if-node-has-available-routes.patch +Patch1: 0002-default-nodes-handle-nodes-without-Routes.patch Patch100: reduce-meson-required-version.patch # docs BuildRequires: doxygen