From d503c2972804d8a67c269cb1d0aa19c795db78f3fbfe97d7df2e81cdd0c6cf84 Mon Sep 17 00:00:00 2001 From: Antonio Larrosa Date: Tue, 15 Nov 2022 08:32:16 +0000 Subject: [PATCH] Accepting request 1035773 from home:alarrosa:branches:multimedia:libs - Add patch from upstream to work around a problem when a link is not activated: * 0001-policy-node-wait-for-unactivated-links-instead-of-removing.patch - Add patch from upstream to fix handling null devices which result in lua exceptions: * 0001-alsa.lua-remove-the-disabled-entities-from-the-names-table.patch OBS-URL: https://build.opensuse.org/request/show/1035773 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=52 --- ...sabled-entities-from-the-names-table.patch | 60 +++++++++++++++++++ ...nactivated-links-instead-of-removing.patch | 46 ++++++++++++++ wireplumber.changes | 11 ++++ wireplumber.spec | 6 ++ 4 files changed, 123 insertions(+) create mode 100644 0001-alsa.lua-remove-the-disabled-entities-from-the-names-table.patch create mode 100644 0001-policy-node-wait-for-unactivated-links-instead-of-removing.patch diff --git a/0001-alsa.lua-remove-the-disabled-entities-from-the-names-table.patch b/0001-alsa.lua-remove-the-disabled-entities-from-the-names-table.patch new file mode 100644 index 0000000..abb16e6 --- /dev/null +++ b/0001-alsa.lua-remove-the-disabled-entities-from-the-names-table.patch @@ -0,0 +1,60 @@ +From e77ad8c0c024529deb4de5ebd69009a0cec11a78 Mon Sep 17 00:00:00 2001 +From: Ashok Sidipotu +Date: Tue, 8 Nov 2022 04:20:21 +0530 +Subject: [PATCH] alsa.lua: remove the disabled entities from the names table + +entities here are the device cards and the device nodes. + +sometimes null device objects are reported by monitor, this results in lua +exceptions handle this use case. + +Fixes #361 +--- + src/scripts/monitors/alsa.lua | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/src/scripts/monitors/alsa.lua b/src/scripts/monitors/alsa.lua +index 660c47c0..195c0916 100644 +--- a/src/scripts/monitors/alsa.lua ++++ b/src/scripts/monitors/alsa.lua +@@ -175,6 +175,7 @@ function createNode(parent, id, obj_type, factory, properties) + -- apply properties from config.rules + rulesApplyProperties(properties) + if properties["node.disabled"] then ++ node_names_table [properties ["node.name"]] = nil + return + end + +@@ -190,6 +191,10 @@ function createDevice(parent, id, factory, properties) + device:connect("create-object", createNode) + device:connect("object-removed", function (parent, id) + local node = parent:get_managed_object(id) ++ if not node then ++ return ++ end ++ + node_names_table[node.properties["node.name"]] = nil + end) + device:activate(Feature.SpaDevice.ENABLED | Feature.Proxy.BOUND) +@@ -269,6 +274,7 @@ function prepareDevice(parent, id, obj_type, factory, properties) + -- apply properties from config.rules + rulesApplyProperties(properties) + if properties["device.disabled"] then ++ device_names_table [properties ["device.name"]] = nil + return + end + +@@ -346,6 +352,10 @@ function createMonitor () + -- handle object-removed to destroy device reservations and recycle device name + m:connect("object-removed", function (parent, id) + local device = parent:get_managed_object(id) ++ if not device then ++ return ++ end ++ + if rd_plugin then + local rd_name = device.properties["api.dbus.ReserveDevice1"] + if rd_name then +-- +GitLab + diff --git a/0001-policy-node-wait-for-unactivated-links-instead-of-removing.patch b/0001-policy-node-wait-for-unactivated-links-instead-of-removing.patch new file mode 100644 index 0000000..88f4284 --- /dev/null +++ b/0001-policy-node-wait-for-unactivated-links-instead-of-removing.patch @@ -0,0 +1,46 @@ +From f79a330849ebf320c42d03c123f48fec6b9ad3a8 Mon Sep 17 00:00:00 2001 +From: Pauli Virtanen +Date: Thu, 3 Nov 2022 19:22:20 +0200 +Subject: [PATCH] scripts: policy-node: wait for unactivated links instead of + removing + +If a link is not activated, don't remove it. Instead, schedule a rescan +when a link activates, so that we'll handle it once it does. + +This is a workaround for some problems, see +https://github.com/Audio4Linux/JDSP4Linux/issues/74 +However, the underlying cause is not understood. +--- + src/scripts/policy-node.lua | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/src/scripts/policy-node.lua b/src/scripts/policy-node.lua +index 43df701c..a25d0a5e 100644 +--- a/src/scripts/policy-node.lua ++++ b/src/scripts/policy-node.lua +@@ -123,6 +123,7 @@ function createLink (si, si_target, passthrough, exclusive) + end + Log.info (l, "activated si-standard-link") + end ++ scheduleRescan() + end) + end + +@@ -696,9 +697,11 @@ function handleLinkable (si) + if link ~= nil then + -- remove old link + if ((link:get_active_features() & Feature.SessionItem.ACTIVE) == 0) then +- -- remove also not yet activated links: they might never become active, +- -- and we should not loop waiting for them +- Log.warning (link, "Link was not activated before removing") ++ -- Link not yet activated. We don't want to remove it now, as that ++ -- may cause problems. Instead, give up for now. A rescan is scheduled ++ -- once the link activates. ++ Log.info (link, "Link to be moved was not activated, will wait for it.") ++ return + end + si_flags[si_id].peer_id = nil + link:remove () +-- +GitLab + diff --git a/wireplumber.changes b/wireplumber.changes index 6aa3566..4f4d819 100644 --- a/wireplumber.changes +++ b/wireplumber.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Tue Nov 15 08:21:15 UTC 2022 - Antonio Larrosa + +- Add patch from upstream to work around a problem when a link is + not activated: + * 0001-policy-node-wait-for-unactivated-links-instead-of-removing.patch + +- Add patch from upstream to fix handling null devices which result + in lua exceptions: + * 0001-alsa.lua-remove-the-disabled-entities-from-the-names-table.patch + ------------------------------------------------------------------- Tue Oct 4 13:01:17 UTC 2022 - Alexei Sorokin diff --git a/wireplumber.spec b/wireplumber.spec index f3b1aea..38a8c2b 100644 --- a/wireplumber.spec +++ b/wireplumber.spec @@ -32,6 +32,10 @@ Source0: wireplumber-%{version}.tar.xz Source1: split-config-file.py # PATCH-FIX-OPENSUSE reduce-meson-required-version.patch Patch0: reduce-meson-required-version.patch +# PATCH-FIX-UPSTREAM +Patch1: 0001-alsa.lua-remove-the-disabled-entities-from-the-names-table.patch +# PATCH-FIX-UPSTREAM +Patch2: 0001-policy-node-wait-for-unactivated-links-instead-of-removing.patch # docs BuildRequires: doxygen BuildRequires: graphviz @@ -140,6 +144,8 @@ the wireplumber shared library. %if 0%{?sle_version} <= 150300 %patch0 -p1 %endif +%patch1 -p1 +%patch2 -p1 pushd src/config/main.lua.d python3 %{SOURCE1}