WpObjectManager objects-changed signal not always emitted
The objects-changed signal in ObjectManager should fire after objects have been added/removed, but it does not in practice.
Occurs on some wireplumber startupts, with visible effects in m-default-nodes.
Some extra debug:
diff --git a/modules/module-default-nodes.c b/modules/module-default-nodes.c
index 0fdaed5..454c4b0 100644
--- a/modules/module-default-nodes.c
+++ b/modules/module-default-nodes.c
@@ -554,6 +554,8 @@ on_object_added (WpObjectManager *om, WpPipewireObject *proxy, gpointer d)
{
WpDefaultNodes * self = WP_DEFAULT_NODES (d);
+ wp_debug_object (om, "object-added signal");
+
if (WP_IS_DEVICE (proxy)) {
g_signal_connect_object (proxy, "params-changed",
G_CALLBACK (schedule_rescan), self, G_CONNECT_SWAPPED);
Then, WIREPLUMBER_DEBUG=5 wireplumber
and grepping for the address of the objectmanager for m-default-nodes:
<< ... >>
T 22:04:06.566114 wp-object-manager ../subprojects/wireplumber/lib/wp/object-manager.c:729:wp_object_manager_add_object: <WpObjectManager:0x61d000010b20> added: <WpPort:0x6250014d5740>
D 22:04:06.566127 m-default-nodes ../subprojects/wireplumber/modules/module-default-nodes.c:557:on_object_added: <WpObjectManager:0x61d000010b20> object-added signal
T 22:04:06.566140 wp-object-manager ../subprojects/wireplumber/lib/wp/object-manager.c:675:wp_object_manager_maybe_objects_changed: <WpObjectManager:0x61d000010b20> pending:4 changed:1 idle_source:(nil) installed:1
T 22:04:06.571665 wp-object-manager ../subprojects/wireplumber/lib/wp/object-manager.c:675:wp_object_manager_maybe_objects_changed: <WpObjectManager:0x61d000010b20> pending:4 changed:1 idle_source:(nil) installed:1
T 22:04:06.572270 wp-object-manager ../subprojects/wireplumber/lib/wp/object-manager.c:675:wp_object_manager_maybe_objects_changed: <WpObjectManager:0x61d000010b20> pending:4 changed:1 idle_source:(nil) installed:1
T 22:04:06.575925 wp-object-manager ../subprojects/wireplumber/lib/wp/object-manager.c:675:wp_object_manager_maybe_objects_changed: <WpObjectManager:0x61d000010b20> pending:4 changed:1 idle_source:(nil) installed:1
T 22:04:06.576546 wp-object-manager ../subprojects/wireplumber/lib/wp/object-manager.c:675:wp_object_manager_maybe_objects_changed: <WpObjectManager:0x61d000010b20> pending:4 changed:1 idle_source:(nil) installed:1
T 22:04:06.580483 wp-object-manager ../subprojects/wireplumber/lib/wp/object-manager.c:675:wp_object_manager_maybe_objects_changed: <WpObjectManager:0x61d000010b20> pending:4 changed:1 idle_source:(nil) installed:1
T 22:04:06.581055 wp-object-manager ../subprojects/wireplumber/lib/wp/object-manager.c:675:wp_object_manager_maybe_objects_changed: <WpObjectManager:0x61d000010b20> pending:4 changed:1 idle_source:(nil) installed:1
T 22:04:09.232080 wp-object-manager ../subprojects/wireplumber/lib/wp/object-manager.c:787:wp_object_manager_add_global: <WpObjectManager:0x61d000010b20> adding global:57 -> <WpClient:0x6250014d5840>
T 22:04:09.232115 wp-object-manager ../subprojects/wireplumber/lib/wp/object-manager.c:787:wp_object_manager_add_global: <WpObjectManager:0x61d000010b20> adding global:58 -> <WpClient:0x6250014d5940>
T 22:04:09.232147 wp-object-manager ../subprojects/wireplumber/lib/wp/object-manager.c:675:wp_object_manager_maybe_objects_changed: <WpObjectManager:0x61d000010b20> pending:6 changed:1 idle_source:(nil) installed:1
T 22:04:09.235396 wp-object-manager ../subprojects/wireplumber/lib/wp/object-manager.c:675:wp_object_manager_maybe_objects_changed: <WpObjectManager:0x61d000010b20> pending:5 changed:1 idle_source:(nil) installed:1
T 22:04:09.235537 wp-object-manager ../subprojects/wireplumber/lib/wp/object-manager.c:675:wp_object_manager_maybe_objects_changed: <WpObjectManager:0x61d000010b20> pending:4 changed:1 idle_source:(nil) installed:1
<< end of log >>
So the pending_nodes counter never reaches zero, and so default nodes stop updating properly. Probably also other stuff using that signal will break.
Maybe if it's hard to fix before next release, put in some workaround like !332 (closed)
Edited by P V