[gentoo-commits] repo/gentoo:master commit in: media-video/wireplumber/files/, media-video/wireplumber/

2024-09-12 Thread Sam James
commit: 17048008b017505277071b5ca38aaf62bd57c244
Author: Sam James  gentoo  org>
AuthorDate: Fri Sep 13 02:10:05 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Fri Sep 13 02:10:05 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=17048008

media-video/wireplumber: backport autoswitch fix

We might now have a stable candidate.

Bug: https://bugs.gentoo.org/936967
Bug: https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/715
Signed-off-by: Sam James  gentoo.org>

 ...replumber-0.5.6-bluetooth-only-autoswitch.patch |  64 ++
 .../wireplumber/wireplumber-0.5.6-r1.ebuild| 132 +
 2 files changed, 196 insertions(+)

diff --git 
a/media-video/wireplumber/files/wireplumber-0.5.6-bluetooth-only-autoswitch.patch
 
b/media-video/wireplumber/files/wireplumber-0.5.6-bluetooth-only-autoswitch.patch
new file mode 100644
index ..779a4d4f21bf
--- /dev/null
+++ 
b/media-video/wireplumber/files/wireplumber-0.5.6-bluetooth-only-autoswitch.patch
@@ -0,0 +1,64 @@
+https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/715
+https://gitlab.freedesktop.org/pipewire/wireplumber/-/merge_requests/669
+https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/b68a6794cd5c3702a2144be60c41a9ca982c416b
+
+From b68a6794cd5c3702a2144be60c41a9ca982c416b Mon Sep 17 00:00:00 2001
+From: Pauli Virtanen 
+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.
+--- 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

diff --git a/media-video/wireplumber/wireplumber-0.5.6-r1.ebuild 
b/media-video/wireplumber/wireplumber-0.5.6-r1.ebuild
new file mode 100644
index ..a5d10f865805
--- /dev/null
+++ b/media-video/wireplumber/wireplumber-0.5.6-r1.ebuild
@@ -0,0 +1,132 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# 1. Please regularly check (even at the point of bumping) Fedora's packaging
+# for needed backports at 
https://src.fedoraproject.org/rpms/wireplumber/tree/rawhide
+#
+# 2. Keep an eye on git master (for both PipeWire and WirePlumber) as things
+# continue to move quickly. It's not uncommon for fixes to be made shortly
+# after releases.
+
+LUA_COMPAT=( lua5-{3,4} )
+
+inherit lua-single meson systemd
+
+DESCRIPTION="Replacement for pipewire-media-session"
+HOMEPAGE="https://gitlab.fr

[gentoo-commits] repo/gentoo:master commit in: media-video/wireplumber/files/, media-video/wireplumber/

2024-03-18 Thread Sam James
commit: 7149f311e97fb3a4d7f443359e239431a06871ff
Author: Igor V. Kovalenko  gmail  com>
AuthorDate: Fri Feb  2 20:04:07 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Mar 19 05:21:38 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7149f311

media-video/wireplumber: Amend sound-server split, new conf syntax

Bug: https://bugs.gentoo.org/921393
Signed-off-by: Igor V. Kovalenko  gmail.com>
Signed-off-by: Sam James  gentoo.org>

 ...-0.4.81-config-disable-sound-server-parts.patch | 27 ++
 media-video/wireplumber/wireplumber-.ebuild|  4 ++--
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.81-config-disable-sound-server-parts.patch
 
b/media-video/wireplumber/files/wireplumber-0.4.81-config-disable-sound-server-parts.patch
new file mode 100644
index ..3a9e828837b5
--- /dev/null
+++ 
b/media-video/wireplumber/files/wireplumber-0.4.81-config-disable-sound-server-parts.patch
@@ -0,0 +1,27 @@
+From ed5ce9c176db2e26ac9915b4d86c3a076a8093ae Mon Sep 17 00:00:00 2001
+From: "Igor V. Kovalenko" 
+Date: Fri, 2 Feb 2024 22:00:03 +0300
+Subject: [PATCH] config: Disable alsa and bluez monitors by default
+
+---
+ src/config/wireplumber.conf | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/config/wireplumber.conf b/src/config/wireplumber.conf
+index 822b7967..ca0faa0a 100644
+--- a/src/config/wireplumber.conf
 b/src/config/wireplumber.conf
