summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-Revert-treewide-meson.build-use-project_-build-sourc.patch101
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-treewide-meson.build-use-feature.allowed.patch277
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-Revert-treewide-meson.build-use-dependency-variable-.patch (renamed from meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-treewide-meson.build-use-dependency-variable-.patch)140
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-Revert-systemd-correctly-prefix-systemd-system-units.patch25
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-Revert-treewide-meson.build-simplify-get_variable-ca.patch130
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-Revert-treewide-meson.build-get-SPA_PLUGIN_DIR-from-.patch124
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-pipewiresink-set-a-default-channel-map-if-the-number.patch77
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire/0006-Revert-meson-declare-spa_dep-and-override_dependency.patch (renamed from meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-Revert-meson-declare-spa_dep-and-override_dependency.patch)17
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire/0007-Revert-meson-use-meson-variables-for-the-SMs-uninsta.patch47
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire/0008-Revert-meson-declare-spa_dep-and-override_dependency.patch31
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire/0009-Revert-test-add-test-for-the-loop.patch32
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire/0010-Revert-spa-improve-the-AEC-interface.patch502
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire/0011-Revert-module-echo-cancel-Move-backends-to-dynamic-l.patch1055
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire/0012-Miscellanous-changes-to-account-for-lower-version-of.patch166
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.47.bb (renamed from meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.43.bb)6
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.47.bbappend (renamed from meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.43.bbappend)15
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-Revert-tests-add-pipewire-env-variables-when-running.patch (renamed from meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0002-Revert-tests-add-pipewire-env-variables-when-running.patch)17
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0002-Revert-wp-uninstalled-build-this-script-with-the-mes.patch (renamed from meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-Revert-wp-uninstalled-build-this-script-with-the-mes.patch)13
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0003-spa-json-fix-va_list-APIs-for-different-architecture.patch214
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb11
20 files changed, 2719 insertions, 281 deletions
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-Revert-treewide-meson.build-use-project_-build-sourc.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-Revert-treewide-meson.build-use-project_-build-sourc.patch
index 42f01086a..89507df60 100644
--- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-Revert-treewide-meson.build-use-project_-build-sourc.patch
+++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-Revert-treewide-meson.build-use-project_-build-sourc.patch
@@ -1,24 +1,21 @@
-From e850a4c080c80fc218224521727996062ebb9487 Mon Sep 17 00:00:00 2001
+From 7bf582601f73c5f796b23a7cc2868424b03a0fd1 Mon Sep 17 00:00:00 2001
From: Ashok Sidipotu <ashok.sidipotu@collabora.com>
Date: Fri, 14 Jan 2022 16:12:55 +0530
-Subject: [PATCH 1/4] Revert "treewide: meson.build: use
+Subject: [PATCH 01/12] Revert "treewide: meson.build: use
project_{build,source}_root()"
This reverts commit 8ed46a283fa1f8623b940eaeb9f7cbcc52eebf0e.
Upstream-Status: Inappropriate[meson version dependent]
---
- doc/meson.build | 34 ++++++++++++++--------------
- meson.build | 8 +++----
- spa/plugins/audioconvert/meson.build | 4 ++--
- spa/tests/meson.build | 4 ++--
- src/daemon/meson.build | 6 ++---
- src/modules/meson.build | 6 ++---
- src/tests/meson.build | 6 ++---
- test/meson.build | 4 ++--
- 8 files changed, 36 insertions(+), 36 deletions(-)
+ doc/meson.build | 34 +++++++++++++++++-----------------
+ meson.build | 8 ++++----
+ spa/tests/meson.build | 4 ++--
+ src/daemon/meson.build | 6 +++---
+ test/meson.build | 4 ++--
+ 5 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/doc/meson.build b/doc/meson.build
-index 0e6d7f8e3..082780145 100644
+index 7e876bce5..95fecffc2 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -1,8 +1,8 @@
@@ -32,7 +29,7 @@ index 0e6d7f8e3..082780145 100644
dot_found = find_program('dot', required: false).found()
summary({'dot (used with doxygen)': dot_found}, bool_yn: true, section: 'Optional programs')
-@@ -49,35 +49,35 @@ extra_docs = [
+@@ -48,35 +48,35 @@ extra_docs = [
inputs = []
foreach extra : extra_docs
@@ -81,7 +78,7 @@ index 0e6d7f8e3..082780145 100644
]
# Example files (in order from simple to esoteric)
-@@ -118,8 +118,8 @@ input_dirs += [ 'doc/examples.dox' ]
+@@ -141,8 +141,8 @@ input_dirs += [ 'doc/pipewire-tools.dox' ]
doxyfile_conf.set('inputs', ' '.join(inputs + input_dirs))
doxyfile_conf.set('cssfiles', ' '.join(cssfiles))
doxyfile_conf.set('path_prefixes', ' '.join(path_prefixes))
@@ -93,10 +90,10 @@ index 0e6d7f8e3..082780145 100644
doxyfile = configure_file(input: 'Doxyfile.in',
output: 'Doxyfile',
diff --git a/meson.build b/meson.build
-index b1ea32f7a..67e697c15 100644
+index 440845e37..338192073 100644
--- a/meson.build
+++ b/meson.build
-@@ -304,9 +304,9 @@ includes_inc = include_directories('include')
+@@ -247,9 +247,9 @@ includes_inc = include_directories('include')
pipewire_inc = include_directories('src')
makedata = configuration_data()
@@ -109,7 +106,7 @@ index b1ea32f7a..67e697c15 100644
if version_arr.length() == 4
makedata.set('TAG', 'HEAD')
else
-@@ -498,7 +498,7 @@ endif
+@@ -436,7 +436,7 @@ endif
setenv = find_program('pw-uninstalled.sh')
run_target('pw-uninstalled',
command : [setenv,
@@ -118,30 +115,8 @@ index b1ea32f7a..67e697c15 100644
'-v@0@'.format(pipewire_version)]
)
-diff --git a/spa/plugins/audioconvert/meson.build b/spa/plugins/audioconvert/meson.build
-index de9f491af..4d15271f5 100644
---- a/spa/plugins/audioconvert/meson.build
-+++ b/spa/plugins/audioconvert/meson.build
-@@ -140,7 +140,7 @@ foreach a : test_apps
- install : installed_tests_enabled,
- install_dir : installed_tests_execdir / 'audioconvert'),
- env : [
-- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')),
-+ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()),
- ])
-
- if installed_tests_enabled
-@@ -170,7 +170,7 @@ foreach a : benchmark_apps
- install : installed_tests_enabled,
- install_dir : installed_tests_execdir / 'audioconvert'),
- env : [
-- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')),
-+ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()),
- ])
-
- if installed_tests_enabled
diff --git a/spa/tests/meson.build b/spa/tests/meson.build
-index 990df87bd..9e2a211e2 100644
+index c73c887f4..9c78dcbd2 100644
--- a/spa/tests/meson.build
+++ b/spa/tests/meson.build
@@ -5,7 +5,7 @@ find = find_program('find', required: false)
@@ -153,17 +128,17 @@ index 990df87bd..9e2a211e2 100644
'-name', '*.h',
'-not', '-name', 'type-info.h',
'-type', 'f',
-@@ -40,7 +40,7 @@ foreach a : benchmark_apps
+@@ -41,7 +41,7 @@ foreach a : benchmark_apps
install_dir : installed_tests_execdir,
),
env : [
-- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')),
+- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable('plugindir')),
+ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()),
]
)
diff --git a/src/daemon/meson.build b/src/daemon/meson.build
-index 44a574337..5e64287a1 100644
+index a2e4c55e3..647d7393d 100644
--- a/src/daemon/meson.build
+++ b/src/daemon/meson.build
@@ -18,9 +18,9 @@ conf_config.set('pulse_comment', '#')
@@ -178,7 +153,7 @@ index 44a574337..5e64287a1 100644
conf_config_uninstalled.set('pulse_comment', '')
build_ms = 'media-session' in get_option('session-managers')
-@@ -105,7 +105,7 @@ custom_target('pipewire-uninstalled',
+@@ -106,7 +106,7 @@ custom_target('pipewire-uninstalled',
install: false,
input: pipewire_exec,
output: 'pipewire-uninstalled',
@@ -187,42 +162,8 @@ index 44a574337..5e64287a1 100644
)
#desktop_file = i18n.merge_file(
-diff --git a/src/modules/meson.build b/src/modules/meson.build
-index 93dc70173..45852f3b9 100644
---- a/src/modules/meson.build
-+++ b/src/modules/meson.build
-@@ -370,9 +370,9 @@ test('pw-test-protocol-native',
- install_dir : installed_tests_execdir,
- ),
- env : [
-- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')),
-- 'PIPEWIRE_CONFIG_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'confdatadir')),
-- 'PIPEWIRE_MODULE_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'moduledir')),
-+ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()),
-+ 'PIPEWIRE_CONFIG_DIR=@0@/src/daemon/'.format(meson.build_root()),
-+ 'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.build_root())
- ]
- )
-
-diff --git a/src/tests/meson.build b/src/tests/meson.build
-index 3e8d05012..1b03967fb 100644
---- a/src/tests/meson.build
-+++ b/src/tests/meson.build
-@@ -13,9 +13,9 @@ foreach a : test_apps
- install : installed_tests_enabled,
- install_dir : installed_tests_execdir),
- env : [
-- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')),
-- 'PIPEWIRE_CONFIG_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'confdatadir')),
-- 'PIPEWIRE_MODULE_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'moduledir')),
-+ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()),
-+ 'PIPEWIRE_CONFIG_DIR=@0@/src/daemon/'.format(meson.build_root()),
-+ 'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.build_root())
- ])
-
- if installed_tests_enabled
diff --git a/test/meson.build b/test/meson.build
-index 20bdcb210..89f2bc2ec 100644
+index 74908d587..eca92eb24 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -14,8 +14,8 @@ pwtest_deps = [
@@ -237,5 +178,5 @@ index 20bdcb210..89f2bc2ec 100644
pwtest_inc = [
--
-2.34.1
+2.35.1
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-treewide-meson.build-use-feature.allowed.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-treewide-meson.build-use-feature.allowed.patch
new file mode 100644
index 000000000..eaef35c2e
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-treewide-meson.build-use-feature.allowed.patch
@@ -0,0 +1,277 @@
+From 6dec8c7faf57a1bd0162a4e790ed031945588d98 Mon Sep 17 00:00:00 2001
+From: Ashok Sidipotu <ashok.sidipotu@collabora.com>
+Date: Thu, 24 Feb 2022 11:22:34 +0530
+Subject: [PATCH 02/12] Revert "treewide: meson.build: use feature.allowed()"
+
+This reverts commit cc7305351202424a2800425d86ae9c9b72aefa15.
+Upstream-Status: Inappropriate[meson version dependent]
+---
+ man/meson.build | 2 +-
+ meson.build | 14 +++++++-------
+ spa/meson.build | 4 ++--
+ spa/plugins/bluez5/meson.build | 18 +++++++++---------
+ spa/plugins/meson.build | 18 +++++++++---------
+ spa/plugins/support/meson.build | 2 +-
+ src/daemon/systemd/meson.build | 4 ++--
+ src/gst/meson.build | 2 +-
+ src/meson.build | 4 ++--
+ src/tools/meson.build | 2 +-
+ 10 files changed, 35 insertions(+), 35 deletions(-)
+
+diff --git a/man/meson.build b/man/meson.build
+index 54d1c5eca..8e6e7dbe4 100644
+--- a/man/meson.build
++++ b/man/meson.build
+@@ -19,7 +19,7 @@ manpages = [
+ 'pw-profiler.1.rst.in',
+ ]
+
+-if get_option('pipewire-jack').allowed()
++if not get_option('pipewire-jack').disabled()
+ manpages += 'pw-jack.1.rst.in'
+ endif
+
+diff --git a/meson.build b/meson.build
+index 338192073..9d806198a 100644
+--- a/meson.build
++++ b/meson.build
+@@ -336,7 +336,7 @@ endforeach
+ gst_dp_found = gst_dep.length() > 0
+ summary({'gstreamer-device-provider': gst_dp_found}, bool_yn: true, section: 'Backend')
+
+-cdata.set('HAVE_GSTREAMER_DEVICE_PROVIDER', get_option('gstreamer-device-provider').allowed())
++cdata.set('HAVE_GSTREAMER_DEVICE_PROVIDER', not get_option('gstreamer-device-provider').disabled())
+
+ webrtc_dep = dependency('webrtc-audio-processing',
+ version : ['>= 0.2', '< 1.0'],
+@@ -382,10 +382,10 @@ cdata.set('HAVE_LILV', lilv_lib.found())
+
+ installed_tests_metadir = pipewire_datadir / 'installed-tests' / pipewire_name
+ installed_tests_execdir = pipewire_libexecdir / 'installed-tests' / pipewire_name
+-installed_tests_enabled = get_option('installed_tests').allowed()
++installed_tests_enabled = not get_option('installed_tests').disabled()
+ installed_tests_template = files('template.test.in')
+
+-if get_option('tests').allowed()
++if not get_option('tests').disabled()
+ gstack = find_program('gstack', required : false)
+ cdata.set('HAVE_GSTACK', gstack.found())
+ endif
+@@ -394,17 +394,17 @@ subdir('po')
+ subdir('spa')
+ subdir('src')
+
+-if get_option('tests').allowed()
++if not get_option('tests').disabled()
+ subdir('test')
+ endif
+
+ configure_file(output : 'config.h',
+ configuration : cdata)
+
+-if get_option('pipewire-jack').allowed()
++if not get_option('pipewire-jack').disabled()
+ subdir('pipewire-jack')
+ endif
+-if get_option('pipewire-v4l2').allowed()
++if not get_option('pipewire-v4l2').disabled()
+ subdir('pipewire-v4l2')
+ endif
+
+@@ -415,7 +415,7 @@ if alsa_dep.found()
+ endif
+
+ generate_manpages = false
+-if get_option('man').allowed()
++if not get_option('man').disabled()
+ rst2man = find_program('rst2man', required: false)
+ if not rst2man.found()
+ rst2man = find_program('rst2man.py', required: get_option('man'))
+diff --git a/spa/meson.build b/spa/meson.build
+index 1931d35b1..2404748df 100644
+--- a/spa/meson.build
++++ b/spa/meson.build
+@@ -31,7 +31,7 @@ pkgconfig.generate(filebase : 'lib@0@'.format(spa_name),
+
+ subdir('include')
+
+-if get_option('spa-plugins').allowed()
++if not get_option('spa-plugins').disabled()
+ udevrulesdir = get_option('udevrulesdir')
+ if udevrulesdir == ''
+ # absolute path, otherwise meson prepends the prefix
+@@ -74,6 +74,6 @@ endif
+
+ subdir('tools')
+ subdir('tests')
+-if get_option('examples').allowed()
++if not get_option('examples').disabled()
+ subdir('examples')
+ endif
+diff --git a/spa/plugins/bluez5/meson.build b/spa/plugins/bluez5/meson.build
+index 4567b67dd..7a1e12ec7 100644
+--- a/spa/plugins/bluez5/meson.build
++++ b/spa/plugins/bluez5/meson.build
+@@ -6,12 +6,12 @@ foreach dep: bluez5_deps
+ endforeach
+
+ cdata.set('HAVE_BLUEZ_5_BACKEND_NATIVE',
+- get_option('bluez5-backend-hsp-native').allowed() or
+- get_option('bluez5-backend-hfp-native').allowed())
+-cdata.set('HAVE_BLUEZ_5_BACKEND_HSP_NATIVE', get_option('bluez5-backend-hsp-native').allowed())
+-cdata.set('HAVE_BLUEZ_5_BACKEND_HFP_NATIVE', get_option('bluez5-backend-hfp-native').allowed())
+-cdata.set('HAVE_BLUEZ_5_BACKEND_OFONO', get_option('bluez5-backend-ofono').allowed())
+-cdata.set('HAVE_BLUEZ_5_BACKEND_HSPHFPD', get_option('bluez5-backend-hsphfpd').allowed())
++ not get_option('bluez5-backend-hsp-native').disabled() or
++ not get_option('bluez5-backend-hfp-native').disabled())
++cdata.set('HAVE_BLUEZ_5_BACKEND_HSP_NATIVE', not get_option('bluez5-backend-hsp-native').disabled())
++cdata.set('HAVE_BLUEZ_5_BACKEND_HFP_NATIVE', not get_option('bluez5-backend-hfp-native').disabled())
++cdata.set('HAVE_BLUEZ_5_BACKEND_OFONO', not get_option('bluez5-backend-ofono').disabled())
++cdata.set('HAVE_BLUEZ_5_BACKEND_HSPHFPD', not get_option('bluez5-backend-hsphfpd').disabled())
+ cdata.set('HAVE_BLUEZ_5_HCI', dependency('bluez', version: '< 6', required: false).found())
+
+ bluez5_sources = [
+@@ -34,18 +34,18 @@ bluez5_data = ['bluez-hardware.conf']
+
+ install_data(bluez5_data, install_dir : spa_datadir / 'bluez5')
+
+-if get_option('bluez5-backend-hsp-native').allowed() or get_option('bluez5-backend-hfp-native').allowed()
++if not get_option('bluez5-backend-hsp-native').disabled() or not get_option('bluez5-backend-hfp-native').disabled()
+ if libusb_dep.found()
+ bluez5_deps += libusb_dep
+ endif
+ bluez5_sources += ['backend-native.c']
+ endif
+
+-if get_option('bluez5-backend-ofono').allowed()
++if not get_option('bluez5-backend-ofono').disabled()
+ bluez5_sources += ['backend-ofono.c']
+ endif
+
+-if get_option('bluez5-backend-hsphfpd').allowed()
++if not get_option('bluez5-backend-hsphfpd').disabled()
+ bluez5_sources += ['backend-hsphfpd.c']
+ endif
+
+diff --git a/spa/plugins/meson.build b/spa/plugins/meson.build
+index fcf007aa9..0b581b29b 100644
+--- a/spa/plugins/meson.build
++++ b/spa/plugins/meson.build
+@@ -1,16 +1,16 @@
+ if alsa_dep.found()
+ subdir('alsa')
+ endif
+-if get_option('audioconvert').allowed()
++if not get_option('audioconvert').disabled()
+ subdir('audioconvert')
+ endif
+-if get_option('audiomixer').allowed()
++if not get_option('audiomixer').disabled()
+ subdir('audiomixer')
+ endif
+-if get_option('control').allowed()
++if not get_option('control').disabled()
+ subdir('control')
+ endif
+-if get_option('audiotestsrc').allowed()
++if not get_option('audiotestsrc').disabled()
+ subdir('audiotestsrc')
+ endif
+ if bluez_dep.found()
+@@ -22,19 +22,19 @@ endif
+ if jack_dep.found()
+ subdir('jack')
+ endif
+-if get_option('support').allowed()
++if not get_option('support').disabled()
+ subdir('support')
+ endif
+-if get_option('test').allowed()
++if not get_option('test').disabled()
+ subdir('test')
+ endif
+-if get_option('videoconvert').allowed()
++if not get_option('videoconvert').disabled()
+ subdir('videoconvert')
+ endif
+-if get_option('videotestsrc').allowed()
++if not get_option('videotestsrc').disabled()
+ subdir('videotestsrc')
+ endif
+-if get_option('volume').allowed()
++if not get_option('volume').disabled()
+ subdir('volume')
+ endif
+ if vulkan_headers
+diff --git a/spa/plugins/support/meson.build b/spa/plugins/support/meson.build
+index 1672d38df..b810b283c 100644
+--- a/spa/plugins/support/meson.build
++++ b/spa/plugins/support/meson.build
+@@ -23,7 +23,7 @@ spa_support_lib = shared_library('spa-support',
+ install_dir : spa_plugindir / 'support')
+ spa_support_dep = declare_dependency(link_with: spa_support_lib)
+
+-if get_option('evl').allowed()
++if not get_option('evl').disabled()
+ evl_inc = include_directories('/usr/evl/include')
+ evl_lib = cc.find_library('evl',
+ dirs: ['/usr/evl/lib/'],
+diff --git a/src/daemon/systemd/meson.build b/src/daemon/systemd/meson.build
+index 482a44c4b..89ad2f6dc 100644
+--- a/src/daemon/systemd/meson.build
++++ b/src/daemon/systemd/meson.build
+@@ -1,6 +1,6 @@
+-if get_option('systemd-system-service').allowed()
++if not get_option('systemd-system-service').disabled()
+ subdir('system')
+ endif
+-if get_option('systemd-user-service').allowed()
++if not get_option('systemd-user-service').disabled()
+ subdir('user')
+ endif
+diff --git a/src/gst/meson.build b/src/gst/meson.build
+index fd552f6cb..709dc0f1c 100644
+--- a/src/gst/meson.build
++++ b/src/gst/meson.build
+@@ -8,7 +8,7 @@ pipewire_gst_sources = [
+ 'gstpipewiresrc.c',
+ ]
+
+-if get_option('gstreamer-device-provider').allowed()
++if not get_option('gstreamer-device-provider').disabled()
+ pipewire_gst_sources += [ 'gstpipewiredeviceprovider.c' ]
+ endif
+
+diff --git a/src/meson.build b/src/meson.build
+index cefc329eb..2fb73fd59 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -3,10 +3,10 @@ subdir('pipewire')
+ subdir('daemon')
+ subdir('tools')
+ subdir('modules')
+-if get_option('examples').allowed()
++if not get_option('examples').disabled()
+ subdir('examples')
+ endif
+-if get_option('tests').allowed()
++if not get_option('tests').disabled()
+ subdir('tests')
+ endif
+
+diff --git a/src/tools/meson.build b/src/tools/meson.build
+index 02514c253..038231fcd 100644
+--- a/src/tools/meson.build
++++ b/src/tools/meson.build
+@@ -34,7 +34,7 @@ if ncurses_dep.found()
+ endif
+
+ build_pw_cat = false
+-if get_option('pw-cat').allowed() and sndfile_dep.found()
++if not get_option('pw-cat').disabled() and sndfile_dep.found()
+ build_pw_cat = true
+
+ pwcat_sources = [
+--
+2.35.1
+
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-treewide-meson.build-use-dependency-variable-.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-Revert-treewide-meson.build-use-dependency-variable-.patch
index 4131e6c27..40735422f 100644
--- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-treewide-meson.build-use-dependency-variable-.patch
+++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-Revert-treewide-meson.build-use-dependency-variable-.patch
@@ -1,7 +1,7 @@
-From cbe87dc5390c91523a9f0bc3eb126fa500c351e2 Mon Sep 17 00:00:00 2001
+From 8eda9c8d98d14dfc411e22c30e81fa32a5cb2f56 Mon Sep 17 00:00:00 2001
From: Ashok Sidipotu <ashok.sidipotu@collabora.com>
Date: Fri, 14 Jan 2022 18:23:54 +0530
-Subject: [PATCH 2/4] Revert "treewide: meson.build: use dependency variable
+Subject: [PATCH 03/12] Revert "treewide: meson.build: use dependency variable
for SPA"
This reverts commit 2b110af36683f13f2b55064dec4ae02c1b407561.
@@ -9,13 +9,13 @@ This reverts commit 2b110af36683f13f2b55064dec4ae02c1b407561.
Upstream-Status: Inappropriate[meson version dependent]
---
spa/examples/meson.build | 4 +-
- spa/meson.build | 41 +++++++-------
+ spa/meson.build | 42 ++++++-------
spa/plugins/alsa/acp/meson.build | 4 +-
- spa/plugins/alsa/meson.build | 7 +--
- spa/plugins/audioconvert/meson.build | 33 ++++++------
+ spa/plugins/alsa/meson.build | 7 ++-
+ spa/plugins/audioconvert/meson.build | 34 ++++++-----
spa/plugins/audiomixer/meson.build | 11 ++--
spa/plugins/audiotestsrc/meson.build | 3 +-
- spa/plugins/bluez5/meson.build | 24 ++++-----
+ spa/plugins/bluez5/meson.build | 24 ++++----
spa/plugins/control/meson.build | 3 +-
spa/plugins/ffmpeg/meson.build | 3 +-
spa/plugins/jack/meson.build | 3 +-
@@ -28,14 +28,14 @@ Upstream-Status: Inappropriate[meson version dependent]
spa/plugins/volume/meson.build | 2 +-
spa/plugins/vulkan/meson.build | 3 +-
spa/tests/meson.build | 5 +-
- spa/tools/meson.build | 9 ++--
+ spa/tools/meson.build | 9 ++-
src/daemon/meson.build | 8 +--
src/gst/meson.build | 4 +-
- src/modules/meson.build | 80 ++++++++++++++--------------
- src/modules/spa/meson.build | 16 +++---
+ src/modules/meson.build | 88 ++++++++++++++++------------
+ src/modules/spa/meson.build | 16 ++---
src/pipewire/meson.build | 4 +-
- test/meson.build | 11 ++--
- 27 files changed, 160 insertions(+), 147 deletions(-)
+ test/meson.build | 11 +---
+ 27 files changed, 170 insertions(+), 147 deletions(-)
diff --git a/spa/examples/meson.build b/spa/examples/meson.build
index 7064a0643..bc04b723c 100644
@@ -53,10 +53,10 @@ index 7064a0643..bc04b723c 100644
install_dir : installed_tests_execdir / 'examples' / 'spa'
)
diff --git a/spa/meson.build b/spa/meson.build
-index 4ad37cdb4..2717b86d6 100644
+index 2404748df..2717b86d6 100644
--- a/spa/meson.build
+++ b/spa/meson.build
-@@ -5,28 +5,7 @@
+@@ -5,29 +5,7 @@
#pthread_lib = dependencies('threads')
#mathlib = cc.find_library('m', required : false)
@@ -64,6 +64,7 @@ index 4ad37cdb4..2717b86d6 100644
- include_directories : [
- include_directories('include'),
- ],
+- dependencies : [atomic_dep],
- version : spaversion,
- variables : {
- 'plugindir' : meson.current_build_dir() / 'plugins',
@@ -86,7 +87,7 @@ index 4ad37cdb4..2717b86d6 100644
subdir('include')
-@@ -76,3 +55,21 @@ subdir('tests')
+@@ -77,3 +55,21 @@ subdir('tests')
if not get_option('examples').disabled()
subdir('examples')
endif
@@ -148,7 +149,7 @@ index e3fa6f0d7..402d93486 100644
)
diff --git a/spa/plugins/audioconvert/meson.build b/spa/plugins/audioconvert/meson.build
-index 4d15271f5..6f4fd968b 100644
+index 89af12671..55e88ccc4 100644
--- a/spa/plugins/audioconvert/meson.build
+++ b/spa/plugins/audioconvert/meson.build
@@ -17,7 +17,7 @@ if have_sse
@@ -265,10 +266,11 @@ index 4d15271f5..6f4fd968b 100644
c_args : [ simd_cargs ],
install_rpath : spa_plugindir / 'audioconvert',
install : installed_tests_enabled,
-@@ -192,8 +192,9 @@ if sndfile_dep.found()
+@@ -191,8 +191,10 @@ if sndfile_dep.found()
+ ]
executable('spa-resample',
sparesample_sources,
- c_args : [ simd_cargs ],
++ c_args : [ simd_cargs ],
+ include_directories : [spa_inc ],
link_with : [ test_lib ],
- dependencies : [ spa_dep, sndfile_dep, mathlib, audioconvert_dep ],
@@ -340,10 +342,10 @@ index d1b22428d..8011ee883 100644
install : true,
install_dir : spa_plugindir / 'audiotestsrc')
diff --git a/spa/plugins/bluez5/meson.build b/spa/plugins/bluez5/meson.build
-index b13e23cf4..eca9c9eb5 100644
+index 7a1e12ec7..ae6d8e8e0 100644
--- a/spa/plugins/bluez5/meson.build
+++ b/spa/plugins/bluez5/meson.build
-@@ -56,8 +56,8 @@ endif
+@@ -51,8 +51,8 @@ endif
bluez5lib = shared_library('spa-bluez5',
bluez5_sources,
@@ -354,7 +356,7 @@ index b13e23cf4..eca9c9eb5 100644
install : true,
install_dir : spa_plugindir / 'bluez5')
-@@ -65,26 +65,26 @@ codec_args = [ '-DCODEC_PLUGIN' ]
+@@ -60,26 +60,26 @@ codec_args = [ '-DCODEC_PLUGIN' ]
bluez_codec_sbc = shared_library('spa-codec-bluez5-sbc',
[ 'a2dp-codec-sbc.c', 'a2dp-codecs.c' ],
@@ -387,7 +389,7 @@ index b13e23cf4..eca9c9eb5 100644
install : true,
install_dir : spa_plugindir / 'bluez5')
endif
-@@ -92,9 +92,9 @@ endif
+@@ -87,9 +87,9 @@ endif
if aptx_dep.found()
bluez_codec_aptx = shared_library('spa-codec-bluez5-aptx',
[ 'a2dp-codec-aptx.c', 'a2dp-codecs.c' ],
@@ -399,7 +401,7 @@ index b13e23cf4..eca9c9eb5 100644
install : true,
install_dir : spa_plugindir / 'bluez5')
endif
-@@ -108,9 +108,9 @@ if ldac_dep.found()
+@@ -103,9 +103,9 @@ if ldac_dep.found()
endif
bluez_codec_ldac = shared_library('spa-codec-bluez5-ldac',
[ 'a2dp-codec-ldac.c', 'a2dp-codecs.c' ],
@@ -594,11 +596,11 @@ index b79bca2cf..9683b41ea 100644
install : true,
install_dir : spa_plugindir / 'vulkan')
diff --git a/spa/tests/meson.build b/spa/tests/meson.build
-index 9e2a211e2..146cfe08a 100644
+index 9c78dcbd2..ea00a2cfe 100644
--- a/spa/tests/meson.build
+++ b/spa/tests/meson.build
-@@ -20,7 +20,7 @@ if find.found()
- configuration: c)
+@@ -21,7 +21,7 @@ if find.found()
+ })
executable('spa-include-test-@0@'.format(spa_header.underscorify()),
src,
- dependencies: [ spa_dep ],
@@ -606,7 +608,7 @@ index 9e2a211e2..146cfe08a 100644
install: false)
endif
endforeach
-@@ -35,7 +35,8 @@ benchmark_apps = [
+@@ -36,7 +36,8 @@ benchmark_apps = [
foreach a : benchmark_apps
benchmark('spa-' + a,
executable('spa-' + a, a + '.c',
@@ -639,10 +641,10 @@ index 6f12e9c8f..e4df6c3ac 100644
+ dependencies : [dl_lib, ],
install : true)
diff --git a/src/daemon/meson.build b/src/daemon/meson.build
-index 5e64287a1..104a6dbf3 100644
+index 647d7393d..28cbe4467 100644
--- a/src/daemon/meson.build
+++ b/src/daemon/meson.build
-@@ -86,16 +86,16 @@ pipewire_exec = executable('pipewire',
+@@ -87,16 +87,16 @@ pipewire_exec = executable('pipewire',
pipewire_daemon_sources,
install: true,
c_args : pipewire_c_args,
@@ -679,10 +681,10 @@ index 709dc0f1c..b91b33dc9 100644
install_dir : '@0@/gstreamer-1.0'.format(get_option('libdir')),
)
diff --git a/src/modules/meson.build b/src/modules/meson.build
-index 45852f3b9..61a53bd6f 100644
+index 2d3a800d3..ba30275ab 100644
--- a/src/modules/meson.build
+++ b/src/modules/meson.build
-@@ -30,20 +30,20 @@ module_sources = [
+@@ -31,20 +31,20 @@ module_sources = [
]
pipewire_module_access = shared_library('pipewire-module-access', [ 'module-access.c' ],
@@ -707,7 +709,7 @@ index 45852f3b9..61a53bd6f 100644
)
simd_cargs = []
-@@ -53,7 +53,7 @@ if have_sse
+@@ -54,7 +54,7 @@ if have_sse
pffft_sse = static_library('pffft_sse',
['module-filter-chain/pffft.c' ],
c_args : [sse_args, '-O3', '-DHAVE_SSE'],
@@ -716,7 +718,7 @@ index 45852f3b9..61a53bd6f 100644
install : false
)
simd_cargs += ['-DHAVE_SSE']
-@@ -63,7 +63,7 @@ if have_neon
+@@ -64,7 +64,7 @@ if have_neon
pffft_neon = static_library('pffft_neon',
['module-filter-chain/pffft.c' ],
c_args : [neon_args, '-O3', '-DHAVE_NEON'],
@@ -725,7 +727,7 @@ index 45852f3b9..61a53bd6f 100644
install : false
)
simd_cargs += ['-DHAVE_NEON']
-@@ -73,7 +73,7 @@ endif
+@@ -74,7 +74,7 @@ endif
pffft_c = static_library('pffft_c',
['module-filter-chain/pffft.c' ],
c_args : [simd_cargs, '-O3', '-DPFFFT_SIMD_DISABLE'],
@@ -734,7 +736,7 @@ index 45852f3b9..61a53bd6f 100644
install : false
)
simd_dependencies += pffft_c
-@@ -99,7 +99,7 @@ endif
+@@ -100,7 +100,7 @@ endif
pipewire_module_filter_chain = shared_library('pipewire-module-filter-chain',
filter_chain_sources,
@@ -743,7 +745,7 @@ index 45852f3b9..61a53bd6f 100644
install : true,
install_dir : modules_install_dir,
install_rpath: modules_install_dir,
-@@ -120,7 +120,7 @@ endif
+@@ -114,7 +114,7 @@ pipewire_module_echo_cancel_sources = [
pipewire_module_echo_cancel = shared_library('pipewire-module-echo-cancel',
pipewire_module_echo_cancel_sources,
@@ -752,7 +754,7 @@ index 45852f3b9..61a53bd6f 100644
install : true,
install_dir : modules_install_dir,
install_rpath: modules_install_dir,
-@@ -130,17 +130,17 @@ pipewire_module_echo_cancel = shared_library('pipewire-module-echo-cancel',
+@@ -124,26 +124,36 @@ pipewire_module_echo_cancel = shared_library('pipewire-module-echo-cancel',
pipewire_module_profiler = shared_library('pipewire-module-profiler',
[ 'module-profiler.c',
'module-profiler/protocol-native.c', ],
@@ -765,7 +767,7 @@ index 45852f3b9..61a53bd6f 100644
+ dependencies : [mathlib, dl_lib, pipewire_dep],
)
- build_module_rt = build_machine.system() == 'linux'
+ build_module_rt = dbus_dep.found()
if build_module_rt
pipewire_module_rt = shared_library('pipewire-module-rt', [ 'module-rt.c' ],
- include_directories : [configinc],
@@ -773,16 +775,26 @@ index 45852f3b9..61a53bd6f 100644
install : true,
install_dir : modules_install_dir,
install_rpath: modules_install_dir,
-@@ -152,7 +152,7 @@ summary({'rt': build_module_rt}, bool_yn: true, section: 'Optional Modules')
- build_module_rtkit = dbus_dep.found()
- if build_module_rtkit
- pipewire_module_rtkit = shared_library('pipewire-module-rtkit', [ 'module-rtkit.c' ],
-- include_directories : [configinc],
+ dependencies : [dbus_dep, mathlib, dl_lib, pipewire_dep],
+ )
++<<<<<<< HEAD
+ # TODO: This serves as a temporary alias to prevent breaking existing setups
+ # while `module-rtkit` is being migrated to `module-rt`
+ pipewire_module_rtkit = shared_library('pipewire-module-rtkit', [ 'module-rt.c' ],
+ include_directories : [configinc],
++=======
++endif
++summary({'rt': build_module_rt}, bool_yn: true, section: 'Optional Modules')
++
++build_module_rtkit = dbus_dep.found()
++if build_module_rtkit
++pipewire_module_rtkit = shared_library('pipewire-module-rtkit', [ 'module-rtkit.c' ],
+ include_directories : [configinc, spa_inc],
++>>>>>>> Revert "treewide: meson.build: use dependency variable for SPA"
install : true,
install_dir : modules_install_dir,
install_rpath: modules_install_dir,
-@@ -164,7 +164,7 @@ summary({'rtkit': build_module_rtkit}, bool_yn: true, section: 'Optional Modules
+@@ -155,7 +165,7 @@ summary({'rt': build_module_rt}, bool_yn: true, section: 'Optional Modules')
build_module_portal = dbus_dep.found()
if build_module_portal
pipewire_module_portal = shared_library('pipewire-module-portal', [ 'module-portal.c' ],
@@ -791,7 +803,7 @@ index 45852f3b9..61a53bd6f 100644
install : true,
install_dir : modules_install_dir,
install_rpath: modules_install_dir,
-@@ -178,20 +178,20 @@ pipewire_module_client_device = shared_library('pipewire-module-client-device',
+@@ -169,20 +179,20 @@ pipewire_module_client_device = shared_library('pipewire-module-client-device',
'module-client-device/resource-device.c',
'module-client-device/proxy-device.c',
'module-client-device/protocol-native.c', ],
@@ -816,7 +828,7 @@ index 45852f3b9..61a53bd6f 100644
)
pipewire_module_protocol_deps = [mathlib, dl_lib, pipewire_dep]
-@@ -207,7 +207,7 @@ pipewire_module_protocol_native = shared_library('pipewire-module-protocol-nativ
+@@ -198,7 +208,7 @@ pipewire_module_protocol_native = shared_library('pipewire-module-protocol-nativ
'module-protocol-native/protocol-native.c',
'module-protocol-native/v0/protocol-native.c',
'module-protocol-native/connection.c' ],
@@ -825,7 +837,7 @@ index 45852f3b9..61a53bd6f 100644
install : true,
install_dir : modules_install_dir,
install_rpath: modules_install_dir,
-@@ -281,7 +281,7 @@ endif
+@@ -273,7 +283,7 @@ endif
pipewire_module_protocol_pulse = shared_library('pipewire-module-protocol-pulse',
pipewire_module_protocol_pulse_sources,
@@ -834,7 +846,7 @@ index 45852f3b9..61a53bd6f 100644
install : true,
install_dir : modules_install_dir,
install_rpath: modules_install_dir,
-@@ -293,7 +293,7 @@ if build_module_pulse_tunnel
+@@ -285,7 +295,7 @@ if build_module_pulse_tunnel
pipewire_module_pulse_tunnel = shared_library('pipewire-module-pulse-tunnel',
[ 'module-pulse-tunnel.c',
'module-protocol-pulse/format.c' ],
@@ -843,7 +855,7 @@ index 45852f3b9..61a53bd6f 100644
install : true,
install_dir : modules_install_dir,
install_rpath: modules_install_dir,
-@@ -304,7 +304,7 @@ summary({'pulse-tunnel': build_module_pulse_tunnel}, bool_yn: true, section: 'Op
+@@ -296,7 +306,7 @@ summary({'pulse-tunnel': build_module_pulse_tunnel}, bool_yn: true, section: 'Op
pipewire_module_protocol_simple = shared_library('pipewire-module-protocol-simple',
[ 'module-protocol-simple.c' ],
@@ -852,7 +864,7 @@ index 45852f3b9..61a53bd6f 100644
install : true,
install_dir : modules_install_dir,
install_rpath: modules_install_dir,
-@@ -313,20 +313,20 @@ pipewire_module_protocol_simple = shared_library('pipewire-module-protocol-simpl
+@@ -305,20 +315,20 @@ pipewire_module_protocol_simple = shared_library('pipewire-module-protocol-simpl
pipewire_module_example_sink = shared_library('pipewire-module-example-sink',
[ 'module-example-sink.c' ],
@@ -877,7 +889,7 @@ index 45852f3b9..61a53bd6f 100644
)
pipewire_module_client_node = shared_library('pipewire-module-client-node',
-@@ -338,12 +338,12 @@ pipewire_module_client_node = shared_library('pipewire-module-client-node',
+@@ -330,12 +340,12 @@ pipewire_module_client_node = shared_library('pipewire-module-client-node',
'module-client-node/v0/transport.c',
'module-client-node/v0/protocol-native.c',
'spa/spa-node.c', ],
@@ -892,7 +904,7 @@ index 45852f3b9..61a53bd6f 100644
)
pipewire_module_metadata = shared_library('pipewire-module-metadata',
-@@ -351,12 +351,12 @@ pipewire_module_metadata = shared_library('pipewire-module-metadata',
+@@ -343,12 +353,12 @@ pipewire_module_metadata = shared_library('pipewire-module-metadata',
'module-metadata/proxy-metadata.c',
'module-metadata/metadata.c',
'module-metadata/protocol-native.c'],
@@ -907,7 +919,7 @@ index 45852f3b9..61a53bd6f 100644
)
test('pw-test-protocol-native',
-@@ -364,8 +364,8 @@ test('pw-test-protocol-native',
+@@ -356,8 +366,8 @@ test('pw-test-protocol-native',
[ 'module-protocol-native/test-connection.c',
'module-protocol-native/connection.c' ],
c_args : libpipewire_c_args,
@@ -918,7 +930,7 @@ index 45852f3b9..61a53bd6f 100644
install : installed_tests_enabled,
install_dir : installed_tests_execdir,
),
-@@ -391,7 +391,7 @@ pipewire_module_adapter = shared_library('pipewire-module-adapter',
+@@ -383,7 +393,7 @@ pipewire_module_adapter = shared_library('pipewire-module-adapter',
[ 'module-adapter.c',
'module-adapter/adapter.c',
'spa/spa-node.c' ],
@@ -927,7 +939,7 @@ index 45852f3b9..61a53bd6f 100644
install : true,
install_dir : modules_install_dir,
install_rpath: modules_install_dir,
-@@ -413,11 +413,11 @@ pipewire_module_session_manager = shared_library('pipewire-module-session-manage
+@@ -405,11 +415,11 @@ pipewire_module_session_manager = shared_library('pipewire-module-session-manage
'module-session-manager/proxy-session-manager.c',
'module-session-manager/session.c',
],
@@ -941,7 +953,7 @@ index 45852f3b9..61a53bd6f 100644
)
build_module_zeroconf_discover = avahi_dep.found()
-@@ -426,7 +426,7 @@ pipewire_module_zeroconf_discover = shared_library('pipewire-module-zeroconf-dis
+@@ -418,7 +428,7 @@ pipewire_module_zeroconf_discover = shared_library('pipewire-module-zeroconf-dis
[ 'module-zeroconf-discover.c',
'module-protocol-pulse/format.c',
'module-zeroconf-discover/avahi-poll.c' ],
@@ -950,7 +962,7 @@ index 45852f3b9..61a53bd6f 100644
install : true,
install_dir : modules_install_dir,
install_rpath: modules_install_dir,
-@@ -440,7 +440,7 @@ if build_module_raop_discover
+@@ -432,7 +442,7 @@ if build_module_raop_discover
pipewire_module_raop_discover = shared_library('pipewire-module-raop-discover',
[ 'module-raop-discover.c',
'module-zeroconf-discover/avahi-poll.c' ],
@@ -959,7 +971,7 @@ index 45852f3b9..61a53bd6f 100644
install : true,
install_dir : modules_install_dir,
install_rpath: modules_install_dir,
-@@ -454,7 +454,7 @@ if build_module_raop
+@@ -446,7 +456,7 @@ if build_module_raop
pipewire_module_raop_sink = shared_library('pipewire-module-raop-sink',
[ 'module-raop-sink.c',
'module-raop/rtsp-client.c' ],
@@ -968,7 +980,7 @@ index 45852f3b9..61a53bd6f 100644
install : true,
install_dir : modules_install_dir,
install_rpath: modules_install_dir,
-@@ -470,7 +470,7 @@ build_module_roc = roc_lib.found()
+@@ -462,7 +472,7 @@ build_module_roc = roc_lib.found()
if build_module_roc
pipewire_module_roc_sink = shared_library('pipewire-module-roc-sink',
[ 'module-roc-sink.c' ],
@@ -977,7 +989,7 @@ index 45852f3b9..61a53bd6f 100644
install : true,
install_dir : modules_install_dir,
install_rpath: modules_install_dir,
-@@ -479,7 +479,7 @@ pipewire_module_roc_sink = shared_library('pipewire-module-roc-sink',
+@@ -471,7 +481,7 @@ pipewire_module_roc_sink = shared_library('pipewire-module-roc-sink',
pipewire_module_roc_source = shared_library('pipewire-module-roc-source',
[ 'module-roc-source.c' ],
@@ -1047,7 +1059,7 @@ index 969f50b22..f66ce8746 100644
pipewire_dep = declare_dependency(link_with : libpipewire,
diff --git a/test/meson.build b/test/meson.build
-index 89f2bc2ec..87e211431 100644
+index eca92eb24..4108ac14b 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -19,6 +19,7 @@ pwtest_c_args = [
@@ -1098,7 +1110,7 @@ index 89f2bc2ec..87e211431 100644
link_with: pwtest_lib)
)
-@@ -80,7 +76,7 @@ test('test-context',
+@@ -88,7 +84,7 @@ test('test-context',
'test-context.c',
'test-config.c',
include_directories: pwtest_inc,
@@ -1107,7 +1119,7 @@ index 89f2bc2ec..87e211431 100644
link_with: [pwtest_lib,
pipewire_module_protocol_native,
pipewire_module_client_node,
-@@ -95,7 +91,7 @@ test('test-support',
+@@ -103,7 +99,7 @@ test('test-support',
'test-support.c',
'test-logger.c',
include_directories: pwtest_inc,
@@ -1116,7 +1128,7 @@ index 89f2bc2ec..87e211431 100644
link_with: [pwtest_lib])
)
test('test-spa',
-@@ -107,7 +103,6 @@ test('test-spa',
+@@ -115,7 +111,6 @@ test('test-spa',
'test-spa-node.c',
'test-spa-pod.c',
include_directories: pwtest_inc,
@@ -1125,5 +1137,5 @@ index 89f2bc2ec..87e211431 100644
)
--
-2.34.1
+2.35.1
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-Revert-systemd-correctly-prefix-systemd-system-units.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-Revert-systemd-correctly-prefix-systemd-system-units.patch
deleted file mode 100644
index 8b975d07f..000000000
--- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-Revert-systemd-correctly-prefix-systemd-system-units.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 85d47ff146f1bda2f94d32b5b392024089c6f564 Mon Sep 17 00:00:00 2001
-From: Ashok Sidipotu <ashok.sidipotu@collabora.com>
-Date: Fri, 14 Jan 2022 20:51:09 +0530
-Subject: [PATCH 4/4] Revert "systemd: correctly prefix systemd system units"
-
-This reverts commit 5054b48c9de655b4b48f7c801cb305d9eb122520.
-
-Upstream-Status: Inappropriate[this systemd configuration is in not relvent to AGL]
----
- src/daemon/systemd/system/meson.build | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/daemon/systemd/system/meson.build b/src/daemon/systemd/system/meson.build
-index 7e1c223f8..4d942c1ab 100644
---- a/src/daemon/systemd/system/meson.build
-+++ b/src/daemon/systemd/system/meson.build
-@@ -1,4 +1,4 @@
--systemd_system_services_dir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir', pkgconfig_define : [ 'rootprefix', prefix])
-+systemd_system_services_dir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir', pkgconfig_define : [ 'prefix', prefix])
-
- install_data(sources : 'pipewire.socket',
- install_dir : systemd_system_services_dir)
---
-2.34.1
-
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-Revert-treewide-meson.build-simplify-get_variable-ca.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-Revert-treewide-meson.build-simplify-get_variable-ca.patch
new file mode 100644
index 000000000..bd7e3804f
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-Revert-treewide-meson.build-simplify-get_variable-ca.patch
@@ -0,0 +1,130 @@
+From 82c58fbde3d85465dc4b6e0af460124f67d1e485 Mon Sep 17 00:00:00 2001
+From: Ashok Sidipotu <ashok.sidipotu@collabora.com>
+Date: Thu, 24 Feb 2022 11:36:15 +0530
+Subject: [PATCH 04/12] Revert "treewide: meson.build: simplify
+ `get_variable()` calls"
+
+This reverts commit ec465966bcc783203041de09dce5c315bb0a6f76.
+Upstream-Status: Inappropriate[meson version dependent]
+---
+ meson.build | 8 ++++----
+ spa/plugins/audioconvert/meson.build | 4 ++--
+ spa/tests/meson.build | 2 +-
+ src/daemon/systemd/system/meson.build | 2 +-
+ src/daemon/systemd/user/meson.build | 2 +-
+ src/modules/meson.build | 6 +++---
+ src/tests/meson.build | 6 +++---
+ 7 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 9d806198a..7040e39ac 100644
+--- a/meson.build
++++ b/meson.build
+@@ -445,11 +445,11 @@ devenv = environment()
+ builddir = meson.project_build_root()
+ srcdir = meson.project_source_root()
+
+-devenv.set('PIPEWIRE_CONFIG_DIR', pipewire_dep.get_variable('confdatadir'))
+-devenv.set('PIPEWIRE_MODULE_DIR', pipewire_dep.get_variable('moduledir'))
++devenv.set('PIPEWIRE_CONFIG_DIR', pipewire_dep.get_variable(internal: 'confdatadir'))
++devenv.set('PIPEWIRE_MODULE_DIR', pipewire_dep.get_variable(internal: 'moduledir'))
+
+-devenv.set('SPA_PLUGIN_DIR', spa_dep.get_variable('plugindir'))
+-devenv.set('SPA_DATA_DIR', spa_dep.get_variable('datadir'))
++devenv.set('SPA_PLUGIN_DIR', spa_dep.get_variable(internal: 'plugindir'))
++devenv.set('SPA_DATA_DIR', spa_dep.get_variable(internal: 'datadir'))
+
+ devenv.set('GST_PLUGIN_PATH', builddir / 'src'/ 'gst')
+
+diff --git a/spa/plugins/audioconvert/meson.build b/spa/plugins/audioconvert/meson.build
+index 55e88ccc4..42332a538 100644
+--- a/spa/plugins/audioconvert/meson.build
++++ b/spa/plugins/audioconvert/meson.build
+@@ -140,7 +140,7 @@ foreach a : test_apps
+ install : installed_tests_enabled,
+ install_dir : installed_tests_execdir / 'audioconvert'),
+ env : [
+- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable('plugindir')),
++ 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')),
+ ])
+
+ if installed_tests_enabled
+@@ -170,7 +170,7 @@ foreach a : benchmark_apps
+ install : installed_tests_enabled,
+ install_dir : installed_tests_execdir / 'audioconvert'),
+ env : [
+- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable('plugindir')),
++ 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')),
+ ])
+
+ if installed_tests_enabled
+diff --git a/spa/tests/meson.build b/spa/tests/meson.build
+index ea00a2cfe..0b26fdf02 100644
+--- a/spa/tests/meson.build
++++ b/spa/tests/meson.build
+@@ -42,7 +42,7 @@ foreach a : benchmark_apps
+ install_dir : installed_tests_execdir,
+ ),
+ env : [
+- 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()),
++ 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')),
+ ]
+ )
+
+diff --git a/src/daemon/systemd/system/meson.build b/src/daemon/systemd/system/meson.build
+index 84ca0b068..b3e5f1f41 100644
+--- a/src/daemon/systemd/system/meson.build
++++ b/src/daemon/systemd/system/meson.build
+@@ -1,4 +1,4 @@
+-systemd_system_services_dir = systemd.get_variable('systemdsystemunitdir', pkgconfig_define : [ 'rootprefix', prefix])
++systemd_system_services_dir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir', pkgconfig_define : [ 'rootprefix', prefix])
+ if get_option('systemd-system-unit-dir') != ''
+ systemd_system_services_dir = get_option('systemd-system-unit-dir')
+ endif
+diff --git a/src/daemon/systemd/user/meson.build b/src/daemon/systemd/user/meson.build
+index d17f3794f..a24f9b174 100644
+--- a/src/daemon/systemd/user/meson.build
++++ b/src/daemon/systemd/user/meson.build
+@@ -1,4 +1,4 @@
+-systemd_user_services_dir = systemd.get_variable('systemduserunitdir', pkgconfig_define : [ 'prefix', prefix])
++systemd_user_services_dir = systemd.get_variable(pkgconfig: 'systemduserunitdir', pkgconfig_define : [ 'prefix', prefix])
+ if get_option('systemd-user-unit-dir') != ''
+ systemd_user_services_dir = get_option('systemd-user-unit-dir')
+ endif
+diff --git a/src/modules/meson.build b/src/modules/meson.build
+index ba30275ab..c1225e3e0 100644
+--- a/src/modules/meson.build
++++ b/src/modules/meson.build
+@@ -372,9 +372,9 @@ test('pw-test-protocol-native',
+ install_dir : installed_tests_execdir,
+ ),
+ env : [
+- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable('plugindir')),
+- 'PIPEWIRE_CONFIG_DIR=@0@'.format(pipewire_dep.get_variable('confdatadir')),
+- 'PIPEWIRE_MODULE_DIR=@0@'.format(pipewire_dep.get_variable('moduledir')),
++ 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')),
++ 'PIPEWIRE_CONFIG_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'confdatadir')),
++ 'PIPEWIRE_MODULE_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'moduledir')),
+ ]
+ )
+
+diff --git a/src/tests/meson.build b/src/tests/meson.build
+index 3e03a4c75..3e8d05012 100644
+--- a/src/tests/meson.build
++++ b/src/tests/meson.build
+@@ -13,9 +13,9 @@ foreach a : test_apps
+ install : installed_tests_enabled,
+ install_dir : installed_tests_execdir),
+ env : [
+- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable('plugindir')),
+- 'PIPEWIRE_CONFIG_DIR=@0@'.format(pipewire_dep.get_variable('confdatadir')),
+- 'PIPEWIRE_MODULE_DIR=@0@'.format(pipewire_dep.get_variable('moduledir')),
++ 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')),
++ 'PIPEWIRE_CONFIG_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'confdatadir')),
++ 'PIPEWIRE_MODULE_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'moduledir')),
+ ])
+
+ if installed_tests_enabled
+--
+2.35.1
+
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-Revert-treewide-meson.build-get-SPA_PLUGIN_DIR-from-.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-Revert-treewide-meson.build-get-SPA_PLUGIN_DIR-from-.patch
new file mode 100644
index 000000000..f2a9d0d09
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-Revert-treewide-meson.build-get-SPA_PLUGIN_DIR-from-.patch
@@ -0,0 +1,124 @@
+From cf7b3a0db10cf0bcd140800ef547199703fdf16e Mon Sep 17 00:00:00 2001
+From: Ashok Sidipotu <ashok.sidipotu@collabora.com>
+Date: Thu, 24 Feb 2022 11:54:54 +0530
+Subject: [PATCH 05/12] Revert "treewide: meson.build: get SPA_PLUGIN_DIR from
+ dependency"
+
+This reverts commit 26eb66fb5b56bb5534745a8e223bd099cf5fe4fa.
+Upstream-Status: Inappropriate[meson version dependent]
+---
+ meson.build | 4 ++--
+ spa/plugins/audioconvert/meson.build | 4 ++--
+ spa/tests/meson.build | 2 +-
+ src/modules/meson.build | 13 +++----------
+ src/tests/meson.build | 6 +++---
+ 5 files changed, 11 insertions(+), 18 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 7040e39ac..1b87bd004 100644
+--- a/meson.build
++++ b/meson.build
+@@ -448,8 +448,8 @@ srcdir = meson.project_source_root()
+ devenv.set('PIPEWIRE_CONFIG_DIR', pipewire_dep.get_variable(internal: 'confdatadir'))
+ devenv.set('PIPEWIRE_MODULE_DIR', pipewire_dep.get_variable(internal: 'moduledir'))
+
+-devenv.set('SPA_PLUGIN_DIR', spa_dep.get_variable(internal: 'plugindir'))
+-devenv.set('SPA_DATA_DIR', spa_dep.get_variable(internal: 'datadir'))
++ devenv.set('SPA_PLUGIN_DIR', builddir / 'spa' / 'plugins')
++ devenv.set('SPA_DATA_DIR', srcdir / 'spa' / 'plugins')
+
+ devenv.set('GST_PLUGIN_PATH', builddir / 'src'/ 'gst')
+
+diff --git a/spa/plugins/audioconvert/meson.build b/spa/plugins/audioconvert/meson.build
+index 42332a538..3aa0f3846 100644
+--- a/spa/plugins/audioconvert/meson.build
++++ b/spa/plugins/audioconvert/meson.build
+@@ -140,7 +140,7 @@ foreach a : test_apps
+ install : installed_tests_enabled,
+ install_dir : installed_tests_execdir / 'audioconvert'),
+ env : [
+- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')),
++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()),
+ ])
+
+ if installed_tests_enabled
+@@ -170,7 +170,7 @@ foreach a : benchmark_apps
+ install : installed_tests_enabled,
+ install_dir : installed_tests_execdir / 'audioconvert'),
+ env : [
+- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')),
++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()),
+ ])
+
+ if installed_tests_enabled
+diff --git a/spa/tests/meson.build b/spa/tests/meson.build
+index 0b26fdf02..d995cfaa4 100644
+--- a/spa/tests/meson.build
++++ b/spa/tests/meson.build
+@@ -42,7 +42,7 @@ foreach a : benchmark_apps
+ install_dir : installed_tests_execdir,
+ ),
+ env : [
+- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')),
++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()),
+ ]
+ )
+
+diff --git a/src/modules/meson.build b/src/modules/meson.build
+index c1225e3e0..bd7d3f711 100644
+--- a/src/modules/meson.build
++++ b/src/modules/meson.build
+@@ -140,12 +140,6 @@ pipewire_module_rt = shared_library('pipewire-module-rt', [ 'module-rt.c' ],
+ install_rpath: modules_install_dir,
+ dependencies : [dbus_dep, mathlib, dl_lib, pipewire_dep],
+ )
+-<<<<<<< HEAD
+-# TODO: This serves as a temporary alias to prevent breaking existing setups
+-# while `module-rtkit` is being migrated to `module-rt`
+-pipewire_module_rtkit = shared_library('pipewire-module-rtkit', [ 'module-rt.c' ],
+- include_directories : [configinc],
+-=======
+ endif
+ summary({'rt': build_module_rt}, bool_yn: true, section: 'Optional Modules')
+
+@@ -153,7 +147,6 @@ build_module_rtkit = dbus_dep.found()
+ if build_module_rtkit
+ pipewire_module_rtkit = shared_library('pipewire-module-rtkit', [ 'module-rtkit.c' ],
+ include_directories : [configinc, spa_inc],
+->>>>>>> Revert "treewide: meson.build: use dependency variable for SPA"
+ install : true,
+ install_dir : modules_install_dir,
+ install_rpath: modules_install_dir,
+@@ -372,9 +365,9 @@ test('pw-test-protocol-native',
+ install_dir : installed_tests_execdir,
+ ),
+ env : [
+- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')),
+- 'PIPEWIRE_CONFIG_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'confdatadir')),
+- 'PIPEWIRE_MODULE_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'moduledir')),
++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()),
++ 'PIPEWIRE_CONFIG_DIR=@0@/src/daemon/'.format(meson.project_build_root()),
++ 'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.project_build_root())
+ ]
+ )
+
+diff --git a/src/tests/meson.build b/src/tests/meson.build
+index 3e8d05012..9a595d431 100644
+--- a/src/tests/meson.build
++++ b/src/tests/meson.build
+@@ -13,9 +13,9 @@ foreach a : test_apps
+ install : installed_tests_enabled,
+ install_dir : installed_tests_execdir),
+ env : [
+- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')),
+- 'PIPEWIRE_CONFIG_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'confdatadir')),
+- 'PIPEWIRE_MODULE_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'moduledir')),
++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()),
++ 'PIPEWIRE_CONFIG_DIR=@0@/src/daemon/'.format(meson.project_build_root()),
++ 'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.project_build_root())
+ ])
+
+ if installed_tests_enabled
+--
+2.35.1
+
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-pipewiresink-set-a-default-channel-map-if-the-number.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-pipewiresink-set-a-default-channel-map-if-the-number.patch
deleted file mode 100644
index 3b1b2a490..000000000
--- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-pipewiresink-set-a-default-channel-map-if-the-number.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From ee2e6412d37d012fbf8d25bd37271a5ee92b3ad4 Mon Sep 17 00:00:00 2001
-From: George Kiagiadakis <george.kiagiadakis@collabora.com>
-Date: Thu, 3 Feb 2022 15:08:57 +0200
-Subject: [PATCH] pipewiresink: set a default channel map if the number of
- channels is fixed
-
-This allows remaping streams using pipewiresink to match the channel layout
-of the target device
-Upstream-Status: Backport [from master/0.3.46]
----
- src/gst/gstpipewireformat.c | 42 ++++++++++++++++++++++++++++++++++++-
- 1 file changed, 41 insertions(+), 1 deletion(-)
-
-diff --git a/src/gst/gstpipewireformat.c b/src/gst/gstpipewireformat.c
-index dca90267c..c8ce7ba62 100644
---- a/src/gst/gstpipewireformat.c
-+++ b/src/gst/gstpipewireformat.c
-@@ -445,6 +445,44 @@ handle_video_fields (ConvertData *d)
- return TRUE;
- }
-
-+static void
-+set_default_channels (struct spa_pod_builder *b, uint32_t channels)
-+{
-+ uint32_t position[SPA_AUDIO_MAX_CHANNELS] = {0};
-+ gboolean ok = TRUE;
-+
-+ switch (channels) {
-+ case 8:
-+ position[6] = SPA_AUDIO_CHANNEL_SL;
-+ position[7] = SPA_AUDIO_CHANNEL_SR;
-+ SPA_FALLTHROUGH
-+ case 6:
-+ position[5] = SPA_AUDIO_CHANNEL_LFE;
-+ SPA_FALLTHROUGH
-+ case 5:
-+ position[4] = SPA_AUDIO_CHANNEL_FC;
-+ SPA_FALLTHROUGH
-+ case 4:
-+ position[2] = SPA_AUDIO_CHANNEL_RL;
-+ position[3] = SPA_AUDIO_CHANNEL_RR;
-+ SPA_FALLTHROUGH
-+ case 2:
-+ position[0] = SPA_AUDIO_CHANNEL_FL;
-+ position[1] = SPA_AUDIO_CHANNEL_FR;
-+ break;
-+ case 1:
-+ position[0] = SPA_AUDIO_CHANNEL_MONO;
-+ break;
-+ default:
-+ ok = FALSE;
-+ break;
-+ }
-+
-+ if (ok)
-+ spa_pod_builder_add (b, SPA_FORMAT_AUDIO_position,
-+ SPA_POD_Array(sizeof(uint32_t), SPA_TYPE_Id, channels, position), 0);
-+}
-+
- static gboolean
- handle_audio_fields (ConvertData *d)
- {
-@@ -538,8 +576,10 @@ handle_audio_fields (ConvertData *d)
- }
- if (i > 0) {
- choice = spa_pod_builder_pop(&d->b, &f);
-- if (i == 1)
-+ if (i == 1) {
- choice->body.type = SPA_CHOICE_None;
-+ set_default_channels (&d->b, v);
-+ }
- }
- }
- return TRUE;
---
-2.34.1
-
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-Revert-meson-declare-spa_dep-and-override_dependency.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0006-Revert-meson-declare-spa_dep-and-override_dependency.patch
index 47e4f3cc2..fe44c07ed 100644
--- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-Revert-meson-declare-spa_dep-and-override_dependency.patch
+++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0006-Revert-meson-declare-spa_dep-and-override_dependency.patch
@@ -1,11 +1,10 @@
-From 83b7f6457e5dca3ee2145e35f361f1520d24be42 Mon Sep 17 00:00:00 2001
+From 869e53ac9ded351ce6cb47b5ce04ef345c673b48 Mon Sep 17 00:00:00 2001
From: Ashok Sidipotu <ashok.sidipotu@collabora.com>
-Date: Fri, 14 Jan 2022 18:30:44 +0530
-Subject: [PATCH 3/4] Revert "meson: declare spa_dep and override_dependency()
- for spa and pipewire"
+Date: Thu, 24 Feb 2022 12:16:03 +0530
+Subject: [PATCH 06/12] Revert "meson: declare spa_dep and
+ override_dependency() for spa and pipewire"
This reverts commit 7ab5c35cadc075bcdf44031f1f7d95352cf9a13b.
-
Upstream-Status: Inappropriate[meson version dependent]
---
meson.build | 2 +-
@@ -14,14 +13,14 @@ Upstream-Status: Inappropriate[meson version dependent]
3 files changed, 4 insertions(+), 21 deletions(-)
diff --git a/meson.build b/meson.build
-index 67e697c15..476f722b7 100644
+index 1b87bd004..af60472f8 100644
--- a/meson.build
+++ b/meson.build
@@ -1,7 +1,7 @@
project('pipewire', ['c' ],
- version : '0.3.43',
+ version : '0.3.47',
license : [ 'MIT', 'LGPL-2.1-or-later', 'GPL-2.0-only' ],
-- meson_version : '>= 0.56.0',
+- meson_version : '>= 0.59.0',
+ meson_version : '>= 0.49.0',
default_options : [ 'warning_level=3',
'c_std=gnu99',
@@ -79,5 +78,5 @@ index f66ce8746..5cfaba3f9 100644
-
subdir('extensions')
--
-2.34.1
+2.35.1
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0007-Revert-meson-use-meson-variables-for-the-SMs-uninsta.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0007-Revert-meson-use-meson-variables-for-the-SMs-uninsta.patch
new file mode 100644
index 000000000..3fff8eb27
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0007-Revert-meson-use-meson-variables-for-the-SMs-uninsta.patch
@@ -0,0 +1,47 @@
+From 4e8241675e68d5fb082d42ff597e681955eabbc4 Mon Sep 17 00:00:00 2001
+From: Ashok Sidipotu <ashok.sidipotu@collabora.com>
+Date: Thu, 24 Feb 2022 12:37:27 +0530
+Subject: [PATCH 07/12] Revert "meson: use meson variables for the SMs'
+ uninstalled scripts"
+
+This reverts commit d5825b8551c34cefabf278a6b5ed04bc6ab0f301.
+Upstream-Status: Inappropriate[meson version dependent]
+---
+ src/daemon/meson.build | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/src/daemon/meson.build b/src/daemon/meson.build
+index 28cbe4467..cd17d23c3 100644
+--- a/src/daemon/meson.build
++++ b/src/daemon/meson.build
+@@ -46,17 +46,21 @@ elif default_sm == 'media-session'
+ ms_bindir = ms_proj.get_variable('media_session_bin_dir', pipewire_bindir)
+ conf_config.set('session_manager_path', ms_bindir / 'pipewire-media-session')
+
+- ms_uninstalled = ms_proj.get_variable('media_session_uninstalled')
+- conf_config_uninstalled.set('session_manager_path', ms_uninstalled.full_path())
+- conf_config_uninstalled.set('session_manager_args', 'pipewire-media-session')
++ conf_config_uninstalled.set('session_manager_path',
++ meson.source_root() / 'subprojects' / 'media-session' / 'media-session-uninstalled.sh')
++ conf_config_uninstalled.set('session_manager_args',
++ '-b ' + meson.build_root() / 'subprojects' / 'media-session' + ' pipewire-media-session')
+ conf_config_uninstalled.set('sm_comment', '')
+ elif default_sm == 'wireplumber'
+ wp_bindir = wp_proj.get_variable('wireplumber_bin_dir', pipewire_bindir)
++
+ conf_config.set('session_manager_path', wp_bindir / 'wireplumber')
+
+- wp_uninstalled = wp_proj.get_variable('wireplumber_uninstalled')
+- conf_config_uninstalled.set('session_manager_path', wp_uninstalled.full_path())
+- conf_config_uninstalled.set('session_manager_args', 'wireplumber')
++ # wp-uninstalled.sh -b path/to/wp/build/root wireplumber
++ conf_config_uninstalled.set('session_manager_path',
++ meson.source_root() / 'subprojects' / 'wireplumber' / 'wp-uninstalled.sh')
++ conf_config_uninstalled.set('session_manager_args',
++ '-b ' + meson.build_root() / 'subprojects' / 'wireplumber' + ' wireplumber')
+ conf_config_uninstalled.set('sm_comment', '')
+ else
+ conf_config_uninstalled.set('session_manager_path', default_sm)
+--
+2.35.1
+
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0008-Revert-meson-declare-spa_dep-and-override_dependency.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0008-Revert-meson-declare-spa_dep-and-override_dependency.patch
new file mode 100644
index 000000000..751adbe5b
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0008-Revert-meson-declare-spa_dep-and-override_dependency.patch
@@ -0,0 +1,31 @@
+From c5b9c082dafe2ad2ac118ffd39c5b88307f3357f Mon Sep 17 00:00:00 2001
+From: Ashok Sidipotu <ashok.sidipotu@collabora.com>
+Date: Thu, 24 Feb 2022 16:12:23 +0530
+Subject: [PATCH 08/12] Revert "meson: declare spa_dep and
+ override_dependency() for spa and pipewire"
+
+This reverts commit 7ab5c35cadc075bcdf44031f1f7d95352cf9a13b.
+---
+ src/pipewire/meson.build | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/src/pipewire/meson.build b/src/pipewire/meson.build
+index 5cfaba3f9..2dd5d790e 100644
+--- a/src/pipewire/meson.build
++++ b/src/pipewire/meson.build
+@@ -121,11 +121,6 @@ pkgconfig.generate(libpipewire,
+ description : 'PipeWire Interface',
+ version : pipewire_version,
+ extra_cflags : '-D_REENTRANT',
+- variables : ['moduledir=${libdir}/@0@'.format(pipewire_name)],
+- uninstalled_variables : [
+- 'moduledir=${prefix}/src/modules',
+- 'confdatadir=${prefix}/src/daemon',
+- ],
+-)
++ variables : ['moduledir=${libdir}/@0@'.format(pipewire_name)])
+
+ subdir('extensions')
+--
+2.35.1
+
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0009-Revert-test-add-test-for-the-loop.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0009-Revert-test-add-test-for-the-loop.patch
new file mode 100644
index 000000000..6628c5c34
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0009-Revert-test-add-test-for-the-loop.patch
@@ -0,0 +1,32 @@
+From bf29285fb6e534b754a3b0c7b33d2a0ed3b98b79 Mon Sep 17 00:00:00 2001
+From: Ashok Sidipotu <ashok.sidipotu@collabora.com>
+Date: Thu, 24 Feb 2022 16:13:54 +0530
+Subject: [PATCH 09/12] Revert "test: add test for the loop"
+
+This reverts commit 5ac5ebfe19618f303c2bb4f0f9295baba0299961.
+---
+ test/meson.build | 8 --------
+ 1 file changed, 8 deletions(-)
+
+diff --git a/test/meson.build b/test/meson.build
+index 4108ac14b..87e211431 100644
+--- a/test/meson.build
++++ b/test/meson.build
+@@ -71,14 +71,6 @@ test('test-client',
+ link_with: pwtest_lib)
+ )
+
+-test('test-loop',
+- executable('test-loop',
+- 'test-loop.c',
+- include_directories: pwtest_inc,
+- dependencies: [ spa_dep ],
+- link_with: pwtest_lib)
+-)
+-
+ test('test-context',
+ executable('test-context',
+ 'test-context.c',
+--
+2.35.1
+
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0010-Revert-spa-improve-the-AEC-interface.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0010-Revert-spa-improve-the-AEC-interface.patch
new file mode 100644
index 000000000..8bf945479
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0010-Revert-spa-improve-the-AEC-interface.patch
@@ -0,0 +1,502 @@
+From 3ac842085c60a0c745bd3f8f0d8419e98220675b Mon Sep 17 00:00:00 2001
+From: Ashok Sidipotu <ashok.sidipotu@collabora.com>
+Date: Thu, 24 Feb 2022 18:02:29 +0530
+Subject: [PATCH 10/12] Revert "spa: improve the AEC interface"
+
+This reverts commit c5c9ecdd87225ecd4978e9f6176a8a6d1fdd4252.
+Upstream-Status: Inappropriate[meson version dependent]
+
+This patch had to be reverted as it is dependent on
+9386c70b3a2cc2df6aabfd7b6a6bc1d7ec873bd1 which needs
+higher meson version.
+
+---
+ spa/include/spa/interfaces/audio/aec.h | 71 +++-----------------
+ spa/plugins/aec/aec-null.c | 62 +++++++++--------
+ spa/plugins/aec/aec-webrtc.cpp | 56 ++++++++-------
+ src/modules/module-echo-cancel.c | 39 +++++------
+ src/modules/module-echo-cancel/echo-cancel.h | 34 ++++++++++
+ 5 files changed, 130 insertions(+), 132 deletions(-)
+ create mode 100644 src/modules/module-echo-cancel/echo-cancel.h
+
+diff --git a/spa/include/spa/interfaces/audio/aec.h b/spa/include/spa/interfaces/audio/aec.h
+index 17e4e4e46..e1fcda563 100644
+--- a/spa/include/spa/interfaces/audio/aec.h
++++ b/spa/include/spa/interfaces/audio/aec.h
+@@ -25,71 +25,20 @@
+
+ #include <spa/utils/dict.h>
+ #include <spa/utils/hook.h>
++#include <spa/pod/pod.h>
+ #include <spa/param/audio/raw.h>
++#include <spa/support/plugin.h>
+
+-#ifndef SPA_AUDIO_AEC_H
+-#define SPA_AUDIO_AEC_H
++#define SPA_TYPE_INTERFACE_AEC SPA_TYPE_INFO_INTERFACE_BASE "AEC"
++#define SPA_VERSION_AUDIO_AEC 1
+
+-#ifdef __cplusplus
+-extern "C" {
+-#endif
+-
+-#define SPA_TYPE_INTERFACE_AUDIO_AEC SPA_TYPE_INFO_INTERFACE_BASE "Audio:AEC"
+-
+-#define SPA_VERSION_AUDIO_AEC 0
+-struct spa_audio_aec {
++struct echo_cancel_info {
+ struct spa_interface iface;
+ const char *name;
+- const struct spa_dict *info;
++ const struct spa_dict info;
+ const char *latency;
++ int (*create) (struct spa_handle *handle, const struct spa_dict *args, const struct spa_audio_info_raw *info);
++ int (*run) (struct spa_handle *handle, const float *rec[], const float *play[], float *out[], uint32_t n_samples);
++ struct spa_dict *(*get_properties) (struct spa_handle *handle);
++ int (*set_properties) (struct spa_handle *handle, const struct spa_dict *args);
+ };
+-
+-struct spa_audio_aec_info {
+-#define SPA_AUDIO_AEC_CHANGE_MASK_PROPS (1u<<0)
+- uint64_t change_mask;
+-
+- const struct spa_dict *props;
+-};
+-
+-struct spa_audio_aec_events {
+-#define SPA_VERSION_AUDIO_AEC_EVENTS 0
+- uint32_t version; /**< version of this structure */
+-
+- /** Emitted when info changes */
+- void (*info) (void *data, const struct spa_audio_aec_info *info);
+-};
+-
+-struct spa_audio_aec_methods {
+-#define SPA_VERSION_AUDIO_AEC_METHODS 0
+- uint32_t version;
+-
+- int (*add_listener) (void *object,
+- struct spa_hook *listener,
+- const struct spa_audio_aec_events *events,
+- void *data);
+-
+- int (*init) (void *data, const struct spa_dict *args, const struct spa_audio_info_raw *info);
+- int (*run) (void *data, const float *rec[], const float *play[], float *out[], uint32_t n_samples);
+- int (*set_props) (void *data, const struct spa_dict *args);
+-};
+-
+-#define spa_audio_aec_method(o,method,version,...) \
+-({ \
+- int _res = -ENOTSUP; \
+- struct spa_audio_aec *_o = o; \
+- spa_interface_call_res(&_o->iface, \
+- struct spa_audio_aec_methods, _res, \
+- method, version, ##__VA_ARGS__); \
+- _res; \
+-})
+-
+-#define spa_audio_aec_add_listener(o,...) spa_audio_aec_method(o, add_listener, 0, __VA_ARGS__)
+-#define spa_audio_aec_init(o,...) spa_audio_aec_method(o, init, 0, __VA_ARGS__)
+-#define spa_audio_aec_run(o,...) spa_audio_aec_method(o, run, 0, __VA_ARGS__)
+-#define spa_audio_aec_set_props(o,...) spa_audio_aec_method(o, set_props, 0, __VA_ARGS__)
+-
+-#ifdef __cplusplus
+-} /* extern "C" */
+-#endif
+-
+-#endif /* SPA_AUDIO_AEC_H */
+diff --git a/spa/plugins/aec/aec-null.c b/spa/plugins/aec/aec-null.c
+index 2909eb213..3168a6b36 100644
+--- a/spa/plugins/aec/aec-null.c
++++ b/spa/plugins/aec/aec-null.c
+@@ -30,11 +30,7 @@
+
+ struct impl {
+ struct spa_handle handle;
+- struct spa_audio_aec aec;
+ struct spa_log *log;
+-
+- struct spa_hook_list hooks_list;
+-
+ uint32_t channels;
+ };
+
+@@ -42,38 +38,54 @@ static struct spa_log_topic log_topic = SPA_LOG_TOPIC(0, "spa.aec.null");
+ #undef SPA_LOG_TOPIC_DEFAULT
+ #define SPA_LOG_TOPIC_DEFAULT &log_topic
+
+-static int null_init(void *data, const struct spa_dict *args, const struct spa_audio_info_raw *info)
++static int null_create(struct spa_handle *handle, const struct spa_dict *args, const struct spa_audio_info_raw *info)
+ {
+- struct impl *impl = data;
++ struct impl *impl;
++ impl = (struct impl *) handle;
+ impl->channels = info->channels;
++
+ return 0;
+ }
+
+-static int null_run(void *data, const float *rec[], const float *play[], float *out[], uint32_t n_samples)
++static int null_run(struct spa_handle *handle, const float *rec[], const float *play[], float *out[], uint32_t n_samples)
+ {
+- struct impl *impl = data;
++ struct impl *impl = (struct impl *) handle;
+ uint32_t i;
+ for (i = 0; i < impl->channels; i++)
+ memcpy(out[i], rec[i], n_samples * sizeof(float));
+ return 0;
+ }
+
+-static struct spa_audio_aec_methods impl_aec = {
+- .init = null_init,
++struct spa_dict *null_get_properties(SPA_UNUSED struct spa_handle *handle)
++{
++ /* Not supported */
++ return NULL;
++}
++
++int null_set_properties(SPA_UNUSED struct spa_handle *handle, SPA_UNUSED const struct spa_dict *args)
++{
++ /* Not supported */
++ return -1;
++}
++
++static struct echo_cancel_info echo_cancel_null_impl = {
++ .name = "null",
++ .info = SPA_DICT_INIT(NULL, 0),
++ .latency = NULL,
++ .create = null_create,
+ .run = null_run,
++ .get_properties = null_get_properties,
++ .set_properties = null_set_properties,
+ };
+
+ static int impl_get_interface(struct spa_handle *handle, const char *type, void **interface)
+ {
+- struct impl *impl;
+
+ spa_return_val_if_fail(handle != NULL, -EINVAL);
+ spa_return_val_if_fail(interface != NULL, -EINVAL);
+
+- impl = (struct impl *) handle;
+-
+- if (spa_streq(type, SPA_TYPE_INTERFACE_AUDIO_AEC))
+- *interface = &impl->aec;
++ if (spa_streq(type, SPA_TYPE_INTERFACE_AEC))
++ *interface = &echo_cancel_null_impl;
+ else
+ return -ENOENT;
+
+@@ -106,29 +118,23 @@ impl_init(const struct spa_handle_factory *factory,
+ spa_return_val_if_fail(factory != NULL, -EINVAL);
+ spa_return_val_if_fail(handle != NULL, -EINVAL);
+
++ echo_cancel_null_impl.iface = SPA_INTERFACE_INIT(
++ SPA_TYPE_INTERFACE_AEC,
++ SPA_VERSION_AUDIO_AEC,
++ NULL,
++ NULL);
++
+ handle->get_interface = impl_get_interface;
+ handle->clear = impl_clear;
+-
+ impl = (struct impl *) handle;
+-
+- impl->aec.iface = SPA_INTERFACE_INIT(
+- SPA_TYPE_INTERFACE_AUDIO_AEC,
+- SPA_VERSION_AUDIO_AEC,
+- &impl_aec, impl);
+- impl->aec.name = "null";
+- impl->aec.info = NULL;
+- impl->aec.latency = NULL;
+-
+ impl->log = (struct spa_log*)spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Log);
+ spa_log_topic_init(impl->log, &log_topic);
+
+- spa_hook_list_init(&impl->hooks_list);
+-
+ return 0;
+ }
+
+ static const struct spa_interface_info impl_interfaces[] = {
+- {SPA_TYPE_INTERFACE_AUDIO_AEC,},
++ {SPA_TYPE_INTERFACE_AEC,},
+ };
+
+ static int
+diff --git a/spa/plugins/aec/aec-webrtc.cpp b/spa/plugins/aec/aec-webrtc.cpp
+index f519189c7..d44fa6e30 100644
+--- a/spa/plugins/aec/aec-webrtc.cpp
++++ b/spa/plugins/aec/aec-webrtc.cpp
+@@ -38,8 +38,6 @@
+
+ struct impl_data {
+ struct spa_handle handle;
+- struct spa_audio_aec aec;
+-
+ struct spa_log *log;
+ std::unique_ptr<webrtc::AudioProcessing> apm;
+ spa_audio_info_raw info;
+@@ -60,9 +58,9 @@ static bool webrtc_get_spa_bool(const struct spa_dict *args, const char *key, bo
+ return value;
+ }
+
+-static int webrtc_init(void *data, const struct spa_dict *args, const struct spa_audio_info_raw *info)
++static int webrtc_create(struct spa_handle *handle, const struct spa_dict *args, const struct spa_audio_info_raw *info)
+ {
+- auto impl = reinterpret_cast<struct impl_data*>(data);
++ auto impl = reinterpret_cast<struct impl_data*>(handle);
+
+ bool extended_filter = webrtc_get_spa_bool(args, "webrtc.extended_filter", true);
+ bool delay_agnostic = webrtc_get_spa_bool(args, "webrtc.delay_agnostic", true);
+@@ -122,9 +120,9 @@ static int webrtc_init(void *data, const struct spa_dict *args, const struct spa
+ return 0;
+ }
+
+-static int webrtc_run(void *data, const float *rec[], const float *play[], float *out[], uint32_t n_samples)
++static int webrtc_run(struct spa_handle *handle, const float *rec[], const float *play[], float *out[], uint32_t n_samples)
+ {
+- auto impl = reinterpret_cast<struct impl_data*>(data);
++ auto impl = reinterpret_cast<struct impl_data*>(handle);
+ webrtc::StreamConfig config =
+ webrtc::StreamConfig(impl->info.rate, impl->info.channels, false);
+ unsigned int num_blocks = n_samples * 1000 / impl->info.rate / 10;
+@@ -160,22 +158,36 @@ static int webrtc_run(void *data, const float *rec[], const float *play[], float
+ return 0;
+ }
+
+-static struct spa_audio_aec_methods impl_aec = {
+- SPA_VERSION_AUDIO_AEC_METHODS,
+- .add_listener = NULL,
+- .init = webrtc_init,
++struct spa_dict *webrtc_get_properties(SPA_UNUSED struct spa_handle *handle)
++{
++ /* Not supported */
++ return NULL;
++}
++
++int webrtc_set_properties(SPA_UNUSED struct spa_handle *handle, SPA_UNUSED const struct spa_dict *args)
++{
++ /* Not supported */
++ return -1;
++}
++
++static struct echo_cancel_info echo_cancel_webrtc_impl = {
++ .name = "webrtc",
++ .info = SPA_DICT_INIT(NULL, 0),
++ .latency = "480/48000",
++ .create = webrtc_create,
+ .run = webrtc_run,
++ .get_properties = webrtc_get_properties,
++ .set_properties = webrtc_set_properties,
+ };
+
+ static int impl_get_interface(struct spa_handle *handle, const char *type, void **interface)
+ {
+- auto impl = reinterpret_cast<struct impl_data*>(handle);
+
+ spa_return_val_if_fail(handle != NULL, -EINVAL);
+ spa_return_val_if_fail(interface != NULL, -EINVAL);
+
+- if (spa_streq(type, SPA_TYPE_INTERFACE_AUDIO_AEC))
+- *interface = &impl->aec;
++ if (spa_streq(type, SPA_TYPE_INTERFACE_AEC))
++ *interface = &echo_cancel_webrtc_impl;
+ else
+ return -ENOENT;
+
+@@ -207,19 +219,15 @@ impl_init(const struct spa_handle_factory *factory,
+ spa_return_val_if_fail(factory != NULL, -EINVAL);
+ spa_return_val_if_fail(handle != NULL, -EINVAL);
+
+- auto impl = new (handle) impl_data();
++ echo_cancel_webrtc_impl.iface = SPA_INTERFACE_INIT(
++ SPA_TYPE_INTERFACE_AEC,
++ SPA_VERSION_AUDIO_AEC,
++ NULL,
++ NULL);
+
++ auto impl = new (handle) impl_data();
+ impl->handle.get_interface = impl_get_interface;
+ impl->handle.clear = impl_clear;
+-
+- impl->aec.iface = SPA_INTERFACE_INIT(
+- SPA_TYPE_INTERFACE_AUDIO_AEC,
+- SPA_VERSION_AUDIO_AEC,
+- &impl_aec, impl);
+- impl->aec.name = "webrtc",
+- impl->aec.info = NULL;
+- impl->aec.latency = "480/48000",
+-
+ impl->log = (struct spa_log*)spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Log);
+ spa_log_topic_init(impl->log, &log_topic);
+
+@@ -227,7 +235,7 @@ impl_init(const struct spa_handle_factory *factory,
+ }
+
+ static const struct spa_interface_info impl_interfaces[] = {
+- {SPA_TYPE_INTERFACE_AUDIO_AEC,},
++ {SPA_TYPE_INTERFACE_AEC,},
+ };
+
+ static int
+diff --git a/src/modules/module-echo-cancel.c b/src/modules/module-echo-cancel.c
+index c933a9376..728325938 100644
+--- a/src/modules/module-echo-cancel.c
++++ b/src/modules/module-echo-cancel.c
+@@ -24,6 +24,7 @@
+ */
+
+ #include "config.h"
++#include "module-echo-cancel/echo-cancel.h"
+
+ #include <errno.h>
+ #include <fcntl.h>
+@@ -187,7 +188,7 @@ struct impl {
+ uint32_t out_ringsize;
+ struct spa_ringbuffer out_ring;
+
+- struct spa_audio_aec *aec;
++ const struct echo_cancel_info *aec_info;
+ uint32_t aec_blocksize;
+
+ unsigned int capture_ready:1;
+@@ -287,7 +288,7 @@ static void process(struct impl *impl)
+ pw_stream_queue_buffer(impl->playback, pout);
+
+ /* Now run the canceller */
+- spa_audio_aec_run(impl->aec, rec, play_delayed, out, size / sizeof(float));
++ echo_cancel_run(impl->aec_info, impl->spa_handle, rec, play_delayed, out, size / sizeof(float));
+
+ /* Next, copy over the output to the output ringbuffer */
+ avail = spa_ringbuffer_get_write_index(&impl->out_ring, &oindex);
+@@ -651,8 +652,8 @@ static int setup_streams(struct impl *impl)
+ pw_properties_set(props, PW_KEY_NODE_LINK_GROUP, str);
+ if ((str = pw_properties_get(impl->source_props, PW_KEY_NODE_LATENCY)) != NULL)
+ pw_properties_set(props, PW_KEY_NODE_LATENCY, str);
+- else if (impl->aec->latency)
+- pw_properties_set(props, PW_KEY_NODE_LATENCY, impl->aec->latency);
++ else if (impl->aec_info->latency)
++ pw_properties_set(props, PW_KEY_NODE_LATENCY, impl->aec_info->latency);
+
+ impl->capture = pw_stream_new(impl->core,
+ "Echo-Cancel Capture", props);
+@@ -684,8 +685,8 @@ static int setup_streams(struct impl *impl)
+ pw_properties_set(props, PW_KEY_NODE_LINK_GROUP, str);
+ if ((str = pw_properties_get(impl->sink_props, PW_KEY_NODE_LATENCY)) != NULL)
+ pw_properties_set(props, PW_KEY_NODE_LATENCY, str);
+- else if (impl->aec->latency)
+- pw_properties_set(props, PW_KEY_NODE_LATENCY, impl->aec->latency);
++ else if (impl->aec_info->latency)
++ pw_properties_set(props, PW_KEY_NODE_LATENCY, impl->aec_info->latency);
+
+ impl->playback = pw_stream_new(impl->core,
+ "Echo-Cancel Playback", props);
+@@ -998,42 +999,42 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
+ return -ENOENT;
+ }
+
+- if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_AUDIO_AEC, &iface)) < 0) {
+- pw_log_error("can't get %s interface %d", SPA_TYPE_INTERFACE_AUDIO_AEC, res);
++ if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_AEC, &iface)) < 0) {
++ pw_log_error("can't get %s interface %d", SPA_TYPE_INTERFACE_AEC, res);
+ return res;
+ }
+- impl->aec = iface;
++ impl->aec_info = iface;
+ impl->spa_handle = handle;
+- if (impl->aec->iface.version != SPA_VERSION_AUDIO_AEC) {
++ if (impl->aec_info->iface.version != SPA_VERSION_AUDIO_AEC) {
+ pw_log_error("codec plugin %s has incompatible ABI version (%d != %d)",
+- SPA_NAME_AEC, impl->aec->iface.version, SPA_VERSION_AUDIO_AEC);
++ SPA_NAME_AEC, impl->aec_info->iface.version, SPA_VERSION_AUDIO_AEC);
+ res = -ENOENT;
+ goto error;
+ }
+
+- (void)SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_AUDIO_AEC, (struct spa_audio_aec *)impl->aec);
++ (void)SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_AEC, (struct echo_cancel_info *)impl->aec_info);
+
+- pw_log_info("Using plugin AEC %s", impl->aec->name);
++ pw_log_info("Using plugin AEC %s", impl->aec_info->name);
+
+ if ((str = pw_properties_get(props, "aec.args")) != NULL)
+ aec_props = pw_properties_new_string(str);
+ else
+ aec_props = pw_properties_new(NULL, NULL);
+
+- if (spa_audio_aec_init(impl->aec, &aec_props->dict, &impl->info)) {
+- pw_log_error("codec plugin %s create failed", impl->aec->name);
++ if (echo_cancel_create(impl->aec_info, impl->spa_handle, &aec_props->dict, &impl->info)) {
++ pw_log_error("codec plugin %s create failed", impl->aec_info->name);
+ res = -ENOENT;
+ goto error;
+ }
+
+ pw_properties_free(aec_props);
+
+- if (impl->aec->latency) {
++ if (impl->aec_info->latency) {
+ unsigned int num, denom, req_num, req_denom;
+ unsigned int factor = 0;
+ unsigned int new_num = 0;
+
+- spa_assert_se(sscanf(impl->aec->latency, "%u/%u", &num, &denom) == 2);
++ spa_assert_se(sscanf(impl->aec_info->latency, "%u/%u", &num, &denom) == 2);
+
+ if ((str = pw_properties_get(props, PW_KEY_NODE_LATENCY)) != NULL) {
+ sscanf(str, "%u/%u", &req_num, &req_denom);
+@@ -1042,8 +1043,8 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
+ }
+
+ if (factor == 0 || new_num == 0) {
+- pw_log_info("Setting node latency to %s", impl->aec->latency);
+- pw_properties_set(props, PW_KEY_NODE_LATENCY, impl->aec->latency);
++ pw_log_info("Setting node latency to %s", impl->aec_info->latency);
++ pw_properties_set(props, PW_KEY_NODE_LATENCY, impl->aec_info->latency);
+ impl->aec_blocksize = sizeof(float) * impl->info.rate * num / denom;
+ } else {
+ pw_log_info("Setting node latency to %u/%u", new_num, req_denom);
+diff --git a/src/modules/module-echo-cancel/echo-cancel.h b/src/modules/module-echo-cancel/echo-cancel.h
+new file mode 100644
+index 000000000..ac83f70e4
+--- /dev/null
++++ b/src/modules/module-echo-cancel/echo-cancel.h
+@@ -0,0 +1,34 @@
++/* PipeWire
++ *
++ * Copyright © 2021 Wim Taymans <wim.taymans@gmail.com>
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice (including the next
++ * paragraph) shall be included in all copies or substantial portions of the
++ * Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ */
++
++
++#include <spa/utils/dict.h>
++#include <spa/utils/hook.h>
++#include <spa/param/audio/raw.h>
++#include <spa/support/plugin.h>
++
++#include <pipewire/properties.h>
++
++#define echo_cancel_create(i,...) (i)->create(__VA_ARGS__)
++#define echo_cancel_run(i,...) (i)->run(__VA_ARGS__)
+--
+2.35.1
+
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0011-Revert-module-echo-cancel-Move-backends-to-dynamic-l.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0011-Revert-module-echo-cancel-Move-backends-to-dynamic-l.patch
new file mode 100644
index 000000000..4d62abcfc
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0011-Revert-module-echo-cancel-Move-backends-to-dynamic-l.patch
@@ -0,0 +1,1055 @@
+From 7f14334d055da433521c32c622682f89fe2dd1c5 Mon Sep 17 00:00:00 2001
+From: Ashok Sidipotu <ashok.sidipotu@collabora.com>
+Date: Thu, 24 Feb 2022 18:02:48 +0530
+Subject: [PATCH 11/12] Revert "module-echo-cancel: Move backends to dynamic
+ libaries"
+
+This reverts commit 9386c70b3a2cc2df6aabfd7b6a6bc1d7ec873bd1.
+Upstream-Status: Inappropriate[meson version dependent]
+---
+ spa/include/meson.build | 1 -
+ spa/include/spa/utils/names.h | 2 -
+ spa/plugins/aec/aec-null.c | 185 -----------
+ spa/plugins/aec/aec-webrtc.cpp | 286 ------------------
+ spa/plugins/aec/meson.build | 16 -
+ spa/plugins/meson.build | 2 -
+ src/modules/meson.build | 9 +-
+ src/modules/module-echo-cancel.c | 83 ++---
+ .../modules/module-echo-cancel/aec-null.c | 56 ++--
+ src/modules/module-echo-cancel/aec-webrtc.cpp | 163 ++++++++++
+ src/modules/module-echo-cancel/echo-cancel.h | 20 +-
+ 11 files changed, 247 insertions(+), 576 deletions(-)
+ delete mode 100644 spa/plugins/aec/aec-null.c
+ delete mode 100644 spa/plugins/aec/aec-webrtc.cpp
+ delete mode 100644 spa/plugins/aec/meson.build
+ rename spa/include/spa/interfaces/audio/aec.h => src/modules/module-echo-cancel/aec-null.c (58%)
+ create mode 100644 src/modules/module-echo-cancel/aec-webrtc.cpp
+
+diff --git a/spa/include/meson.build b/spa/include/meson.build
+index 443db7dca..0566b025d 100644
+--- a/spa/include/meson.build
++++ b/spa/include/meson.build
+@@ -3,7 +3,6 @@ spa_sections = [
+ 'control',
+ 'debug',
+ 'graph',
+- 'interfaces',
+ 'monitor',
+ 'node',
+ 'param',
+diff --git a/spa/include/spa/utils/names.h b/spa/include/spa/utils/names.h
+index 3ece5a861..1e570d098 100644
+--- a/spa/include/spa/utils/names.h
++++ b/spa/include/spa/utils/names.h
+@@ -82,8 +82,6 @@ extern "C" {
+ #define SPA_NAME_AUDIO_ADAPT "audio.adapt" /**< combination of a node and an
+ * audio.convert. Does clock slaving */
+
+-#define SPA_NAME_AEC "audio.aec" /**< Echo canceling */
+-
+ /** video processing */
+ #define SPA_NAME_VIDEO_PROCESS_FORMAT "video.process.format" /**< processes raw video from one format
+ * to another */
+diff --git a/spa/plugins/aec/aec-null.c b/spa/plugins/aec/aec-null.c
+deleted file mode 100644
+index 3168a6b36..000000000
+--- a/spa/plugins/aec/aec-null.c
++++ /dev/null
+@@ -1,185 +0,0 @@
+-/* PipeWire
+- *
+- * Copyright © 2021 Wim Taymans <wim.taymans@gmail.com>
+- *
+- * Permission is hereby granted, free of charge, to any person obtaining a
+- * copy of this software and associated documentation files (the "Software"),
+- * to deal in the Software without restriction, including without limitation
+- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+- * and/or sell copies of the Software, and to permit persons to whom the
+- * Software is furnished to do so, subject to the following conditions:
+- *
+- * The above copyright notice and this permission notice (including the next
+- * paragraph) shall be included in all copies or substantial portions of the
+- * Software.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+- * DEALINGS IN THE SOFTWARE.
+- */
+-
+-#include <spa/interfaces/audio/aec.h>
+-#include <spa/support/log.h>
+-#include <spa/utils/string.h>
+-#include <spa/utils/names.h>
+-#include <spa/support/plugin.h>
+-
+-struct impl {
+- struct spa_handle handle;
+- struct spa_log *log;
+- uint32_t channels;
+-};
+-
+-static struct spa_log_topic log_topic = SPA_LOG_TOPIC(0, "spa.aec.null");
+-#undef SPA_LOG_TOPIC_DEFAULT
+-#define SPA_LOG_TOPIC_DEFAULT &log_topic
+-
+-static int null_create(struct spa_handle *handle, const struct spa_dict *args, const struct spa_audio_info_raw *info)
+-{
+- struct impl *impl;
+- impl = (struct impl *) handle;
+- impl->channels = info->channels;
+-
+- return 0;
+-}
+-
+-static int null_run(struct spa_handle *handle, const float *rec[], const float *play[], float *out[], uint32_t n_samples)
+-{
+- struct impl *impl = (struct impl *) handle;
+- uint32_t i;
+- for (i = 0; i < impl->channels; i++)
+- memcpy(out[i], rec[i], n_samples * sizeof(float));
+- return 0;
+-}
+-
+-struct spa_dict *null_get_properties(SPA_UNUSED struct spa_handle *handle)
+-{
+- /* Not supported */
+- return NULL;
+-}
+-
+-int null_set_properties(SPA_UNUSED struct spa_handle *handle, SPA_UNUSED const struct spa_dict *args)
+-{
+- /* Not supported */
+- return -1;
+-}
+-
+-static struct echo_cancel_info echo_cancel_null_impl = {
+- .name = "null",
+- .info = SPA_DICT_INIT(NULL, 0),
+- .latency = NULL,
+- .create = null_create,
+- .run = null_run,
+- .get_properties = null_get_properties,
+- .set_properties = null_set_properties,
+-};
+-
+-static int impl_get_interface(struct spa_handle *handle, const char *type, void **interface)
+-{
+-
+- spa_return_val_if_fail(handle != NULL, -EINVAL);
+- spa_return_val_if_fail(interface != NULL, -EINVAL);
+-
+- if (spa_streq(type, SPA_TYPE_INTERFACE_AEC))
+- *interface = &echo_cancel_null_impl;
+- else
+- return -ENOENT;
+-
+- return 0;
+-}
+-
+-static int impl_clear(struct spa_handle *handle)
+-{
+- spa_return_val_if_fail(handle != NULL, -EINVAL);
+-
+- return 0;
+-}
+-
+-static size_t
+-impl_get_size(const struct spa_handle_factory *factory,
+- const struct spa_dict *params)
+-{
+- return sizeof(struct impl);
+-}
+-
+-static int
+-impl_init(const struct spa_handle_factory *factory,
+- struct spa_handle *handle,
+- const struct spa_dict *info,
+- const struct spa_support *support,
+- uint32_t n_support)
+-{
+- struct impl *impl;
+-
+- spa_return_val_if_fail(factory != NULL, -EINVAL);
+- spa_return_val_if_fail(handle != NULL, -EINVAL);
+-
+- echo_cancel_null_impl.iface = SPA_INTERFACE_INIT(
+- SPA_TYPE_INTERFACE_AEC,
+- SPA_VERSION_AUDIO_AEC,
+- NULL,
+- NULL);
+-
+- handle->get_interface = impl_get_interface;
+- handle->clear = impl_clear;
+- impl = (struct impl *) handle;
+- impl->log = (struct spa_log*)spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Log);
+- spa_log_topic_init(impl->log, &log_topic);
+-
+- return 0;
+-}
+-
+-static const struct spa_interface_info impl_interfaces[] = {
+- {SPA_TYPE_INTERFACE_AEC,},
+-};
+-
+-static int
+-impl_enum_interface_info(const struct spa_handle_factory *factory,
+- const struct spa_interface_info **info,
+- uint32_t *index)
+-{
+- spa_return_val_if_fail(factory != NULL, -EINVAL);
+- spa_return_val_if_fail(info != NULL, -EINVAL);
+- spa_return_val_if_fail(index != NULL, -EINVAL);
+-
+- switch (*index) {
+- case 0:
+- *info = &impl_interfaces[*index];
+- break;
+- default:
+- return 0;
+- }
+- (*index)++;
+- return 1;
+-}
+-
+-const struct spa_handle_factory spa_aec_exaudio_factory = {
+- SPA_VERSION_HANDLE_FACTORY,
+- SPA_NAME_AEC,
+- NULL,
+- impl_get_size,
+- impl_init,
+- impl_enum_interface_info,
+-};
+-
+-
+-SPA_EXPORT
+-int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index)
+-{
+- spa_return_val_if_fail(factory != NULL, -EINVAL);
+- spa_return_val_if_fail(index != NULL, -EINVAL);
+-
+- switch (*index) {
+- case 0:
+- *factory = &spa_aec_exaudio_factory;
+- break;
+- default:
+- return 0;
+- }
+- (*index)++;
+- return 1;
+-}
+diff --git a/spa/plugins/aec/aec-webrtc.cpp b/spa/plugins/aec/aec-webrtc.cpp
+deleted file mode 100644
+index d44fa6e30..000000000
+--- a/spa/plugins/aec/aec-webrtc.cpp
++++ /dev/null
+@@ -1,286 +0,0 @@
+-/* PipeWire
+- *
+- * Copyright © 2021 Wim Taymans <wim.taymans@gmail.com>
+- * © 2021 Arun Raghavan <arun@asymptotic.io>
+- *
+- * Permission is hereby granted, free of charge, to any person obtaining a
+- * copy of this software and associated documentation files (the "Software"),
+- * to deal in the Software without restriction, including without limitation
+- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+- * and/or sell copies of the Software, and to permit persons to whom the
+- * Software is furnished to do so, subject to the following conditions:
+- *
+- * The above copyright notice and this permission notice (including the next
+- * paragraph) shall be included in all copies or substantial portions of the
+- * Software.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+- * DEALINGS IN THE SOFTWARE.
+- */
+-
+-#include <memory>
+-#include <utility>
+-
+-#include <spa/interfaces/audio/aec.h>
+-#include <spa/support/log.h>
+-#include <spa/utils/string.h>
+-#include <spa/utils/names.h>
+-#include <spa/support/plugin.h>
+-
+-#include <webrtc/modules/audio_processing/include/audio_processing.h>
+-#include <webrtc/modules/interface/module_common_types.h>
+-#include <webrtc/system_wrappers/include/trace.h>
+-
+-struct impl_data {
+- struct spa_handle handle;
+- struct spa_log *log;
+- std::unique_ptr<webrtc::AudioProcessing> apm;
+- spa_audio_info_raw info;
+- std::unique_ptr<float *[]> play_buffer, rec_buffer, out_buffer;
+-};
+-
+-static struct spa_log_topic log_topic = SPA_LOG_TOPIC(0, "spa.eac.webrtc");
+-#undef SPA_LOG_TOPIC_DEFAULT
+-#define SPA_LOG_TOPIC_DEFAULT &log_topic
+-
+-static bool webrtc_get_spa_bool(const struct spa_dict *args, const char *key, bool default_value) {
+- const char *str_val;
+- bool value = default_value;
+- str_val = spa_dict_lookup(args, key);
+- if (str_val != NULL)
+- value =spa_atob(str_val);
+-
+- return value;
+-}
+-
+-static int webrtc_create(struct spa_handle *handle, const struct spa_dict *args, const struct spa_audio_info_raw *info)
+-{
+- auto impl = reinterpret_cast<struct impl_data*>(handle);
+-
+- bool extended_filter = webrtc_get_spa_bool(args, "webrtc.extended_filter", true);
+- bool delay_agnostic = webrtc_get_spa_bool(args, "webrtc.delay_agnostic", true);
+- bool high_pass_filter = webrtc_get_spa_bool(args, "webrtc.high_pass_filter", true);
+- bool noise_suppression = webrtc_get_spa_bool(args, "webrtc.noise_suppression", true);
+- bool voice_detection = webrtc_get_spa_bool(args, "webrtc.voice_detection", true);
+-
+- // Note: AGC seems to mess up with Agnostic Delay Detection, especially with speech,
+- // result in very poor performance, disable by default
+- bool gain_control = webrtc_get_spa_bool(args, "webrtc.gain_control", false);
+-
+- // Disable experimental flags by default
+- bool experimental_agc = webrtc_get_spa_bool(args, "webrtc.experimental_agc", false);
+- bool experimental_ns = webrtc_get_spa_bool(args, "webrtc.experimental_ns", false);
+-
+- // FIXME: Intelligibility enhancer is not currently supported
+- // This filter will modify playback buffer (when calling ProcessReverseStream), but now
+- // playback buffer modifications are discarded.
+-
+- webrtc::Config config;
+- config.Set<webrtc::ExtendedFilter>(new webrtc::ExtendedFilter(extended_filter));
+- config.Set<webrtc::DelayAgnostic>(new webrtc::DelayAgnostic(delay_agnostic));
+- config.Set<webrtc::ExperimentalAgc>(new webrtc::ExperimentalAgc(experimental_agc));
+- config.Set<webrtc::ExperimentalNs>(new webrtc::ExperimentalNs(experimental_ns));
+-
+- webrtc::ProcessingConfig pconfig = {{
+- webrtc::StreamConfig(info->rate, info->channels, false), /* input stream */
+- webrtc::StreamConfig(info->rate, info->channels, false), /* output stream */
+- webrtc::StreamConfig(info->rate, info->channels, false), /* reverse input stream */
+- webrtc::StreamConfig(info->rate, info->channels, false), /* reverse output stream */
+- }};
+-
+- auto apm = std::unique_ptr<webrtc::AudioProcessing>(webrtc::AudioProcessing::Create(config));
+- if (apm->Initialize(pconfig) != webrtc::AudioProcessing::kNoError) {
+- spa_log_error(impl->log, "Error initialising webrtc audio processing module");
+- return -1;
+- }
+-
+- apm->high_pass_filter()->Enable(high_pass_filter);
+- // Always disable drift compensation since it requires drift sampling
+- apm->echo_cancellation()->enable_drift_compensation(false);
+- apm->echo_cancellation()->Enable(true);
+- // TODO: wire up supression levels to args
+- apm->echo_cancellation()->set_suppression_level(webrtc::EchoCancellation::kHighSuppression);
+- apm->noise_suppression()->set_level(webrtc::NoiseSuppression::kHigh);
+- apm->noise_suppression()->Enable(noise_suppression);
+- apm->voice_detection()->Enable(voice_detection);
+- // TODO: wire up AGC parameters to args
+- apm->gain_control()->set_analog_level_limits(0, 255);
+- apm->gain_control()->set_mode(webrtc::GainControl::kAdaptiveDigital);
+- apm->gain_control()->Enable(gain_control);
+- impl->apm = std::move(apm);
+- impl->info = *info;
+- impl->play_buffer = std::make_unique<float *[]>(info->channels);
+- impl->rec_buffer = std::make_unique<float *[]>(info->channels);
+- impl->out_buffer = std::make_unique<float *[]>(info->channels);
+- return 0;
+-}
+-
+-static int webrtc_run(struct spa_handle *handle, const float *rec[], const float *play[], float *out[], uint32_t n_samples)
+-{
+- auto impl = reinterpret_cast<struct impl_data*>(handle);
+- webrtc::StreamConfig config =
+- webrtc::StreamConfig(impl->info.rate, impl->info.channels, false);
+- unsigned int num_blocks = n_samples * 1000 / impl->info.rate / 10;
+-
+- if (n_samples * 1000 / impl->info.rate % 10 != 0) {
+- spa_log_error(impl->log, "Buffers must be multiples of 10ms in length (currently %u samples)", n_samples);
+- return -1;
+- }
+-
+- for (size_t i = 0; i < num_blocks; i ++) {
+- for (size_t j = 0; j < impl->info.channels; j++) {
+- impl->play_buffer[j] = const_cast<float *>(play[j]) + config.num_frames() * i;
+- impl->rec_buffer[j] = const_cast<float *>(rec[j]) + config.num_frames() * i;
+- impl->out_buffer[j] = out[j] + config.num_frames() * i;
+- }
+- /* FIXME: ProcessReverseStream may change the playback buffer, in which
+- * case we should use that, if we ever expose the intelligibility
+- * enhancer */
+- if (impl->apm->ProcessReverseStream(impl->play_buffer.get(), config, config, impl->play_buffer.get()) !=
+- webrtc::AudioProcessing::kNoError) {
+- spa_log_error(impl->log, "Processing reverse stream failed");
+- }
+-
+- // Extra delay introduced by multiple frames
+- impl->apm->set_stream_delay_ms((num_blocks - 1) * 10);
+-
+- if (impl->apm->ProcessStream(impl->rec_buffer.get(), config, config, impl->out_buffer.get()) !=
+- webrtc::AudioProcessing::kNoError) {
+- spa_log_error(impl->log, "Processing stream failed");
+- }
+- }
+-
+- return 0;
+-}
+-
+-struct spa_dict *webrtc_get_properties(SPA_UNUSED struct spa_handle *handle)
+-{
+- /* Not supported */
+- return NULL;
+-}
+-
+-int webrtc_set_properties(SPA_UNUSED struct spa_handle *handle, SPA_UNUSED const struct spa_dict *args)
+-{
+- /* Not supported */
+- return -1;
+-}
+-
+-static struct echo_cancel_info echo_cancel_webrtc_impl = {
+- .name = "webrtc",
+- .info = SPA_DICT_INIT(NULL, 0),
+- .latency = "480/48000",
+- .create = webrtc_create,
+- .run = webrtc_run,
+- .get_properties = webrtc_get_properties,
+- .set_properties = webrtc_set_properties,
+-};
+-
+-static int impl_get_interface(struct spa_handle *handle, const char *type, void **interface)
+-{
+-
+- spa_return_val_if_fail(handle != NULL, -EINVAL);
+- spa_return_val_if_fail(interface != NULL, -EINVAL);
+-
+- if (spa_streq(type, SPA_TYPE_INTERFACE_AEC))
+- *interface = &echo_cancel_webrtc_impl;
+- else
+- return -ENOENT;
+-
+- return 0;
+-}
+-
+-static int impl_clear(struct spa_handle *handle)
+-{
+- spa_return_val_if_fail(handle != NULL, -EINVAL);
+- auto impl = reinterpret_cast<struct impl_data*>(handle);
+- impl->~impl_data();
+- return 0;
+-}
+-
+-static size_t
+-impl_get_size(const struct spa_handle_factory *factory,
+- const struct spa_dict *params)
+-{
+- return sizeof(struct impl_data);
+-}
+-
+-static int
+-impl_init(const struct spa_handle_factory *factory,
+- struct spa_handle *handle,
+- const struct spa_dict *info,
+- const struct spa_support *support,
+- uint32_t n_support)
+-{
+- spa_return_val_if_fail(factory != NULL, -EINVAL);
+- spa_return_val_if_fail(handle != NULL, -EINVAL);
+-
+- echo_cancel_webrtc_impl.iface = SPA_INTERFACE_INIT(
+- SPA_TYPE_INTERFACE_AEC,
+- SPA_VERSION_AUDIO_AEC,
+- NULL,
+- NULL);
+-
+- auto impl = new (handle) impl_data();
+- impl->handle.get_interface = impl_get_interface;
+- impl->handle.clear = impl_clear;
+- impl->log = (struct spa_log*)spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Log);
+- spa_log_topic_init(impl->log, &log_topic);
+-
+- return 0;
+-}
+-
+-static const struct spa_interface_info impl_interfaces[] = {
+- {SPA_TYPE_INTERFACE_AEC,},
+-};
+-
+-static int
+-impl_enum_interface_info(const struct spa_handle_factory *factory,
+- const struct spa_interface_info **info,
+- uint32_t *index)
+-{
+- spa_return_val_if_fail(factory != NULL, -EINVAL);
+- spa_return_val_if_fail(info != NULL, -EINVAL);
+- spa_return_val_if_fail(index != NULL, -EINVAL);
+-
+- switch (*index) {
+- case 0:
+- *info = &impl_interfaces[*index];
+- break;
+- default:
+- return 0;
+- }
+- (*index)++;
+- return 1;
+-}
+-
+-const struct spa_handle_factory spa_aec_exaudio_factory = {
+- SPA_VERSION_HANDLE_FACTORY,
+- SPA_NAME_AEC,
+- NULL,
+- impl_get_size,
+- impl_init,
+- impl_enum_interface_info,
+-};
+-
+-
+-SPA_EXPORT
+-int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index)
+-{
+- spa_return_val_if_fail(factory != NULL, -EINVAL);
+- spa_return_val_if_fail(index != NULL, -EINVAL);
+-
+- switch (*index) {
+- case 0:
+- *factory = &spa_aec_exaudio_factory;
+- break;
+- default:
+- return 0;
+- }
+- (*index)++;
+- return 1;
+-}
+diff --git a/spa/plugins/aec/meson.build b/spa/plugins/aec/meson.build
+deleted file mode 100644
+index 2b1a2c05a..000000000
+--- a/spa/plugins/aec/meson.build
++++ /dev/null
+@@ -1,16 +0,0 @@
+-aec_null = shared_library('spa-aec-null',
+- [ 'aec-null.c' ],
+- include_directories : [ configinc ],
+- dependencies : [ spa_dep ],
+- install : true,
+- install_dir : spa_plugindir / 'aec')
+-
+-if webrtc_dep.found()
+- aec_webrtc = shared_library('spa-aec-webrtc',
+- [ 'aec-webrtc.cpp' ],
+- include_directories : [ configinc ],
+- dependencies : [ spa_dep, webrtc_dep ],
+- install : true,
+- install_dir : spa_plugindir / 'aec')
+-endif
+-
+diff --git a/spa/plugins/meson.build b/spa/plugins/meson.build
+index 0b581b29b..fd229d460 100644
+--- a/spa/plugins/meson.build
++++ b/spa/plugins/meson.build
+@@ -51,5 +51,3 @@ endif
+ if libcamera_dep.found()
+ subdir('libcamera')
+ endif
+-
+-subdir('aec')
+\ No newline at end of file
+diff --git a/src/modules/meson.build b/src/modules/meson.build
+index bd7d3f711..568b32c50 100644
+--- a/src/modules/meson.build
++++ b/src/modules/meson.build
+@@ -110,15 +110,22 @@ pipewire_module_filter_chain = shared_library('pipewire-module-filter-chain',
+
+ pipewire_module_echo_cancel_sources = [
+ 'module-echo-cancel.c',
++ 'module-echo-cancel/aec-null.c',
+ ]
+
++if webrtc_dep.found()
++ pipewire_module_echo_cancel_sources += [
++ 'module-echo-cancel/aec-webrtc.cpp'
++ ]
++endif
++
+ pipewire_module_echo_cancel = shared_library('pipewire-module-echo-cancel',
+ pipewire_module_echo_cancel_sources,
+ include_directories : [configinc, spa_inc],
+ install : true,
+ install_dir : modules_install_dir,
+ install_rpath: modules_install_dir,
+- dependencies : [mathlib, dl_lib, pipewire_dep],
++ dependencies : [mathlib, dl_lib, pipewire_dep, webrtc_dep],
+ )
+
+ pipewire_module_profiler = shared_library('pipewire-module-profiler',
+diff --git a/src/modules/module-echo-cancel.c b/src/modules/module-echo-cancel.c
+index 728325938..00adbbfc5 100644
+--- a/src/modules/module-echo-cancel.c
++++ b/src/modules/module-echo-cancel.c
+@@ -24,7 +24,6 @@
+ */
+
+ #include "config.h"
+-#include "module-echo-cancel/echo-cancel.h"
+
+ #include <errno.h>
+ #include <fcntl.h>
+@@ -44,14 +43,10 @@
+ #include <spa/param/audio/raw.h>
+ #include <spa/param/profiler.h>
+ #include <spa/pod/builder.h>
+-#include <spa/support/plugin.h>
+ #include <spa/utils/json.h>
+-#include <spa/utils/names.h>
+ #include <spa/utils/result.h>
+ #include <spa/utils/ringbuffer.h>
+ #include <spa/utils/string.h>
+-#include <spa/support/plugin-loader.h>
+-#include <spa/interfaces/audio/aec.h>
+
+ #include <pipewire/private.h>
+ #include <pipewire/impl.h>
+@@ -59,6 +54,8 @@
+
+ #include <pipewire/extensions/profiler.h>
+
++#include "module-echo-cancel/echo-cancel.h"
++
+ /** \page page_module_echo_cancel PipeWire Module: Echo Cancel
+ *
+ * The `echo-cancel` module performs echo cancellation. The module creates
+@@ -71,8 +68,8 @@
+ *
+ * - `source.props = {}`: properties to be passed to the source stream
+ * - `sink.props = {}`: properties to be passed to the sink stream
+- * - `library.name = <str>`: the echo cancellation library Currently supported:
+- * `aec/libspa-aec-exaudio`. Leave unset to use the default method (`aec/libspa-aec-exaudio`).
++ * - `aec.method = <str>`: the echo cancellation method. Currently supported:
++ * `webrtc`. Leave unset to use the default method (`webrtc`).
+ * - `aec.args = <str>`: arguments to pass to the echo cancellation method
+ *
+ * ## General options
+@@ -97,7 +94,7 @@
+ * context.modules = [
+ * { name = libpipewire-module-echo-cancel
+ * args = {
+- * # library.name = aec/libspa-aec-exaudio
++ * # aec.method = webrtc
+ * # node.latency = 1024/48000
+ * source.props = {
+ * node.name = "Echo Cancellation Source"
+@@ -141,7 +138,7 @@ static const struct spa_dict_item module_props[] = {
+ "[ audio.position=<channel map> ] "
+ "[ buffer.max_size=<max buffer size in ms> ] "
+ "[ buffer.play_delay=<play delay in ms> ] "
+- "[ library.name =<library name> ] "
++ "[ aec.method=<aec method> ] "
+ "[ aec.args=<aec arguments> ] "
+ "[ source.props=<properties> ] "
+ "[ sink.props=<properties> ] " },
+@@ -189,6 +186,7 @@ struct impl {
+ struct spa_ringbuffer out_ring;
+
+ const struct echo_cancel_info *aec_info;
++ void *aec;
+ uint32_t aec_blocksize;
+
+ unsigned int capture_ready:1;
+@@ -199,9 +197,6 @@ struct impl {
+
+ uint32_t max_buffer_size;
+ uint32_t buffer_delay;
+-
+- struct spa_handle *spa_handle;
+- struct spa_plugin_loader *loader;
+ };
+
+ static void do_unload_module(void *obj, void *data, int res, uint32_t id)
+@@ -288,7 +283,7 @@ static void process(struct impl *impl)
+ pw_stream_queue_buffer(impl->playback, pout);
+
+ /* Now run the canceller */
+- echo_cancel_run(impl->aec_info, impl->spa_handle, rec, play_delayed, out, size / sizeof(float));
++ echo_cancel_run(impl->aec_info, impl->aec, rec, play_delayed, out, size / sizeof(float));
+
+ /* Next, copy over the output to the output ringbuffer */
+ avail = spa_ringbuffer_get_write_index(&impl->out_ring, &oindex);
+@@ -808,8 +803,8 @@ static void impl_destroy(struct impl *impl)
+ pw_stream_destroy(impl->sink);
+ if (impl->core && impl->do_disconnect)
+ pw_core_disconnect(impl->core);
+- if (impl->spa_handle)
+- spa_plugin_loader_unload(impl->loader, impl->spa_handle);
++ if (impl->aec)
++ echo_cancel_destroy(impl->aec_info, impl->aec);
+ pw_properties_free(impl->source_props);
+ pw_properties_free(impl->sink_props);
+
+@@ -898,10 +893,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
+ struct impl *impl;
+ uint32_t id = pw_global_get_id(pw_impl_module_get_global(module));
+ const char *str;
+- const char *path;
+- int res = 0;
+- struct spa_handle *handle = NULL;
+- void *iface;
++ int res;
+
+ PW_LOG_TOPIC_INIT(mod_topic);
+
+@@ -975,57 +967,22 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
+ if (pw_properties_get(impl->sink_props, PW_KEY_MEDIA_CLASS) == NULL)
+ pw_properties_set(impl->sink_props, PW_KEY_MEDIA_CLASS, "Audio/Sink");
+
+- if ((str = pw_properties_get(props, "aec.method")) != NULL)
+- pw_log_warn("aec.method is not supported anymore use library.name");
+-
+- /* Use webrtc as default */
+- if ((path = pw_properties_get(props, "library.name")) == NULL)
+- path = "aec/libspa-aec-webrtc";
+-
+- struct spa_dict_item info_items[] = {
+- { SPA_KEY_LIBRARY_NAME, path },
+- };
+- struct spa_dict info = SPA_DICT_INIT_ARRAY(info_items);
+-
+- impl->loader = spa_support_find(context->support, context->n_support, SPA_TYPE_INTERFACE_PluginLoader);
+- if (impl->loader == NULL) {
+- pw_log_error("a plugin loader is needed");
+- return -EINVAL;
+- }
+-
+- handle = spa_plugin_loader_load(impl->loader, SPA_NAME_AEC, &info);
+- if (handle == NULL) {
+- pw_log_error("AEC codec plugin %s not available library.name %s", SPA_NAME_AEC, path);
+- return -ENOENT;
+- }
+-
+- if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_AEC, &iface)) < 0) {
+- pw_log_error("can't get %s interface %d", SPA_TYPE_INTERFACE_AEC, res);
+- return res;
+- }
+- impl->aec_info = iface;
+- impl->spa_handle = handle;
+- if (impl->aec_info->iface.version != SPA_VERSION_AUDIO_AEC) {
+- pw_log_error("codec plugin %s has incompatible ABI version (%d != %d)",
+- SPA_NAME_AEC, impl->aec_info->iface.version, SPA_VERSION_AUDIO_AEC);
+- res = -ENOENT;
+- goto error;
+- }
+-
+- (void)SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_AEC, (struct echo_cancel_info *)impl->aec_info);
++ if ((str = pw_properties_get(props, "aec.method")) == NULL)
++ str = "webrtc";
+
+- pw_log_info("Using plugin AEC %s", impl->aec_info->name);
++#ifdef HAVE_WEBRTC
++ if (spa_streq(str, "webrtc"))
++ impl->aec_info = echo_cancel_webrtc;
++ else
++#endif
++ impl->aec_info = echo_cancel_null;
+
+ if ((str = pw_properties_get(props, "aec.args")) != NULL)
+ aec_props = pw_properties_new_string(str);
+ else
+ aec_props = pw_properties_new(NULL, NULL);
+
+- if (echo_cancel_create(impl->aec_info, impl->spa_handle, &aec_props->dict, &impl->info)) {
+- pw_log_error("codec plugin %s create failed", impl->aec_info->name);
+- res = -ENOENT;
+- goto error;
+- }
++ impl->aec = echo_cancel_create(impl->aec_info, aec_props, &impl->info);
+
+ pw_properties_free(aec_props);
+
+diff --git a/spa/include/spa/interfaces/audio/aec.h b/src/modules/module-echo-cancel/aec-null.c
+similarity index 58%
+rename from spa/include/spa/interfaces/audio/aec.h
+rename to src/modules/module-echo-cancel/aec-null.c
+index e1fcda563..4ee9ac6d7 100644
+--- a/spa/include/spa/interfaces/audio/aec.h
++++ b/src/modules/module-echo-cancel/aec-null.c
+@@ -22,23 +22,43 @@
+ * DEALINGS IN THE SOFTWARE.
+ */
+
++#include "echo-cancel.h"
+
+-#include <spa/utils/dict.h>
+-#include <spa/utils/hook.h>
+-#include <spa/pod/pod.h>
+-#include <spa/param/audio/raw.h>
+-#include <spa/support/plugin.h>
+-
+-#define SPA_TYPE_INTERFACE_AEC SPA_TYPE_INFO_INTERFACE_BASE "AEC"
+-#define SPA_VERSION_AUDIO_AEC 1
+-
+-struct echo_cancel_info {
+- struct spa_interface iface;
+- const char *name;
+- const struct spa_dict info;
+- const char *latency;
+- int (*create) (struct spa_handle *handle, const struct spa_dict *args, const struct spa_audio_info_raw *info);
+- int (*run) (struct spa_handle *handle, const float *rec[], const float *play[], float *out[], uint32_t n_samples);
+- struct spa_dict *(*get_properties) (struct spa_handle *handle);
+- int (*set_properties) (struct spa_handle *handle, const struct spa_dict *args);
++struct impl {
++ uint32_t channels;
+ };
++
++static void *null_create(const struct pw_properties *args, const struct spa_audio_info_raw *info)
++{
++ struct impl *impl;
++ impl = calloc(1, sizeof(struct impl));
++ impl->channels = info->channels;
++ return impl;
++}
++
++static void null_destroy(void *ec)
++{
++ free(ec);
++}
++
++static int null_run(void *ec, const float *rec[], const float *play[], float *out[], uint32_t n_samples)
++{
++ struct impl *impl = ec;
++ uint32_t i;
++ for (i = 0; i < impl->channels; i++)
++ memcpy(out[i], rec[i], n_samples * sizeof(float));
++ return 0;
++}
++
++static const struct echo_cancel_info echo_cancel_null_impl = {
++ .name = "null",
++ .info = SPA_DICT_INIT(NULL, 0),
++ .latency = NULL,
++
++ .create = null_create,
++ .destroy = null_destroy,
++
++ .run = null_run,
++};
++
++const struct echo_cancel_info *echo_cancel_null = &echo_cancel_null_impl;
+diff --git a/src/modules/module-echo-cancel/aec-webrtc.cpp b/src/modules/module-echo-cancel/aec-webrtc.cpp
+new file mode 100644
+index 000000000..77b569a22
+--- /dev/null
++++ b/src/modules/module-echo-cancel/aec-webrtc.cpp
+@@ -0,0 +1,163 @@
++/* PipeWire
++ *
++ * Copyright © 2021 Wim Taymans <wim.taymans@gmail.com>
++ * © 2021 Arun Raghavan <arun@asymptotic.io>
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice (including the next
++ * paragraph) shall be included in all copies or substantial portions of the
++ * Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ */
++
++#include <memory>
++#include <utility>
++
++#include "echo-cancel.h"
++
++#include <pipewire/pipewire.h>
++
++#include <webrtc/modules/audio_processing/include/audio_processing.h>
++#include <webrtc/modules/interface/module_common_types.h>
++#include <webrtc/system_wrappers/include/trace.h>
++
++struct impl {
++ std::unique_ptr<webrtc::AudioProcessing> apm;
++ spa_audio_info_raw info;
++ std::unique_ptr<float *[]> play_buffer, rec_buffer, out_buffer;
++
++ impl(std::unique_ptr<webrtc::AudioProcessing> apm, const spa_audio_info_raw& info)
++ : apm(std::move(apm)),
++ info(info),
++ play_buffer(std::make_unique<float *[]>(info.channels)),
++ rec_buffer(std::make_unique<float *[]>(info.channels)),
++ out_buffer(std::make_unique<float *[]>(info.channels))
++ { }
++};
++
++static void *webrtc_create(const struct pw_properties *args, const spa_audio_info_raw *info)
++{
++ bool extended_filter = pw_properties_get_bool(args, "webrtc.extended_filter", true);
++ bool delay_agnostic = pw_properties_get_bool(args, "webrtc.delay_agnostic", true);
++ bool high_pass_filter = pw_properties_get_bool(args, "webrtc.high_pass_filter", true);
++ bool noise_suppression = pw_properties_get_bool(args, "webrtc.noise_suppression", true);
++ bool voice_detection = pw_properties_get_bool(args, "webrtc.voice_detection", true);
++
++ // Note: AGC seems to mess up with Agnostic Delay Detection, especially with speech,
++ // result in very poor performance, disable by default
++ bool gain_control = pw_properties_get_bool(args, "webrtc.gain_control", false);
++
++ // Disable experimental flags by default
++ bool experimental_agc = pw_properties_get_bool(args, "webrtc.experimental_agc", false);
++ bool experimental_ns = pw_properties_get_bool(args, "webrtc.experimental_ns", false);
++
++ // FIXME: Intelligibility enhancer is not currently supported
++ // This filter will modify playback buffer (when calling ProcessReverseStream), but now
++ // playback buffer modifications are discarded.
++
++ webrtc::Config config;
++ config.Set<webrtc::ExtendedFilter>(new webrtc::ExtendedFilter(extended_filter));
++ config.Set<webrtc::DelayAgnostic>(new webrtc::DelayAgnostic(delay_agnostic));
++ config.Set<webrtc::ExperimentalAgc>(new webrtc::ExperimentalAgc(experimental_agc));
++ config.Set<webrtc::ExperimentalNs>(new webrtc::ExperimentalNs(experimental_ns));
++
++ webrtc::ProcessingConfig pconfig = {{
++ webrtc::StreamConfig(info->rate, info->channels, false), /* input stream */
++ webrtc::StreamConfig(info->rate, info->channels, false), /* output stream */
++ webrtc::StreamConfig(info->rate, info->channels, false), /* reverse input stream */
++ webrtc::StreamConfig(info->rate, info->channels, false), /* reverse output stream */
++ }};
++
++ auto apm = std::unique_ptr<webrtc::AudioProcessing>(webrtc::AudioProcessing::Create(config));
++ if (apm->Initialize(pconfig) != webrtc::AudioProcessing::kNoError) {
++ pw_log_error("Error initialising webrtc audio processing module");
++ return nullptr;
++ }
++
++ apm->high_pass_filter()->Enable(high_pass_filter);
++ // Always disable drift compensation since it requires drift sampling
++ apm->echo_cancellation()->enable_drift_compensation(false);
++ apm->echo_cancellation()->Enable(true);
++ // TODO: wire up supression levels to args
++ apm->echo_cancellation()->set_suppression_level(webrtc::EchoCancellation::kHighSuppression);
++ apm->noise_suppression()->set_level(webrtc::NoiseSuppression::kHigh);
++ apm->noise_suppression()->Enable(noise_suppression);
++ apm->voice_detection()->Enable(voice_detection);
++ // TODO: wire up AGC parameters to args
++ apm->gain_control()->set_analog_level_limits(0, 255);
++ apm->gain_control()->set_mode(webrtc::GainControl::kAdaptiveDigital);
++ apm->gain_control()->Enable(gain_control);
++
++ return new impl(std::move(apm), *info);
++}
++
++static void webrtc_destroy(void *ec)
++{
++ auto impl = static_cast<struct impl *>(ec);
++
++ delete impl;
++}
++
++static int webrtc_run(void *ec, const float *rec[], const float *play[], float *out[], uint32_t n_samples)
++{
++ auto impl = static_cast<struct impl *>(ec);
++ webrtc::StreamConfig config =
++ webrtc::StreamConfig(impl->info.rate, impl->info.channels, false);
++ unsigned int num_blocks = n_samples * 1000 / impl->info.rate / 10;
++
++ if (n_samples * 1000 / impl->info.rate % 10 != 0) {
++ pw_log_error("Buffers must be multiples of 10ms in length (currently %u samples)", n_samples);
++ return -1;
++ }
++
++ for (size_t i = 0; i < num_blocks; i ++) {
++ for (size_t j = 0; j < impl->info.channels; j++) {
++ impl->play_buffer[j] = const_cast<float *>(play[j]) + config.num_frames() * i;
++ impl->rec_buffer[j] = const_cast<float *>(rec[j]) + config.num_frames() * i;
++ impl->out_buffer[j] = out[j] + config.num_frames() * i;
++ }
++ /* FIXME: ProcessReverseStream may change the playback buffer, in which
++ * case we should use that, if we ever expose the intelligibility
++ * enhancer */
++ if (impl->apm->ProcessReverseStream(impl->play_buffer.get(), config, config, impl->play_buffer.get()) !=
++ webrtc::AudioProcessing::kNoError) {
++ pw_log_error("Processing reverse stream failed");
++ }
++
++ // Extra delay introduced by multiple frames
++ impl->apm->set_stream_delay_ms((num_blocks - 1) * 10);
++
++ if (impl->apm->ProcessStream(impl->rec_buffer.get(), config, config, impl->out_buffer.get()) !=
++ webrtc::AudioProcessing::kNoError) {
++ pw_log_error("Processing stream failed");
++ }
++ }
++
++ return 0;
++}
++
++static const struct echo_cancel_info echo_cancel_webrtc_impl = {
++ .name = "webrtc",
++ .info = SPA_DICT_INIT(NULL, 0),
++ .latency = "480/48000",
++
++ .create = webrtc_create,
++ .destroy = webrtc_destroy,
++
++ .run = webrtc_run,
++};
++
++const struct echo_cancel_info *echo_cancel_webrtc = &echo_cancel_webrtc_impl;
+diff --git a/src/modules/module-echo-cancel/echo-cancel.h b/src/modules/module-echo-cancel/echo-cancel.h
+index ac83f70e4..fe011b962 100644
+--- a/src/modules/module-echo-cancel/echo-cancel.h
++++ b/src/modules/module-echo-cancel/echo-cancel.h
+@@ -22,13 +22,29 @@
+ * DEALINGS IN THE SOFTWARE.
+ */
+
++#include "config.h"
+
+ #include <spa/utils/dict.h>
+-#include <spa/utils/hook.h>
+ #include <spa/param/audio/raw.h>
+-#include <spa/support/plugin.h>
+
+ #include <pipewire/properties.h>
+
++struct echo_cancel_info {
++ const char *name;
++ const struct spa_dict info;
++ const char *latency;
++
++ void *(*create) (const struct pw_properties *args, const struct spa_audio_info_raw *info);
++ void (*destroy) (void *ec);
++
++ int (*run) (void *ec, const float *rec[], const float *play[], float *out[], uint32_t n_samples);
++};
++
+ #define echo_cancel_create(i,...) (i)->create(__VA_ARGS__)
++#define echo_cancel_destroy(i,...) (i)->destroy(__VA_ARGS__)
+ #define echo_cancel_run(i,...) (i)->run(__VA_ARGS__)
++
++#ifdef HAVE_WEBRTC
++extern const struct echo_cancel_info *echo_cancel_webrtc;
++#endif
++extern const struct echo_cancel_info *echo_cancel_null;
+--
+2.35.1
+
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0012-Miscellanous-changes-to-account-for-lower-version-of.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0012-Miscellanous-changes-to-account-for-lower-version-of.patch
new file mode 100644
index 000000000..69731a4f1
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0012-Miscellanous-changes-to-account-for-lower-version-of.patch
@@ -0,0 +1,166 @@
+From b781a4dbb45191a4b2746d5fe12d6f907681441c Mon Sep 17 00:00:00 2001
+From: Ashok Sidipotu <ashok.sidipotu@collabora.com>
+Date: Thu, 24 Feb 2022 12:28:59 +0530
+Subject: [PATCH 12/12] Miscellanous changes to account for lower version of
+ meson in agl
+
+Upstream-Status: Inappropriate[meson version dependent]
+---
+ meson.build | 30 ++++++++++++++-------------
+ spa/plugins/audioconvert/meson.build | 4 ++--
+ spa/tests/meson.build | 2 +-
+ src/daemon/systemd/system/meson.build | 5 +----
+ src/modules/meson.build | 18 +++-------------
+ src/tests/meson.build | 6 +++---
+ 6 files changed, 26 insertions(+), 39 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index af60472f8..7106eeaad 100644
+--- a/meson.build
++++ b/meson.build
+@@ -440,25 +440,27 @@ run_target('pw-uninstalled',
+ '-v@0@'.format(pipewire_version)]
+ )
+
+-devenv = environment()
++if meson.version().version_compare('>=0.58.0')
++ devenv = environment()
+
+-builddir = meson.project_build_root()
+-srcdir = meson.project_source_root()
++ builddir = meson.build_root()
++ srcdir = meson.source_root()
+
+-devenv.set('PIPEWIRE_CONFIG_DIR', pipewire_dep.get_variable(internal: 'confdatadir'))
+-devenv.set('PIPEWIRE_MODULE_DIR', pipewire_dep.get_variable(internal: 'moduledir'))
++ devenv.set('PIPEWIRE_CONFIG_DIR', pipewire_dep.get_variable(internal: 'confdatadir'))
++ devenv.set('PIPEWIRE_MODULE_DIR', pipewire_dep.get_variable(internal: 'moduledir'))
+
+- devenv.set('SPA_PLUGIN_DIR', builddir / 'spa' / 'plugins')
+- devenv.set('SPA_DATA_DIR', srcdir / 'spa' / 'plugins')
++ devenv.set('SPA_PLUGIN_DIR', builddir / 'spa' / 'plugins')
++ devenv.set('SPA_DATA_DIR', srcdir / 'spa' / 'plugins')
+
+-devenv.set('GST_PLUGIN_PATH', builddir / 'src'/ 'gst')
++ devenv.set('GST_PLUGIN_PATH', builddir / 'src'/ 'gst')
+
+-devenv.set('ALSA_PLUGIN_DIR', builddir / 'pipewire-alsa' / 'alsa-plugins')
+-devenv.set('ACP_PATHS_DIR', srcdir / 'spa' / 'plugins' / 'alsa' / 'mixer' / 'paths')
+-devenv.set('ACP_PROFILES_DIR', srcdir / 'spa' / 'plugins' / 'alsa' / 'mixer' / 'profile-sets')
++ devenv.set('ALSA_PLUGIN_DIR', builddir / 'pipewire-alsa' / 'alsa-plugins')
++ devenv.set('ACP_PATHS_DIR', srcdir / 'spa' / 'plugins' / 'alsa' / 'mixer' / 'paths')
++ devenv.set('ACP_PROFILES_DIR', srcdir / 'spa' / 'plugins' / 'alsa' / 'mixer' / 'profile-sets')
+
+-devenv.set('LD_LIBRARY_PATH', builddir / 'pipewire-jack' / 'src')
++ devenv.set('LD_LIBRARY_PATH', builddir / 'pipewire-jack' / 'src')
+
+-devenv.set('PW_UNINSTALLED', '1')
++ devenv.set('PW_UNINSTALLED', '1')
+
+-meson.add_devenv(devenv)
++ meson.add_devenv(devenv)
++endif
+diff --git a/spa/plugins/audioconvert/meson.build b/spa/plugins/audioconvert/meson.build
+index 3aa0f3846..6f4fd968b 100644
+--- a/spa/plugins/audioconvert/meson.build
++++ b/spa/plugins/audioconvert/meson.build
+@@ -140,7 +140,7 @@ foreach a : test_apps
+ install : installed_tests_enabled,
+ install_dir : installed_tests_execdir / 'audioconvert'),
+ env : [
+- 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()),
++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()),
+ ])
+
+ if installed_tests_enabled
+@@ -170,7 +170,7 @@ foreach a : benchmark_apps
+ install : installed_tests_enabled,
+ install_dir : installed_tests_execdir / 'audioconvert'),
+ env : [
+- 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()),
++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()),
+ ])
+
+ if installed_tests_enabled
+diff --git a/spa/tests/meson.build b/spa/tests/meson.build
+index d995cfaa4..ea00a2cfe 100644
+--- a/spa/tests/meson.build
++++ b/spa/tests/meson.build
+@@ -42,7 +42,7 @@ foreach a : benchmark_apps
+ install_dir : installed_tests_execdir,
+ ),
+ env : [
+- 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()),
++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()),
+ ]
+ )
+
+diff --git a/src/daemon/systemd/system/meson.build b/src/daemon/systemd/system/meson.build
+index b3e5f1f41..4d942c1ab 100644
+--- a/src/daemon/systemd/system/meson.build
++++ b/src/daemon/systemd/system/meson.build
+@@ -1,7 +1,4 @@
+-systemd_system_services_dir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir', pkgconfig_define : [ 'rootprefix', prefix])
+-if get_option('systemd-system-unit-dir') != ''
+- systemd_system_services_dir = get_option('systemd-system-unit-dir')
+-endif
++systemd_system_services_dir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir', pkgconfig_define : [ 'prefix', prefix])
+
+ install_data(sources : 'pipewire.socket',
+ install_dir : systemd_system_services_dir)
+diff --git a/src/modules/meson.build b/src/modules/meson.build
+index 568b32c50..8cf4f781d 100644
+--- a/src/modules/meson.build
++++ b/src/modules/meson.build
+@@ -150,18 +150,6 @@ pipewire_module_rt = shared_library('pipewire-module-rt', [ 'module-rt.c' ],
+ endif
+ summary({'rt': build_module_rt}, bool_yn: true, section: 'Optional Modules')
+
+-build_module_rtkit = dbus_dep.found()
+-if build_module_rtkit
+-pipewire_module_rtkit = shared_library('pipewire-module-rtkit', [ 'module-rtkit.c' ],
+- include_directories : [configinc, spa_inc],
+- install : true,
+- install_dir : modules_install_dir,
+- install_rpath: modules_install_dir,
+- dependencies : [dbus_dep, mathlib, dl_lib, pipewire_dep],
+-)
+-endif
+-summary({'rt': build_module_rt}, bool_yn: true, section: 'Optional Modules')
+-
+ build_module_portal = dbus_dep.found()
+ if build_module_portal
+ pipewire_module_portal = shared_library('pipewire-module-portal', [ 'module-portal.c' ],
+@@ -372,9 +360,9 @@ test('pw-test-protocol-native',
+ install_dir : installed_tests_execdir,
+ ),
+ env : [
+- 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()),
+- 'PIPEWIRE_CONFIG_DIR=@0@/src/daemon/'.format(meson.project_build_root()),
+- 'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.project_build_root())
++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()),
++ 'PIPEWIRE_CONFIG_DIR=@0@/src/daemon/'.format(meson.build_root()),
++ 'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.build_root())
+ ]
+ )
+
+diff --git a/src/tests/meson.build b/src/tests/meson.build
+index 9a595d431..1b03967fb 100644
+--- a/src/tests/meson.build
++++ b/src/tests/meson.build
+@@ -13,9 +13,9 @@ foreach a : test_apps
+ install : installed_tests_enabled,
+ install_dir : installed_tests_execdir),
+ env : [
+- 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()),
+- 'PIPEWIRE_CONFIG_DIR=@0@/src/daemon/'.format(meson.project_build_root()),
+- 'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.project_build_root())
++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()),
++ 'PIPEWIRE_CONFIG_DIR=@0@/src/daemon/'.format(meson.build_root()),
++ 'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.build_root())
+ ])
+
+ if installed_tests_enabled
+--
+2.35.1
+
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.43.bb b/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.47.bb
index f1d4b3863..c7479bec9 100644
--- a/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.43.bb
+++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.47.bb
@@ -20,8 +20,8 @@ SECTION = "multimedia"
DEPENDS = "dbus"
-# v0.3.43
-SRCREV = "07724b7aefa8a23a016727b53f4e426ecd63d248"
+# v0.3.47
+SRCREV = "2af393889358723a2789caa3c856700b1c968ef0"
SRC_URI = "git://gitlab.freedesktop.org/pipewire/pipewire.git;branch=master;protocol=https"
S = "${WORKDIR}/git"
@@ -242,6 +242,8 @@ FILES:${PN}-dev += " \
CONFFILES:libpipewire += "${datadir}/pipewire/client.conf"
FILES:libpipewire = " \
${datadir}/pipewire/client.conf \
+ ${datadir}/pipewire/client-rt.conf \
+ ${datadir}/pipewire/minimal.conf \
${libdir}/libpipewire-*.so.* \
"
# Add the bare minimum modules and plugins required to be able
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.43.bbappend b/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.47.bbappend
index 8d3df64cb..8c8467b52 100644
--- a/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.43.bbappend
+++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.47.bbappend
@@ -8,10 +8,17 @@ PACKAGECONFIG = "\
SRC_URI += "\
file://0001-Revert-treewide-meson.build-use-project_-build-sourc.patch \
- file://0002-Revert-treewide-meson.build-use-dependency-variable-.patch \
- file://0003-Revert-meson-declare-spa_dep-and-override_dependency.patch \
- file://0004-Revert-systemd-correctly-prefix-systemd-system-units.patch \
- file://0005-pipewiresink-set-a-default-channel-map-if-the-number.patch \
+ file://0002-Revert-treewide-meson.build-use-feature.allowed.patch \
+ file://0003-Revert-treewide-meson.build-use-dependency-variable-.patch \
+ file://0004-Revert-treewide-meson.build-simplify-get_variable-ca.patch \
+ file://0005-Revert-treewide-meson.build-get-SPA_PLUGIN_DIR-from-.patch \
+ file://0006-Revert-meson-declare-spa_dep-and-override_dependency.patch \
+ file://0007-Revert-meson-use-meson-variables-for-the-SMs-uninsta.patch \
+ file://0008-Revert-meson-declare-spa_dep-and-override_dependency.patch \
+ file://0009-Revert-test-add-test-for-the-loop.patch \
+ file://0010-Revert-spa-improve-the-AEC-interface.patch \
+ file://0011-Revert-module-echo-cancel-Move-backends-to-dynamic-l.patch \
+ file://0012-Miscellanous-changes-to-account-for-lower-version-of.patch \
"
do_install:append() {
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0002-Revert-tests-add-pipewire-env-variables-when-running.patch b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-Revert-tests-add-pipewire-env-variables-when-running.patch
index 7a24d1554..88301d56f 100644
--- a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0002-Revert-tests-add-pipewire-env-variables-when-running.patch
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-Revert-tests-add-pipewire-env-variables-when-running.patch
@@ -1,8 +1,8 @@
-From 4ea8ddc256df636208479a5b64bf8bdc6e413aca Mon Sep 17 00:00:00 2001
+From 1197f31d2b681d0cf0ca1309d50c8ab8ea80ac5e Mon Sep 17 00:00:00 2001
From: Ashok Sidipotu <ashok.sidipotu@collabora.com>
Date: Thu, 2 Dec 2021 16:57:54 +0530
-Subject: [PATCH] Revert "tests: add pipewire env variables when running tests,
- tidy up common_env"
+Subject: [PATCH 1/2] Revert "tests: add pipewire env variables when running
+ tests, tidy up common_env"
This reverts commit c24db9f3539f9b7ebe9e74c991cc3037f28ea22c.
@@ -75,7 +75,7 @@ index ffab80b..2fc46dc 100644
'-DG_LOG_USE_STRUCTURED',
]
diff --git a/tests/wp/meson.build b/tests/wp/meson.build
-index adc9cef..e75640c 100644
+index 178564d..b64ccae 100644
--- a/tests/wp/meson.build
+++ b/tests/wp/meson.build
@@ -1,7 +1,11 @@
@@ -94,7 +94,7 @@ index adc9cef..e75640c 100644
'-DG_LOG_USE_STRUCTURED',
]
diff --git a/tests/wplua/meson.build b/tests/wplua/meson.build
-index 128cc30..cd45c1c 100644
+index a7ff033..fcf4b51 100644
--- a/tests/wplua/meson.build
+++ b/tests/wplua/meson.build
@@ -1,13 +1,18 @@
@@ -120,19 +120,20 @@ index 128cc30..cd45c1c 100644
)
script_tester = executable('script-tester',
-@@ -20,10 +25,12 @@ test(
+@@ -20,6 +25,7 @@ test(
script_tester,
args: ['pod.lua'],
env: common_env,
+ workdir : meson.current_source_dir(),
)
test(
- 'test-lua-monitor-rules',
+ 'test-lua-json',
+@@ -32,4 +38,5 @@ test(
script_tester,
args: ['monitor-rules.lua'],
env: common_env,
+ workdir : meson.current_source_dir(),
)
--
-2.33.1
+2.35.1
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-Revert-wp-uninstalled-build-this-script-with-the-mes.patch b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0002-Revert-wp-uninstalled-build-this-script-with-the-mes.patch
index 658b89946..d20634d8b 100644
--- a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-Revert-wp-uninstalled-build-this-script-with-the-mes.patch
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0002-Revert-wp-uninstalled-build-this-script-with-the-mes.patch
@@ -1,11 +1,10 @@
-From 78cde5e91ba5d9aa7bfe918ce6bad3b4af30c796 Mon Sep 17 00:00:00 2001
+From 8e959b7894047030edca21a04dd91994e8868a1f Mon Sep 17 00:00:00 2001
From: Ashok Sidipotu <ashok.sidipotu@collabora.com>
-Date: Fri, 14 Jan 2022 20:14:56 +0530
-Subject: [PATCH] Revert "wp-uninstalled: build this script with the meson dirs
- filled in"
+Date: Fri, 25 Feb 2022 06:05:43 +0530
+Subject: [PATCH 2/2] Revert "wp-uninstalled: build this script with the meson
+ dirs filled in"
This reverts commit 52aaf96179584292f493c4b329bc2c409e6d3dee.
-
Upstream-Status: Inappropriate[meson version dependent]
---
meson.build | 31 -------------------------------
@@ -13,7 +12,7 @@ Upstream-Status: Inappropriate[meson version dependent]
2 files changed, 2 insertions(+), 40 deletions(-)
diff --git a/meson.build b/meson.build
-index 1f9c9d8..7e02b29 100644
+index e4323dc..185248f 100644
--- a/meson.build
+++ b/meson.build
@@ -120,34 +120,3 @@ subdir('src')
@@ -74,5 +73,5 @@ index 79e53f2..d6279ff 100755
while getopts ":b:c:" opt; do
--
-2.33.1
+2.35.1
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0003-spa-json-fix-va_list-APIs-for-different-architecture.patch b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0003-spa-json-fix-va_list-APIs-for-different-architecture.patch
new file mode 100644
index 000000000..9d0c68d58
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0003-spa-json-fix-va_list-APIs-for-different-architecture.patch
@@ -0,0 +1,214 @@
+From ae6c9a5e612c343dd307fe34a1a282b7a4f17a5c Mon Sep 17 00:00:00 2001
+From: Julian Bouzas <julian.bouzas@collabora.com>
+Date: Wed, 9 Feb 2022 07:59:59 -0500
+Subject: [PATCH 3/3] 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.
+
+Upstream-Status: Backport
+---
+ 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 f14f395..c5e59a3 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) { \
++ 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: \
++ break; \
++ } \
++} while(false)
+
+ /*!
+ * \brief Creates a spa json of type array
+@@ -724,48 +724,46 @@ wp_spa_json_parse_object_valist (WpSpaJson *self, va_list args)
+ return res;
+ }
+
+-static gboolean
+-wp_spa_json_parse_value (const gchar *data, int len, const gchar *fmt,
+- va_list args)
+-{
+- switch (*fmt) {
+- case 'n':
+- if (!spa_json_is_null (data, len))
+- return FALSE;
+- break;
+- case 'b':
+- if (!wp_spa_json_parse_boolean_internal (data, len,
+- va_arg(args, gboolean *)))
+- return FALSE;
+- break;
+- case 'i':
+- if (spa_json_parse_int (data, len, va_arg(args, gint *)) < 0)
+- return FALSE;
+- break;
+- case 'f':
+- if (spa_json_parse_float (data, len,
+- (float *)va_arg(args, double *)) < 0)
+- return FALSE;
+- break;
+- case 's': {
+- gchar *str = wp_spa_json_parse_string_internal (data, len);
+- if (!str)
+- return FALSE;
+- *va_arg(args, gchar **) = str;
+- break;
+- }
+- case 'J': {
+- WpSpaJson *j = wp_spa_json_new (data, len);
+- if (!j)
+- return FALSE;
+- *va_arg(args, WpSpaJson **) = j;
+- break;
+- }
+- default:
+- return FALSE;
+- }
+- return TRUE;
+-}
++/* Args is not a pointer in some architectures, so this needs to be a macro to
++ * avoid args being copied */
++#define wp_spa_json_parse_value(data,len,fmt,args) \
++do { \
++ switch (*fmt) { \
++ case 'n': \
++ if (!spa_json_is_null (data, len)) \
++ return FALSE; \
++ break; \
++ case 'b': \
++ if (!wp_spa_json_parse_boolean_internal (data, len, \
++ va_arg(args, gboolean *))) \
++ return FALSE; \
++ break; \
++ case 'i': \
++ if (spa_json_parse_int (data, len, va_arg(args, gint *)) < 0) \
++ return FALSE; \
++ break; \
++ case 'f': \
++ if (spa_json_parse_float (data, len, va_arg(args, float *)) < 0) \
++ return FALSE; \
++ break; \
++ case 's': { \
++ gchar *str = wp_spa_json_parse_string_internal (data, len); \
++ if (!str) \
++ return FALSE; \
++ *va_arg(args, gchar **) = str; \
++ break; \
++ } \
++ case 'J': { \
++ WpSpaJson *j = wp_spa_json_new (data, len); \
++ if (!j) \
++ return FALSE; \
++ *va_arg(args, WpSpaJson **) = j; \
++ break; \
++ } \
++ default: \
++ return FALSE; \
++ } \
++} while(false)
+
+ /*!
+ * \brief Parses the object property values of a spa json object
+@@ -827,8 +825,7 @@ wp_spa_json_object_get_valist (WpSpaJson *self, va_list args)
+ value = g_value_get_boxed (&item);
+
+ if (g_strcmp0 (key_str, lookup_key) == 0) {
+- if (!wp_spa_json_parse_value (value->data, value->size, lookup_fmt, args))
+- return FALSE;
++ wp_spa_json_parse_value (value->data, value->size, lookup_fmt, args);
+ lookup_key = va_arg(args, const gchar *);
+ if (!lookup_key)
+ return TRUE;
+@@ -1366,9 +1363,12 @@ gboolean
+ wp_spa_json_parser_get_value (WpSpaJsonParser *self, const gchar *fmt,
+ va_list args)
+ {
+- return wp_spa_json_parser_advance (self) &&
+- wp_spa_json_parse_value (self->curr.cur,
+- self->curr.end - self->curr.cur, fmt, args);
++ if (wp_spa_json_parser_advance (self)) {
++ wp_spa_json_parse_value (self->curr.cur, self->curr.end - self->curr.cur,
++ fmt, args);
++ return TRUE;
++ }
++ return FALSE;
+ }
+
+ /*!
+@@ -1419,9 +1419,13 @@ wp_spa_json_parser_get_valist (WpSpaJsonParser *self, va_list args)
+ if (!format)
+ return TRUE;
+
+- /* parse value */
+- if (!wp_spa_json_parser_get_value (self, format, args))
++ /* advance */
++ if (!wp_spa_json_parser_advance (self))
+ return FALSE;
++
++ /* parse value */
++ wp_spa_json_parse_value (self->curr.cur, self->curr.end - self->curr.cur,
++ format, args);
+ } while (TRUE);
+
+ return FALSE;
+--
+2.35.1
+
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb
index a08ebbbed..f42b12770 100644
--- a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb
@@ -14,16 +14,17 @@ DEPENDS = "glib-2.0 glib-2.0-native pipewire lua"
SRC_URI = "\
git://gitlab.freedesktop.org/pipewire/wireplumber.git;protocol=https;branch=master \
"
-# v0.4.7
-SRCREV = "afb177b5e0840d54dc41d02920702c3c9580ce02"
+# v0.4.8
+SRCREV = "e14bb72dcc85e2130d0ea96768e5ae3b375a041e"
# patches to be able to compile with lower version of meson that is available in AGL.
SRC_URI += "\
- file://0001-Revert-wp-uninstalled-build-this-script-with-the-mes.patch \
- file://0002-Revert-tests-add-pipewire-env-variables-when-running.patch \
+ file://0001-Revert-tests-add-pipewire-env-variables-when-running.patch \
+ file://0002-Revert-wp-uninstalled-build-this-script-with-the-mes.patch \
+ file://0003-spa-json-fix-va_list-APIs-for-different-architecture.patch \
"
-PV = "0.4.5"
+PV = "0.4.8"
S = "${WORKDIR}/git"
WPAPI="0.4"