Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package wireplumber for openSUSE:Factory 
checked in at 2022-01-27 23:16:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/wireplumber (Old)
 and      /work/SRC/openSUSE:Factory/.wireplumber.new.1898 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "wireplumber"

Thu Jan 27 23:16:21 2022 rev:4 rq:949044 version:0.4.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/wireplumber/wireplumber.changes  2022-01-11 
00:01:48.693236023 +0100
+++ /work/SRC/openSUSE:Factory/.wireplumber.new.1898/wireplumber.changes        
2022-01-27 23:16:34.339141730 +0100
@@ -1,0 +2,27 @@
+Tue Jan 25 15:08:59 UTC 2022 - Antonio Larrosa <alarr...@suse.com>
+
+- Update to version 0.4.7:
+  * Fixed a regression in 0.4.6 that caused the selection of the
+    default audio sources and sinks to be delayed until some event,
+    which effectively caused losing audio output in many
+    circumstances (glfo#pipewire/wireplumber#148,
+    glfo#pipewire/wireplumber#150, glfo#pipewire/wireplumber#151,
+    glfo#pipewire/wireplumber#153)
+  * Fixed a regression in 0.4.6 that caused the echo-cancellation
+    pipewire module (and possibly others) to not work
+  * A default sink or source is now not selected if there is no
+    available route for it (glfo#pipewire/wireplumber#145)
+  * Fixed an issue where some clients would wait for a bit while
+    seeking (glfo#pipewire/wireplumber#146)
+  * Fixed audio capture in the endpoints-based policy
+  * Fixed an issue that would cause certain lua scripts to error
+    out with older configuration files
+    (glfo#pipewire/wireplumber#158)
+- Drop patches already included upstream:
+  * 
0001-policy-node-schedule-rescan-without-timeout-if-defined-target-is-not-found.patch
+  * 0002-policy-node-find-best-linkable-if-default-one-cannot-be-linked.patch
+- Add patch from upstream to fix selection of Pro Audio nodes
+  as default nodes:
+  * 0001-default-nodes-handle-nodes-without-Routes.patch
+
+-------------------------------------------------------------------

Old:
----
  
0001-policy-node-schedule-rescan-without-timeout-if-defined-target-is-not-found.patch
  0002-policy-node-find-best-linkable-if-default-one-cannot-be-linked.patch
  wireplumber-0.4.6.obscpio

New:
----
  0001-default-nodes-handle-nodes-without-Routes.patch
  wireplumber-0.4.7.obscpio

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ wireplumber.spec ++++++
--- /var/tmp/diff_new_pack.aaXLkt/_old  2022-01-27 23:16:34.963137419 +0100
+++ /var/tmp/diff_new_pack.aaXLkt/_new  2022-01-27 23:16:34.967137392 +0100
@@ -22,7 +22,7 @@
 %define sover 0
 %define libwireplumber libwireplumber-%{apiver_str}-%{sover}
 Name:           wireplumber
-Version:        0.4.6
+Version:        0.4.7
 Release:        0
 Summary:        Session / policy manager implementation for PipeWire
 License:        MIT
@@ -30,8 +30,8 @@
 URL:            https://gitlab.freedesktop.org/pipewire/wireplumber
 Source0:        wireplumber-%{version}.tar.xz
 Source1:        split-config-file.py
-Patch0:         
0001-policy-node-schedule-rescan-without-timeout-if-defined-target-is-not-found.patch
-Patch1:         
0002-policy-node-find-best-linkable-if-default-one-cannot-be-linked.patch
+Patch0:         0001-default-nodes-handle-nodes-without-Routes.patch
+
 Patch100:       reduce-meson-required-version.patch
 # docs
 BuildRequires:  doxygen

++++++ 0001-default-nodes-handle-nodes-without-Routes.patch ++++++
>From 211f1e6b6cd4898121e4c2b821fae4dea6cc3317 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaym...@redhat.com>
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


++++++ _service ++++++
--- /var/tmp/diff_new_pack.aaXLkt/_old  2022-01-27 23:16:35.015137060 +0100
+++ /var/tmp/diff_new_pack.aaXLkt/_new  2022-01-27 23:16:35.015137060 +0100
@@ -4,7 +4,7 @@
     <param name="scm">git</param>
     <param 
name="url">https://gitlab.freedesktop.org/pipewire/wireplumber.git</param>
     <param name="changesgenerate">enable</param>
-    <param name="revision">0.4.6</param>
+    <param name="revision">0.4.7</param>
     <param name="versionformat">@PARENT_TAG@</param>
 <!--
     <param name="versionprefix">0.4.6+git</param>

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.aaXLkt/_old  2022-01-27 23:16:35.039136894 +0100
+++ /var/tmp/diff_new_pack.aaXLkt/_new  2022-01-27 23:16:35.047136839 +0100
@@ -1,6 +1,6 @@
 <servicedata>
 <service name="tar_scm">
                 <param 
name="url">https://gitlab.freedesktop.org/pipewire/wireplumber.git</param>
-              <param 
name="changesrevision">9a733293d7d39554d0c9b04741a64ece023dbac6</param></service></servicedata>
+              <param 
name="changesrevision">afb177b5e0840d54dc41d02920702c3c9580ce02</param></service></servicedata>
 (No newline at EOF)
 

++++++ wireplumber-0.4.6.obscpio -> wireplumber-0.4.7.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wireplumber-0.4.6/NEWS.rst 
new/wireplumber-0.4.7/NEWS.rst
--- old/wireplumber-0.4.6/NEWS.rst      2022-01-06 17:11:51.000000000 +0100
+++ new/wireplumber-0.4.7/NEWS.rst      2022-01-13 10:27:44.000000000 +0100
@@ -1,6 +1,31 @@
-WirePlumber 0.4.6
+WirePlumber 0.4.7
 ~~~~~~~~~~~~~~~~~
 
+Fixes:
+
+  - Fixed a regression in 0.4.6 that caused the selection of the default audio
+    sources and sinks to be delayed until some event, which effectively caused
+    losing audio output in many circumstances (#148, #150, #151, #153)
+
+  - Fixed a regression in 0.4.6 that caused the echo-cancellation pipewire
+    module (and possibly others) to not work
+
+  - A default sink or source is now not selected if there is no available route
+    for it (#145)
+
+  - Fixed an issue where some clients would wait for a bit while seeking (#146)
+
+  - Fixed audio capture in the endpoints-based policy
+
+  - Fixed an issue that would cause certain lua scripts to error out with older
+    configuration files (#158)
+
+Past releases
+~~~~~~~~~~~~~
+
+WirePlumber 0.4.6
+.................
+
 Changes:
 
   - Fixed a lot of race condition bugs that would cause strange crashes or
@@ -41,9 +66,6 @@
 
   - Added support for using strings as log level selectors in WIREPLUMBER_DEBUG
 
-Past releases
-~~~~~~~~~~~~~
-
 WirePlumber 0.4.5
 .................
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wireplumber-0.4.6/lib/wp/spa-pod.c 
new/wireplumber-0.4.7/lib/wp/spa-pod.c
--- old/wireplumber-0.4.6/lib/wp/spa-pod.c      2022-01-06 17:11:51.000000000 
+0100
+++ new/wireplumber-0.4.7/lib/wp/spa-pod.c      2022-01-13 10:27:44.000000000 
+0100
@@ -2332,6 +2332,10 @@
         }
         break;
       }
+      case 'b':
+        spa_pod_builder_bool(&self->builder,
+            va_arg(args, gboolean) ? true : false);
+        break;
       default:
         SPA_POD_BUILDER_COLLECT(&self->builder, *format, args);
         break;
@@ -2778,6 +2782,10 @@
         }
         break;
       }
+      case 'b':
+        *va_arg(args, gboolean*) =
+            SPA_POD_VALUE(struct spa_pod_bool, pod) ? TRUE : FALSE;
+        break;
       default:
         SPA_POD_PARSER_COLLECT (pod, *format, args);
         break;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wireplumber-0.4.6/meson.build 
new/wireplumber-0.4.7/meson.build
--- old/wireplumber-0.4.6/meson.build   2022-01-06 17:11:51.000000000 +0100
+++ new/wireplumber-0.4.7/meson.build   2022-01-13 10:27:44.000000000 +0100
@@ -1,5 +1,5 @@
 project('wireplumber', ['c'],
-  version : '0.4.6',
+  version : '0.4.7',
   license : 'MIT',
   meson_version : '>= 0.56.0',
   default_options : [
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wireplumber-0.4.6/modules/module-default-nodes.c 
new/wireplumber-0.4.7/modules/module-default-nodes.c
--- old/wireplumber-0.4.6/modules/module-default-nodes.c        2022-01-06 
17:11:51.000000000 +0100
+++ new/wireplumber-0.4.7/modules/module-default-nodes.c        2022-01-13 
10:27:44.000000000 +0100
@@ -8,6 +8,7 @@
 
 #include <wp/wp.h>
 #include <errno.h>
+#include <pipewire/pipewire.h>
 #include <pipewire/keys.h>
 
 #define COMPILING_MODULE_DEFAULT_NODES 1
@@ -97,6 +98,87 @@
   }
 }
 
+static gboolean
+node_has_available_routes (WpDefaultNodes * self, WpNode *node)
+{
+  const gchar *dev_id_str = wp_pipewire_object_get_property (
+          WP_PIPEWIRE_OBJECT (node), PW_KEY_DEVICE_ID);
+  const gchar *cpd_str = wp_pipewire_object_get_property (
+          WP_PIPEWIRE_OBJECT (node), "card.profile.device");
+  gint dev_id = dev_id_str ? atoi (dev_id_str) : -1;
+  gint cpd = cpd_str ? atoi (cpd_str) : -1;
+  g_autoptr (WpDevice) device = NULL;
+
+  if (dev_id == -1 || cpd == -1)
+    return TRUE;
+
+  /* Get the device */
+  device = wp_object_manager_lookup (self->rescan_om, WP_TYPE_DEVICE,
+      WP_CONSTRAINT_TYPE_G_PROPERTY, "bound-id", "=i", dev_id, NULL);
+  if (!device)
+    return TRUE;
+
+  /* Check if the current device route supports the node card device profile */
+  {
+    g_autoptr (WpIterator) routes = NULL;
+    g_auto (GValue) val = G_VALUE_INIT;
+    routes = wp_pipewire_object_enum_params_sync (WP_PIPEWIRE_OBJECT (device),
+        "Route", NULL);
+    for (; wp_iterator_next (routes, &val); g_value_unset (&val)) {
+      WpSpaPod *route = g_value_get_boxed (&val);
+      gint route_device = -1;
+      guint32 route_avail = SPA_PARAM_AVAILABILITY_unknown;
+
+      if (!wp_spa_pod_get_object (route, NULL,
+          "device", "i", &route_device,
+          "available", "?I", &route_avail,
+          NULL))
+        continue;
+
+      if (route_device != cpd)
+        continue;
+
+      if (route_avail == SPA_PARAM_AVAILABILITY_no)
+        return FALSE;
+
+      return TRUE;
+    }
+  }
+
+  /* Check if available routes support the node card device profile */
+  {
+    g_autoptr (WpIterator) routes = NULL;
+    g_auto (GValue) val = G_VALUE_INIT;
+    routes = wp_pipewire_object_enum_params_sync (WP_PIPEWIRE_OBJECT (device),
+        "EnumRoute", NULL);
+    for (; wp_iterator_next (routes, &val); g_value_unset (&val)) {
+      WpSpaPod *route = g_value_get_boxed (&val);
+      guint32 route_avail = SPA_PARAM_AVAILABILITY_unknown;
+      g_autoptr (WpSpaPod) route_devices = NULL;
+
+      if (!wp_spa_pod_get_object (route, NULL,
+          "available", "?I", &route_avail,
+          "devices", "?P", &route_devices,
+          NULL))
+        continue;
+
+      {
+        g_autoptr (WpIterator) it = wp_spa_pod_new_iterator (route_devices);
+        g_auto (GValue) v = G_VALUE_INIT;
+        for (; wp_iterator_next (it, &v); g_value_unset (&v)) {
+          gint32 *d = (gint32 *)g_value_get_pointer (&v);
+          if (d && *d == cpd) {
+            if (route_avail != SPA_PARAM_AVAILABILITY_no)
+              return TRUE;
+          }
+        }
+      }
+    }
+  }
+
+  return FALSE;
+}
+
 static WpNode *
 find_best_media_class_node (WpDefaultNodes * self, const gchar *media_class,
     const gchar *node_name, WpDirection direction, gint *priority)
@@ -124,6 +206,9 @@
           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 (name && node_name && g_strcmp0 (name, node_name) == 0)
         prio += 10000;
 
@@ -307,12 +392,22 @@
           PW_KEY_DEVICE_ID, "=i", device_id, NULL);
       for (; wp_iterator_next (node_it, &node_val); g_value_unset (&node_val)) 
{
         WpPipewireObject *node = g_value_get_object (&node_val);
-        if (wp_node_get_n_ports (WP_NODE (node)) > 0)
+        g_autoptr (WpPort) port =
+              wp_object_manager_lookup (self->rescan_om,
+              WP_TYPE_PORT, WP_CONSTRAINT_TYPE_PW_PROPERTY,
+              PW_KEY_NODE_ID, "=u", wp_proxy_get_bound_id (WP_PROXY (node)),
+              NULL);
+        if (port)
           ready_nodes++;
       }
 
-      if (ready_nodes < total_nodes)
+      if (ready_nodes < total_nodes) {
+        const gchar *device_name = wp_pipewire_object_get_property (
+            WP_PIPEWIRE_OBJECT (device), PW_KEY_DEVICE_NAME);
+        wp_debug_object (self, "device '%s' is not ready (%d/%d)", device_name,
+            ready_nodes, total_nodes);
         return FALSE;
+      }
     }
   }
 
@@ -327,10 +422,19 @@
       WpPipewireObject *node = g_value_get_object (&node_val);
       const gchar *media_class = wp_pipewire_object_get_property (
           WP_PIPEWIRE_OBJECT (node), PW_KEY_MEDIA_CLASS);
-      if (wp_node_get_n_ports (WP_NODE (node)) == 0 &&
+      g_autoptr (WpPort) port =
+          wp_object_manager_lookup (self->rescan_om,
+          WP_TYPE_PORT, WP_CONSTRAINT_TYPE_PW_PROPERTY,
+          PW_KEY_NODE_ID, "=u", wp_proxy_get_bound_id (WP_PROXY (node)),
+          NULL);
+      if (!port &&
           (g_strcmp0 ("Audio/Source/Virtual", media_class) == 0 ||
-           g_strcmp0 ("Video/Source/Virtual", media_class) == 0))
+           g_strcmp0 ("Video/Source/Virtual", media_class) == 0)) {
+        const gchar *node_name = wp_pipewire_object_get_property (
+            WP_PIPEWIRE_OBJECT (node), PW_KEY_NODE_NAME);
+        wp_debug_object (self, "virtual node '%s' is not ready", node_name);
         return FALSE;
+      }
     }
   }
 