+@@ -64,8 +64,8 @@ wireplumber.profiles = {
+ support.settings = required
+ support.log-settings = required
+ metadata.sm-objects = required
+-hardware.audio = required
+-hardware.bluetooth = required
++#hardware.audio = required
++#hardware.bluetooth = required
+ hardware.video-capture = required
+ policy.standard = required
+ #policy.role-priority-system = optional
+-- 
+2.43.0
+

diff --git a/media-video/wireplumber/wireplumber-.ebuild 
b/media-video/wireplumber/wireplumber-.ebuild
index 42e484bf9447..9b1c4d46ea55 100644
--- a/media-video/wireplumber/wireplumber-.ebuild
+++ b/media-video/wireplumber/wireplumber-.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -70,7 +70,7 @@ RDEPEND="${DEPEND}
 DOCS=( {NEWS,README}.rst )
 
 PATCHES=(
-   "${FILESDIR}"/${PN}-0.4.15-config-disable-sound-server-parts.patch # 
defer enabling sound server parts to media-video/pipewire
+   "${FILESDIR}"/${PN}-0.4.81-config-disable-sound-server-parts.patch # 
defer enabling sound server parts to media-video/pipewire
 )
 
 src_configure() {



[gentoo-commits] repo/gentoo:master commit in: media-video/wireplumber/files/, media-video/wireplumber/

2022-12-09 Thread Sam James
commit: 995ecdbe98cdd53e619e8010263680e7b6328c9b
Author: Sam James  gentoo  org>
AuthorDate: Sat Dec 10 04:30:25 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Dec 10 04:35:06 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=995ecdbe

media-video/wireplumber: drop 0.4.11-r3

Signed-off-by: Sam James  gentoo.org>

 media-video/wireplumber/Manifest   |   1 -
 .../files/wireplumber-0.4.11-alsa-lua-crash.patch  |  33 -
 .../wireplumber-0.4.11-dbus-reconnect-crash.patch  |  45 ---
 .../files/wireplumber-0.4.11-loop.patch| 147 -
 .../wireplumber/wireplumber-0.4.11-r3.ebuild   | 131 --
 5 files changed, 357 deletions(-)

diff --git a/media-video/wireplumber/Manifest b/media-video/wireplumber/Manifest
index bc9a9c83c560..f04df271892e 100644
--- a/media-video/wireplumber/Manifest
+++ b/media-video/wireplumber/Manifest
@@ -1,2 +1 @@
-DIST wireplumber-0.4.11.tar.gz 403931 BLAKE2B 
77ef2540081420d4255dcb54165d0aceb08d97c60d19b9eb7606e90cf95e305e690794a1f46234b53b13765452fea0d23ae6acae9deea672db67e21c31d2307d
 SHA512 
73a5120cd0c55b5fe5248cc22497efd23e40bb91961553639d9cf1bbf138d273db65153fa3c1bb0d2794f869e077e011156d323832534f62651d66f8cc87dca4
 DIST wireplumber-0.4.12.tar.bz2 317524 BLAKE2B 
5f020759fab459fb3311f8a5cef2bf7dc62304b6e95f5d983b86b0e6ddef7bc16c4f2ef6a36264d7ed94e48dbb4c66ff3389bfd7ca58841b4fd6cdfb21bc
 SHA512 
79827ea9f61bacf8df80f9cd0ca4c80192cf85a1b181a51256b3c845d1d04a690ea5c1270d6d5d05d56f799f16980a593e61d003ef78ad7dc8d5e9ea332aa5d4

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.11-alsa-lua-crash.patch 
b/media-video/wireplumber/files/wireplumber-0.4.11-alsa-lua-crash.patch
deleted file mode 100644
index 3bc8bbd08bb6..
--- a/media-video/wireplumber/files/wireplumber-0.4.11-alsa-lua-crash.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/c16e637c329bc9dda8544b18f5bd47a8d63ee253
-
-From c16e637c329bc9dda8544b18f5bd47a8d63ee253 Mon Sep 17 00:00:00 2001
-From: George Kiagiadakis 
-Date: Thu, 7 Jul 2022 20:58:36 +0300
-Subject: [PATCH] alsa: use "obj_type" as a variable name to avoid shadowing
- lua's "type" function
-
-This causes a crash when running in a VM because the code tries to
-execute lua's "type()" and ends up executing the local string variable...
-
-Fixes: #303
 a/src/scripts/monitors/alsa.lua
-+++ b/src/scripts/monitors/alsa.lua
-@@ -49,7 +49,7 @@ function nonempty(str)
-   return str ~= "" and str or nil
- end
- 
--function createNode(parent, id, type, factory, properties)
-+function createNode(parent, id, obj_type, factory, properties)
-   local dev_props = parent.properties
- 
-   -- set the device id and spa factory name; REQUIRED, do not change
-@@ -199,7 +199,7 @@ function createDevice(parent, id, factory, properties)
-   end
- end
- 
--function prepareDevice(parent, id, type, factory, properties)
-+function prepareDevice(parent, id, obj_type, factory, properties)
-   -- ensure the device has an appropriate name
-   local name = "alsa_card." ..
- (properties["device.name"] or
-GitLab

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.11-dbus-reconnect-crash.patch 
b/media-video/wireplumber/files/wireplumber-0.4.11-dbus-reconnect-crash.patch
deleted file mode 100644
index 6098ed11c302..
--- 
a/media-video/wireplumber/files/wireplumber-0.4.11-dbus-reconnect-crash.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/eb406bdb2cbbcd49c55c71285f8f2eddb624d24b
-
-From eb406bdb2cbbcd49c55c71285f8f2eddb624d24b Mon Sep 17 00:00:00 2001
-From: George Kiagiadakis 
-Date: Wed, 13 Jul 2022 13:38:14 +0300
-Subject: [PATCH] dbus: fix crash when trying to reconnect
-
-When coming from on_sync_reconnect, data points to the WpDBus object
-instead of the activation transition.
-
-Fixes: #305
 a/lib/wp/dbus.c
-+++ b/lib/wp/dbus.c
-@@ -58,14 +58,26 @@ wp_dbus_set_state (WpDbus *self, WpDBusState new_state)
- static void
- on_got_bus (GObject * obj, GAsyncResult * res, gpointer data)
- {
--  WpTransition *transition = WP_TRANSITION (data);
--  WpDbus *self = wp_transition_get_source_object (transition);
-+  WpTransition *transition;
-+  WpDbus *self;
-   g_autoptr (GError) error = NULL;
- 
-+  if (WP_IS_TRANSITION (data)) {
-+// coming from wp_dbus_enable
-+transition = WP_TRANSITION (data);
-+self = wp_transition_get_source_object (transition);
-+  } else {
-+// coming from on_sync_reconnect
-+transition = NULL;
-+self = WP_DBUS (data);
-+  }
-+
-   self->connection = g_dbus_connection_new_for_address_finish (res, &error);
-   if (!self->connection) {
--g_prefix_error (&error, "Failed to connect to bus: ");
--wp_transition_return_error (transition, g_steal_pointer (&error));
-+if (transition) {
-+  g_prefix_error (&error, "Failed to connect to bus: ");
-+  wp_transition_return_error (

[gentoo-commits] repo/gentoo:master commit in: media-video/wireplumber/files/, media-video/wireplumber/

2022-08-26 Thread Sam James
commit: 916a0b55068c037e5871ab411da6c3a2e5444349
Author: Sam James  gentoo  org>
AuthorDate: Fri Aug 26 10:51:07 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Fri Aug 26 10:51:07 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=916a0b55

media-video/wireplumber: backport 100% CPU loop fixes

Closes: https://bugs.gentoo.org/866551
Signed-off-by: Sam James  gentoo.org>

 .../files/wireplumber-0.4.11-loop.patch| 147 +
 .../wireplumber/wireplumber-0.4.11-r3.ebuild   | 131 ++
 2 files changed, 278 insertions(+)

diff --git a/media-video/wireplumber/files/wireplumber-0.4.11-loop.patch 
b/media-video/wireplumber/files/wireplumber-0.4.11-loop.patch
new file mode 100644
index ..75e2bafcaddc
--- /dev/null
+++ b/media-video/wireplumber/files/wireplumber-0.4.11-loop.patch
@@ -0,0 +1,147 @@
+https://bugs.gentoo.org/866551
+https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/37c839b9308cd3d6580bf01077db8cb29ec2aa2f
+https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/370b692933634675213110048fcda6dff52eb52b
+
+From: Pauli Virtanen 
+Date: Tue, 19 Jul 2022 20:39:06 +0300
+Subject: [PATCH] policy-node: fix potential rescan loop
+
+SiLink activation might be delayed indefinitely under some error
+conditions. Currently, policy-node schedules a rescan when it sees a
+non-activated link on a stream to be moved, which produces busy loop if
+the si-link doesn't activate.
+
+Instead of rescheduling on non-active si-links, just remove and emit a
+warning. The si-link then gets removed once it gets activated.
+
+Reproducer:
+
+1. Play audio from Rhythmbox and pause.
+2. Switch default output with pactl between two different outputs
+3. Links from the paused stream stay at "init"
+--- a/src/scripts/policy-node.lua
 b/src/scripts/policy-node.lua
+@@ -694,16 +694,15 @@ function handleLinkable (si)
+ local link = lookupLink (si_id, si_flags[si_id].peer_id)
+ if reconnect then
+   if link ~= nil then
+--- remove old link if active, otherwise schedule rescan
+-if ((link:get_active_features() & Feature.SessionItem.ACTIVE) ~= 0) 
then
+-  si_flags[si_id].peer_id = nil
+-  link:remove ()
+-  Log.info (si, "... moving to new target")
+-else
+-  scheduleRescan()
+-  Log.info (si, "... scheduled rescan")
+-  return
++-- 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")
+ end
++si_flags[si_id].peer_id = nil
++link:remove ()
++Log.info (si, "... moving to new target")
+   end
+ else
+   if link ~= nil then
+GitLab
+
+From: Pauli Virtanen 
+Date: Tue, 19 Jul 2022 20:01:10 +0300
+Subject: [PATCH] m-si-link: don't wait for establish before activation +
+ cleanup links
+
+SiLink should not wait for WpLinks becoming ESTABLISHED, before
+activation. That flag shows whether a link has moved away from the
+"init" state, however, links to e.g. Pulseaudio corked streams can stay
+in "init" state until uncorking.  This causes trouble for policies,
+which needlessly wait for such links to establish.
+
+The WpLink objects may also be kept alive by other referents, and
+just unrefing them does not necessarily destroy the PW objects.
+
+Activate SiLink even if the WpLink is still in "init" state. It's enough
+that the link otherwise successfully establishes.
+
+At dispose time, explicitly request destroying the WpLinks that were
+created by the SiLink, to ensure they are removed even if there's
+something else referring to them.
+--- a/modules/module-si-standard-link.c
 b/modules/module-si-standard-link.c
+@@ -132,6 +132,27 @@ si_standard_link_get_associated_proxy (WpSessionItem * 
item, GType proxy_type)
+   return NULL;
+ }
+ 
++static void
++request_destroy_link (gpointer data, gpointer user_data)
++{
++  WpLink *link = WP_LINK (data);
++
++  wp_global_proxy_request_destroy (WP_GLOBAL_PROXY (link));
++}
++
++static void
++clear_node_links (GPtrArray **node_links_p)
++{
++  /*
++   * Something else (eg. object managers) may be keeping the WpLink
++   * objects alive. Deactive the links now, to destroy the PW objects.
++   */
++  if (*node_links_p)
++g_ptr_array_foreach (*node_links_p, request_destroy_link, NULL);
++
++  g_clear_pointer (node_links_p, g_ptr_array_unref);
++}
++
+ static void
+ si_standard_link_disable_active (WpSessionItem *si)
+ {
+@@ -154,7 +175,8 @@ si_standard_link_disable_active (WpSessionItem *si)
+   WP_SI_LINKABLE (si_in));
+   }
+ 
+-  g_clear_pointer (&self->node_links, g_ptr_array_unref);
++  clear_node_links (&self->node_links);
++
+   self->n_active_links = 0;
+   self->n_failed_links = 0;

[gentoo-commits] repo/gentoo:master commit in: media-video/wireplumber/files/, media-video/wireplumber/

2022-07-19 Thread Sam James
commit: fb53fea720a58c87881d06b3d07e3af216d260ce
Author: Sam James  gentoo  org>
AuthorDate: Tue Jul 19 21:21:31 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Jul 19 21:21:31 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb53fea7

media-video/wireplumber: backport dbus crash fix

Signed-off-by: Sam James  gentoo.org>

 .../wireplumber-0.4.11-dbus-reconnect-crash.patch  |  45 +++
 .../wireplumber/wireplumber-0.4.11-r2.ebuild   | 130 +
 2 files changed, 175 insertions(+)

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.11-dbus-reconnect-crash.patch 
b/media-video/wireplumber/files/wireplumber-0.4.11-dbus-reconnect-crash.patch
new file mode 100644
index ..6098ed11c302
--- /dev/null
+++ 
b/media-video/wireplumber/files/wireplumber-0.4.11-dbus-reconnect-crash.patch
@@ -0,0 +1,45 @@
+https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/eb406bdb2cbbcd49c55c71285f8f2eddb624d24b
+
+From eb406bdb2cbbcd49c55c71285f8f2eddb624d24b Mon Sep 17 00:00:00 2001
+From: George Kiagiadakis 
+Date: Wed, 13 Jul 2022 13:38:14 +0300
+Subject: [PATCH] dbus: fix crash when trying to reconnect
+
+When coming from on_sync_reconnect, data points to the WpDBus object
+instead of the activation transition.
+
+Fixes: #305
+--- a/lib/wp/dbus.c
 b/lib/wp/dbus.c
+@@ -58,14 +58,26 @@ wp_dbus_set_state (WpDbus *self, WpDBusState new_state)
+ static void
+ on_got_bus (GObject * obj, GAsyncResult * res, gpointer data)
+ {
+-  WpTransition *transition = WP_TRANSITION (data);
+-  WpDbus *self = wp_transition_get_source_object (transition);
++  WpTransition *transition;
++  WpDbus *self;
+   g_autoptr (GError) error = NULL;
+ 
++  if (WP_IS_TRANSITION (data)) {
++// coming from wp_dbus_enable
++transition = WP_TRANSITION (data);
++self = wp_transition_get_source_object (transition);
++  } else {
++// coming from on_sync_reconnect
++transition = NULL;
++self = WP_DBUS (data);
++  }
++
+   self->connection = g_dbus_connection_new_for_address_finish (res, &error);
+   if (!self->connection) {
+-g_prefix_error (&error, "Failed to connect to bus: ");
+-wp_transition_return_error (transition, g_steal_pointer (&error));
++if (transition) {
++  g_prefix_error (&error, "Failed to connect to bus: ");
++  wp_transition_return_error (transition, g_steal_pointer (&error));
++}
+ return;
+   }
+ 
+GitLab

diff --git a/media-video/wireplumber/wireplumber-0.4.11-r2.ebuild 
b/media-video/wireplumber/wireplumber-0.4.11-r2.ebuild
new file mode 100644
index ..804d3273b583
--- /dev/null
+++ b/media-video/wireplumber/wireplumber-0.4.11-r2.ebuild
@@ -0,0 +1,130 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# 1. Please regularly check (even at the point of bumping) Fedora's packaging
+# for needed backports at 
https://src.fedoraproject.org/rpms/wireplumber/tree/rawhide
+#
+# 2. Keep an eye on git master (for both PipeWire and WirePlumber) as things
+# continue to move quickly. It's not uncommon for fixes to be made shortly
+# after releases.
+
+LUA_COMPAT=( lua5-{3,4} )
+
+inherit lua-single meson systemd
+
+if [[ ${PV} ==  ]]; then
+   EGIT_REPO_URI="https://gitlab.freedesktop.org/pipewire/${PN}.git";
+   EGIT_BRANCH="master"
+   inherit git-r3
+else
+   
SRC_URI="https://gitlab.freedesktop.org/pipewire/${PN}/-/archive/${PV}/${P}.tar.gz";
+   KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
+fi
+
+DESCRIPTION="Replacement for pipewire-media-session"
+HOMEPAGE="https://gitlab.freedesktop.org/pipewire/wireplumber";
+
+LICENSE="MIT"
+SLOT="0/0.4"
+IUSE="elogind system-service systemd test"
+
+REQUIRED_USE="
+   ${LUA_REQUIRED_USE}
+   ?? ( elogind systemd )
+   system-service? ( systemd )
+"
+
+RESTRICT="!test? ( test )"
+
+# introspection? ( dev-libs/gobject-introspection ) is valid but likely only 
used for doc building
+BDEPEND="
+   dev-libs/glib
+   dev-util/gdbus-codegen
+   dev-util/glib-utils
+   sys-devel/gettext
+"
+
+DEPEND="
+   ${LUA_DEPS}
+   >=dev-libs/glib-2.62
+   >=media-video/pipewire-0.3.53-r1:=
+   virtual/libintl
+   elogind? ( sys-auth/elogind )
+   systemd? ( sys-apps/systemd )
+"
+
+# Any dev-lua/* deps get declared like this inside RDEPEND:
+#  $(lua_gen_cond_dep '
+#  dev-lua/[${LUA_USEDEP}]
+#  ')
+RDEPEND="${DEPEND}
+   system-service? (
+   acct-user/pipewire
+   acct-group/pipewire
+   )
+"
+
+DOCS=( {NEWS,README}.rst )
+
+PATCHES=(
+   "${FILESDIR}"/${PN}-0.4.10-config-disable-sound-server-parts.patch # 
defer enabling sound server parts to media-video/pipewire
+   "${FILESDIR}"/${P}-alsa-lua-crash.patch
+   "${FILESDIR}"/${P}-dbus-reconnect-crash.patch
+)
+
+src_configure() {
+   local emesonargs=(
+   -Ddoc=disable

[gentoo-commits] repo/gentoo:master commit in: media-video/wireplumber/files/, media-video/wireplumber/

2022-05-29 Thread Sam James
commit: 6773cae240f67b63545aad170a8ce49222379296
Author: Niklāvs Koļesņikovs <89q1r14hd  relay  firefox  com>
AuthorDate: Sun May 29 14:05:25 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Mon May 30 04:42:28 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6773cae2

media-video/wireplumber: fix a bad mistake in 0.4.10-r2 by doing -r3

Somehow git format-patch ended up producing a revert for an unrelated
commit which either randomly or perhaps via some copy and paste error
happened to be a revert of the only patch that 0.4.10-r1 was applying.

Because of that wireplumber-0.4.10-r2 incorrectly dropped it. This is
now fixed in 0.4.10-r3 by reinstating the removed patch as well as
adding in the one that was meant to be present in -r2 but had been
incorrectly generated due to probably wrong git format-patch command.

Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd  relay.firefox.com>
Signed-off-by: Sam James  gentoo.org>

 ...nodes-don-t-check-if-all-device-nodes-are.patch | 187 +
 .../wireplumber/wireplumber-0.4.10-r3.ebuild   | 126 ++
 2 files changed, 313 insertions(+)

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.10-m-default-nodes-don-t-check-if-all-device-nodes-are.patch
 
b/media-video/wireplumber/files/wireplumber-0.4.10-m-default-nodes-don-t-check-if-all-device-nodes-are.patch
new file mode 100644
index ..d9c51489a893
--- /dev/null
+++ 
b/media-video/wireplumber/files/wireplumber-0.4.10-m-default-nodes-don-t-check-if-all-device-nodes-are.patch
@@ -0,0 +1,187 @@
+https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/392cce2136e81ac3146078eacbbae85b694c917a
+
+From 392cce2136e81ac3146078eacbbae85b694c917a Mon Sep 17 00:00:00 2001
+From: Julian Bouzas 
+Date: Fri, 20 May 2022 07:38:24 -0400
+Subject: [PATCH] m-default-nodes: don't check if all device nodes are ready
+ when finding default node
+
+This check was originally added to avoid a small audio glitch when changing
+default nodes while also changing the device profile (eg Gnome Sound Settings).
+The check is removed because it causes issues when disabling alsa nodes. There
+are plans to fix the audio glitch issue in the future with the planned
+event-dispatcher architecture.
+
+Fixes #279
+---
+ modules/module-default-nodes.c | 136 -
+ 1 file changed, 136 deletions(-)
+
+diff --git a/modules/module-default-nodes.c b/modules/module-default-nodes.c
+index 0fdaed5..577f9bb 100644
+--- a/modules/module-default-nodes.c
 b/modules/module-default-nodes.c
+@@ -345,135 +345,6 @@ reevaluate_default_node (WpDefaultNodes * self, 
WpMetadata *m, gint node_t)
+   }
+ }
+ 
+-static guint
+-get_device_total_nodes (WpPipewireObject * proxy)
+-{
+-  g_autoptr (WpIterator) profiles = NULL;
+-  g_auto (GValue) item = G_VALUE_INIT;
+-
+-  profiles = wp_pipewire_object_enum_params_sync (proxy, "Profile", NULL);
+-  if (!profiles)
+-return 0;
+-
+-  for (; wp_iterator_next (profiles, &item); g_value_unset (&item)) {
+-WpSpaPod *pod = g_value_get_boxed (&item);
+-gint idx = -1;
+-const gchar *name = NULL;
+-g_autoptr (WpSpaPod) classes = NULL;
+-
+-/* Parse */
+-if (!wp_spa_pod_get_object (pod, NULL,
+-"index", "i", &idx,
+-"name", "s", &name,
+-"classes", "?P", &classes,
+-NULL))
+-  continue;
+-if (!classes)
+-  continue;
+-
+-/* Parse profile classes */
+-{
+-  g_autoptr (WpIterator) it = wp_spa_pod_new_iterator (classes);
+-  g_auto (GValue) v = G_VALUE_INIT;
+-  gint total_nodes = 0;
+-  for (; wp_iterator_next (it, &v); g_value_unset (&v)) {
+-WpSpaPod *entry = g_value_get_boxed (&v);
+-g_autoptr (WpSpaPodParser) pp = NULL;
+-const gchar *media_class = NULL;
+-gint n_nodes = 0;
+-g_return_val_if_fail (entry, 0);
+-if (!wp_spa_pod_is_struct (entry))
+-  continue;
+-pp = wp_spa_pod_parser_new_struct (entry);
+-g_return_val_if_fail (pp, 0);
+-g_return_val_if_fail (wp_spa_pod_parser_get_string (pp, 
&media_class), 0);
+-g_return_val_if_fail (wp_spa_pod_parser_get_int (pp, &n_nodes), 0);
+-wp_spa_pod_parser_end (pp);
+-
+-total_nodes += n_nodes;
+-  }
+-
+-  if (total_nodes > 0)
+-return total_nodes;
+-}
+-  }
+-
+-  return 0;
+-}
+-
+-static gboolean
+-nodes_ready (WpDefaultNodes * self)
+-{
+-  g_autoptr (WpIterator) it = NULL;
+-  g_auto (GValue) val = G_VALUE_INIT;
+-
+-  /* Get the total number of nodes for each device and make sure they exist
+-   * and have at least 1 port */
+-  it = wp_object_manager_new_filtered_iterator (self->rescan_om,
+-  WP_TYPE_DEVICE, NULL);
+-  for (; wp_iterator_next (it, &val); g_value_unset (&val)) {
+-WpPipewireObject *device = g_value_get_object (&val);
+-guint total_nodes = get_device_total_nodes (device);
+-if (total_nodes > 0) {
+-  guint32 devi

[gentoo-commits] repo/gentoo:master commit in: media-video/wireplumber/files/, media-video/wireplumber/

2022-05-12 Thread Sam James
commit: 12ffc90b5986b4a2eb943fb5bf94c3393991761d
Author: Niklāvs Koļesņikovs <89q1r14hd  relay  firefox  com>
AuthorDate: Thu May 12 13:51:21 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Fri May 13 00:41:15 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=12ffc90b

media-video/wireplumber: patch 0.4.10 to default enable backends

Due to signifiant number of people having outdated copies of
WirePlumber scripts, upstream chose to change the default behavior of
WP monitors (essentially PW backends) and to enable them by default,
so that they work with the older scripts.

Gentoo already duplicates to /etc/wireplumber which would trigger the
usual config protection mechanism but users could also have copied them
to ~/.config/wireplumber. Therefore it's still a nice thing to apply this
change.

Bug: https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/254

Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd  relay.firefox.com>
Closes: https://github.com/gentoo/gentoo/pull/25455
Signed-off-by: Sam James  gentoo.org>

 ...-enabled-property-to-default-to-true-when.patch | 129 +
 .../wireplumber/wireplumber-0.4.10-r1.ebuild   | 122 +++
 2 files changed, 251 insertions(+)

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.10-config-fix-enabled-property-to-default-to-true-when.patch
 
b/media-video/wireplumber/files/wireplumber-0.4.10-config-fix-enabled-property-to-default-to-true-when.patch
new file mode 100644
index ..40a486616580
--- /dev/null
+++ 
b/media-video/wireplumber/files/wireplumber-0.4.10-config-fix-enabled-property-to-default-to-true-when.patch
@@ -0,0 +1,129 @@
+https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/1f045309208ab5d927883b5adc2b7d1623fae162
+
+From 1f045309208ab5d927883b5adc2b7d1623fae162 Mon Sep 17 00:00:00 2001
+From: George Kiagiadakis 
+Date: Thu, 12 May 2022 12:19:38 +0300
+Subject: [PATCH] config: fix enabled property to default to "true" when not
+ defined
+
+Fixes backwards compatibility with older config files
+
+Fixes: #254
+---
+ src/config/bluetooth.lua.d/30-bluez-monitor.lua | 2 +-
+ src/config/main.lua.d/20-default-access.lua | 2 +-
+ src/config/main.lua.d/30-alsa-monitor.lua   | 2 +-
+ src/config/main.lua.d/30-libcamera-monitor.lua  | 2 +-
+ src/config/main.lua.d/30-v4l2-monitor.lua   | 2 +-
+ src/config/main.lua.d/40-device-defaults.lua| 2 +-
+ src/config/main.lua.d/40-stream-defaults.lua| 2 +-
+ src/config/policy.lua.d/10-default-policy.lua   | 2 +-
+ 8 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/src/config/bluetooth.lua.d/30-bluez-monitor.lua 
b/src/config/bluetooth.lua.d/30-bluez-monitor.lua
+index b40026c2..a870aa5d 100644
+--- a/src/config/bluetooth.lua.d/30-bluez-monitor.lua
 b/src/config/bluetooth.lua.d/30-bluez-monitor.lua
+@@ -3,7 +3,7 @@ bluez_monitor.properties = {}
+ bluez_monitor.rules = {}
+ 
+ function bluez_monitor.enable()
+-  if not bluez_monitor.enabled then
++  if bluez_monitor.enabled == false then
+ return
+   end
+ 
+diff --git a/src/config/main.lua.d/20-default-access.lua 
b/src/config/main.lua.d/20-default-access.lua
+index a6ffb2ee..0a7eb955 100644
+--- a/src/config/main.lua.d/20-default-access.lua
 b/src/config/main.lua.d/20-default-access.lua
+@@ -3,7 +3,7 @@ default_access.properties = {}
+ default_access.rules = {}
+ 
+ function default_access.enable()
+-  if not default_access.enabled then
++  if default_access.enabled == false then
+ return
+   end
+ 
+diff --git a/src/config/main.lua.d/30-alsa-monitor.lua 
b/src/config/main.lua.d/30-alsa-monitor.lua
+index da0b2c70..8e45e434 100644
+--- a/src/config/main.lua.d/30-alsa-monitor.lua
 b/src/config/main.lua.d/30-alsa-monitor.lua
+@@ -3,7 +3,7 @@ alsa_monitor.properties = {}
+ alsa_monitor.rules = {}
+ 
+ function alsa_monitor.enable()
+-  if not alsa_monitor.enabled then
++  if alsa_monitor.enabled == false then
+ return
+   end
+ 
+diff --git a/src/config/main.lua.d/30-libcamera-monitor.lua 
b/src/config/main.lua.d/30-libcamera-monitor.lua
+index 4a8257ff..cd820a83 100644
+--- a/src/config/main.lua.d/30-libcamera-monitor.lua
 b/src/config/main.lua.d/30-libcamera-monitor.lua
+@@ -3,7 +3,7 @@ libcamera_monitor.properties = {}
+ libcamera_monitor.rules = {}
+ 
+ function libcamera_monitor.enable()
+-  if not libcamera_monitor.enabled then
++  if libcamera_monitor.enabled == false then
+ return
+   end
+ 
+diff --git a/src/config/main.lua.d/30-v4l2-monitor.lua 
b/src/config/main.lua.d/30-v4l2-monitor.lua
+index 7cfd4bcd..3fbdc9e7 100644
+--- a/src/config/main.lua.d/30-v4l2-monitor.lua
 b/src/config/main.lua.d/30-v4l2-monitor.lua
+@@ -3,7 +3,7 @@ v4l2_monitor.properties = {}
+ v4l2_monitor.rules = {}
+ 
+ function v4l2_monitor.enable()
+-  if not v4l2_monitor.enabled then
++  if v4l2_monitor.enabled == false then
+ return
+   end
+ 
+diff --git a/src/config/main.lua.d/40-device-defaults.lua 
b/src/config

[gentoo-commits] repo/gentoo:master commit in: media-video/wireplumber/files/, media-video/wireplumber/

2022-04-21 Thread Sam James
commit: 0479ba8351119cc528869546d64d7439d3bc90f2
Author: Niklāvs Koļesņikovs <89q1r14hd  relay  firefox  com>
AuthorDate: Thu Apr 21 18:11:50 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Apr 21 21:57:01 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0479ba83

media-video/wireplumber: clean up 0.4.8-r3

It so happened that WirePlumber 0.4.9 ended up being stabilized, and
it's hard to imagine what we'd still need 0.4.8 for. Therefore let's
clean it up now.

Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd  relay.firefox.com>
Signed-off-by: Sam James  gentoo.org>

 media-video/wireplumber/Manifest   |   1 -
 ...tooth-fix-string.find-crash-with-nil-stri.patch |  28 ---
 ...eam-do-not-crash-if-config.properties-is-.patch |  27 ---
 ...4.8-si-audio-adapter-relax-format-parsing.patch |  44 -
 ...x-va-list-APIs-for-different-architecture.patch | 214 -
 .../wireplumber/wireplumber-0.4.8-r3.ebuild| 123 
 6 files changed, 437 deletions(-)

diff --git a/media-video/wireplumber/Manifest b/media-video/wireplumber/Manifest
index 3c57ec31c440..0a2dee8196dd 100644
--- a/media-video/wireplumber/Manifest
+++ b/media-video/wireplumber/Manifest
@@ -1,2 +1 @@
-DIST wireplumber-0.4.8.tar.gz 374824 BLAKE2B 
7b5c8492d58be8b40c4c98bc807d031c453904a7df51c9b0d96c353c93018ba8cbd699b2c3c885defe7b5360df4256ad5e175015dc0102e5007853f6e0132cb7
 SHA512 
cb96b1d55be7e9d1433fc4a4fb4accce63f5f318a9a2b5cffc51a9f052765df777a0ba4ac73579771084295a73e6f05ed3a16a5fb9d0f5da4e183cfd74483c2c
 DIST wireplumber-0.4.9.tar.gz 376170 BLAKE2B 
50f552c730ac543fc2e8b0e054c861bcd22ed281a62f2921fb956f39b917cce6eb53287dfcfc81db240476f82f5cf1d7556fa34be8bf507ff847089536b81f44
 SHA512 
39b9e9be014489042fe480219b99d7591e0b68dd44b889bd5c6aeee73e771adb807bc21f48d031217f097182827bd2f48b68d52291036d52e95d4fa75e7f9929

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.8-policy-bluetooth-fix-string.find-crash-with-nil-stri.patch
 
b/media-video/wireplumber/files/wireplumber-0.4.8-policy-bluetooth-fix-string.find-crash-with-nil-stri.patch
deleted file mode 100644
index 364f8df195cf..
--- 
a/media-video/wireplumber/files/wireplumber-0.4.8-policy-bluetooth-fix-string.find-crash-with-nil-stri.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/c4c5ca8e2215e5fc295b39af4504c43ed3fe176f
-
-From c4c5ca8e2215e5fc295b39af4504c43ed3fe176f Mon Sep 17 00:00:00 2001
-From: George Kiagiadakis 
-Date: Mon, 14 Feb 2022 10:38:51 +0200
-Subject: [PATCH] policy-bluetooth: fix string.find crash with nil string
-
-Fixes #193

- src/scripts/policy-bluetooth.lua | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/scripts/policy-bluetooth.lua 
b/src/scripts/policy-bluetooth.lua
-index 24fbffbb..f8f69a14 100644
 a/src/scripts/policy-bluetooth.lua
-+++ b/src/scripts/policy-bluetooth.lua
-@@ -118,7 +118,7 @@ local function isSwitched(device)
- end
- 
- local function isBluez5AudioSink(sink_name)
--  if string.find(sink_name, "bluez_output.") ~= nil then
-+  if sink_name and string.find(sink_name, "bluez_output.") ~= nil then
- return true
-   end
-   return false
--- 
-GitLab
-

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.8-restore-stream-do-not-crash-if-config.properties-is-.patch
 
b/media-video/wireplumber/files/wireplumber-0.4.8-restore-stream-do-not-crash-if-config.properties-is-.patch
deleted file mode 100644
index 5f4a838c36a6..
--- 
a/media-video/wireplumber/files/wireplumber-0.4.8-restore-stream-do-not-crash-if-config.properties-is-.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/5f96f69218273573e625475846269b3914cfcecf
-
-From 5f96f69218273573e625475846269b3914cfcecf Mon Sep 17 00:00:00 2001
-From: George Kiagiadakis 
-Date: Wed, 9 Feb 2022 13:35:13 +0200
-Subject: [PATCH] restore-stream: do not crash if config.properties is nil
-
-Fixes #190

- src/scripts/restore-stream.lua | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/scripts/restore-stream.lua b/src/scripts/restore-stream.lua
-index 404eede5..0c17bdd7 100644
 a/src/scripts/restore-stream.lua
-+++ b/src/scripts/restore-stream.lua
-@@ -10,6 +10,7 @@
- 
- -- Receive script arguments from config.lua
- local config = ... or {}
-+config.properties = config.properties or {}
- config_restore_props = config.properties["restore-props"] or false
- config_restore_target = config.properties["restore-target"] or false
- 
--- 
-GitLab
-

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.8-si-audio-adapter-relax-format-parsing.patch
 
b/media-video/wireplumber/files/wireplumber-0.4.8-si-audio-adapter-relax-format-parsing.patch
deleted file mode 100644
index 93225b02d88b..
--- 
a/media-video/wireplumber/files/wireplumber-0.4.8-si-audio-adapter-relax-format-parsing.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-https://gitlab.free

[gentoo-commits] repo/gentoo:master commit in: media-video/wireplumber/files/, media-video/wireplumber/

2022-04-21 Thread Sam James
commit: dbd15d4f2887fa9bd30a88ae68e77d23f0835928
Author: Niklāvs Koļesņikovs <89q1r14hd  relay  firefox  com>
AuthorDate: Thu Apr 21 18:02:38 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Apr 21 21:57:00 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dbd15d4f

media-video/wireplumber: backport two minor fixes

The first fix deals with handling of device removal and is included for
correctness sake, since it appears to be the right thing for WirePlumber
to do.

The second fix implements and documents D-Bus disabling for
WirePlumber which must be done when attempting to run WirePlumber as
a system service. This does not mean it's a recommended or even fully
supported configuration but there's people who want it. And having it
available should not cause any harm to other users.

Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd  relay.firefox.com>
Signed-off-by: Sam James  gentoo.org>

 ...ment-which-options-need-to-be-turned-off-.patch |  87 +++
 ...icy-device-profile-clear-tables-when-devi.patch |  33 ++
 .../wireplumber/wireplumber-0.4.9-r1.ebuild| 121 +
 3 files changed, 241 insertions(+)

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.9-config-document-which-options-need-to-be-turned-off-.patch
 
b/media-video/wireplumber/files/wireplumber-0.4.9-config-document-which-options-need-to-be-turned-off-.patch
new file mode 100644
index ..9e664ec56564
--- /dev/null
+++ 
b/media-video/wireplumber/files/wireplumber-0.4.9-config-document-which-options-need-to-be-turned-off-.patch
@@ -0,0 +1,87 @@
+https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/0da29f38181e391160fa8702623050b8544ec775
+
+From 0da29f38181e391160fa8702623050b8544ec775 Mon Sep 17 00:00:00 2001
+From: George Kiagiadakis 
+Date: Mon, 4 Apr 2022 14:38:28 +0300
+Subject: [PATCH] config: document which options need to be turned off to use
+ wp without D-Bus
+
+and actually implement an option for the logind module
+
+Related to: #237
+---
+ src/config/bluetooth.lua.d/30-bluez-monitor.lua| 4 +++-
+ src/config/bluetooth.lua.d/50-bluez-config.lua | 8 
+ src/config/main.lua.d/50-alsa-config.lua   | 4 +++-
+ src/config/main.lua.d/50-default-access-config.lua | 3 +++
+ 4 files changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/src/config/bluetooth.lua.d/30-bluez-monitor.lua 
b/src/config/bluetooth.lua.d/30-bluez-monitor.lua
+index 266d3e2f..ba86657f 100644
+--- a/src/config/bluetooth.lua.d/30-bluez-monitor.lua
 b/src/config/bluetooth.lua.d/30-bluez-monitor.lua
+@@ -8,5 +8,7 @@ function bluez_monitor.enable()
+ rules = bluez_monitor.rules,
+   })
+ 
+-  load_optional_module("logind")
++  if bluez_monitor.properties["with-logind"] then
++load_optional_module("logind")
++  end
+ end
+diff --git a/src/config/bluetooth.lua.d/50-bluez-config.lua 
b/src/config/bluetooth.lua.d/50-bluez-config.lua
+index 072504ec..dd8033ff 100644
+--- a/src/config/bluetooth.lua.d/50-bluez-config.lua
 b/src/config/bluetooth.lua.d/50-bluez-config.lua
+@@ -34,6 +34,14 @@ bluez_monitor.properties = {
+   -- Register dummy AVRCP player, required for AVRCP volume function.
+   -- Disable if you are running mpris-proxy or equivalent.
+   --["bluez5.dummy-avrcp-player"] = true,
++
++  -- Enable the logind module, which arbitrates which user will be allowed
++  -- to have bluetooth audio enabled at any given time (particularly useful
++  -- if you are using GDM as a display manager, as the gdm user also launches
++  -- pipewire and wireplumber).
++  -- This requires access to the D-Bus user session; disable if you are 
running
++  -- a system-wide instance of wireplumber.
++  ["with-logind"] = true,
+ }
+ 
+ bluez_monitor.rules = {
+diff --git a/src/config/main.lua.d/50-alsa-config.lua 
b/src/config/main.lua.d/50-alsa-config.lua
+index 6c97e8ad..d29b0b6f 100644
+--- a/src/config/main.lua.d/50-alsa-config.lua
 b/src/config/main.lua.d/50-alsa-config.lua
+@@ -7,6 +7,8 @@ alsa_monitor.properties = {
+   --["alsa.jack-device"] = false,
+ 
+   -- Reserve devices via org.freedesktop.ReserveDevice1 on D-Bus
++  -- Disable if you are running a system-wide instance, which
++  -- doesn't have access to the D-Bus user session
+   ["alsa.reserve"] = true,
+   --["alsa.reserve.priority"] = -20,
+   --["alsa.reserve.application-name"] = "WirePlumber",
+@@ -20,7 +22,7 @@ alsa_monitor.properties = {
+ 
+ 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
+   --{
+diff --git a/src/config/main.lua.d/50-default-access-config.lua 
b/src/config/main.lua.d/50-default-access-config.lua
+index 6cf18bed..45cc5b73 100644
+--- a/src/config/main.lua.d/50-default-access-config.lua
 b/src/config/main.lua.d/50-defaul

[gentoo-commits] repo/gentoo:master commit in: media-video/wireplumber/files/, media-video/wireplumber/

2022-02-14 Thread Sam James
commit: 570b62814fc7fb91ee5755647499353ff5653eef
Author: Niklāvs Koļesņikovs <89q1r14hd  relay  firefox  com>
AuthorDate: Mon Feb 14 09:07:31 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Feb 14 20:08:01 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=570b6281

media-video/wireplumber: fixes a possible 0.4.8 crash on tty switch

This commit backports one upstream patch to fix a crash inside Bluetooth
module when the user switches to tty.

Additionally it adds another backport that changes the internal API to
fix support for some unknown architectures (perhaps embedded?). It does
not appear that the API change would leak to outside of WP itself.

Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd  relay.firefox.com>
Closes: https://github.com/gentoo/gentoo/pull/24188
Signed-off-by: Sam James  gentoo.org>

 ...tooth-fix-string.find-crash-with-nil-stri.patch |  28 +++
 ...x-va-list-APIs-for-different-architecture.patch | 214 +
 .../wireplumber/wireplumber-0.4.8-r2.ebuild| 122 
 3 files changed, 364 insertions(+)

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.8-policy-bluetooth-fix-string.find-crash-with-nil-stri.patch
 
b/media-video/wireplumber/files/wireplumber-0.4.8-policy-bluetooth-fix-string.find-crash-with-nil-stri.patch
new file mode 100644
index ..364f8df195cf
--- /dev/null
+++ 
b/media-video/wireplumber/files/wireplumber-0.4.8-policy-bluetooth-fix-string.find-crash-with-nil-stri.patch
@@ -0,0 +1,28 @@
+https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/c4c5ca8e2215e5fc295b39af4504c43ed3fe176f
+
+From c4c5ca8e2215e5fc295b39af4504c43ed3fe176f Mon Sep 17 00:00:00 2001
+From: George Kiagiadakis 
+Date: Mon, 14 Feb 2022 10:38:51 +0200
+Subject: [PATCH] policy-bluetooth: fix string.find crash with nil string
+
+Fixes #193
+---
+ src/scripts/policy-bluetooth.lua | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/scripts/policy-bluetooth.lua 
b/src/scripts/policy-bluetooth.lua
+index 24fbffbb..f8f69a14 100644
+--- a/src/scripts/policy-bluetooth.lua
 b/src/scripts/policy-bluetooth.lua
+@@ -118,7 +118,7 @@ local function isSwitched(device)
+ end
+ 
+ local function isBluez5AudioSink(sink_name)
+-  if string.find(sink_name, "bluez_output.") ~= nil then
++  if sink_name and string.find(sink_name, "bluez_output.") ~= nil then
+ return true
+   end
+   return false
+-- 
+GitLab
+

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.8-spa-json-fix-va-list-APIs-for-different-architecture.patch
 
b/media-video/wireplumber/files/wireplumber-0.4.8-spa-json-fix-va-list-APIs-for-different-architecture.patch
new file mode 100644
index ..b77cfa3c3c6f
--- /dev/null
+++ 
b/media-video/wireplumber/files/wireplumber-0.4.8-spa-json-fix-va-list-APIs-for-different-architecture.patch
@@ -0,0 +1,214 @@
+https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/e429db7e8c266045aee25e153fb2308bd61fe233
+
+From e429db7e8c266045aee25e153fb2308bd61fe233 Mon Sep 17 00:00:00 2001
+From: Julian Bouzas 
+Date: Wed, 9 Feb 2022 07:59:59 -0500
+Subject: [PATCH] spa-json: fix va_list APIs for different architectures
+
+The va_list type might not always be a pointer in some architectures, so we
+cannot guarantee it will be modified after using it for a second time in 
another
+function. This fixes the issue by using macros so args does not get copied, and
+always gets modified when using it more than once.
+---
+ lib/wp/spa-json.c | 156 --
+ 1 file changed, 80 insertions(+), 76 deletions(-)
+
+diff --git a/lib/wp/spa-json.c b/lib/wp/spa-json.c
+index f14f395d..c5e59a3e 100644
+--- a/lib/wp/spa-json.c
 b/lib/wp/spa-json.c
+@@ -363,33 +363,33 @@ wp_spa_json_new_string (const gchar *value)
+   wp_spa_json_builder_new_formatted ("\"%s\"", value));
+ }
+ 
+-static void
+-wp_spa_json_builder_add_value (WpSpaJsonBuilder *self, const gchar *fmt,
+-va_list args)
+-{
+-  switch (*fmt) {
+-case 'n':
+-  wp_spa_json_builder_add_null (self);
+-  break;
+-case 'b':
+-  wp_spa_json_builder_add_boolean (self, va_arg(args, gboolean));
+-  break;
+-case 'i':
+-  wp_spa_json_builder_add_int (self, va_arg(args, gint));
+-  break;
+-case 'f':
+-  wp_spa_json_builder_add_float (self, (float)va_arg(args, double));
+-  break;
+-case 's':
+-  wp_spa_json_builder_add_string (self, va_arg(args, const gchar *));
+-  break;
+-case 'J':
+-  wp_spa_json_builder_add_json (self, va_arg(args, WpSpaJson *));
+-  break;
+-default:
+-  return;
+-  }
+-}
++/* Args is not a pointer in some architectures, so this needs to be a macro to
++ * avoid args being copied */
++#define wp_spa_json_builder_add_value(self,fmt,args)  
 \
++do {  
 \
++  switch (*fmt) { 

[gentoo-commits] repo/gentoo:master commit in: media-video/wireplumber/files/, media-video/wireplumber/

2022-02-11 Thread Sam James
commit: 786a2d71d3bd51fc39dc73c548b7c9d7fa45096e
Author: Niklāvs Koļesņikovs <89q1r14hd  relay  firefox  com>
AuthorDate: Fri Feb 11 19:41:30 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Feb 12 05:16:52 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=786a2d71

media-video/wireplumber: backport a fix and enable config protection

WirePlumber 0.4.8 contains a config/script change that, if not present
in the user modified files, will cause startup failure. This commit
backports an upstream fix to prevent a crash in addition to also
implementing a solution to at least keep /etc/wireplumber up to date
though the usual config_protect mechanism. This is needed because while
the particular issue has been addressed, it does not solve the general
problem with there potentially being outdated files in /etc/wireplumber
directory. The same is true for $HOME/.config/wireplumber, too, however
there's no reasonable way to help users who decide to copy config files
to there and then never update them against newer versions.

Closes: https://bugs.gentoo.org/832952

Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd  relay.firefox.com>
Signed-off-by: Sam James  gentoo.org>

 ...eam-do-not-crash-if-config.properties-is-.patch | 27 ++
 ...0.4.7-r1.ebuild => wireplumber-0.4.7-r2.ebuild} | 11 +
 ...er-0.4.8.ebuild => wireplumber-0.4.8-r1.ebuild} | 15 
 media-video/wireplumber/wireplumber-.ebuild| 11 +
 4 files changed, 64 insertions(+)

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.8-restore-stream-do-not-crash-if-config.properties-is-.patch
 
b/media-video/wireplumber/files/wireplumber-0.4.8-restore-stream-do-not-crash-if-config.properties-is-.patch
new file mode 100644
index ..5f4a838c36a6
--- /dev/null
+++ 
b/media-video/wireplumber/files/wireplumber-0.4.8-restore-stream-do-not-crash-if-config.properties-is-.patch
@@ -0,0 +1,27 @@
+https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/5f96f69218273573e625475846269b3914cfcecf
+
+From 5f96f69218273573e625475846269b3914cfcecf Mon Sep 17 00:00:00 2001
+From: George Kiagiadakis 
+Date: Wed, 9 Feb 2022 13:35:13 +0200
+Subject: [PATCH] restore-stream: do not crash if config.properties is nil
+
+Fixes #190
+---
+ src/scripts/restore-stream.lua | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/scripts/restore-stream.lua b/src/scripts/restore-stream.lua
+index 404eede5..0c17bdd7 100644
+--- a/src/scripts/restore-stream.lua
 b/src/scripts/restore-stream.lua
+@@ -10,6 +10,7 @@
+ 
+ -- Receive script arguments from config.lua
+ local config = ... or {}
++config.properties = config.properties or {}
+ config_restore_props = config.properties["restore-props"] or false
+ config_restore_target = config.properties["restore-target"] or false
+ 
+-- 
+GitLab
+

diff --git a/media-video/wireplumber/wireplumber-0.4.7-r1.ebuild 
b/media-video/wireplumber/wireplumber-0.4.7-r2.ebuild
similarity index 90%
rename from media-video/wireplumber/wireplumber-0.4.7-r1.ebuild
rename to media-video/wireplumber/wireplumber-0.4.7-r2.ebuild
index 6c3ec05b1b1c..03a62724a829 100644
--- a/media-video/wireplumber/wireplumber-0.4.7-r1.ebuild
+++ b/media-video/wireplumber/wireplumber-0.4.7-r2.ebuild
@@ -82,6 +82,17 @@ src_configure() {
meson_src_configure
 }
 
+src_install() {
+   meson_src_install
+
+   # We copy the default config, so that Gentoo tools can pick up on any
+   # updates and /etc does not end up with stale overrides.
+   # If a reflinking CoW filesystem is used (e.g. Btrfs), then the files
+   # will not actually get stored twice until modified.
+   insinto /etc
+   doins -r ${ED}/usr/share/wireplumber
+}
+
 pkg_postinst() {
if systemd_is_booted ; then
ewarn "pipewire-media-session.service is no longer installed. 
You must switch"

diff --git a/media-video/wireplumber/wireplumber-0.4.8.ebuild 
b/media-video/wireplumber/wireplumber-0.4.8-r1.ebuild
similarity index 87%
rename from media-video/wireplumber/wireplumber-0.4.8.ebuild
rename to media-video/wireplumber/wireplumber-0.4.8-r1.ebuild
index e270841b0638..6348d11b2485 100644
--- a/media-video/wireplumber/wireplumber-0.4.8.ebuild
+++ b/media-video/wireplumber/wireplumber-0.4.8-r1.ebuild
@@ -60,6 +60,10 @@ RDEPEND="${DEPEND}
 
 DOCS=( {NEWS,README}.rst )
 
+PATCHES=(
+   
"${FILESDIR}"/${P}-restore-stream-do-not-crash-if-config.properties-is-.patch
+)
+
 src_configure() {
local emesonargs=(
-Ddoc=disabled # Ebuild not wired up yet (Sphinx, Doxygen?)
@@ -78,6 +82,17 @@ src_configure() {
meson_src_configure
 }
 
+src_install() {
+   meson_src_install
+
+   # We copy the default config, so that Gentoo tools can pick up on any
+   # updates and /etc does not end up with stale overrides.
+   # If a reflinking CoW filesystem is used (e.g. Btrfs), then the files
+   # will not actually get stored tw

[gentoo-commits] repo/gentoo:master commit in: media-video/wireplumber/files/, media-video/wireplumber/

2022-01-08 Thread Sam James
commit: 39651aab61fdc7770b13aaf18edee284c54a8818
Author: Niklāvs Koļesņikovs <89q1r14hd  relay  firefox  com>
AuthorDate: Fri Jan  7 20:54:44 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Jan  9 07:56:39 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39651aab

media-video/wireplumber: bump to 0.4.6-r1 for two patches

Turns out the current BE fix was a WIP patch which was, apparently
superseded by an entirely different patch fixing the same issue.

Additionally include a recently upstreamed fix for random PA client
delays on device rescan and a few minor fixes which have no associated
upstream issue but look like they'd be good idea to have.

Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd  relay.firefox.com>
Closes: https://github.com/gentoo/gentoo/pull/23690
Signed-off-by: Sam James  gentoo.org>

 .../files/wireplumber-0.4.6-endianness-fixes.patch | 229 -
 ...-find-best-linkable-if-default-one-cannot.patch |  48 +
 ...cy-node-fix-typo-when-finding-best-target.patch |  27 +++
 ...-schedule-a-rescan-without-timeout-if-def.patch |  50 +
 ...-different-architecture-errors-for-boolea.patch |  40 
 ...er-0.4.6.ebuild => wireplumber-0.4.6-r1.ebuild} |   5 +-
 6 files changed, 169 insertions(+), 230 deletions(-)

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.6-endianness-fixes.patch 
b/media-video/wireplumber/files/wireplumber-0.4.6-endianness-fixes.patch
deleted file mode 100644
index 9b8bba93a8ab..
--- a/media-video/wireplumber/files/wireplumber-0.4.6-endianness-fixes.patch
+++ /dev/null
@@ -1,229 +0,0 @@
-Bunch of patches from 
https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/49
-Requires pipewire 0.3.42 for 03f0a7c9bac3e61126fc852e543b8ea254471eb7.
-
 a/tests/wp/spa-pod.c
-+++ b/tests/wp/spa-pod.c
-@@ -6,6 +6,8 @@
-  * SPDX-License-Identifier: MIT
-  */
- 
-+#include 
-+
- #include 
- 
- static void
-@@ -428,12 +430,12 @@ test_spa_pod_object (void)
- wp_spa_type_name (wp_spa_pod_get_spa_type (pod)));
- 
- const char *id_name;
--gboolean mute = TRUE;
-+bool mute = true;
- float vol = 0.0;
- gint32 frequency;
- const char *device;
- gint64 device_fd;
--gboolean custom = FALSE;
-+bool custom = false;
- g_assert_true (wp_spa_pod_get_object (pod,
- &id_name,
- "mute", "b", &mute,
-@@ -475,12 +477,12 @@ test_spa_pod_object (void)
- wp_spa_type_name (wp_spa_pod_get_spa_type (pod)));
- 
- const char *id_name;
--gboolean mute = TRUE;
-+bool mute = true;
- float vol = 0.0;
- gint32 frequency;
- const char *device;
- gint64 device_fd;
--gboolean custom = FALSE;
-+bool custom = false;
- g_autoptr (WpSpaPodParser) p = wp_spa_pod_parser_new_object (pod, 
&id_name);
- g_assert_nonnull (pod);
- g_assert_true (wp_spa_pod_parser_get (p, "mute", "b", &mute, NULL));
-@@ -603,7 +605,7 @@ test_spa_pod_struct (void)
- g_assert_true (wp_spa_pod_parser_get (p, "P", &value_object, NULL));
- g_assert_nonnull (value_object);
- const char *id_name;
--gboolean mute = TRUE;
-+bool mute = true;
- 
- g_assert_true (wp_spa_pod_get_object (value_object,
- &id_name,
 a/tests/wp/endpoint.c
-+++ b/tests/wp/endpoint.c
-@@ -499,7 +499,7 @@ test_endpoint_with_props (TestEndpointFixture *fixture, 
gconstpointer data)
- g_auto (GValue) item = G_VALUE_INIT;
- g_autoptr (WpSpaPod) pod = NULL;
- gfloat float_value = 0.0f;
--gboolean boolean_value = TRUE;
-+bool boolean_value = true;
- 
- iterator = wp_pipewire_object_enum_params_sync (
- WP_PIPEWIRE_OBJECT (fixture->proxy_endpoint), "Props", NULL);
-@@ -513,7 +513,7 @@ test_endpoint_with_props (TestEndpointFixture *fixture, 
gconstpointer data)
- "mute", "b", &boolean_value,
- NULL));
- g_assert_cmpfloat_with_epsilon (float_value, 1.0f, 0.001);
--g_assert_cmpint (boolean_value, ==, FALSE);
-+g_assert_cmpint (boolean_value, ==, false);
-   }
- 
-   /* setup change signals */
-@@ -541,7 +541,7 @@ test_endpoint_with_props (TestEndpointFixture *fixture, 
gconstpointer data)
- g_auto (GValue) item = G_VALUE_INIT;
- g_autoptr (WpSpaPod) pod = NULL;
- gfloat float_value = 0.0f;
--gboolean boolean_value = TRUE;
-+bool boolean_value = true;
- 
- iterator = wp_pipewire_object_enum_params_sync (
- WP_PIPEWIRE_OBJECT (fixture->proxy_endpoint), "Props", NULL);
-@@ -556,14 +556,14 @@ test_endpoint_with_props (TestEndpointFixture *fixture, 
gconstpointer data)
- "mute", "b", &boolean_value,
- NULL));
- g_assert_cmpfloat_with_epsilon (float_value, 0.7f, 0.001);
--g_assert_cmpint (boolean_value, ==, FALSE);
-+g_assert_cmpint (boolean_value, ==, false);
-   }
-   {
- g_autoptr (WpIterator) iterator = NULL;
- g_auto (GValue) item = G_VALUE_INIT;
- g_autoptr (WpSpaPod) pod = NULL;
- gfloat float_v

[gentoo-commits] repo/gentoo:master commit in: media-video/wireplumber/files/, media-video/wireplumber/

2022-01-06 Thread Sam James
commit: 26754e7d4280639fb756a8340e0de7d29b8de78a
Author: Niklāvs Koļesņikovs <89q1r14hd  relay  firefox  com>
AuthorDate: Tue Jan  4 06:38:20 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Jan  6 20:53:31 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26754e7d

media-video/wireplumber: add fix to stop stream move on HDMI suspend

The patch looks like it might fix other things too but the best known
issue it should be resolving is that without it having a display
suspend or enter power off state would make audio streams be moved
to the next highest priority device. Such behavior might be
PulseAudio default but for PipeWire it's considered undesirable and
a bug to fix.

Bug: https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/94

Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd  relay.firefox.com>
Signed-off-by: Sam James  gentoo.org>

 ...tes.lua-reevaluate-current-profile-only-f.patch | 81 ++
 ...0.4.5-r3.ebuild => wireplumber-0.4.5-r4.ebuild} |  1 +
 2 files changed, 82 insertions(+)

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.5-default-routes.lua-reevaluate-current-profile-only-f.patch
 
b/media-video/wireplumber/files/wireplumber-0.4.5-default-routes.lua-reevaluate-current-profile-only-f.patch
new file mode 100644
index ..423a1fcb6139
--- /dev/null
+++ 
b/media-video/wireplumber/files/wireplumber-0.4.5-default-routes.lua-reevaluate-current-profile-only-f.patch
@@ -0,0 +1,81 @@
+https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/22fd4292ab35786b09561508778ab49cc6488dc6
+
+From 22fd4292ab35786b09561508778ab49cc6488dc6 Mon Sep 17 00:00:00 2001
+From: Julian Bouzas 
+Date: Tue, 7 Dec 2021 14:10:32 -0500
+Subject: [PATCH] default-routes.lua: reevaluate current profile only for its
+ own routes
+
+Only check the current active profile when some routes changed that are part of
+the profile. If some other route changed, just ignore it.
+---
+ src/scripts/default-routes.lua | 39 +++---
+ 1 file changed, 22 insertions(+), 17 deletions(-)
+
+diff --git a/src/scripts/default-routes.lua b/src/scripts/default-routes.lua
+index 1840989f..953cba33 100644
+--- a/src/scripts/default-routes.lua
 b/src/scripts/default-routes.lua
+@@ -352,6 +352,12 @@ function handleDevice(device)
+   local dev_info = dev_infos[device["bound-id"]]
+   local new_route_infos = {}
+   local avail_routes_changed = false
++  local profile = nil
++
++  -- get current profile
++  for p in device:iterate_params("Profile") do
++profile = parseParam(p, "Profile")
++  end
+ 
+   -- look at all the routes and update/reset cached information
+   for p in device:iterate_params("EnumRoute") do
+@@ -370,7 +376,9 @@ function handleDevice(device)
+   Log.info(device, "route " .. route.name .. " available changed " ..
+route_info.available .. " -> " .. route.available)
+   route_info.available = route.available
+-  avail_routes_changed = true
++  if profile and arrayContains(route.profiles, profile.index) then
++avail_routes_changed = true
++  end
+ end
+ route_info.prev_active = route_info.active
+ route_info.active = false
+@@ -419,23 +427,20 @@ function handleDevice(device)
+ ::skip_route::
+   end
+ 
+-  -- now get the profile and restore routes for it
+-  for p in device:iterate_params("Profile") do
+-local profile = parseParam(p, "Profile")
+-if profile then
+-  local profile_changed = (dev_info.active_profile ~= profile.index)
+-
+-  -- if the profile changed, restore routes for that profile
+-  -- if any of the routes of the current profile changed in availability,
+-  -- then try to select a new "best" route for each device and ignore
+-  -- what was stored
+-  if profile_changed or avail_routes_changed then
+-dev_info.active_profile = profile.index
+-restoreProfileRoutes(device, dev_info, profile, profile_changed)
+-  end
+-
+-  saveProfile(dev_info, profile.name)
++  -- restore routes for profile
++  if profile then
++local profile_changed = (dev_info.active_profile ~= profile.index)
++
++-- if the profile changed, restore routes for that profile
++-- if any of the routes of the current profile changed in availability,
++-- then try to select a new "best" route for each device and ignore
++-- what was stored
++if profile_changed or avail_routes_changed then
++  dev_info.active_profile = profile.index
++  restoreProfileRoutes(device, dev_info, profile, profile_changed)
+ end
++
++saveProfile(dev_info, profile.name)
+   end
+ end
+ 
+-- 
+GitLab

diff --git a/media-video/wireplumber/wireplumber-0.4.5-r3.ebuild 
b/media-video/wireplumber/wireplumber-0.4.5-r4.ebuild
similarity index 97%
rename from media-video/wireplumber/wireplumber-0.4.5-r3.ebuild
rename to media-video/wireplumber/wireplumber-0.4.5-r4.ebuild
index e39673240df7..faf7c563e1

[gentoo-commits] repo/gentoo:master commit in: media-video/wireplumber/files/, media-video/wireplumber/

2021-12-01 Thread Sam James
commit: f14cc9569d7591317f868b9359232a8ddafb76e5
Author: Niklāvs Koļesņikovs <89q1r14hd  relay  firefox  com>
AuthorDate: Fri Nov 19 08:07:46 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Dec  1 19:49:41 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f14cc956

media-video/wireplumber: apply multiple important looking fixes

Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd  relay.firefox.com>
Closes: https://github.com/gentoo/gentoo/pull/23001
Signed-off-by: Sam James  gentoo.org>

 ...-alsa-handle-the-release-requested-signal.patch | 33 
 ...ead-hidden-files-from-the-config-director.patch | 27 ++
 ...evice-replace-the-hash-table-key-on-new-i.patch | 47 +++
 ...de-wait-for-nodes-when-we-become-unlinked.patch | 34 
 .../wireplumber/wireplumber-0.4.5-r1.ebuild| 96 ++
 5 files changed, 237 insertions(+)

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.5-alsa-handle-the-release-requested-signal.patch
 
b/media-video/wireplumber/files/wireplumber-0.4.5-alsa-handle-the-release-requested-signal.patch
new file mode 100644
index ..511dc6df377e
--- /dev/null
+++ 
b/media-video/wireplumber/files/wireplumber-0.4.5-alsa-handle-the-release-requested-signal.patch
@@ -0,0 +1,33 @@
+From efd24584182903bf5ee4660a3b3360cc47ad895b Mon Sep 17 00:00:00 2001
+From: Wim Taymans 
+Date: Tue, 23 Nov 2021 13:17:29 +0100
+Subject: [PATCH] alsa: handle the release-requested signal
+
+Handle the release-requested signal by destroying the device and
+then calling release.
+
+Fixes pipewire/pipewire#1846
+---
+ src/scripts/monitors/alsa.lua | 6 ++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/scripts/monitors/alsa.lua b/src/scripts/monitors/alsa.lua
+index 68c39d8..be4648e 100644
+--- a/src/scripts/monitors/alsa.lua
 b/src/scripts/monitors/alsa.lua
+@@ -287,6 +287,12 @@ function prepareDevice(parent, id, type, factory, 
properties)
+   end
+ end)
+ 
++rd:connect("release-requested", function (rd)
++Log.info("release requested")
++parent:store_managed_object(id, nil)
++rd:call("release")
++end)
++
+ if jack_device then
+   rd:connect("notify::owner-name-changed", function (rd, pspec)
+ if rd["state"] == "busy" and
+-- 
+2.34.1
+

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.5-lib-don-t-read-hidden-files-from-the-config-director.patch
 
b/media-video/wireplumber/files/wireplumber-0.4.5-lib-don-t-read-hidden-files-from-the-config-director.patch
new file mode 100644
index ..1554c65e27da
--- /dev/null
+++ 
b/media-video/wireplumber/files/wireplumber-0.4.5-lib-don-t-read-hidden-files-from-the-config-director.patch
@@ -0,0 +1,27 @@
+From ee5f3f2f195b01fd89ee148da5799b02f99ebb6e Mon Sep 17 00:00:00 2001
+From: Peter Hutterer 
+Date: Sun, 14 Nov 2021 19:44:30 +1000
+Subject: [PATCH 3/3] lib: don't read hidden files from the config directory
+
+Fixes #104
+---
+ lib/wp/wp.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/lib/wp/wp.c b/lib/wp/wp.c
+index ffdff1a..c356133 100644
+--- a/lib/wp/wp.c
 b/lib/wp/wp.c
+@@ -315,6 +315,9 @@ wp_new_files_iterator (WpLookupDirs dirs, const gchar 
*subdir,
+ if (dir) {
+   const gchar *filename;
+   while ((filename = g_dir_read_name (dir))) {
++if (filename[0] == '.')
++  continue;
++
+ if (suffix && !g_str_has_suffix (filename, suffix))
+   continue;
+ 
+-- 
+2.34.0
+

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.5-m-reserve-device-replace-the-hash-table-key-on-new-i.patch
 
b/media-video/wireplumber/files/wireplumber-0.4.5-m-reserve-device-replace-the-hash-table-key-on-new-i.patch
new file mode 100644
index ..70d69093d082
--- /dev/null
+++ 
b/media-video/wireplumber/files/wireplumber-0.4.5-m-reserve-device-replace-the-hash-table-key-on-new-i.patch
@@ -0,0 +1,47 @@
+From f4546a18e871537be698916178b40091a4a0b377 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer 
+Date: Fri, 12 Nov 2021 11:19:54 +1000
+Subject: [PATCH 3/3] m-reserve-device: replace the hash table key on new
+ insert
+
+We're using the WpReserveDevice's name as key in the hash table, so we
+must update the key as well when we replace an item in the hashtable -
+the old device (and its name) will be released.
+
+The side-effect of this is that the *third* device with an identical
+name will no longer replace the previous device. This results in the
+following sequence:
+
+- dev1 added: name Audio0
+  - dev1 requests name owner Audio0
+- dev2 added: name Audio0
+  - replace dev1 in the hashtable
+ - dev1 emits "release" signal
+ - dev1 unowns the Audio0 name
+  - dev2 requests name owner Audio0
+- dev3 added: name Audio0
+  - adds to the hashtable because the existing key is now undefined
+  - dev3 requests name owner Audio0
+ - error, you cannot request ownership for the same name twice
+
+Fixes #93
+---
+ modules/module-reserve

[gentoo-commits] repo/gentoo:master commit in: media-video/wireplumber/files/, media-video/wireplumber/

2021-09-15 Thread Sam James
commit: 639f62636b5ce8dd284fdeb3a5e95dd08bd59115
Author: Niklāvs Koļesņikovs <89q1r14hd  relay  firefox  com>
AuthorDate: Wed Sep 15 11:32:40 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Sep 15 17:06:10 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=639f6263

media-video/pipewire: enable support for test IUSE

Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd  relay.firefox.com>
Signed-off-by: Sam James  gentoo.org>

 ...ber-0.4.2-meson-Build-tests-conditionally.patch | 41 ++
 .../wireplumber/wireplumber-0.4.2-r1.ebuild|  9 -
 media-video/wireplumber/wireplumber-.ebuild|  5 ++-
 3 files changed, 53 insertions(+), 2 deletions(-)

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.2-meson-Build-tests-conditionally.patch
 
b/media-video/wireplumber/files/wireplumber-0.4.2-meson-Build-tests-conditionally.patch
new file mode 100644
index 000..dab53c71bf4
--- /dev/null
+++ 
b/media-video/wireplumber/files/wireplumber-0.4.2-meson-Build-tests-conditionally.patch
@@ -0,0 +1,41 @@
+From 3b24c419b497c283e64df23b3b5eecd4c3d51927 Mon Sep 17 00:00:00 2001
+From: Sam James 
+Date: Tue, 14 Sep 2021 05:07:41 +0100
+Subject: [PATCH 1/5] meson: Build tests conditionally
+
+It's useful downstream to be able to control building
+tests, as there's not much use building them if we're
+not going to run them.
+
+Signed-off-by: Sam James 
+---
+ meson.build   | 5 -
+ meson_options.txt | 2 ++
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 3712a82..5f87ade 100644
+--- a/meson.build
 b/meson.build
+@@ -109,4 +109,7 @@ subdir('lib')
+ subdir('docs')
+ subdir('modules')
+ subdir('src')
+-subdir('tests')
++
++if get_option('tests')
++  subdir('tests')
++endif
+diff --git a/meson_options.txt b/meson_options.txt
+index a7a0a89..4008864 100644
+--- a/meson_options.txt
 b/meson_options.txt
+@@ -24,3 +24,5 @@ option('systemd-user-unit-dir',
+description : 'Directory for user systemd units')
+ option('glib-supp', type : 'string', value : '',
+description: 'The glib.supp valgrind suppressions file to be used when 
running valgrind')
++option('tests', type : 'boolean', value : 'true',
++   description : 'Build the test suite')
+-- 
+2.33.0
+

diff --git a/media-video/wireplumber/wireplumber-0.4.2-r1.ebuild 
b/media-video/wireplumber/wireplumber-0.4.2-r1.ebuild
index 6e5080a5e1d..ed677c4b5aa 100644
--- a/media-video/wireplumber/wireplumber-0.4.2-r1.ebuild
+++ b/media-video/wireplumber/wireplumber-0.4.2-r1.ebuild
@@ -21,10 +21,12 @@ 
HOMEPAGE="https://gitlab.freedesktop.org/pipewire/wireplumber";
 
 LICENSE="MIT"
 SLOT="0/0.4"
-IUSE="systemd"
+IUSE="systemd test"
 
 REQUIRED_USE="${LUA_REQUIRED_USE}"
 
+RESTRICT="!test? ( test )"
+
 # introspection? ( dev-libs/gobject-introspection ) is valid but likely only 
used for doc building
 BDEPEND="
dev-libs/glib
@@ -48,6 +50,10 @@ RDEPEND="${DEPEND}"
 
 DOCS=( {NEWS,README}.rst )
 
+PATCHES=(
+"${FILESDIR}"/${PN}-0.4.2-meson-Build-tests-conditionally.patch
+)
+
 src_configure() {
local emesonargs=(
-Dintrospection=disabled # Only used for Sphinx doc generation
@@ -58,6 +64,7 @@ src_configure() {
$(meson_use systemd systemd-user-service)
-Dsystemd-system-unit-dir=$(systemd_get_systemunitdir)
-Dsystemd-user-unit-dir=$(systemd_get_userunitdir)
+   $(meson_use test tests)
)
 
meson_src_configure

diff --git a/media-video/wireplumber/wireplumber-.ebuild 
b/media-video/wireplumber/wireplumber-.ebuild
index 6e5080a5e1d..6477107a785 100644
--- a/media-video/wireplumber/wireplumber-.ebuild
+++ b/media-video/wireplumber/wireplumber-.ebuild
@@ -21,10 +21,12 @@ 
HOMEPAGE="https://gitlab.freedesktop.org/pipewire/wireplumber";
 
 LICENSE="MIT"
 SLOT="0/0.4"
-IUSE="systemd"
+IUSE="systemd test"
 
 REQUIRED_USE="${LUA_REQUIRED_USE}"
 
+RESTRICT="!test? ( test )"
+
 # introspection? ( dev-libs/gobject-introspection ) is valid but likely only 
used for doc building
 BDEPEND="
dev-libs/glib
@@ -58,6 +60,7 @@ src_configure() {
$(meson_use systemd systemd-user-service)
-Dsystemd-system-unit-dir=$(systemd_get_systemunitdir)
-Dsystemd-user-unit-dir=$(systemd_get_userunitdir)
+   $(meson_use test tests)
)
 
meson_src_configure