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

- Update to version 0.5.9:
  * Additions & Enhancements:
    - Added a new audio node grouping functionality using an
      external command line tool (!646)
    - The libcamera monitor now supports devices that are not
      associated with device ids (!701)
    - The wireplumber user systemd service is now associated with
      dbus.service to avoid strange warnings when dbus exits (!702)
    - Added "SYSLOG_IDENTIFIER", "SYSLOG_FACILITY", "SYSLOG_PID"
      and "TID" to log messages that are sent to the journal (!709)
  * Fixes:
    - Fixed a crash of wpctl set-default on 32-bit architectures
      (#773)
    - Fixed a crash when a configuration component had no
      'provides' field (#771)
    - Reduced the log level of some messages that didn't need
      to be as high (!695)
    - Fixed another nil reference issue in the alsa.lua monitor
      script (!704)
    - Fixed name deduplication of v4l2 and libcamera devices (!705)
    - Fixed an issue with wpctl not being able to save settings
      sometimes (!708, #749) 
- Drop patches that are already included in this version:
  * 0001-internal-comp-loader-generate-a-provides-for-components.patch
  * 0002-wpctl-fix-default-device-name-leak.patch
  * 0003-wpctl-fix-types-in-variadic-arguments.patch
  * 0004-monitor-utils-Support-devices-without-any-device-ids.patch
  * 0005-v4l2_monitor-scripts-fix-for-deduplicate-devices-with-the.patch
  * 0006-monitors_libcamera-fix-deduplicating-devices-with-the-same.patch
  * 0007-monitors_alsa-fix-nil-table-indexing.patch

OBS-URL: https://build.opensuse.org/request/show/1278392
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=94
This commit is contained in:
2025-05-19 11:45:21 +00:00
committed by Git OBS Bridge
commit 1b4f2c103e
24 changed files with 3305 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

View File

@@ -0,0 +1,67 @@
From b68a6794cd5c3702a2144be60c41a9ca982c416b Mon Sep 17 00:00:00 2001
From: Pauli Virtanen <pav@iki.fi>
Date: Sun, 8 Sep 2024 20:22:41 +0300
Subject: [PATCH] autoswitch-bluetooth-profile: switch only Bluetooth devices
Handle only devices associated with Bluetooth loopback nodes.
Make sure the node.link-group iteration cannot get stuck if there is a
loop in the link graph.
---
.../device/autoswitch-bluetooth-profile.lua | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/scripts/device/autoswitch-bluetooth-profile.lua b/src/scripts/device/autoswitch-bluetooth-profile.lua
index d4f3529f..70e27601 100644
--- a/src/scripts/device/autoswitch-bluetooth-profile.lua
+++ b/src/scripts/device/autoswitch-bluetooth-profile.lua
@@ -301,13 +301,14 @@ end
-- We consider a Stream of interest if it is linked to a bluetooth loopback
-- source filter
-local function checkStreamStatus (stream, node_om)
+local function checkStreamStatus (stream, node_om, visited_link_groups)
-- check if the stream is linked to a bluetooth loopback source
local stream_id = tonumber(stream["bound-id"])
local peer_id = lutils.getNodePeerId (stream_id)
if peer_id ~= nil then
local bt_node = node_om:lookup {
- Constraint { "bound-id", "=", peer_id, type = "gobject" }
+ Constraint { "bound-id", "=", peer_id, type = "gobject" },
+ Constraint { "bluez5.loopback", "=", "true", type = "pw" }
}
if bt_node ~= nil then
local dev_id = bt_node.properties["device.id"]
@@ -325,18 +326,27 @@ local function checkStreamStatus (stream, node_om)
else
-- Check if it is linked to a filter main node, and recursively advance if so
local filter_main_node = node_om:lookup {
- Constraint { "bound-id", "=", peer_id, type = "gobject" }
+ Constraint { "bound-id", "=", peer_id, type = "gobject" },
+ Constraint { "node.link-group", "+", type = "pw" }
}
if filter_main_node ~= nil then
-- Now check all stream nodes for this filter
local filter_link_group = filter_main_node.properties ["node.link-group"]
+ if visited_link_groups == nil then
+ visited_link_groups = {}
+ end
+ if visited_link_groups [filter_link_group] then
+ return nil
+ else
+ visited_link_groups [filter_link_group] = true
+ end
for filter_stream_node in node_om:iterate {
Constraint { "media.class", "matches", "Stream/Input/Audio", type = "pw-global" },
Constraint { "stream.monitor", "!", "true", type = "pw" },
Constraint { "bluez5.loopback", "!", "true", type = "pw" },
Constraint { "node.link-group", "=", filter_link_group, type = "pw" }
} do
- local dev_id = checkStreamStatus (filter_stream_node, node_om)
+ local dev_id = checkStreamStatus (filter_stream_node, node_om, visited_link_groups)
if dev_id ~= nil then
return dev_id
end
--
GitLab

View File

@@ -0,0 +1,71 @@
From 32d2abdf34c987df24ba3b073159ea4eee2edf73 Mon Sep 17 00:00:00 2001
From: George Kiagiadakis <george.kiagiadakis@collabora.com>
Date: Thu, 13 Feb 2025 16:06:29 +0200
Subject: [PATCH] internal-comp-loader: generate a "provides" for components
that don't have one
It is valid for components not to have a "provides" field, but it
prevents them from being able to have "before" and "after" dependencies.
With this patch, we generate a hidden "provides" field so that the
dependencies sorting algorithm can work without issues.
Fixes: #771
---
lib/wp/private/internal-comp-loader.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/lib/wp/private/internal-comp-loader.c b/lib/wp/private/internal-comp-loader.c
index 45877eb7..842c6934 100644
--- a/lib/wp/private/internal-comp-loader.c
+++ b/lib/wp/private/internal-comp-loader.c
@@ -28,7 +28,7 @@ struct _ComponentData
grefcount ref;
/* an identifier for this component that is understandable by the end user */
gchar *printable_id;
- /* the provided feature name or NULL */
+ /* the provided feature name */
gchar *provides;
/* the original state of the feature (required / optional / disabled) */
FeatureState state;
@@ -205,7 +205,7 @@ component_data_new_from_json (WpSpaJson * json, WpProperties * features,
comp->printable_id = g_strdup_printf ("%s [%s]", comp->provides, comp->type);
}
} else {
- comp->provides = NULL;
+ comp->provides = g_strdup_printf ("__anonymous_%p", comp);
comp->state = FEATURE_STATE_REQUIRED;
comp->printable_id = g_strdup_printf ("[%s: %s]", comp->type, comp->name);
}
@@ -328,7 +328,7 @@ wp_component_array_load_task_get_next_step (WpTransition * transition, guint ste
static gboolean
component_equals (const ComponentData * comp, const gchar * provides)
{
- return (comp->provides && g_str_equal (provides, comp->provides));
+ return g_str_equal (provides, comp->provides);
}
static inline gboolean
@@ -358,7 +358,7 @@ sort_components_before_after (WpComponentArrayLoadTask * self, GError ** error)
gchar *target_provides = g_ptr_array_index (comp->before, j);
for (guint k = 0; k < self->components->len; k++) {
ComponentData *target = g_ptr_array_index (self->components, k);
- if (target->provides && g_str_equal (target_provides, target->provides)) {
+ if (g_str_equal (target_provides, target->provides)) {
g_ptr_array_insert (target->after, -1, g_strdup (comp->provides));
}
}
@@ -531,9 +531,8 @@ parse_components (WpComponentArrayLoadTask * self, GError ** error)
if (comp->state == FEATURE_STATE_REQUIRED)
g_ptr_array_add (required_components, component_data_ref (comp));
- if (comp->provides)
- g_hash_table_insert (self->feat_components, comp->provides,
- component_data_ref (comp));
+ g_hash_table_insert (self->feat_components, comp->provides,
+ component_data_ref (comp));
}
/* topological sorting based on depth-first search */
--
GitLab

View File

@@ -0,0 +1,94 @@
From 76985fff5b4f771714ea1814d85a69298dd83897 Mon Sep 17 00:00:00 2001
From: Julian Bouzas <julian.bouzas@collabora.com>
Date: Fri, 12 Jul 2024 10:49:16 -0400
Subject: [PATCH] autoswitch-bluetooth-profile: Switch to HSP/HFP on timeout
This patch adds a 500ms timeout callback to switch to HSP/HFP when a stream
starts capturing BT audio. This avoids quickly switching from A2DP to HSP/HFP
back and forth if an application just wants to probe the BT source for a short
period of time.
See #634
---
.../device/autoswitch-bluetooth-profile.lua | 34 ++++++++++++++-----
1 file changed, 26 insertions(+), 8 deletions(-)
diff --git a/src/scripts/device/autoswitch-bluetooth-profile.lua b/src/scripts/device/autoswitch-bluetooth-profile.lua
index 70e27601..bd9def55 100644
--- a/src/scripts/device/autoswitch-bluetooth-profile.lua
+++ b/src/scripts/device/autoswitch-bluetooth-profile.lua
@@ -32,9 +32,11 @@ state = nil
headset_profiles = nil
local profile_restore_timeout_msec = 2000
+local profile_switch_timeout_msec = 500
local INVALID = -1
local restore_timeout_source = {}
+local switch_timeout_source = {}
local last_profiles = {}
@@ -174,12 +176,6 @@ local function switchDeviceToHeadsetProfile (dev_id, device_om)
return
end
- -- clear restore callback, if any
- if restore_timeout_source[dev_id] ~= nil then
- restore_timeout_source[dev_id]:destroy ()
- restore_timeout_source[dev_id] = nil
- end
-
local cur_profile_name = getCurrentProfile (device)
local priority, index, name = findProfile (device, nil, cur_profile_name)
if hasProfileInputRoute (device, index) then
@@ -278,6 +274,24 @@ local function restoreProfile (dev_id, device_om)
end
end
+local function triggerSwitchDeviceToHeadsetProfile (dev_id, device_om)
+ -- Always clear any pending restore/switch callbacks when triggering a new switch
+ if restore_timeout_source[dev_id] ~= nil then
+ restore_timeout_source[dev_id]:destroy ()
+ restore_timeout_source[dev_id] = nil
+ end
+ if switch_timeout_source[dev_id] ~= nil then
+ switch_timeout_source[dev_id]:destroy ()
+ switch_timeout_source[dev_id] = nil
+ end
+
+ -- create new switch callback
+ switch_timeout_source[dev_id] = Core.timeout_add (profile_switch_timeout_msec, function ()
+ switch_timeout_source[dev_id] = nil
+ switchDeviceToHeadsetProfile (dev_id, device_om)
+ end)
+end
+
local function triggerRestoreProfile (dev_id, device_om)
-- we never restore the device profiles if there are active streams
for _, v in pairs (active_streams) do
@@ -286,7 +300,11 @@ local function triggerRestoreProfile (dev_id, device_om)
end
end
- -- clear restore callback, if any
+ -- Always clear any pending restore/switch callbacks when triggering a new restore
+ if switch_timeout_source[dev_id] ~= nil then
+ switch_timeout_source[dev_id]:destroy ()
+ switch_timeout_source[dev_id] = nil
+ end
if restore_timeout_source[dev_id] ~= nil then
restore_timeout_source[dev_id]:destroy ()
restore_timeout_source[dev_id] = nil
@@ -367,7 +385,7 @@ local function handleStream (stream, node_om, device_om)
if dev_id ~= nil then
active_streams [stream.id] = dev_id
previous_streams [stream.id] = dev_id
- switchDeviceToHeadsetProfile (dev_id, device_om)
+ triggerSwitchDeviceToHeadsetProfile (dev_id, device_om)
else
dev_id = active_streams [stream.id]
active_streams [stream.id] = nil
--
GitLab

View File

@@ -0,0 +1,27 @@
From f3bc7168edeac015154feda01698a9c10f68e1b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= <pobrn@protonmail.com>
Date: Wed, 19 Feb 2025 18:34:58 +0100
Subject: [PATCH] wpctl: fix default device name leak
The `get-default-configured-node-name` handler returns a copy
of the name of the node, hence it must be freed.
---
src/tools/wpctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/tools/wpctl.c b/src/tools/wpctl.c
index 9f507eca..38d730c8 100644
--- a/src/tools/wpctl.c
+++ b/src/tools/wpctl.c
@@ -529,7 +529,7 @@ status_run (WpCtl * self)
printf (TREE_INDENT_END "Default Configured Devices:\n");
if (def_nodes_api) {
for (guint i = 0; i < G_N_ELEMENTS (DEFAULT_NODE_MEDIA_CLASSES); i++) {
- const gchar *name = NULL;
+ g_autofree gchar *name = NULL;
g_signal_emit_by_name (def_nodes_api, "get-default-configured-node-name",
DEFAULT_NODE_MEDIA_CLASSES[i], &name);
if (name)
--
GitLab

View File

@@ -0,0 +1,36 @@
From 255b65d18204f7cf5c0706308196ffbcf8f1a697 Mon Sep 17 00:00:00 2001
From: Torkel Niklasson <torkel@axis.com>
Date: Thu, 26 Sep 2024 12:01:18 +0200
Subject: [PATCH] m-mixer-api: Fix memory in leak wp_mixer_api_set_volume
Declare result from wp_object_manager_lookup as g_autoptr, to prevent
leaking memory.
---
modules/module-mixer-api.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/module-mixer-api.c b/modules/module-mixer-api.c
index e9dccbab0..502640c68 100644
--- a/modules/module-mixer-api.c
+++ b/modules/module-mixer-api.c
@@ -501,7 +501,7 @@ wp_mixer_api_set_volume (WpMixerApi * self, guint32 id, GVariant * vvolume)
props = wp_spa_pod_builder_end (b);
if (info->device_id != SPA_ID_INVALID) {
- WpPipewireObject *device = wp_object_manager_lookup (self->om,
+ g_autoptr (WpPipewireObject) device = wp_object_manager_lookup (self->om,
WP_TYPE_DEVICE, WP_CONSTRAINT_TYPE_G_PROPERTY,
"bound-id", "=u", info->device_id, NULL);
g_return_val_if_fail (device != NULL, FALSE);
@@ -514,7 +514,7 @@ wp_mixer_api_set_volume (WpMixerApi * self, guint32 id, GVariant * vvolume)
"save", "b", true,
NULL));
} else {
- WpPipewireObject *node = wp_object_manager_lookup (self->om,
+ g_autoptr (WpPipewireObject) node = wp_object_manager_lookup (self->om,
WP_TYPE_NODE, WP_CONSTRAINT_TYPE_G_PROPERTY,
"bound-id", "=u", id, NULL);
g_return_val_if_fail (node != NULL, FALSE);
--
GitLab

View File

@@ -0,0 +1,49 @@
From 5846d12ea156c961772a44163a42987ef35c1ab6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= <pobrn@protonmail.com>
Date: Tue, 18 Feb 2025 19:57:22 +0100
Subject: [PATCH] wpctl: fix types in variadic arguments
`wp_object_manager_add_interest()` passes the format string
and the arguments after that to `g_variant_new()`, which
requires a 32-bit integer for "u". Passing a 64-bit integer
will cause problems on certain ABIs.
Furthermore, remove the metadata related interest declaration
from `set_default_prepare()` since the "set-default" command
does not access metadata directly, it uses the "default-nodes-api"
plugin.
Fixes: 7784cfad92cfa4 ("wpctl: support @DEFAULT_{AUDIO,VIDEO}_{SINK,SOURCE}@ as ID ")
Fixes #773
---
src/tools/wpctl.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/tools/wpctl.c b/src/tools/wpctl.c
index 38d730c8..0e671109 100644
--- a/src/tools/wpctl.c
+++ b/src/tools/wpctl.c
@@ -753,7 +753,7 @@ inspect_print_object (WpCtl * self, WpProxy * proxy, guint nest_level)
if (cmdline.inspect.show_referenced && nest_level == 0 &&
key_is_object_reference (prop_item->key))
{
- guint id = (guint) strtol (prop_item->value, NULL, 10);
+ guint32 id = (guint32) strtol (prop_item->value, NULL, 10);
g_autoptr (WpProxy) refer_proxy =
wp_object_manager_lookup (self->om, WP_TYPE_GLOBAL_PROXY,
WP_CONSTRAINT_TYPE_G_PROPERTY, "bound-id", "=u", id, NULL);
@@ -833,10 +833,8 @@ set_default_prepare (WpCtl * self, GError ** error)
{
wp_object_manager_add_interest (self->om, WP_TYPE_NODE,
WP_CONSTRAINT_TYPE_PW_GLOBAL_PROPERTY,
- "object.id", "=u", cmdline.set_default.id,
+ "object.id", "=u", (guint32) cmdline.set_default.id,
NULL);
- wp_object_manager_request_object_features (self->om, WP_TYPE_METADATA,
- WP_OBJECT_FEATURES_ALL);
wp_object_manager_request_object_features (self->om, WP_TYPE_NODE,
WP_PIPEWIRE_OBJECT_FEATURES_MINIMAL);
return TRUE;
--
GitLab

View File

@@ -0,0 +1,64 @@
From ed80938b8c6a08aeb22ec4cefdee6f98c2f8e646 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= <pobrn@protonmail.com>
Date: Thu, 26 Sep 2024 14:49:12 +0200
Subject: [PATCH] module-dbus-connection: fix GCancellable leak
`wp_dbus_connection_disable()` creates a new GCancellable
object at the end, which is never freed if the GObject
is then destroyed. To fix this, override `finalize()` and
clear everything there as well.
Direct leak of 64 byte(s) in 1 object(s) allocated from:
0 0x70e688efd1aa in calloc /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_malloc_linux.cpp:77
1 0x70e6874b3e62 in g_malloc0 (/usr/lib/libglib-2.0.so.0+0x63e62) (BuildId: 7b781c8d1a6e2161838c5d8f3bd797797c132753)
2 0x70e6875dea75 in g_type_create_instance (/usr/lib/libgobject-2.0.so.0+0x3ea75) (BuildId: 5af5e0f7d0a900ecb6083fbd71e22e5522d872e2)
3 0x70e6875c3804 (/usr/lib/libgobject-2.0.so.0+0x23804) (BuildId: 5af5e0f7d0a900ecb6083fbd71e22e5522d872e2)
4 0x70e6875c4e7e in g_object_new_with_properties (/usr/lib/libgobject-2.0.so.0+0x24e7e) (BuildId: 5af5e0f7d0a900ecb6083fbd71e22e5522d872e2)
5 0x70e6875c5ed1 in g_object_new (/usr/lib/libgobject-2.0.so.0+0x25ed1) (BuildId: 5af5e0f7d0a900ecb6083fbd71e22e5522d872e2)
6 0x70e684d2a8a6 in wp_dbus_connection_disable ../subprojects/wireplumber/modules/module-dbus-connection.c:173
7 0x70e688a833cc in wp_plugin_deactivate ../subprojects/wireplumber/lib/wp/plugin.c:144
8 0x70e688a7126c in wp_object_deactivate ../subprojects/wireplumber/lib/wp/object.c:542
9 0x70e688a6e74e in wp_object_dispose ../subprojects/wireplumber/lib/wp/object.c:191
10 0x70e6875c0f6c in g_object_unref (/usr/lib/libgobject-2.0.so.0+0x20f6c) (BuildId: 5af5e0f7d0a900ecb6083fbd71e22e5522d872e2)
11 0x70e6841f7d6d in wp_portal_permissionstore_plugin_disable ../subprojects/wireplumber/modules/module-portal-permissionstore.c:207
12 0x70e688a833cc in wp_plugin_deactivate ../subprojects/wireplumber/lib/wp/plugin.c:144
[...]
---
modules/module-dbus-connection.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/modules/module-dbus-connection.c b/modules/module-dbus-connection.c
index 21ba95a20..b337be5e1 100644
--- a/modules/module-dbus-connection.c
+++ b/modules/module-dbus-connection.c
@@ -211,6 +211,19 @@ wp_dbus_connection_set_property (GObject * object, guint property_id,
}
}
+static void
+wp_dbus_connection_finalize (GObject * object)
+{
+ WpDBusConnection *self = WP_DBUS_CONNECTION (object);
+
+ g_cancellable_cancel (self->cancellable);
+
+ g_clear_object (&self->connection);
+ g_clear_object (&self->cancellable);
+
+ G_OBJECT_CLASS (wp_dbus_connection_parent_class)->finalize (object);
+}
+
static void
wp_dbus_connection_class_init (WpDBusConnectionClass * klass)
{
@@ -219,6 +232,7 @@ wp_dbus_connection_class_init (WpDBusConnectionClass * klass)
object_class->get_property = wp_dbus_connection_get_property;
object_class->set_property = wp_dbus_connection_set_property;
+ object_class->finalize = wp_dbus_connection_finalize;
plugin_class->enable = wp_dbus_connection_enable;
plugin_class->disable = wp_dbus_connection_disable;
--
GitLab

View File

@@ -0,0 +1,41 @@
From 0d356f90ed9fbdb168b6294aae2c049f4dfb6d92 Mon Sep 17 00:00:00 2001
From: Robert Mader <robert.mader@collabora.com>
Date: Tue, 1 Apr 2025 14:37:17 +0200
Subject: [PATCH] monitor-utils: Support devices without any device ids
Such as libcameras virtual devices.
---
src/scripts/lib/monitor-utils.lua | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/scripts/lib/monitor-utils.lua b/src/scripts/lib/monitor-utils.lua
index 3e409cab..410d495c 100644
--- a/src/scripts/lib/monitor-utils.lua
+++ b/src/scripts/lib/monitor-utils.lua
@@ -135,8 +135,6 @@ end
function mutils.register_cam_node (self, parent, id, factory, properties)
local obj_path = properties["object.path"]
local api = properties["device.api"]
- local dev_ids = properties["device.devids"]
- log:debug(api .. " reported device " .. obj_path .. " with device ids " .. dev_ids)
-- cache info, it comes handy when creating node
local cam_data = {}
@@ -146,6 +144,14 @@ function mutils.register_cam_node (self, parent, id, factory, properties)
cam_data.factory = factory
cam_data.properties = properties
+ local dev_ids = properties["device.devids"]
+ if not dev_ids then
+ log:debug(api .. " reported device " .. obj_path .. " without device ids")
+ create_cam_node(cam_data)
+ return
+ end
+
+ log:debug(api .. " reported device " .. obj_path .. " with device ids " .. dev_ids)
table.insert(self.cam_data, cam_data)
if self.cam_source then
--
GitLab

View File

@@ -0,0 +1,26 @@
From e51e1b60802cf3c2a722950cf50ac4400d7dd9ac Mon Sep 17 00:00:00 2001
From: Lukas Riezler <lukas.riezler@wolfvision.net>
Date: Tue, 11 Mar 2025 10:09:37 +0100
Subject: [PATCH] v4l2/monitor: scripts: fix for deduplicate devices with the
same name
---
src/scripts/monitors/v4l2/name-device.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/scripts/monitors/v4l2/name-device.lua b/src/scripts/monitors/v4l2/name-device.lua
index 5188850a2..2deec68a6 100644
--- a/src/scripts/monitors/v4l2/name-device.lua
+++ b/src/scripts/monitors/v4l2/name-device.lua
@@ -31,7 +31,7 @@ SimpleEventHook {
-- deduplicate devices with the same name
for counter = 2, 99, 1 do
- if mutils.find_duplicate (parent, id, "device.name", properties["node.name"]) then
+ if mutils.find_duplicate (parent, id, "device.name", properties["device.name"]) then
properties["device.name"] = name .. "." .. counter
else
break
--
GitLab

View File

@@ -0,0 +1,26 @@
From 9f440d0b503561cb6ce9f344dfadf3dcd0bf2584 Mon Sep 17 00:00:00 2001
From: George Kiagiadakis <george.kiagiadakis@collabora.com>
Date: Fri, 11 Apr 2025 15:53:44 +0300
Subject: [PATCH] monitors/libcamera: fix deduplicating devices with the same
name
---
src/scripts/monitors/libcamera/name-device.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/scripts/monitors/libcamera/name-device.lua b/src/scripts/monitors/libcamera/name-device.lua
index 91b869975..912e37c24 100644
--- a/src/scripts/monitors/libcamera/name-device.lua
+++ b/src/scripts/monitors/libcamera/name-device.lua
@@ -31,7 +31,7 @@ SimpleEventHook {
-- deduplicate devices with the same name
for counter = 2, 99, 1 do
- if mutils.find_duplicate (parent, id, "device.name", properties["node.name"]) then
+ if mutils.find_duplicate (parent, id, "device.name", properties["device.name"]) then
properties["device.name"] = name .. "." .. counter
else
break
--
GitLab

View File

@@ -0,0 +1,31 @@
From 2d48caa74b3f69d54d96aa9e36b344d46355e38f Mon Sep 17 00:00:00 2001
From: Pauli Virtanen <pav@iki.fi>
Date: Tue, 8 Apr 2025 01:18:36 +0300
Subject: [PATCH] monitors/alsa: fix nil table indexing
It's possible that managed_node.properties["node.name"] == nil if the
node is gone.
The removeDevice call above has already cleared the node names, so no
need to do it again.
---
src/scripts/monitors/alsa.lua | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/scripts/monitors/alsa.lua b/src/scripts/monitors/alsa.lua
index 871ebbfe..06b40f20 100644
--- a/src/scripts/monitors/alsa.lua
+++ b/src/scripts/monitors/alsa.lua
@@ -560,9 +560,6 @@ function createMonitor ()
end
end
device_names_table[device.properties["device.name"]] = nil
- for managed_node in device:iterate_managed_objects() do
- node_names_table[managed_node.properties["node.name"]] = nil
- end
end)
-- reset the name tables to make sure names are recycled
--
GitLab

24
_service Normal file
View File

@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<services>
<service name="obs_scm" mode="manual">
<param name="scm">git</param>
<param name="url">https://gitlab.freedesktop.org/pipewire/wireplumber.git</param>
<param name="revision">0.5.9</param>
<param name="versionformat">@PARENT_TAG@</param>
<!--
<param name="revision">master</param>
<param name="versionformat">@PARENT_TAG@+git@TAG_OFFSET@.%h</param>
<param name="changesgenerate">enable</param>
-->
<!--
<param name="revision">master</param>
<param name="versionformat">@PARENT_TAG@+git%cd.%h</param>
-->
</service>
<service name="tar" mode="buildtime"/>
<service name="recompress" mode="buildtime">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="manual" />
</services>

View File

@@ -0,0 +1,19 @@
Index: wireplumber-0.5.8/src/systemd/user/wireplumber.service.in
===================================================================
--- wireplumber-0.5.8.orig/src/systemd/user/wireplumber.service.in
+++ wireplumber-0.5.8/src/systemd/user/wireplumber.service.in
@@ -11,10 +11,13 @@ NoNewPrivileges=yes
SystemCallArchitectures=native
SystemCallFilter=@system-service
Type=simple
-ExecStart=@WP_BINARY@
+ExecStart=@WP_BINARY@ -p $WIREPLUMBER_PROFILE
Restart=on-failure
Slice=session.slice
Environment=GIO_USE_VFS=local
+Environment=WIREPLUMBER_PROFILE=main
+EnvironmentFile=-/usr/etc/wireplumber.env
+EnvironmentFile=-/etc/wireplumbler.env
[Install]
WantedBy=pipewire.service

52
split-config-file.py Normal file
View File

@@ -0,0 +1,52 @@
#!/usr/bin/python3
import hashlib
import sys
import re
def sha256_from_data(data):
hash_sha256 = hashlib.sha256()
hash_sha256.update(data)
return hash_sha256.hexdigest()
lines = open('wireplumber.conf', 'r', encoding='utf-8').readlines()
is_in_device_monitor = False
main_config_content = ''
device_monitors_content = ''
main_profile_contents = ''
for line in lines:
if re.match(' *## Device monitors$', line):
main_config_content += line
main_config_content += ' # Section moved to a device-monitors.conf file which is provided by the wireplumber-audio package\n\n'
is_in_device_monitor = True
continue
elif re.match(' *## ', line):
is_in_device_monitor = False
if is_in_device_monitor:
device_monitors_content += line
else:
# Fixes wireplumber running the main profile when not having audio support (bsc#1223916)
if line in [' hardware.audio = required\n', ' hardware.bluetooth = required\n']:
main_profile_contents += line
line = line.replace('required', 'disabled')
main_config_content += line
config_sha256 = sha256_from_data(device_monitors_content.encode('utf-8'))
verified_sha256 = 'bf33d018e5b924da71266636757fa264bc677b945c35e4dcd7f708da42731cc9'
if config_sha256 != verified_sha256:
print('The "Device monitors" section was modified, please verify that the contents are ok')
print('and if they are, modify the "verified_sha256" value in this script to')
print(f' {config_sha256}')
print('Current device monitors section is:')
print(device_monitors_content)
sys.exit(1)
device_monitors_content = 'wireplumber.components = [\n' + device_monitors_content + ']'
main_profile_contents = 'wireplumber.profiles = {\n main = {\n' + main_profile_contents + ' }\n}\n'
open('wireplumber.conf', 'w', encoding='utf-8').write(main_config_content)
open('wireplumber.conf.d/00-device-monitors.conf', 'w', encoding='utf-8').write(device_monitors_content)
open('wireplumber.conf.d/01-require-audio-in-main-profile.conf', 'w', encoding='utf-8').write(main_profile_contents)

BIN
wireplumber-0.5.6.obscpio (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:93899496a3ffaf69bc0d683343b14eb4a98a505f98796f592f9a7b6c9e4672a8
size 2802700

BIN
wireplumber-0.5.8.obscpio (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:63c1877d7eb1114cf87991404f7c523166df20c544a5fffecfbde42942d022ee
size 2845708

2341
wireplumber.changes Normal file

File diff suppressed because it is too large Load Diff

7
wireplumber.env Normal file
View File

@@ -0,0 +1,7 @@
# Name of the wireplumber profile to use when running the default wireplumber
# user service. This is usually either main (when wireplumber manages audio)
# or video-only (when pulseaudio manages the audio).
#
# The default value is set in the service and should be main
#
WIREPLUMBER_PROFILE="video-only"

4
wireplumber.obsinfo Normal file
View File

@@ -0,0 +1,4 @@
name: wireplumber
version: 0.5.9
mtime: 1747650741
commit: 76b9e509d1a8725a57482505177036d8fe68a472

290
wireplumber.spec Normal file
View File

@@ -0,0 +1,290 @@
#
# spec file for package wireplumber
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define pipewire_minimum_version 1.0.2
%define apiver 0.5
%define apiver_str 0_5
%define sover 0
%define libwireplumber libwireplumber-%{apiver_str}-%{sover}
Name: wireplumber
Version: 0.5.9
Release: 0
Summary: Session / policy manager implementation for PipeWire
License: MIT
Group: Development/Libraries/C and C++
URL: https://gitlab.freedesktop.org/pipewire/wireplumber
Source0: wireplumber-%{version}.tar.xz
Source1: wireplumber.env
Patch100: set-profile-in-service.patch
# docs
BuildRequires: doxygen
BuildRequires: graphviz
# /docs
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: meson >= 0.59.0
BuildRequires: pipewire >= %{pipewire_minimum_version}
BuildRequires: pipewire-spa-plugins-0_2 >= %{pipewire_minimum_version}
BuildRequires: pkgconfig
BuildRequires: python3-base
BuildRequires: python3-lxml
BuildRequires: xmltoman
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(gio-unix-2.0)
BuildRequires: pkgconfig(glib-2.0) >= 2.62.0
BuildRequires: pkgconfig(gmodule-2.0)
BuildRequires: pkgconfig(gobject-2.0) >= 2.62
BuildRequires: pkgconfig(gobject-introspection-1.0)
BuildRequires: pkgconfig(libpipewire-0.3) >= %{pipewire_minimum_version}
BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(lua)
BuildRequires: pkgconfig(systemd)
BuildRequires: python3-Sphinx
BuildRequires: python3-sphinx_rtd_theme
BuildRequires: python3-breathe
#!BuildIgnore: pipewire-session-manager
Requires: (%{name}-video-only-profile if pulseaudio)
Requires: pipewire >= %{pipewire_minimum_version}
Provides: pipewire-session-manager
Recommends: pipewire-jack
Recommends: pipewire-pulseaudio
Provides: wireplumber-audio = %{version}-%{release}
Obsoletes: wireplumber-audio < %{version}-%{release}
%if 0%{?suse_version} <= 1500
BuildRequires: gcc9
BuildRequires: gcc9-c++
%else
BuildRequires: c++_compiler
%endif
%{?systemd_ordering}
%description
WirePlumber is a modular session / policy manager for PipeWire and
a GObject-based high-level library that wraps PipeWire's API,
providing convenience for writing the daemon's modules as well as
external tools for managing PipeWire.
%lang_package
%package doc
Summary: Wireplumber Session / policy manager documentation
Group: Development/Libraries/C and C++
BuildArch: noarch
%description doc
This package contains documentation for the WirePlumber
session/policy manager for PipeWire.
%package video-only-profile
Summary: Disable audio support in PipeWire / WirePlumber
Group: Development/Libraries/C and C++
Requires: %{libwireplumber} = %{version}
Requires: %{name} = %{version}
Recommends: pulseaudio
Supplements: pulseaudio
BuildArch: noarch
%description video-only-profile
WirePlumber is a modular session / policy manager for PipeWire and
a GObject-based high-level library that wraps PipeWire's API,
providing convenience for writing the daemon's modules as well as
external tools for managing PipeWire.
This package makes wireplumber use the video-only-profile when
started via the wireplumber user service (the default way to run
it) effectively disabling the use of alsa devices in PipeWire.
%package devel
Summary: Session / policy manager implementation for PipeWire
Group: Development/Libraries/C and C++
Requires: %{libwireplumber} = %{version}
Requires: %{name} = %{version}
%description devel
WirePlumber is a modular session / policy manager for PipeWire and
a GObject-based high-level library that wraps PipeWire's API,
providing convenience for writing the daemon's modules as well as
external tools for managing PipeWire.
This package provides all the necessary files for development with WirePlumber
%package -n %{libwireplumber}
Summary: Session / policy manager implementation for PipeWire
Group: System/Libraries
%description -n %{libwireplumber}
WirePlumber is a modular session / policy manager for PipeWire and
a GObject-based high-level library that wraps PipeWire's API,
providing convenience for writing the daemon's modules as well as
external tools for managing PipeWire.
This package provides the wireplumber shared library.
%package -n typelib-1_0-Wp-%{apiver_str}
Summary: Introspection bindings for libwireplumber
Group: System/Libraries
%description -n typelib-1_0-Wp-%{apiver_str}
WirePlumber is a modular session / policy manager for PipeWire and
a GObject-based high-level library that wraps PipeWire's API,
providing convenience for writing the daemon's modules as well as
external tools for managing PipeWire.
This package provides the GObject Introspection bindings for
the wireplumber shared library.
%package zsh-completion
Summary: Wireplumber zsh completion
Group: System/Shells
Requires: %{name} = %{version}
Requires: zsh
Supplements: (wireplumber and zsh)
BuildArch: noarch
%description zsh-completion
Optional dependency offering zsh completion for various wpctl parameters.
%prep
%autosetup -p1
%build
%if 0%{?suse_version} <= 1500
export CC=gcc-9
export CXX=g++-9
%endif
%meson -Ddoc=enabled \
-Dsystem-lua=true \
-Delogind=disabled
%meson_build
%install
%meson_install
%if 0%{?suse_version} > 1500
mkdir -p %{buildroot}/%{_distconfdir}
install -m 644 %{S:1} %{buildroot}/%{_distconfdir}/
%else
mkdir -p %{buildroot}/%{_sysconfdir}
install -m 644 %{S:1} %{buildroot}/%{_sysconfdir}/
%endif
%fdupes -s %{buildroot}/%{_datadir}/doc/pipewire/html
%find_lang %{name} %{?no_lang_C}
%ifnarch %ix86 ppc64
%check
export XDG_RUNTIME_DIR=/tmp
%meson_test
%endif
%pre
%systemd_user_pre wireplumber.service
%post
%systemd_user_post wireplumber.service
%if 0%{?suse_version} <= 1500
# If the pipewire.socket user unit is not enabled and the workaround
# for boo#1186561 has never been executed, we need to execute it now
if [ ! -L %{_sysconfdir}/systemd/user/pipewire.service.wants/wireplumber.service \
-a ! -f %{_localstatedir}/lib/pipewire/wireplumber_post_workaround \
-a -x %{_bindir}/systemctl ]; then
for service in wireplumber.service ; do
%{_bindir}/systemctl --global preset "$service" || :
done
mkdir -p %{_localstatedir}/lib/pipewire
cat << EOF > %{_localstatedir}/lib/pipewire/wireplumber_post_workaround
# The existence of this file means that the wireplumber user services were
# enabled at least once. Please don't remove this file as that would
# make the services to be enabled again in the next package update.
#
# Check the following bugs for more information:
# https://bugzilla.opensuse.org/show_bug.cgi?id=1200485
EOF
fi
%endif
%preun
%systemd_user_preun wireplumber.service
%postun
%systemd_user_postun wireplumber.service
%post -n %{libwireplumber} -p /sbin/ldconfig
%postun -n %{libwireplumber} -p /sbin/ldconfig
%files
%{_bindir}/wireplumber
%{_bindir}/wpctl
%{_bindir}/wpexec
%dir %{_libdir}/wireplumber-%{apiver}
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-dbus-connection.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-default-nodes-api.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-file-monitor-api.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-log-settings.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-logind.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-lua-scripting.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-mixer-api.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-portal-permissionstore.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-reserve-device.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-settings.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-si-audio-adapter.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-si-node.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-si-standard-link.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-standard-event-source.so
%{_userunitdir}/wireplumber.service
%{_userunitdir}/wireplumber@.service
%dir %{_datadir}/doc/wireplumber
%dir %{_datadir}/doc/wireplumber/examples
%{_datadir}/doc/wireplumber/examples/wireplumber.conf.d
%{_datadir}/wireplumber
%files lang -f %{name}.lang
%files video-only-profile
%if 0%{?suse_version} > 1500
%{_distconfdir}/wireplumber.env
%else
%{_sysconfdir}/wireplumber.env
%endif
%files devel
%{_includedir}/wireplumber-%{apiver}
%{_libdir}/libwireplumber-%{apiver}.so
%{_libdir}/pkgconfig/wireplumber-%{apiver}.pc
%{_datadir}/gir-1.0/Wp-%{apiver}.gir
%files doc
%{_datadir}/doc/wireplumber/html/
%exclude %{_datadir}/doc/wireplumber/examples
%files -n typelib-1_0-Wp-%{apiver_str}
%{_libdir}/girepository-1.0/Wp-%{apiver}.typelib
%files -n %{libwireplumber}
%{_libdir}/libwireplumber-%{apiver}.so.%{sover}
%{_libdir}/libwireplumber-%{apiver}.so.%{sover}.*
%files zsh-completion
%dir %{_datarootdir}/zsh
%dir %{_datarootdir}/zsh/site-functions/
%{_datarootdir}/zsh/site-functions/_wpctl
%changelog