@@ -370,6 +474,7 @@
   g_autoptr (WpCore) core = wp_object_get_core (WP_OBJECT (self));
   g_return_if_fail (core);
 
+  wp_debug_object (self, "scheduling default nodes rescan");
   wp_core_sync_closure (core, NULL, g_cclosure_new_object (
       G_CALLBACK (sync_rescan), G_OBJECT (self)));
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wireplumber-0.4.6/modules/module-device-activation.c 
new/wireplumber-0.4.7/modules/module-device-activation.c
--- old/wireplumber-0.4.6/modules/module-device-activation.c    2022-01-06 
17:11:51.000000000 +0100
+++ new/wireplumber-0.4.7/modules/module-device-activation.c    2022-01-13 
10:27:44.000000000 +0100
@@ -31,6 +31,7 @@
 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 @@
   /* 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 @@
           "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 @@
 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 @@
   /* 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 @@
   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 @@
 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 @@
   /* 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 @@
   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 @@
 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 @@
     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 @@
   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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/wireplumber-0.4.6/src/config/main.lua.d/50-alsa-config.lua 
new/wireplumber-0.4.7/src/config/main.lua.d/50-alsa-config.lua
--- old/wireplumber-0.4.6/src/config/main.lua.d/50-alsa-config.lua      
2022-01-06 17:11:51.000000000 +0100
+++ new/wireplumber-0.4.7/src/config/main.lua.d/50-alsa-config.lua      
2022-01-13 10:27:44.000000000 +0100
@@ -17,6 +17,19 @@
 
 alsa_monitor.rules = {
   -- An array of matches/actions to evaluate.
+  -- 
+  -- If you want to disable some devices or nodes, you can apply properties 
per device as the following example.
+  -- The name can be found by running pw-cli ls Device, or pw-cli dump Device
+  --{
+  --  matches = {
+  --    {
+  --      { "device.name", "matches", "name_of_some_disabled_card" },
+  --    },
+  --  },
+  --  apply_properties = {
+  --    ["device.disabled"] = true,
+  --  },
+  --}
   {
     -- Rules for matching a device or node. It is an array of
     -- properties that all need to match the regexp. If any of the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/wireplumber-0.4.6/src/config/policy.lua.d/50-endpoints-config.lua 
new/wireplumber-0.4.7/src/config/policy.lua.d/50-endpoints-config.lua
--- old/wireplumber-0.4.6/src/config/policy.lua.d/50-endpoints-config.lua       
2022-01-06 17:11:51.000000000 +0100
+++ new/wireplumber-0.4.7/src/config/policy.lua.d/50-endpoints-config.lua       
2022-01-13 10:27:44.000000000 +0100
@@ -4,36 +4,92 @@
 --[[
 
 default_policy.policy.roles = {
+  ["Capture"] = {
+    ["alias"] = { "Multimedia", "Music", "Voice", "Capture" },
+    ["priority"] = 25,
+    ["action.default"] = "cork",
+    ["action.capture"] = "mix",
+    ["media.class"] = "Audio/Source",
+  },
   ["Multimedia"] = {
     ["alias"] = { "Movie", "Music", "Game" },
-    ["priority"] = 10,
-    ["action.default"] = "mix",
+    ["priority"] = 25,
+    ["action.default"] = "cork",
+  },
+  ["Speech-Low"] = {
+    ["priority"] = 30,
+    ["action.default"] = "cork",
+    ["action.Speech-Low"] = "mix",
+  },
+  ["Custom-Low"] = {
+    ["priority"] = 35,
+    ["action.default"] = "cork",
+    ["action.Custom-Low"] = "mix",
   },
-  ["Notification"] = {
-    ["priority"] = 20,
+  ["Navigation"] = {
+    ["priority"] = 50,
     ["action.default"] = "duck",
-    ["action.Notification"] = "mix",
+    ["action.Navigation"] = "mix",
   },
-  ["Alert"] = {
-    ["priority"] = 30,
+  ["Speech-High"] = {
+    ["priority"] = 60,
+    ["action.default"] = "cork",
+    ["action.Speech-High"] = "mix",
+  },
+  ["Custom-High"] = {
+    ["priority"] = 65,
     ["action.default"] = "cork",
-    ["action.Alert"] = "mix",
+    ["action.Custom-High"] = "mix",
+  },
+  ["Communication"] = {
+    ["priority"] = 75,
+    ["action.default"] = "cork",
+    ["action.Communication"] = "mix",
+  },
+  ["Emergency"] = {
+    ["alias"] = { "Alert" },
+    ["priority"] = 99,
+    ["action.default"] = "cork",
+    ["action.Emergency"] = "mix",
   },
 }
 
 default_policy.endpoints = {
+  ["endpoint.capture"] = {
+    ["media.class"] = "Audio/Source",
+    ["role"] = "Capture",
+  },
   ["endpoint.multimedia"] = {
     ["media.class"] = "Audio/Sink",
     ["role"] = "Multimedia",
   },
-  ["endpoint.notifications"] = {
+  ["endpoint.speech_low"] = {
+    ["media.class"] = "Audio/Sink",
+    ["role"] = "Speech-Low",
+  },
+  ["endpoint.custom_low"] = {
     ["media.class"] = "Audio/Sink",
-    ["role"] = "Notification",
+    ["role"] = "Custom-Low",
   },
-  ["endpoint.alert"] = {
+  ["endpoint.navigation"] = {
     ["media.class"] = "Audio/Sink",
-    ["role"] = "Alert",
+    ["role"] = "Navigation",
+  },
+  ["endpoint.speech_high"] = {
+    ["media.class"] = "Audio/Sink",
+    ["role"] = "Speech-High",
+  },
+  ["endpoint.custom_high"] = {
+    ["media.class"] = "Audio/Sink",
+    ["role"] = "Custom-High",
+  },
+  ["endpoint.communication"] = {
+    ["media.class"] = "Audio/Sink",
+    ["role"] = "Communication",
+  },
+  ["endpoint.emergency"] = {
+    ["media.class"] = "Audio/Sink",
+    ["role"] = "Emergency",
   },
 }
-
-]]--
+]]--
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/wireplumber-0.4.6/src/scripts/access/access-default.lua 
new/wireplumber-0.4.7/src/scripts/access/access-default.lua
--- old/wireplumber-0.4.6/src/scripts/access/access-default.lua 2022-01-06 
17:11:51.000000000 +0100
+++ new/wireplumber-0.4.7/src/scripts/access/access-default.lua 2022-01-13 
10:27:44.000000000 +0100
@@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wireplumber-0.4.6/src/scripts/create-item.lua 
new/wireplumber-0.4.7/src/scripts/create-item.lua
--- old/wireplumber-0.4.6/src/scripts/create-item.lua   2022-01-06 
17:11:51.000000000 +0100
+++ new/wireplumber-0.4.7/src/scripts/create-item.lua   2022-01-13 
10:27:44.000000000 +0100
@@ -6,7 +6,7 @@
 -- SPDX-License-Identifier: MIT
 
 -- Receive script arguments from config.lua
-local config = ...
+local config = ... or {}
 
 items = {}
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wireplumber-0.4.6/src/scripts/default-routes.lua 
new/wireplumber-0.4.7/src/scripts/default-routes.lua
--- old/wireplumber-0.4.6/src/scripts/default-routes.lua        2022-01-06 
17:11:51.000000000 +0100
+++ new/wireplumber-0.4.7/src/scripts/default-routes.lua        2022-01-13 
10:27:44.000000000 +0100
@@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wireplumber-0.4.6/src/scripts/monitors/alsa-midi.lua 
new/wireplumber-0.4.7/src/scripts/monitors/alsa-midi.lua
--- old/wireplumber-0.4.6/src/scripts/monitors/alsa-midi.lua    2022-01-06 
17:11:51.000000000 +0100
+++ new/wireplumber-0.4.7/src/scripts/monitors/alsa-midi.lua    2022-01-13 
10:27:44.000000000 +0100
@@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wireplumber-0.4.6/src/scripts/monitors/alsa.lua 
new/wireplumber-0.4.7/src/scripts/monitors/alsa.lua
--- old/wireplumber-0.4.6/src/scripts/monitors/alsa.lua 2022-01-06 
17:11:51.000000000 +0100
+++ new/wireplumber-0.4.7/src/scripts/monitors/alsa.lua 2022-01-13 
10:27:44.000000000 +0100
@@ -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 {}
@@ -168,6 +168,9 @@
 
   -- apply properties from config.rules
   rulesApplyProperties(properties)
+  if properties["node.disabled"] then
+    return
+  end
 
   -- create the node
   local node = Node("adapter", properties)
@@ -177,9 +180,13 @@
 
 function createDevice(parent, id, factory, properties)
   local device = SpaDevice(factory, properties)
-  device:connect("create-object", createNode)
-  device:activate(Feature.SpaDevice.ENABLED | Feature.Proxy.BOUND)
-  parent:store_managed_object(id, device)
+  if device then
+    device:connect("create-object", createNode)
+    device:activate(Feature.SpaDevice.ENABLED | Feature.Proxy.BOUND)
+    parent:store_managed_object(id, device)
+  else
+    Log.warning ("Failed to create '" .. factory .. "' device")
+  end
 end
 
 function prepareDevice(parent, id, type, factory, properties)
@@ -250,6 +257,9 @@
 
   -- apply properties from config.rules
   rulesApplyProperties(properties)
+  if properties["device.disabled"] then
+    return
+  end
 
   -- override the device factory to use ACP
   if properties["api.alsa.use-acp"] then
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wireplumber-0.4.6/src/scripts/monitors/bluez.lua 
new/wireplumber-0.4.7/src/scripts/monitors/bluez.lua
--- old/wireplumber-0.4.6/src/scripts/monitors/bluez.lua        2022-01-06 
17:11:51.000000000 +0100
+++ new/wireplumber-0.4.7/src/scripts/monitors/bluez.lua        2022-01-13 
10:27:44.000000000 +0100
@@ -109,8 +109,13 @@
 
     -- create the device
     device = SpaDevice(factory, properties)
-    device:connect("create-object", createNode)
-    parent:store_managed_object(id, device)
+    if device then
+      device:connect("create-object", createNode)
+      parent:store_managed_object(id, device)
+    else
+      Log.warning ("Failed to create '" .. factory .. "' device")
+      return
+    end
   end
 
   Log.info(parent, string.format("%d, %s (%s): %s",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wireplumber-0.4.6/src/scripts/monitors/libcamera.lua 
new/wireplumber-0.4.7/src/scripts/monitors/libcamera.lua
--- old/wireplumber-0.4.6/src/scripts/monitors/libcamera.lua    2022-01-06 
17:11:51.000000000 +0100
+++ new/wireplumber-0.4.7/src/scripts/monitors/libcamera.lua    2022-01-13 
10:27:44.000000000 +0100
@@ -125,9 +125,13 @@
 
   -- create the device
   local device = SpaDevice(factory, properties)
-  device:connect("create-object", createNode)
-  device:activate(Feature.SpaDevice.ENABLED | Feature.Proxy.BOUND)
-  parent:store_managed_object(id, device)
+  if device then
+    device:connect("create-object", createNode)
+    device:activate(Feature.SpaDevice.ENABLED | Feature.Proxy.BOUND)
+    parent:store_managed_object(id, device)
+  else
+    Log.warning ("Failed to create '" .. factory .. "' device")
+  end
 end
 
 monitor = SpaDevice("api.libcamera.enum.manager", config.properties or {})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wireplumber-0.4.6/src/scripts/monitors/v4l2.lua 
new/wireplumber-0.4.7/src/scripts/monitors/v4l2.lua
--- old/wireplumber-0.4.6/src/scripts/monitors/v4l2.lua 2022-01-06 
17:11:51.000000000 +0100
+++ new/wireplumber-0.4.7/src/scripts/monitors/v4l2.lua 2022-01-13 
10:27:44.000000000 +0100
@@ -125,9 +125,13 @@
 
   -- create the device
   local device = SpaDevice(factory, properties)
-  device:connect("create-object", createNode)
-  device:activate(Feature.SpaDevice.ENABLED | Feature.Proxy.BOUND)
-  parent:store_managed_object(id, device)
+  if device then
+    device:connect("create-object", createNode)
+    device:activate(Feature.SpaDevice.ENABLED | Feature.Proxy.BOUND)
+    parent:store_managed_object(id, device)
+  else
+    Log.warning ("Failed to create '" .. factory .. "' device")
+  end
 end
 
 monitor = SpaDevice("api.v4l2.enum.udev", config.properties or {})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/wireplumber-0.4.6/src/scripts/policy-endpoint-client-links.lua 
new/wireplumber-0.4.7/src/scripts/policy-endpoint-client-links.lua
--- old/wireplumber-0.4.6/src/scripts/policy-endpoint-client-links.lua  
2022-01-06 17:11:51.000000000 +0100
+++ new/wireplumber-0.4.7/src/scripts/policy-endpoint-client-links.lua  
2022-01-13 10:27:44.000000000 +0100
@@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/wireplumber-0.4.6/src/scripts/policy-endpoint-client.lua 
new/wireplumber-0.4.7/src/scripts/policy-endpoint-client.lua
--- old/wireplumber-0.4.6/src/scripts/policy-endpoint-client.lua        
2022-01-06 17:11:51.000000000 +0100
+++ new/wireplumber-0.4.7/src/scripts/policy-endpoint-client.lua        
2022-01-13 10:27:44.000000000 +0100
@@ -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 = {}
@@ -37,10 +37,12 @@
   end
 end
 
-function findRole(role)
+function findRole(role, tmc)
   if role and not config.roles[role] then
     for r, p in pairs(config.roles) do
-      if type(p.alias) == "table" then
+      -- default media class can be overridden in the role config data
+      mc = p["media.class"] or "Audio/Sink"
+      if (type(p.alias) == "table" and tmc == mc) then
         for i = 1, #(p.alias), 1 do
           if role == p.alias[i] then
             return r
@@ -69,7 +71,7 @@
   end
 
   -- find highest priority endpoint by role
-  media_role = findRole(node.properties["media.role"])
+  media_role = findRole(node.properties["media.role"], target_media_class)
   for si_target_ep in endpoints_om:iterate {
     Constraint { "role", "=", media_role, type = "pw-global" },
     Constraint { "media.class", "=", target_media_class, type = "pw-global" },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/wireplumber-0.4.6/src/scripts/policy-endpoint-device.lua 
new/wireplumber-0.4.7/src/scripts/policy-endpoint-device.lua
--- old/wireplumber-0.4.6/src/scripts/policy-endpoint-device.lua        
2022-01-06 17:11:51.000000000 +0100
+++ new/wireplumber-0.4.7/src/scripts/policy-endpoint-device.lua        
2022-01-13 10:27:44.000000000 +0100
@@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wireplumber-0.4.6/src/scripts/policy-node.lua 
new/wireplumber-0.4.7/src/scripts/policy-node.lua
--- old/wireplumber-0.4.6/src/scripts/policy-node.lua   2022-01-06 
17:11:51.000000000 +0100
+++ new/wireplumber-0.4.7/src/scripts/policy-node.lua   2022-01-13 
10:27:44.000000000 +0100
@@ -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
@@ -477,13 +477,22 @@
 end
 
 function findUndefinedTarget (si)
-  -- Find the default linkable if the default nodes module is loaded, otherwise
-  -- just find the best linkable based on priority and routes
-  if default_nodes ~= nil then
-    return findDefaultlinkable (si)
-  else
-    return findBestlinkable (si)
+  -- Just find the best linkable if default nodes module is not loaded
+  if default_nodes == nil then
+    return findBestLinkable (si)
+  end
+
+  -- Otherwise find the default linkable. If the default linkabke cannot link,
+  -- we find the best one instead. We return nil if default does not exist.
+  local si_target, can_passthrough = findDefaultlinkable (si)
+  if si_target then
+    if canLink (si.properties, si_target) then
+      return si_target, can_passthrough
+    else
+      return findBestLinkable (si)
+    end
   end
+  return nil, nil
 end
 
 function lookupLink (si_id, si_target_id)
@@ -552,25 +561,16 @@
     si_target = nil
   end
 
-  -- wait up to 2 seconds for the requested target to become available
-  -- this is because the client may have already "seen" a target that we 
haven't
-  -- yet prepared, which leads to a race condition
+  -- if the client has seen a target that we haven't yet prepared, schedule
+  -- a rescan one more time and hope for the best
   local si_id = si.id
   if si_props["node.target"] and si_props["node.target"] ~= "-1"
       and not si_target
       and not si_flags[si_id].was_handled
       and not si_flags[si_id].done_waiting then
-    if not si_flags[si_id].timeout_source then
-      si_flags[si_id].timeout_source = Core.timeout_add(2000, function()
-        if si_flags[si_id] then
-          si_flags[si_id].done_waiting = true
-          si_flags[si_id].timeout_source = nil
-          scheduleRescan()
-        end
-        return false
-      end)
-    end
     Log.info (si, "... waiting for target")
+    si_flags[si_id].done_waiting = true
+    scheduleRescan()
     return
   end
 

++++++ wireplumber.obsinfo ++++++
--- /var/tmp/diff_new_pack.aaXLkt/_old  2022-01-27 23:16:35.343134794 +0100
+++ /var/tmp/diff_new_pack.aaXLkt/_new  2022-01-27 23:16:35.347134767 +0100
@@ -1,5 +1,5 @@
 name: wireplumber
-version: 0.4.6
-mtime: 1641485511
-commit: 9a733293d7d39554d0c9b04741a64ece023dbac6
+version: 0.4.7
+mtime: 1642066064
+commit: afb177b5e0840d54dc41d02920702c3c9580ce02
 

Reply via email to