SHA256
1
0
forked from pool/wireplumber

Accepting request 948987 from home:alarrosa:branches:multimedia:libs

- Add two patches from upstream:
  * 0012-device-activation-show-device-name-in-logs.patch
  * 0013-scripts-fallback-to-empty-config-table-if-args-were-.patch

OBS-URL: https://build.opensuse.org/request/show/948987
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=27
This commit is contained in:
Antonio Larrosa 2022-01-25 10:36:07 +00:00 committed by Git OBS Bridge
parent b0d3a20766
commit a1ca724012
4 changed files with 283 additions and 2 deletions

View File

@ -0,0 +1,135 @@
From 8844cfb0743f3ce1b447120f4c012cfdae9c2aec Mon Sep 17 00:00:00 2001
From: Julian Bouzas <julian.bouzas@collabora.com>
Date: Wed, 12 Jan 2022 14:07:59 -0500
Subject: [PATCH 12/14] device-activation: show device name in logs
---
modules/module-device-activation.c | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/modules/module-device-activation.c b/modules/module-device-activation.c
index a28f2ea..98978a2 100644
--- a/modules/module-device-activation.c
+++ b/modules/module-device-activation.c
@@ -31,6 +31,7 @@ G_DEFINE_TYPE (WpDeviceActivation, wp_device_activation, WP_TYPE_PLUGIN)
static void
set_device_profile (WpDeviceActivation *self, WpPipewireObject *device, gint index)
{
+ const gchar *dn = wp_pipewire_object_get_property (device, PW_KEY_DEVICE_NAME);
gpointer active_ptr = NULL;
g_return_if_fail (device);
@@ -38,7 +39,7 @@ set_device_profile (WpDeviceActivation *self, WpPipewireObject *device, gint ind
/* Make sure the profile we want to set is not active */
active_ptr = g_object_get_qdata (G_OBJECT (device), active_profile_quark ());
if (active_ptr && GPOINTER_TO_INT (active_ptr) - 1 == index) {
- wp_info_object (self, "profile %d is already active", index);
+ wp_info_object (self, "profile %d is already active in %s", index, dn);
return;
}
@@ -49,8 +50,7 @@ set_device_profile (WpDeviceActivation *self, WpPipewireObject *device, gint ind
"index", "i", index,
NULL));
- wp_info_object (self, "profile %d set on device " WP_OBJECT_FORMAT, index,
- WP_OBJECT_ARGS (device));
+ wp_info_object (self, "profile %d set on device %s", index, dn);
}
static gint
@@ -184,6 +184,7 @@ static gint
handle_active_profile (WpDeviceActivation *self, WpPipewireObject *proxy,
WpIterator *profiles, gboolean *changed, gboolean *off)
{
+ const gchar *dn = wp_pipewire_object_get_property (proxy, PW_KEY_DEVICE_NAME);
gpointer active_ptr = NULL;
gint new_active = -1;
gint local_changed = FALSE;
@@ -191,7 +192,7 @@ handle_active_profile (WpDeviceActivation *self, WpPipewireObject *proxy,
/* Find the new active profile */
new_active = find_active_profile (proxy, off);
if (new_active < 0) {
- wp_info_object (self, "cannot find active profile");
+ wp_info_object (self, "cannot find active profile in %s", dn);
return new_active;
}
@@ -199,7 +200,7 @@ handle_active_profile (WpDeviceActivation *self, WpPipewireObject *proxy,
active_ptr = g_object_get_qdata (G_OBJECT (proxy), active_profile_quark ());
local_changed = !active_ptr || GPOINTER_TO_INT (active_ptr) - 1 != new_active;
if (local_changed) {
- wp_info_object (self, "active profile changed to: %d", new_active);
+ wp_info_object (self, "active profile changed to %d in %s", new_active, dn);
g_object_set_qdata (G_OBJECT (proxy), active_profile_quark (),
GINT_TO_POINTER (new_active + 1));
}
@@ -214,6 +215,7 @@ static gint
handle_best_profile (WpDeviceActivation *self, WpPipewireObject *proxy,
WpIterator *profiles, gboolean *changed)
{
+ const gchar *dn = wp_pipewire_object_get_property (proxy, PW_KEY_DEVICE_NAME);
gpointer best_ptr = NULL;
gint new_best = -1;
gboolean local_changed = FALSE;
@@ -221,7 +223,7 @@ handle_best_profile (WpDeviceActivation *self, WpPipewireObject *proxy,
/* Get the new best profile index */
new_best = find_best_profile (profiles);
if (new_best < 0) {
- wp_info_object (self, "cannot find best profile");
+ wp_info_object (self, "cannot find best profile in %s", dn);
return new_best;
}
@@ -229,7 +231,7 @@ handle_best_profile (WpDeviceActivation *self, WpPipewireObject *proxy,
best_ptr = g_object_get_qdata (G_OBJECT (proxy), best_profile_quark ());
local_changed = !best_ptr || GPOINTER_TO_INT (best_ptr) - 1 != new_best;
if (local_changed) {
- wp_info_object (self, "found new best profile: %d", new_best);
+ wp_info_object (self, "best profile changed to %d in %s", new_best, dn);
g_object_set_qdata (G_OBJECT (proxy), best_profile_quark (),
GINT_TO_POINTER (new_best + 1));
}
@@ -244,6 +246,7 @@ static void
handle_enum_profiles (WpDeviceActivation *self, WpPipewireObject *proxy,
WpIterator *profiles)
{
+ const gchar *dn = wp_pipewire_object_get_property (proxy, PW_KEY_DEVICE_NAME);
gint active_idx = FALSE, best_idx = FALSE;
gboolean active_changed = FALSE, best_changed = FALSE, active_off = FALSE;
@@ -256,14 +259,16 @@ handle_enum_profiles (WpDeviceActivation *self, WpPipewireObject *proxy,
default_idx = find_default_profile (self, proxy, profiles, &default_avail);
if (default_idx >= 0) {
if (default_avail == SPA_PARAM_AVAILABILITY_no) {
- wp_info_object (self, "default profile %d unavailable", default_idx);
+ wp_info_object (self, "default profile %d unavailable for %s",
+ default_idx, dn);
} else {
- wp_info_object (self, "found default profile: %d", default_idx);
+ wp_info_object (self, "found default profile %d for %s", default_idx,
+ dn);
set_device_profile (self, proxy, default_idx);
return;
}
} else {
- wp_info_object (self, "cannot find default profile");
+ wp_info_object (self, "cannot find default profile for %s", dn);
}
}
@@ -272,9 +277,9 @@ handle_enum_profiles (WpDeviceActivation *self, WpPipewireObject *proxy,
if (best_idx >= 0 && best_changed)
set_device_profile (self, proxy, best_idx);
else if (best_idx >= 0)
- wp_info_object (self, "best profile already set: %d", best_idx);
+ wp_info_object (self, "best profile %d already set in %s", best_idx, dn);
else
- wp_info_object (self, "best profile not found");
+ wp_info_object (self, "best profile not found in %s", dn);
}
static void
--
2.34.1

View File

@ -0,0 +1,139 @@
From 18bc3d3596a1fac8ab21361160ac4e9c6ec37c89 Mon Sep 17 00:00:00 2001
From: George Kiagiadakis <george.kiagiadakis@collabora.com>
Date: Thu, 13 Jan 2022 11:08:34 +0200
Subject: [PATCH 13/14] scripts: fallback to empty config table if args were
not passed from the config files
Fixes #158
---
src/scripts/access/access-default.lua | 2 +-
src/scripts/create-item.lua | 2 +-
src/scripts/default-routes.lua | 2 +-
src/scripts/monitors/alsa-midi.lua | 2 +-
src/scripts/monitors/alsa.lua | 2 +-
src/scripts/policy-endpoint-client-links.lua | 2 +-
src/scripts/policy-endpoint-client.lua | 2 +-
src/scripts/policy-endpoint-device.lua | 2 +-
src/scripts/policy-node.lua | 2 +-
9 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/scripts/access/access-default.lua b/src/scripts/access/access-default.lua
index 3c27e90..0fac87b 100644
--- a/src/scripts/access/access-default.lua
+++ b/src/scripts/access/access-default.lua
@@ -5,7 +5,7 @@
--
-- SPDX-License-Identifier: MIT
-local config = ...
+local config = ... or {}
-- preprocess rules and create Interest objects
for _, r in ipairs(config.rules or {}) do
diff --git a/src/scripts/create-item.lua b/src/scripts/create-item.lua
index ad4a6f6..f2c7562 100644
--- a/src/scripts/create-item.lua
+++ b/src/scripts/create-item.lua
@@ -6,7 +6,7 @@
-- SPDX-License-Identifier: MIT
-- Receive script arguments from config.lua
-local config = ...
+local config = ... or {}
items = {}
diff --git a/src/scripts/default-routes.lua b/src/scripts/default-routes.lua
index 953cba3..075f5d6 100644
--- a/src/scripts/default-routes.lua
+++ b/src/scripts/default-routes.lua
@@ -8,7 +8,7 @@
--
-- SPDX-License-Identifier: MIT
-local config = ...
+local config = ... or {}
-- whether to store state on the file system
use_persistent_storage = config["use-persistent-storage"] or false
diff --git a/src/scripts/monitors/alsa-midi.lua b/src/scripts/monitors/alsa-midi.lua
index bf4fde4..0efee34 100644
--- a/src/scripts/monitors/alsa-midi.lua
+++ b/src/scripts/monitors/alsa-midi.lua
@@ -6,7 +6,7 @@
-- SPDX-License-Identifier: MIT
-- Receive script arguments from config.lua
-local config = ...
+local config = ... or {}
-- ensure config.properties is not nil
config.properties = config.properties or {}
diff --git a/src/scripts/monitors/alsa.lua b/src/scripts/monitors/alsa.lua
index c917a5c..3e8eda8 100644
--- a/src/scripts/monitors/alsa.lua
+++ b/src/scripts/monitors/alsa.lua
@@ -6,7 +6,7 @@
-- SPDX-License-Identifier: MIT
-- Receive script arguments from config.lua
-local config = ...
+local config = ... or {}
-- ensure config.properties is not nil
config.properties = config.properties or {}
diff --git a/src/scripts/policy-endpoint-client-links.lua b/src/scripts/policy-endpoint-client-links.lua
index 1a93294..eaa1c08 100644
--- a/src/scripts/policy-endpoint-client-links.lua
+++ b/src/scripts/policy-endpoint-client-links.lua
@@ -5,7 +5,7 @@
--
-- SPDX-License-Identifier: MIT
-local config = ...
+local config = ... or {}
config.roles = config.roles or {}
config["duck.level"] = config["duck.level"] or 0.3
diff --git a/src/scripts/policy-endpoint-client.lua b/src/scripts/policy-endpoint-client.lua
index e898e35..487d4b4 100644
--- a/src/scripts/policy-endpoint-client.lua
+++ b/src/scripts/policy-endpoint-client.lua
@@ -6,7 +6,7 @@
-- SPDX-License-Identifier: MIT
-- Receive script arguments from config.lua
-local config = ...
+local config = ... or {}
config.roles = config.roles or {}
local self = {}
diff --git a/src/scripts/policy-endpoint-device.lua b/src/scripts/policy-endpoint-device.lua
index b726cb3..71f7772 100644
--- a/src/scripts/policy-endpoint-device.lua
+++ b/src/scripts/policy-endpoint-device.lua
@@ -6,7 +6,7 @@
-- SPDX-License-Identifier: MIT
-- Receive script arguments from config.lua
-local config = ...
+local config = ... or {}
-- ensure config.move and config.follow are not nil
config.move = config.move or false
diff --git a/src/scripts/policy-node.lua b/src/scripts/policy-node.lua
index 9df5007..51a5549 100644
--- a/src/scripts/policy-node.lua
+++ b/src/scripts/policy-node.lua
@@ -6,7 +6,7 @@
-- SPDX-License-Identifier: MIT
-- Receive script arguments from config.lua
-local config = ...
+local config = ... or {}
-- ensure config.move and config.follow are not nil
config.move = config.move or false
--
2.34.1

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Jan 25 10:33:09 UTC 2022 - Antonio Larrosa <alarrosa@suse.com>
- Add two patches from upstream:
* 0012-device-activation-show-device-name-in-logs.patch
* 0013-scripts-fallback-to-empty-config-table-if-args-were-.patch
-------------------------------------------------------------------
Tue Jan 25 08:34:28 UTC 2022 - Antonio Larrosa <alarrosa@suse.com>

View File

@ -41,8 +41,8 @@ Patch8: 0008-scripts-monitors-log-warning-if-spa-devices-were-not.patch
Patch9: 0009-default-nodes-check-if-default-node-has-available-ro.patch
Patch10: 0010-added-support-for-disabling-nodes-and-devices-throug.patch
Patch11: 0011-default-nodes-add-more-logs.patch
#0012-device-activation-show-device-name-in-logs.patch
#0013-scripts-fallback-to-empty-config-table-if-args-were-.patch
Patch12: 0012-device-activation-show-device-name-in-logs.patch
Patch13: 0013-scripts-fallback-to-empty-config-table-if-args-were-.patch
Patch100: reduce-meson-required-version.patch
# docs