wireplumber: Add Equalizer filter chain node 66/29466/4
authorAshok Sidipotu <ashok.sidipotu@collabora.com>
Thu, 23 Nov 2023 00:38:06 +0000 (01:38 +0100)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Tue, 28 Nov 2023 11:34:36 +0000 (11:34 +0000)
- The filter has two bands one for bass and another one for treble.
- The filter node attaches itself to multimedia endpoint, this setting
  is configurable.
- Also add a patch to fix the dangling logs issue in the endpoints
  policy.

Bug-AGL: SPEC-4931
Change-Id: Ibb3f56ac40eedc8c30445186624e50cbb3049afa
Signed-off-by: Ashok Sidipotu <ashok.sidipotu@collabora.com>
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/29466
Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Tested-by: Jenkins Job builder account
meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/wireplumber.conf
meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-policy-endpoint-device.lua-fix-dangling-logs-issue.patch [new file with mode: 0644]
meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb

index 680a791..46ad113 100644 (file)
@@ -57,6 +57,47 @@ context.modules = [
 
   # Provides factories to make session manager objects.
   { name = libpipewire-module-session-manager }
+
+  { name = libpipewire-module-filter-chain
+    args = {
+          node.description = "Equalizer Sink"
+          media.name       = "Equalizer Sink"
+          filter.graph = {
+              nodes = [
+                  {
+                      type  = builtin
+                      name  = bass
+                      label = bq_lowshelf
+                      # the cut off freq of the bass filter can be adjusted here.
+                      control = { "Freq" = 250.0 "Q" = 1.0 "Gain" = 0.0 }
+                  }
+                  {
+                      type  = builtin
+                      name  = treble
+                      label = bq_peaking
+                      # the cut off freq of the treble filter can be adjusted here.
+                      control = { "Freq" = 6000.0 "Q" = 1.0 "Gain" = 0.0 }
+                  }
+              ]
+              links = [
+                  { output = "bass:Out" input = "treble:In" }
+              ]
+          }
+          audio.channels = 2
+          audio.position = [ FL FR ]
+          capture.props = {
+              node.name   = "eq-sink"
+              media.class = Audio/Sink
+              # select the endpoint to which the node is attached
+              target.endpoint = "endpoint.multimedia"
+              node.passive = true
+          }
+          playback.props = {
+              node.name   = "eq-output-stream"
+              node.passive = true
+          }
+      }
+  }
 ]
 
 wireplumber.components = [
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-policy-endpoint-device.lua-fix-dangling-logs-issue.patch b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-policy-endpoint-device.lua-fix-dangling-logs-issue.patch
new file mode 100644 (file)
index 0000000..ef71921
--- /dev/null
@@ -0,0 +1,47 @@
+From d1624b1648512ead7f6b222bc64cda94016fb0c6 Mon Sep 17 00:00:00 2001
+From: Ashok Sidipotu <ashok.sidipotu@collabora.com>
+Date: Fri, 24 Nov 2023 02:45:41 +0100
+Subject: [PATCH] policy-endpoint-device.lua: fix dangling logs issue.
+
+When logs are enabled sometimes the new log msgs added to print the link
+string can assert.
+
+Upstream-Status: WirePlumber MR570 submitted
+---
+ src/scripts/policy-endpoint-device.lua | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/scripts/policy-endpoint-device.lua b/src/scripts/policy-endpoint-device.lua
+index 4440c17c..4c74077b 100644
+--- a/src/scripts/policy-endpoint-device.lua
++++ b/src/scripts/policy-endpoint-device.lua
+@@ -116,7 +116,7 @@ function createLink (si_ep, si_target)
+   local in_item = nil
+   local ep_props = si_ep.properties
+   local target_props = si_target.properties
+-
++  local is_filter = (ep_props["node.link-group"] ~= nil)
+   if target_props["item.node.direction"] == "input" then
+     -- playback
+     out_item = si_ep
+@@ -131,10 +131,10 @@ function createLink (si_ep, si_target)
+     (is_filter and ep_props["node.name"] or ep_props["name"]),
+     target_props["node.name"])
+
+-  Log.info(si_link, link_string)
+-
+   -- create and configure link
+   local si_link = SessionItem ( "si-standard-link" )
++
++  Log.info(si_link, "creating link " .. link_string)
+   if not si_link:configure {
+     ["out.item"] = out_item,
+     ["in.item"] = in_item,
+@@ -146,6 +146,7 @@ function createLink (si_ep, si_target)
+     return
+   end
+
++
+   -- register
+   si_link:register ()
+
index 2c3ff9b..0d7e354 100644 (file)
@@ -13,6 +13,7 @@ DEPENDS = "glib-2.0 glib-2.0-native pipewire lua"
 
 SRC_URI = "\
     git://gitlab.freedesktop.org/pipewire/wireplumber.git;protocol=https;branch=master \
+    file://0001-policy-endpoint-device.lua-fix-dangling-logs-issue.patch \
 "
 # v0.4.16
 SRCREV = "0d249b8a13d7168fe54fa6eb1db1c4a5fcc8d3f8"