From 9653de99a5452bb419f2f694553cfb66fabfbf01 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Thu, 3 Feb 2022 17:46:24 -0500 Subject: pipewire: remove old meson compatibility patches Remove accumulated patches to PipeWire that allowed building it with the older meson in dunfell, as they break building it newer meson in poky master/kirkstone. A fix contained in one of those patches for installing the systemd system unit has been reworked and added as a new separate patch. Bug-AGL: SPEC-3819 Signed-off-by: Scott Murray Change-Id: I949875339b500c9ccd8590a635f7734158617579 --- ...wide-meson.build-use-project_-build-sourc.patch | 182 ---- .../0001-systemd-Do-not-override-rootprefix.patch | 35 + .../0002-Revert-loop-remove-destroy-list.patch | 120 ++ ...-treewide-meson.build-use-feature.allowed.patch | 277 ----- ...wide-meson.build-use-dependency-variable-.patch | 1141 -------------------- ...wide-meson.build-simplify-get_variable-ca.patch | 130 --- ...wide-meson.build-get-SPA_PLUGIN_DIR-from-.patch | 124 --- ...n-declare-spa_dep-and-override_dependency.patch | 82 -- ...n-use-meson-variables-for-the-SMs-uninsta.patch | 47 - ...n-declare-spa_dep-and-override_dependency.patch | 31 - .../0009-Revert-test-add-test-for-the-loop.patch | 32 - ...0010-Revert-spa-improve-the-AEC-interface.patch | 502 --------- ...le-echo-cancel-Move-backends-to-dynamic-l.patch | 1055 ------------------ ...s-changes-to-account-for-lower-version-of.patch | 166 --- .../0013-Revert-loop-remove-destroy-list.patch | 120 -- .../pipewire/pipewire_0.3.47.bbappend | 21 +- 16 files changed, 160 insertions(+), 3905 deletions(-) delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-Revert-treewide-meson.build-use-project_-build-sourc.patch create mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-systemd-Do-not-override-rootprefix.patch create mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-loop-remove-destroy-list.patch delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-treewide-meson.build-use-feature.allowed.patch delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-Revert-treewide-meson.build-use-dependency-variable-.patch delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-Revert-treewide-meson.build-simplify-get_variable-ca.patch delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-Revert-treewide-meson.build-get-SPA_PLUGIN_DIR-from-.patch delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0006-Revert-meson-declare-spa_dep-and-override_dependency.patch delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0007-Revert-meson-use-meson-variables-for-the-SMs-uninsta.patch delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0008-Revert-meson-declare-spa_dep-and-override_dependency.patch delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0009-Revert-test-add-test-for-the-loop.patch delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0010-Revert-spa-improve-the-AEC-interface.patch delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0011-Revert-module-echo-cancel-Move-backends-to-dynamic-l.patch delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0012-Miscellanous-changes-to-account-for-lower-version-of.patch delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0013-Revert-loop-remove-destroy-list.patch (limited to 'meta-pipewire/recipes-multimedia') 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 deleted file mode 100644 index 89507df60..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-Revert-treewide-meson.build-use-project_-build-sourc.patch +++ /dev/null @@ -1,182 +0,0 @@ -From 7bf582601f73c5f796b23a7cc2868424b03a0fd1 Mon Sep 17 00:00:00 2001 -From: Ashok Sidipotu -Date: Fri, 14 Jan 2022 16:12:55 +0530 -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/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 7e876bce5..95fecffc2 100644 ---- a/doc/meson.build -+++ b/doc/meson.build -@@ -1,8 +1,8 @@ - doxyfile_conf = configuration_data() - doxyfile_conf.set('PACKAGE_NAME', meson.project_name()) - doxyfile_conf.set('PACKAGE_VERSION', meson.project_version()) --doxyfile_conf.set('top_srcdir', meson.project_source_root()) --doxyfile_conf.set('top_builddir', meson.project_build_root()) -+doxyfile_conf.set('top_srcdir', meson.source_root()) -+doxyfile_conf.set('top_builddir', meson.build_root()) - - dot_found = find_program('dot', required: false).found() - summary({'dot (used with doxygen)': dot_found}, bool_yn: true, section: 'Optional programs') -@@ -48,35 +48,35 @@ extra_docs = [ - - inputs = [] - foreach extra : extra_docs -- inputs += meson.project_source_root() / 'doc' / extra -+ inputs += meson.source_root() / 'doc' / extra - endforeach - foreach h : pipewire_headers -- inputs += meson.project_source_root() / 'src' / 'pipewire' / h -+ inputs += meson.source_root() / 'src' / 'pipewire' / h - endforeach - foreach h : pipewire_ext_headers -- inputs += meson.project_source_root() / 'src' / 'pipewire' / 'extensions' / h -+ inputs += meson.source_root() / 'src' / 'pipewire' / 'extensions' / h - endforeach - foreach h : pipewire_ext_sm_headers -- inputs += meson.project_source_root() / 'src' / 'pipewire' / 'extensions' / h -+ inputs += meson.source_root() / 'src' / 'pipewire' / 'extensions' / h - endforeach - foreach h : pipewire_sources -- inputs += meson.project_source_root() / 'src' / 'pipewire' / h -+ inputs += meson.source_root() / 'src' / 'pipewire' / h - endforeach - foreach h : module_sources -- inputs += meson.project_source_root() / 'src' / 'modules' / h -+ inputs += meson.source_root() / 'src' / 'modules' / h - endforeach --inputs += meson.project_source_root() / 'test' / 'pwtest.h' --input_dirs = [ meson.project_source_root() / 'spa' / 'include' / 'spa' ] -+inputs += meson.source_root() / 'test' / 'pwtest.h' -+input_dirs = [ meson.source_root() / 'spa' / 'include' / 'spa' ] - - path_prefixes = [ -- meson.project_source_root() / 'src', -- meson.project_source_root() / 'spa' / 'include', -- meson.project_source_root(), -+ meson.source_root() / 'src', -+ meson.source_root() / 'spa' / 'include', -+ meson.source_root(), - ] - - cssfiles = [ -- meson.project_source_root() / 'doc' / 'doxygen-awesome.css', -- meson.project_source_root() / 'doc' / 'custom.css' -+ meson.source_root() / 'doc' / 'doxygen-awesome.css', -+ meson.source_root() / 'doc' / 'custom.css' - ] - - # Example files (in order from simple to esoteric) -@@ -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)) --doxyfile_conf.set('c_input_filter', meson.project_source_root() / 'doc' / 'input-filter.sh') --doxyfile_conf.set('h_input_filter', meson.project_source_root() / 'doc' / 'input-filter-h.sh') -+doxyfile_conf.set('c_input_filter', meson.source_root() / 'doc' / 'input-filter.sh') -+doxyfile_conf.set('h_input_filter', meson.source_root() / 'doc' / 'input-filter-h.sh') - - doxyfile = configure_file(input: 'Doxyfile.in', - output: 'Doxyfile', -diff --git a/meson.build b/meson.build -index 440845e37..338192073 100644 ---- a/meson.build -+++ b/meson.build -@@ -247,9 +247,9 @@ includes_inc = include_directories('include') - pipewire_inc = include_directories('src') - - makedata = configuration_data() --makedata.set('BUILD_ROOT', meson.project_build_root()) --makedata.set('SOURCE_ROOT', meson.project_source_root()) --makedata.set('VERSION', pipewire_version) -+ makedata.set('BUILD_ROOT', meson.build_root()) -+ makedata.set('SOURCE_ROOT', meson.source_root()) -+ makedata.set('VERSION', pipewire_version) - if version_arr.length() == 4 - makedata.set('TAG', 'HEAD') - else -@@ -436,7 +436,7 @@ endif - setenv = find_program('pw-uninstalled.sh') - run_target('pw-uninstalled', - command : [setenv, -- '-b@0@'.format(meson.project_build_root()), -+ '-b@0@'.format(meson.build_root()), - '-v@0@'.format(pipewire_version)] - ) - -diff --git a/spa/tests/meson.build b/spa/tests/meson.build -index c73c887f4..9c78dcbd2 100644 ---- a/spa/tests/meson.build -+++ b/spa/tests/meson.build -@@ -5,7 +5,7 @@ find = find_program('find', required: false) - summary({'find (for header testing)': find.found()}, bool_yn: true, section: 'Optional programs') - if find.found() - spa_headers = run_command(find, -- meson.project_source_root() / 'spa' / 'include', -+ meson.source_root() / 'spa' / 'include', - '-name', '*.h', - '-not', '-name', 'type-info.h', - '-type', 'f', -@@ -41,7 +41,7 @@ foreach a : benchmark_apps - install_dir : installed_tests_execdir, - ), - env : [ -- '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 a2e4c55e3..647d7393d 100644 ---- a/src/daemon/meson.build -+++ b/src/daemon/meson.build -@@ -18,9 +18,9 @@ conf_config.set('pulse_comment', '#') - - conf_config_uninstalled = conf_config - conf_config_uninstalled.set('pipewire_path', -- meson.project_build_root() / 'src' / 'daemon' / 'pipewire') -+ meson.build_root() / 'src' / 'daemon' / 'pipewire') - conf_config_uninstalled.set('pipewire_pulse_path', -- meson.project_build_root() / 'src' / 'daemon' / 'pipewire-pulse') -+ meson.build_root() / 'src' / 'daemon' / 'pipewire-pulse') - conf_config_uninstalled.set('pulse_comment', '') - - build_ms = 'media-session' in get_option('session-managers') -@@ -106,7 +106,7 @@ custom_target('pipewire-uninstalled', - install: false, - input: pipewire_exec, - output: 'pipewire-uninstalled', -- command: [ln, '-fs', meson.project_build_root() + '/@INPUT@', '@OUTPUT@'], -+ command: [ln, '-fs', meson.build_root() + '/@INPUT@', '@OUTPUT@'], - ) - - #desktop_file = i18n.merge_file( -diff --git a/test/meson.build b/test/meson.build -index 74908d587..eca92eb24 100644 ---- a/test/meson.build -+++ b/test/meson.build -@@ -14,8 +14,8 @@ pwtest_deps = [ - ] - - pwtest_c_args = [ -- '-DBUILD_ROOT="@0@"'.format(meson.project_build_root()), -- '-DSOURCE_ROOT="@0@"'.format(meson.project_source_root()), -+ '-DBUILD_ROOT="@0@"'.format(meson.build_root()), -+ '-DSOURCE_ROOT="@0@"'.format(meson.source_root()), - ] - - pwtest_inc = [ --- -2.35.1 - diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-systemd-Do-not-override-rootprefix.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-systemd-Do-not-override-rootprefix.patch new file mode 100644 index 000000000..45d09e6b0 --- /dev/null +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-systemd-Do-not-override-rootprefix.patch @@ -0,0 +1,35 @@ +From 2501972518a67b1710998452d164cd077a4370f1 Mon Sep 17 00:00:00 2001 +From: Scott Murray +Date: Thu, 17 Mar 2022 10:44:00 -0400 +Subject: [PATCH] systemd: Do not override rootprefix + +Do not override rootprefix with the value of prefix when querying +systemdsystemunitdir from the systemd pkgconfig, as doing so forces +the assumption that the system is running with usrmerge, which may +not be the case. Instead, rely on the systemd.pc correctly +representing the desired install locations. + +Reworked version of change in: + +https://git.automotivelinux.org/AGL/meta-agl/tree/meta-pipewire/recipes-multimedia/pipewire/pipewire/0012-Miscellanous-changes-to-account-for-lower-version-of.patch + +Upstream-Status: Pending + +Signed-off-by: Scott Murray +--- + 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 84ca0b068..6956f2be3 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('systemdsystemunitdir') + if get_option('systemd-system-unit-dir') != '' + systemd_system_services_dir = get_option('systemd-system-unit-dir') + endif +-- +2.35.1 + diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-loop-remove-destroy-list.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-loop-remove-destroy-list.patch new file mode 100644 index 000000000..8a988b024 --- /dev/null +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-loop-remove-destroy-list.patch @@ -0,0 +1,120 @@ +From 16f63a3c8fa227625bade5a9edea22354b347d18 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= +Date: Fri, 18 Feb 2022 18:36:36 +0100 +Subject: [PATCH] Revert "loop: remove destroy list" + +This reverts commit c474846c42967c44db069a23b76a29da6f496f33. +In addition, `s->loop` is also checked before dispatching a source. + +The destroy list is needed in the presence of threads. The +issue is that a source may be destroyed between `epoll_wait()` +returning and thread loop lock being acquired. If this +source is active, then a use-after-free will be triggered +when the thread loop acquires the lock and starts dispatching +the sources. + + thread 1 thread 2 + ---------- ---------- + loop_iterate + spa_loop_control_hook_before + // release lock + + pw_thread_loop_lock + + spa_system_pollfd_wait + // assume it returns with source A + + pw_loop_destroy_source(..., A) + // frees storage of A + + pw_thread_loop_unlock + spa_loop_control_hook_after + // acquire the lock + + for (...) { + struct spa_source *s = ep[i].data; + s->rmask = ep[i].events; + // use-after-free if `s` refers to + // the previously freed `A` + +Fixes #2147 + +Upstream-Status: Backport [https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/16f63a3c] +Signed-off-by: Scott Murray + +--- + spa/plugins/support/loop.c | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +diff --git a/spa/plugins/support/loop.c b/spa/plugins/support/loop.c +index 0588ce770..04739eb2a 100644 +--- a/spa/plugins/support/loop.c ++++ b/spa/plugins/support/loop.c +@@ -75,6 +75,7 @@ struct impl { + struct spa_system *system; + + struct spa_list source_list; ++ struct spa_list destroy_list; + struct spa_hook_list hooks_list; + + int poll_fd; +@@ -325,6 +326,14 @@ static void loop_leave(void *object) + impl->thread = 0; + } + ++static inline void process_destroy(struct impl *impl) ++{ ++ struct source_impl *source, *tmp; ++ spa_list_for_each_safe(source, tmp, &impl->destroy_list, link) ++ free(source); ++ spa_list_init(&impl->destroy_list); ++} ++ + static int loop_iterate(void *object, int timeout) + { + struct impl *impl = object; +@@ -354,11 +363,14 @@ static int loop_iterate(void *object, int timeout) + } + for (i = 0; i < nfds; i++) { + struct spa_source *s = ep[i].data; +- if (SPA_LIKELY(s && s->rmask)) { ++ if (SPA_LIKELY(s && s->rmask && s->loop)) { + s->priv = NULL; + s->func(s); + } + } ++ if (SPA_UNLIKELY(!spa_list_is_empty(&impl->destroy_list))) ++ process_destroy(impl); ++ + return nfds; + } + +@@ -712,7 +724,7 @@ static void loop_destroy_source(void *object, struct spa_source *source) + spa_system_close(impl->impl->system, source->fd); + source->fd = -1; + } +- free(source); ++ spa_list_insert(&impl->impl->destroy_list, &impl->link); + } + + static const struct spa_loop_methods impl_loop = { +@@ -783,6 +795,8 @@ static int impl_clear(struct spa_handle *handle) + spa_list_consume(source, &impl->source_list, link) + loop_destroy_source(impl, &source->source); + ++ process_destroy(impl); ++ + spa_system_close(impl->system, impl->ack_fd); + spa_system_close(impl->system, impl->poll_fd); + +@@ -844,6 +858,7 @@ impl_init(const struct spa_handle_factory *factory, + impl->poll_fd = res; + + spa_list_init(&impl->source_list); ++ spa_list_init(&impl->destroy_list); + spa_hook_list_init(&impl->hooks_list); + + impl->buffer_data = SPA_PTR_ALIGN(impl->buffer_mem, MAX_ALIGN, uint8_t); +-- +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 deleted file mode 100644 index eaef35c2e..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-treewide-meson.build-use-feature.allowed.patch +++ /dev/null @@ -1,277 +0,0 @@ -From 6dec8c7faf57a1bd0162a4e790ed031945588d98 Mon Sep 17 00:00:00 2001 -From: Ashok Sidipotu -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/0003-Revert-treewide-meson.build-use-dependency-variable-.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-Revert-treewide-meson.build-use-dependency-variable-.patch deleted file mode 100644 index 40735422f..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-Revert-treewide-meson.build-use-dependency-variable-.patch +++ /dev/null @@ -1,1141 +0,0 @@ -From 8eda9c8d98d14dfc411e22c30e81fa32a5cb2f56 Mon Sep 17 00:00:00 2001 -From: Ashok Sidipotu -Date: Fri, 14 Jan 2022 18:23:54 +0530 -Subject: [PATCH 03/12] Revert "treewide: meson.build: use dependency variable - for SPA" - -This reverts commit 2b110af36683f13f2b55064dec4ae02c1b407561. - -Upstream-Status: Inappropriate[meson version dependent] ---- - spa/examples/meson.build | 4 +- - spa/meson.build | 42 ++++++------- - spa/plugins/alsa/acp/meson.build | 4 +- - 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/control/meson.build | 3 +- - spa/plugins/ffmpeg/meson.build | 3 +- - spa/plugins/jack/meson.build | 3 +- - spa/plugins/libcamera/meson.build | 3 +- - spa/plugins/support/meson.build | 14 +++-- - spa/plugins/test/meson.build | 3 +- - spa/plugins/v4l2/meson.build | 3 +- - spa/plugins/videoconvert/meson.build | 3 +- - spa/plugins/videotestsrc/meson.build | 3 +- - spa/plugins/volume/meson.build | 2 +- - spa/plugins/vulkan/meson.build | 3 +- - spa/tests/meson.build | 5 +- - spa/tools/meson.build | 9 ++- - src/daemon/meson.build | 8 +-- - src/gst/meson.build | 4 +- - src/modules/meson.build | 88 ++++++++++++++++------------ - src/modules/spa/meson.build | 16 ++--- - src/pipewire/meson.build | 4 +- - 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 ---- a/spa/examples/meson.build -+++ b/spa/examples/meson.build -@@ -23,8 +23,8 @@ foreach c : spa_examples - executable( - c, - c + '.c', -- include_directories : [configinc], -- dependencies : [spa_dep, dl_lib, pthread_lib, mathlib] + deps, -+ include_directories : [configinc, spa_inc], -+ dependencies : [dl_lib, pthread_lib, mathlib] + deps, - install : installed_tests_enabled, - install_dir : installed_tests_execdir / 'examples' / 'spa' - ) -diff --git a/spa/meson.build b/spa/meson.build -index 2404748df..2717b86d6 100644 ---- a/spa/meson.build -+++ b/spa/meson.build -@@ -5,29 +5,7 @@ - #pthread_lib = dependencies('threads') - #mathlib = cc.find_library('m', required : false) - --spa_dep = declare_dependency( -- include_directories : [ -- include_directories('include'), -- ], -- dependencies : [atomic_dep], -- version : spaversion, -- variables : { -- 'plugindir' : meson.current_build_dir() / 'plugins', -- 'datadir' : meson.current_source_dir() / 'plugins', -- }, --) -- --meson.override_dependency('lib@0@'.format(spa_name), spa_dep) -- --pkgconfig.generate(filebase : 'lib@0@'.format(spa_name), -- name : 'libspa', -- subdirs : spa_name, -- description : 'Simple Plugin API', -- version : spaversion, -- extra_cflags : '-D_REENTRANT', -- variables : ['plugindir=${libdir}/@0@'.format(spa_name)], -- uninstalled_variables : ['plugindir=${prefix}/spa/plugins'], --) -+spa_inc = include_directories('include') - - subdir('include') - -@@ -77,3 +55,21 @@ subdir('tests') - if not get_option('examples').disabled() - subdir('examples') - endif -+ -+spa_dep = declare_dependency( -+ include_directories : [spa_inc], -+ version : spaversion, -+ variables : { 'plugindir' : meson.current_build_dir() / 'plugins' } -+) -+ -+pkgconfig.generate(filebase : 'lib@0@'.format(spa_name), -+ name : 'libspa', -+ subdirs : spa_name, -+ description : 'Simple Plugin API', -+ version : spaversion, -+ extra_cflags : '-D_REENTRANT', -+ variables : ['plugindir=${libdir}/@0@'.format(spa_name)], -+ uninstalled_variables : ['plugindir=${prefix}/spa/plugins'], -+) -+ -+meson.override_dependency('lib@0@'.format(spa_name), spa_dep) -diff --git a/spa/plugins/alsa/acp/meson.build b/spa/plugins/alsa/acp/meson.build -index 0ec97e2b4..3686aec82 100644 ---- a/spa/plugins/alsa/acp/meson.build -+++ b/spa/plugins/alsa/acp/meson.build -@@ -16,7 +16,7 @@ acp_lib = static_library( - 'acp', - acp_sources, - c_args : acp_c_args, -- include_directories : [configinc, includes_inc ], -- dependencies : [ spa_dep, alsa_dep, mathlib, ] -+ include_directories : [configinc, spa_inc, includes_inc ], -+ dependencies : [ alsa_dep, mathlib, ] - ) - acp_dep = declare_dependency(link_with: acp_lib) -diff --git a/spa/plugins/alsa/meson.build b/spa/plugins/alsa/meson.build -index e3fa6f0d7..402d93486 100644 ---- a/spa/plugins/alsa/meson.build -+++ b/spa/plugins/alsa/meson.build -@@ -16,8 +16,8 @@ spa_alsa = shared_library( - 'spa-alsa', - [ spa_alsa_sources ], - c_args : acp_c_args, -- include_directories : [configinc], -- dependencies : [ spa_dep, alsa_dep, libudev_dep, mathlib, epoll_shim_dep, libinotify_dep ], -+ include_directories : [spa_inc, configinc], -+ dependencies : [ alsa_dep, libudev_dep, mathlib, epoll_shim_dep, libinotify_dep ], - link_with : [ acp_lib ], - install : true, - install_dir : spa_plugindir / 'alsa' -@@ -30,7 +30,8 @@ alsa_udevrules = [ - executable('spa-acp-tool', - [ 'acp-tool.c' ], - c_args : acp_c_args, -- dependencies : [ spa_dep, alsa_dep, mathlib, acp_dep ], -+ include_directories : [spa_inc ], -+ dependencies : [ alsa_dep, mathlib, acp_dep ], - install : true, - ) - -diff --git a/spa/plugins/audioconvert/meson.build b/spa/plugins/audioconvert/meson.build -index 89af12671..55e88ccc4 100644 ---- a/spa/plugins/audioconvert/meson.build -+++ b/spa/plugins/audioconvert/meson.build -@@ -17,7 +17,7 @@ if have_sse - 'volume-ops-sse.c', - 'channelmix-ops-sse.c' ], - c_args : [sse_args, '-O3', '-DHAVE_SSE'], -- dependencies : [ spa_dep ], -+ include_directories : [spa_inc], - install : false - ) - simd_cargs += ['-DHAVE_SSE'] -@@ -27,7 +27,7 @@ if have_sse2 - audioconvert_sse2 = static_library('audioconvert_sse2', - ['fmt-ops-sse2.c' ], - c_args : [sse2_args, '-O3', '-DHAVE_SSE2'], -- dependencies : [ spa_dep ], -+ include_directories : [spa_inc], - install : false - ) - simd_cargs += ['-DHAVE_SSE2'] -@@ -38,7 +38,7 @@ if have_ssse3 - ['fmt-ops-ssse3.c', - 'resample-native-ssse3.c' ], - c_args : [ssse3_args, '-O3', '-DHAVE_SSSE3'], -- dependencies : [ spa_dep ], -+ include_directories : [spa_inc], - install : false - ) - simd_cargs += ['-DHAVE_SSSE3'] -@@ -48,7 +48,7 @@ if have_sse41 - audioconvert_sse41 = static_library('audioconvert_sse41', - ['fmt-ops-sse41.c'], - c_args : [sse41_args, '-O3', '-DHAVE_SSE41'], -- dependencies : [ spa_dep ], -+ include_directories : [spa_inc], - install : false - ) - simd_cargs += ['-DHAVE_SSE41'] -@@ -58,7 +58,7 @@ if have_avx and have_fma - audioconvert_avx = static_library('audioconvert_avx', - ['resample-native-avx.c'], - c_args : [avx_args, fma_args, '-O3', '-DHAVE_AVX', '-DHAVE_FMA'], -- dependencies : [ spa_dep ], -+ include_directories : [spa_inc], - install : false - ) - simd_cargs += ['-DHAVE_AVX', '-DHAVE_FMA'] -@@ -68,7 +68,7 @@ if have_avx2 - audioconvert_avx2 = static_library('audioconvert_avx2', - ['fmt-ops-avx2.c'], - c_args : [avx2_args, '-O3', '-DHAVE_AVX2'], -- dependencies : [ spa_dep ], -+ include_directories : [spa_inc], - install : false - ) - simd_cargs += ['-DHAVE_AVX2'] -@@ -80,7 +80,7 @@ if have_neon - ['resample-native-neon.c', - 'fmt-ops-neon.c' ], - c_args : [neon_args, '-O3', '-DHAVE_NEON'], -- dependencies : [ spa_dep ], -+ include_directories : [spa_inc], - install : false - ) - simd_cargs += ['-DHAVE_NEON'] -@@ -100,8 +100,7 @@ audioconvert_lib = static_library('audioconvert', - 'volume-ops-c.c' ], - c_args : [ simd_cargs, '-O3'], - link_with : simd_dependencies, -- include_directories : [configinc], -- dependencies : [ spa_dep ], -+ include_directories : [configinc, spa_inc], - install : false - ) - audioconvert_dep = declare_dependency(link_with: audioconvert_lib) -@@ -109,7 +108,8 @@ audioconvert_dep = declare_dependency(link_with: audioconvert_lib) - spa_audioconvert_lib = shared_library('spa-audioconvert', - audioconvert_sources, - c_args : simd_cargs, -- dependencies : [ spa_dep, mathlib, audioconvert_dep ], -+ include_directories : [spa_inc], -+ dependencies : [ mathlib, audioconvert_dep ], - install : true, - install_dir : spa_plugindir / 'audioconvert') - spa_audioconvert_dep = declare_dependency(link_with: spa_audioconvert_lib) -@@ -117,7 +117,7 @@ spa_audioconvert_dep = declare_dependency(link_with: spa_audioconvert_lib) - test_lib = static_library('test_lib', - ['test-source.c' ], - c_args : ['-O3'], -- dependencies : [ spa_dep ], -+ include_directories : [spa_inc], - install : false - ) - -@@ -132,8 +132,8 @@ test_apps = [ - foreach a : test_apps - test(a, - executable(a, a + '.c', -- dependencies : [ spa_dep, dl_lib, pthread_lib, mathlib, audioconvert_dep, spa_audioconvert_dep ], -- include_directories : [ configinc ], -+ dependencies : [ dl_lib, pthread_lib, mathlib, audioconvert_dep, spa_audioconvert_dep ], -+ include_directories : [ configinc, spa_inc ], - link_with : [ test_lib ], - install_rpath : spa_plugindir / 'audioconvert', - c_args : [ simd_cargs ], -@@ -163,8 +163,8 @@ benchmark_apps = [ - foreach a : benchmark_apps - benchmark(a, - executable(a, a + '.c', -- dependencies : [ spa_dep, dl_lib, pthread_lib, mathlib, audioconvert_dep, spa_audioconvert_dep ], -- include_directories : [ configinc ], -+ dependencies : [ dl_lib, pthread_lib, mathlib, audioconvert_dep, spa_audioconvert_dep ], -+ include_directories : [ configinc, spa_inc ], - c_args : [ simd_cargs ], - install_rpath : spa_plugindir / 'audioconvert', - install : installed_tests_enabled, -@@ -191,8 +191,10 @@ if sndfile_dep.found() - ] - executable('spa-resample', - sparesample_sources, -+ c_args : [ simd_cargs ], -+ include_directories : [spa_inc ], - link_with : [ test_lib ], -- dependencies : [ spa_dep, sndfile_dep, mathlib, audioconvert_dep ], -+ dependencies : [sndfile_dep, mathlib, audioconvert_dep], - install : true, - ) - endif -diff --git a/spa/plugins/audiomixer/meson.build b/spa/plugins/audiomixer/meson.build -index 9e1d12d59..214c2a887 100644 ---- a/spa/plugins/audiomixer/meson.build -+++ b/spa/plugins/audiomixer/meson.build -@@ -11,7 +11,7 @@ simd_dependencies = [] - audiomixer_c = static_library('audiomixer_c', - ['mix-ops-c.c' ], - c_args : ['-O3'], -- dependencies : [ spa_dep ], -+ include_directories : [spa_inc], - install : false - ) - simd_dependencies += audiomixer_c -@@ -20,7 +20,7 @@ if have_sse - audiomixer_sse = static_library('audiomixer_sse', - ['mix-ops-sse.c' ], - c_args : [sse_args, '-O3', '-DHAVE_SSE'], -- dependencies : [ spa_dep ], -+ include_directories : [spa_inc], - install : false - ) - simd_cargs += ['-DHAVE_SSE'] -@@ -30,7 +30,7 @@ if have_sse2 - audiomixer_sse2 = static_library('audiomixer_sse2', - ['mix-ops-sse2.c' ], - c_args : [sse2_args, '-O3', '-DHAVE_SSE2'], -- dependencies : [ spa_dep ], -+ include_directories : [spa_inc], - install : false - ) - simd_cargs += ['-DHAVE_SSE2'] -@@ -40,7 +40,7 @@ if have_avx and have_fma - audiomixer_avx = static_library('audiomixer_avx', - ['mix-ops-avx.c'], - c_args : [avx_args, fma_args, '-O3', '-DHAVE_AVX', '-DHAVE_FMA'], -- dependencies : [ spa_dep ], -+ include_directories : [spa_inc], - install : false - ) - simd_cargs += ['-DHAVE_AVX', '-DHAVE_FMA'] -@@ -51,7 +51,8 @@ audiomixerlib = shared_library('spa-audiomixer', - audiomixer_sources, - c_args : simd_cargs, - link_with : simd_dependencies, -- dependencies : [ spa_dep, mathlib ], -+ include_directories : [spa_inc], -+ dependencies : [ mathlib ], - install : true, - install_dir : spa_plugindir / 'audiomixer' - ) -diff --git a/spa/plugins/audiotestsrc/meson.build b/spa/plugins/audiotestsrc/meson.build -index d1b22428d..8011ee883 100644 ---- a/spa/plugins/audiotestsrc/meson.build -+++ b/spa/plugins/audiotestsrc/meson.build -@@ -2,6 +2,7 @@ audiotestsrc_sources = ['audiotestsrc.c', 'plugin.c'] - - audiotestsrclib = shared_library('spa-audiotestsrc', - audiotestsrc_sources, -- dependencies : [ spa_dep, mathlib ], -+ include_directories : [spa_inc], -+ dependencies : [mathlib, ], - install : true, - install_dir : spa_plugindir / 'audiotestsrc') -diff --git a/spa/plugins/bluez5/meson.build b/spa/plugins/bluez5/meson.build -index 7a1e12ec7..ae6d8e8e0 100644 ---- a/spa/plugins/bluez5/meson.build -+++ b/spa/plugins/bluez5/meson.build -@@ -51,8 +51,8 @@ endif - - bluez5lib = shared_library('spa-bluez5', - bluez5_sources, -- include_directories : [ configinc ], -- dependencies : [ spa_dep, bluez5_deps ], -+ include_directories : [ spa_inc, configinc ], -+ dependencies : bluez5_deps, - install : true, - install_dir : spa_plugindir / 'bluez5') - -@@ -60,26 +60,26 @@ codec_args = [ '-DCODEC_PLUGIN' ] - - bluez_codec_sbc = shared_library('spa-codec-bluez5-sbc', - [ 'a2dp-codec-sbc.c', 'a2dp-codecs.c' ], -- include_directories : [ configinc ], -+ include_directories : [ spa_inc, configinc ], - c_args : codec_args, -- dependencies : [ spa_dep, sbc_dep ], -+ dependencies : sbc_dep, - install : true, - install_dir : spa_plugindir / 'bluez5') - - bluez_codec_faststream = shared_library('spa-codec-bluez5-faststream', - [ 'a2dp-codec-faststream.c', 'a2dp-codecs.c' ], -- include_directories : [ configinc ], -+ include_directories : [ spa_inc, configinc ], - c_args : codec_args, -- dependencies : [ spa_dep, sbc_dep ], -+ dependencies : sbc_dep, - install : true, - install_dir : spa_plugindir / 'bluez5') - - if fdk_aac_dep.found() - bluez_codec_aac = shared_library('spa-codec-bluez5-aac', - [ 'a2dp-codec-aac.c', 'a2dp-codecs.c' ], -- include_directories : [ configinc ], -+ include_directories : [ spa_inc, configinc ], - c_args : codec_args, -- dependencies : [ spa_dep, fdk_aac_dep ], -+ dependencies : fdk_aac_dep, - install : true, - install_dir : spa_plugindir / 'bluez5') - 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' ], -- include_directories : [ configinc ], -+ include_directories : [ spa_inc, configinc ], - c_args : codec_args, -- dependencies : [ spa_dep, aptx_dep, sbc_dep ], -+ dependencies : [ aptx_dep, sbc_dep ], - install : true, - install_dir : spa_plugindir / 'bluez5') - endif -@@ -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' ], -- include_directories : [ configinc ], -+ include_directories : [ spa_inc, configinc ], - c_args : ldac_args, -- dependencies : [ spa_dep, ldac_dep ], -+ dependencies : ldac_dep, - install : true, - install_dir : spa_plugindir / 'bluez5') - endif -diff --git a/spa/plugins/control/meson.build b/spa/plugins/control/meson.build -index adabdfab3..10f9cfeda 100644 ---- a/spa/plugins/control/meson.build -+++ b/spa/plugins/control/meson.build -@@ -5,6 +5,7 @@ control_sources = [ - - controllib = shared_library('spa-control', - control_sources, -- dependencies : [ spa_dep, mathlib ], -+ include_directories : [spa_inc], -+ dependencies : [ mathlib ], - install : true, - install_dir : spa_plugindir / 'control') -diff --git a/spa/plugins/ffmpeg/meson.build b/spa/plugins/ffmpeg/meson.build -index 0e41ecb6e..2aec258da 100644 ---- a/spa/plugins/ffmpeg/meson.build -+++ b/spa/plugins/ffmpeg/meson.build -@@ -4,6 +4,7 @@ ffmpeg_sources = ['ffmpeg.c', - - ffmpeglib = shared_library('spa-ffmpeg', - ffmpeg_sources, -- dependencies : [ spa_dep, avcodec_dep ], -+ include_directories : [spa_inc], -+ dependencies : [avcodec_dep], - install : true, - install_dir : spa_plugindir / 'ffmpeg') -diff --git a/spa/plugins/jack/meson.build b/spa/plugins/jack/meson.build -index 312a54061..b1732acd6 100644 ---- a/spa/plugins/jack/meson.build -+++ b/spa/plugins/jack/meson.build -@@ -7,6 +7,7 @@ spa_jack_sources = [ - - spa_jack = shared_library('spa-jack', - spa_jack_sources, -- dependencies : [ spa_dep, jack_dep, mathlib ], -+ include_directories : [spa_inc], -+ dependencies : [ jack_dep, mathlib ], - install : true, - install_dir : spa_plugindir / 'jack') -diff --git a/spa/plugins/libcamera/meson.build b/spa/plugins/libcamera/meson.build -index abb1a42cf..02ac2d9c2 100644 ---- a/spa/plugins/libcamera/meson.build -+++ b/spa/plugins/libcamera/meson.build -@@ -11,7 +11,8 @@ summary({'libdrm': libdrm_dep.found()}, bool_yn: true, section: 'Backend') - if libdrm_dep.found() - libcameralib = shared_library('spa-libcamera', - libcamera_sources, -- dependencies : [ spa_dep, libudev_dep, libcamera_dep, pthread_lib, libdrm_dep ], -+ include_directories : [ spa_inc ], -+ dependencies : [ libudev_dep, libcamera_dep, pthread_lib, libdrm_dep ], - install : true, - install_dir : spa_plugindir / 'libcamera') - endif -diff --git a/spa/plugins/support/meson.build b/spa/plugins/support/meson.build -index b810b283c..15010a51e 100644 ---- a/spa/plugins/support/meson.build -+++ b/spa/plugins/support/meson.build -@@ -17,12 +17,14 @@ endif - - spa_support_lib = shared_library('spa-support', - spa_support_sources, -+ include_directories : [ spa_inc ], - c_args : [ simd_cargs ], -- dependencies : [ spa_dep, pthread_lib, epoll_shim_dep ], -+ dependencies : [ pthread_lib, epoll_shim_dep ], - install : true, - install_dir : spa_plugindir / 'support') - spa_support_dep = declare_dependency(link_with: spa_support_lib) - -+ - if not get_option('evl').disabled() - evl_inc = include_directories('/usr/evl/include') - evl_lib = cc.find_library('evl', -@@ -33,8 +35,8 @@ if not get_option('evl').disabled() - - spa_evl_lib = shared_library('spa-evl', - spa_evl_sources, -- include_directories : [ evl_inc], -- dependencies : [ spa_dep, pthread_lib, evl_lib ], -+ include_directories : [ spa_inc, evl_inc], -+ dependencies : [ pthread_lib, evl_lib], - install : true, - install_dir : spa_plugindir / 'support') - endif -@@ -44,7 +46,8 @@ if dbus_dep.found() - - spa_dbus_lib = shared_library('spa-dbus', - spa_dbus_sources, -- dependencies : [ spa_dep, dbus_dep ], -+ include_directories : [ spa_inc], -+ dependencies : [dbus_dep, ], - install : true, - install_dir : spa_plugindir / 'support') - spa_dbus_dep = declare_dependency(link_with: spa_dbus_lib) -@@ -61,7 +64,8 @@ if systemd_dep.found() - - spa_journal_lib = shared_library('spa-journal', - spa_journal_sources, -- dependencies : [ spa_dep, systemd_dep ], -+ include_directories : spa_inc, -+ dependencies : systemd_dep, - install : true, - install_dir : spa_plugindir / 'support') - spa_journal_dep = declare_dependency(link_with: spa_journal_lib) -diff --git a/spa/plugins/test/meson.build b/spa/plugins/test/meson.build -index 950ee7c38..e824450f6 100644 ---- a/spa/plugins/test/meson.build -+++ b/spa/plugins/test/meson.build -@@ -2,6 +2,7 @@ test_sources = ['fakesrc.c', 'fakesink.c', 'plugin.c'] - - testlib = shared_library('spa-test', - test_sources, -- dependencies : [ spa_dep, pthread_lib ], -+ include_directories : [ spa_inc], -+ dependencies : [pthread_lib, ], - install : true, - install_dir : spa_plugindir / 'test') -diff --git a/spa/plugins/v4l2/meson.build b/spa/plugins/v4l2/meson.build -index 648583f32..297a62b16 100644 ---- a/spa/plugins/v4l2/meson.build -+++ b/spa/plugins/v4l2/meson.build -@@ -5,6 +5,7 @@ v4l2_sources = ['v4l2.c', - - v4l2lib = shared_library('spa-v4l2', - v4l2_sources, -- dependencies : [ spa_dep, libudev_dep, libinotify_dep ], -+ include_directories : [ spa_inc ], -+ dependencies : [ libudev_dep, libinotify_dep ], - install : true, - install_dir : spa_plugindir / 'v4l2') -diff --git a/spa/plugins/videoconvert/meson.build b/spa/plugins/videoconvert/meson.build -index 24673a541..17d860d5a 100644 ---- a/spa/plugins/videoconvert/meson.build -+++ b/spa/plugins/videoconvert/meson.build -@@ -9,7 +9,8 @@ simd_dependencies = [] - videoconvertlib = shared_library('spa-videoconvert', - videoconvert_sources, - c_args : simd_cargs, -- dependencies : [ spa_dep, mathlib ], -+ include_directories : [spa_inc], -+ dependencies : [ mathlib ], - link_with : simd_dependencies, - install : true, - install_dir : spa_plugindir / 'videoconvert') -diff --git a/spa/plugins/videotestsrc/meson.build b/spa/plugins/videotestsrc/meson.build -index 01a33ee29..f6f3dca56 100644 ---- a/spa/plugins/videotestsrc/meson.build -+++ b/spa/plugins/videotestsrc/meson.build -@@ -2,6 +2,7 @@ videotestsrc_sources = ['videotestsrc.c', 'plugin.c'] - - videotestsrclib = shared_library('spa-videotestsrc', - videotestsrc_sources, -- dependencies : [ spa_dep, pthread_lib ], -+ include_directories : [ spa_inc], -+ dependencies : [pthread_lib, ], - install : true, - install_dir : spa_plugindir / 'videotestsrc') -diff --git a/spa/plugins/volume/meson.build b/spa/plugins/volume/meson.build -index 2445e2bbd..e10f89563 100644 ---- a/spa/plugins/volume/meson.build -+++ b/spa/plugins/volume/meson.build -@@ -2,6 +2,6 @@ volume_sources = ['volume.c', 'plugin.c'] - - volumelib = shared_library('spa-volume', - volume_sources, -- dependencies : [ spa_dep ], -+ include_directories : [spa_inc], - install : true, - install_dir : spa_plugindir / 'volume') -diff --git a/spa/plugins/vulkan/meson.build b/spa/plugins/vulkan/meson.build -index b79bca2cf..9683b41ea 100644 ---- a/spa/plugins/vulkan/meson.build -+++ b/spa/plugins/vulkan/meson.build -@@ -6,6 +6,7 @@ spa_vulkan_sources = [ - - spa_vulkan = shared_library('spa-vulkan', - spa_vulkan_sources, -- dependencies : [ spa_dep, vulkan_dep, mathlib ], -+ include_directories : [spa_inc], -+ dependencies : [ vulkan_dep, mathlib ], - install : true, - install_dir : spa_plugindir / 'vulkan') -diff --git a/spa/tests/meson.build b/spa/tests/meson.build -index 9c78dcbd2..ea00a2cfe 100644 ---- a/spa/tests/meson.build -+++ b/spa/tests/meson.build -@@ -21,7 +21,7 @@ if find.found() - }) - executable('spa-include-test-@0@'.format(spa_header.underscorify()), - src, -- dependencies: [ spa_dep ], -+ include_directories: [spa_inc], - install: false) - endif - endforeach -@@ -36,7 +36,8 @@ benchmark_apps = [ - foreach a : benchmark_apps - benchmark('spa-' + a, - executable('spa-' + a, a + '.c', -- dependencies : [ spa_dep, dl_lib, pthread_lib, mathlib ], -+ dependencies : [dl_lib, pthread_lib, mathlib ], -+ include_directories : [spa_inc ], - install : installed_tests_enabled, - install_dir : installed_tests_execdir, - ), -diff --git a/spa/tools/meson.build b/spa/tools/meson.build -index 6f12e9c8f..e4df6c3ac 100644 ---- a/spa/tools/meson.build -+++ b/spa/tools/meson.build -@@ -1,11 +1,14 @@ - executable('spa-inspect', 'spa-inspect.c', -- dependencies : [ spa_dep, dl_lib ], -+ include_directories : [spa_inc], -+ dependencies : [dl_lib, ], - install : true) - - executable('spa-monitor', 'spa-monitor.c', -- dependencies : [ spa_dep, dl_lib ], -+ include_directories : [spa_inc], -+ dependencies : [dl_lib, ], - install : true) - - executable('spa-json-dump', 'spa-json-dump.c', -- dependencies : [ spa_dep, dl_lib, ], -+ include_directories : [spa_inc], -+ dependencies : [dl_lib, ], - install : true) -diff --git a/src/daemon/meson.build b/src/daemon/meson.build -index 647d7393d..28cbe4467 100644 ---- a/src/daemon/meson.build -+++ b/src/daemon/meson.build -@@ -87,16 +87,16 @@ pipewire_exec = executable('pipewire', - pipewire_daemon_sources, - install: true, - c_args : pipewire_c_args, -- include_directories : [ configinc ], -- dependencies : [ spa_dep, pipewire_dep, ], -+ include_directories : [configinc, spa_inc], -+ dependencies : [pipewire_dep, ], - ) - - executable('pipewire-pulse', - pipewire_daemon_sources, - install: true, - c_args : pipewire_c_args, -- include_directories : [ configinc ], -- dependencies : [ spa_dep, pipewire_dep, ], -+ include_directories : [configinc, spa_inc], -+ dependencies : [pipewire_dep, ], - ) - - ln = find_program('ln') -diff --git a/src/gst/meson.build b/src/gst/meson.build -index 709dc0f1c..b91b33dc9 100644 ---- a/src/gst/meson.build -+++ b/src/gst/meson.build -@@ -24,8 +24,8 @@ pipewire_gst_headers = [ - - pipewire_gst = shared_library('gstpipewire', - pipewire_gst_sources, -- include_directories : [ configinc ], -- dependencies : [ spa_dep, gst_dep, pipewire_dep ], -+ include_directories : [configinc, spa_inc], -+ dependencies : [gst_dep, pipewire_dep], - install : true, - install_dir : '@0@/gstreamer-1.0'.format(get_option('libdir')), - ) -diff --git a/src/modules/meson.build b/src/modules/meson.build -index 2d3a800d3..ba30275ab 100644 ---- a/src/modules/meson.build -+++ b/src/modules/meson.build -@@ -31,20 +31,20 @@ module_sources = [ - ] - - pipewire_module_access = shared_library('pipewire-module-access', [ 'module-access.c' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -- dependencies : [spa_dep, mathlib, dl_lib, pipewire_dep], -+ dependencies : [mathlib, dl_lib, pipewire_dep], - ) - - pipewire_module_loopback = shared_library('pipewire-module-loopback', - [ 'module-loopback.c' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -- dependencies : [spa_dep, mathlib, dl_lib, pipewire_dep], -+ dependencies : [mathlib, dl_lib, pipewire_dep], - ) - - simd_cargs = [] -@@ -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'], -- dependencies : [ spa_dep ], -+ include_directories : [spa_inc], - install : false - ) - simd_cargs += ['-DHAVE_SSE'] -@@ -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'], -- dependencies : [ spa_dep ], -+ include_directories : [spa_inc], - install : false - ) - simd_cargs += ['-DHAVE_NEON'] -@@ -74,7 +74,7 @@ endif - pffft_c = static_library('pffft_c', - ['module-filter-chain/pffft.c' ], - c_args : [simd_cargs, '-O3', '-DPFFFT_SIMD_DISABLE'], -- dependencies : [ spa_dep ], -+ include_directories : [spa_inc], - install : false - ) - simd_dependencies += pffft_c -@@ -100,7 +100,7 @@ endif - - pipewire_module_filter_chain = shared_library('pipewire-module-filter-chain', - filter_chain_sources, -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -@@ -114,7 +114,7 @@ pipewire_module_echo_cancel_sources = [ - - pipewire_module_echo_cancel = shared_library('pipewire-module-echo-cancel', - pipewire_module_echo_cancel_sources, -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -@@ -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', ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -- dependencies : [spa_dep, mathlib, dl_lib, pipewire_dep], -+ dependencies : [mathlib, dl_lib, pipewire_dep], - ) - - build_module_rt = dbus_dep.found() - if build_module_rt - pipewire_module_rt = shared_library('pipewire-module-rt', [ 'module-rt.c' ], -- include_directories : [configinc], -+ 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], - ) -+<<<<<<< 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, -@@ -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' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -@@ -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', ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -- dependencies : [spa_dep, mathlib, dl_lib, pipewire_dep], -+ dependencies : [mathlib, dl_lib, pipewire_dep], - ) - - pipewire_module_link_factory = shared_library('pipewire-module-link-factory', - [ 'module-link-factory.c' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -- dependencies : [spa_dep, mathlib, dl_lib, pipewire_dep], -+ dependencies : [mathlib, dl_lib, pipewire_dep], - ) - - pipewire_module_protocol_deps = [mathlib, dl_lib, pipewire_dep] -@@ -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' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -@@ -273,7 +283,7 @@ endif - - pipewire_module_protocol_pulse = shared_library('pipewire-module-protocol-pulse', - pipewire_module_protocol_pulse_sources, -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -@@ -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' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -@@ -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' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -@@ -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' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : false, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -- dependencies : [spa_dep, mathlib, dl_lib, pipewire_dep], -+ dependencies : [mathlib, dl_lib, pipewire_dep], - ) - - pipewire_module_example_sink = shared_library('pipewire-module-example-source', - [ 'module-example-source.c' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : false, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -- dependencies : [spa_dep, mathlib, dl_lib, pipewire_dep], -+ dependencies : [mathlib, dl_lib, pipewire_dep], - ) - - 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', ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - link_with : pipewire_module_protocol_native, - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -- dependencies : [spa_dep, mathlib, dl_lib, pipewire_dep], -+ dependencies : [mathlib, dl_lib, pipewire_dep], - ) - - 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'], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - link_with : pipewire_module_protocol_native, - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -- dependencies : [spa_dep, mathlib, dl_lib, pipewire_dep], -+ dependencies : [mathlib, dl_lib, pipewire_dep], - ) - - 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, -- include_directories : [configinc ], -- dependencies : [spa_dep, pipewire_dep], -+ include_directories : [configinc, spa_inc ], -+ dependencies : [pipewire_dep], - install : installed_tests_enabled, - install_dir : installed_tests_execdir, - ), -@@ -383,7 +393,7 @@ pipewire_module_adapter = shared_library('pipewire-module-adapter', - [ 'module-adapter.c', - 'module-adapter/adapter.c', - 'spa/spa-node.c' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -@@ -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', - ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -- dependencies : [spa_dep, mathlib, dl_lib, pipewire_dep], -+ dependencies : [mathlib, dl_lib, pipewire_dep], - ) - - build_module_zeroconf_discover = avahi_dep.found() -@@ -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' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -@@ -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' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -@@ -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' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -@@ -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' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -@@ -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' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -diff --git a/src/modules/spa/meson.build b/src/modules/spa/meson.build -index 8332910b5..ab4fac18d 100644 ---- a/src/modules/spa/meson.build -+++ b/src/modules/spa/meson.build -@@ -1,31 +1,31 @@ - pipewire_module_spa_node = shared_library('pipewire-module-spa-node', - [ 'module-node.c', 'spa-node.c' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, -- dependencies : [spa_dep, mathlib, dl_lib, pipewire_dep], -+ dependencies : [mathlib, dl_lib, pipewire_dep], - ) - - pipewire_module_spa_device = shared_library('pipewire-module-spa-device', - [ 'module-device.c', 'spa-device.c' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, -- dependencies : [spa_dep, mathlib, dl_lib, pipewire_dep], -+ dependencies : [mathlib, dl_lib, pipewire_dep], - ) - - pipewire_module_spa_node_factory = shared_library('pipewire-module-spa-node-factory', - [ 'module-node-factory.c', 'spa-node.c' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, -- dependencies : [spa_dep, mathlib, dl_lib, pipewire_dep], -+ dependencies : [mathlib, dl_lib, pipewire_dep], - ) - - pipewire_module_spa_device_factory = shared_library('pipewire-module-spa-device-factory', - [ 'module-device-factory.c', 'spa-device.c' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, -- dependencies : [spa_dep, mathlib, dl_lib, pipewire_dep], -+ dependencies : [mathlib, dl_lib, pipewire_dep], - ) -diff --git a/src/pipewire/meson.build b/src/pipewire/meson.build -index 969f50b22..f66ce8746 100644 ---- a/src/pipewire/meson.build -+++ b/src/pipewire/meson.build -@@ -103,9 +103,9 @@ libpipewire = shared_library(pipewire_name, pipewire_sources, - version : libversion, - soversion : soversion, - c_args : libpipewire_c_args, -- include_directories : [pipewire_inc, configinc, includes_inc], -+ include_directories : [pipewire_inc, configinc, spa_inc, includes_inc], - install : true, -- dependencies : [spa_dep, dl_lib, mathlib, pthread_lib, libintl_dep, atomic_dep, ], -+ dependencies : [dl_lib, mathlib, pthread_lib, libintl_dep, atomic_dep, ], - ) - - pipewire_dep = declare_dependency(link_with : libpipewire, -diff --git a/test/meson.build b/test/meson.build -index eca92eb24..4108ac14b 100644 ---- a/test/meson.build -+++ b/test/meson.build -@@ -19,6 +19,7 @@ pwtest_c_args = [ - ] - - pwtest_inc = [ -+ spa_inc, - pipewire_inc, - configinc, - includes_inc, -@@ -36,7 +37,6 @@ test('test-pwtest', - executable('test-pwtest', - 'test-pwtest.c', - include_directories: pwtest_inc, -- dependencies: [ spa_dep ], - link_with: pwtest_lib) - ) - -@@ -45,7 +45,6 @@ test('test-pwtest', - executable('test-example', - 'test-example.c', - include_directories: pwtest_inc, -- dependencies: [ spa_dep ], - link_with: pwtest_lib) - - test('test-pw-utils', -@@ -55,7 +54,6 @@ test('test-pw-utils', - 'test-map.c', - 'test-utils.c', - include_directories: pwtest_inc, -- dependencies: [ spa_dep ], - link_with: pwtest_lib) - ) - -@@ -63,7 +61,6 @@ test('test-lib', - executable('test-lib', - 'test-lib.c', - include_directories: pwtest_inc, -- dependencies: [ spa_dep ], - link_with: pwtest_lib) - ) - -@@ -71,7 +68,6 @@ test('test-client', - executable('test-client', - 'test-client.c', - include_directories: pwtest_inc, -- dependencies: [ spa_dep ], - link_with: pwtest_lib) - ) - -@@ -88,7 +84,7 @@ test('test-context', - 'test-context.c', - 'test-config.c', - include_directories: pwtest_inc, -- dependencies: [spa_dep, spa_support_dep, spa_dbus_dep], -+ dependencies: [spa_support_dep, spa_dbus_dep], - link_with: [pwtest_lib, - pipewire_module_protocol_native, - pipewire_module_client_node, -@@ -103,7 +99,7 @@ test('test-support', - 'test-support.c', - 'test-logger.c', - include_directories: pwtest_inc, -- dependencies: [spa_dep, systemd_dep, spa_support_dep, spa_journal_dep], -+ dependencies: [systemd_dep, spa_support_dep, spa_journal_dep], - link_with: [pwtest_lib]) - ) - test('test-spa', -@@ -115,7 +111,6 @@ test('test-spa', - 'test-spa-node.c', - 'test-spa-pod.c', - include_directories: pwtest_inc, -- dependencies: [ spa_dep ], - link_with: pwtest_lib) - ) - --- -2.35.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 deleted file mode 100644 index bd7e3804f..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-Revert-treewide-meson.build-simplify-get_variable-ca.patch +++ /dev/null @@ -1,130 +0,0 @@ -From 82c58fbde3d85465dc4b6e0af460124f67d1e485 Mon Sep 17 00:00:00 2001 -From: Ashok Sidipotu -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 deleted file mode 100644 index f2a9d0d09..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-Revert-treewide-meson.build-get-SPA_PLUGIN_DIR-from-.patch +++ /dev/null @@ -1,124 +0,0 @@ -From cf7b3a0db10cf0bcd140800ef547199703fdf16e Mon Sep 17 00:00:00 2001 -From: Ashok Sidipotu -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/0006-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 deleted file mode 100644 index fe44c07ed..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0006-Revert-meson-declare-spa_dep-and-override_dependency.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 869e53ac9ded351ce6cb47b5ce04ef345c673b48 Mon Sep 17 00:00:00 2001 -From: Ashok Sidipotu -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 +- - spa/meson.build | 13 +------------ - src/pipewire/meson.build | 10 ++-------- - 3 files changed, 4 insertions(+), 21 deletions(-) - -diff --git a/meson.build b/meson.build -index 1b87bd004..af60472f8 100644 ---- a/meson.build -+++ b/meson.build -@@ -1,7 +1,7 @@ - project('pipewire', ['c' ], - version : '0.3.47', - license : [ 'MIT', 'LGPL-2.1-or-later', 'GPL-2.0-only' ], -- meson_version : '>= 0.59.0', -+ meson_version : '>= 0.49.0', - default_options : [ 'warning_level=3', - 'c_std=gnu99', - 'cpp_std=c++17', -diff --git a/spa/meson.build b/spa/meson.build -index 2717b86d6..4e0f96727 100644 ---- a/spa/meson.build -+++ b/spa/meson.build -@@ -56,20 +56,9 @@ if not get_option('examples').disabled() - subdir('examples') - endif - --spa_dep = declare_dependency( -- include_directories : [spa_inc], -- version : spaversion, -- variables : { 'plugindir' : meson.current_build_dir() / 'plugins' } --) -- - pkgconfig.generate(filebase : 'lib@0@'.format(spa_name), - name : 'libspa', - subdirs : spa_name, - description : 'Simple Plugin API', - version : spaversion, -- extra_cflags : '-D_REENTRANT', -- variables : ['plugindir=${libdir}/@0@'.format(spa_name)], -- uninstalled_variables : ['plugindir=${prefix}/spa/plugins'], --) -- --meson.override_dependency('lib@0@'.format(spa_name), spa_dep) -+ extra_cflags : '-D_REENTRANT') -diff --git a/src/pipewire/meson.build b/src/pipewire/meson.build -index f66ce8746..5cfaba3f9 100644 ---- a/src/pipewire/meson.build -+++ b/src/pipewire/meson.build -@@ -109,12 +109,8 @@ libpipewire = shared_library(pipewire_name, pipewire_sources, - ) - - pipewire_dep = declare_dependency(link_with : libpipewire, -- include_directories : [pipewire_inc, configinc], -- dependencies : [pthread_lib, atomic_dep, spa_dep], -- variables : { -- 'moduledir' : meson.current_build_dir() / '..' / 'modules', -- 'confdatadir' : meson.current_build_dir() / '..' / 'daemon', -- } -+ include_directories : [pipewire_inc, configinc, spa_inc], -+ dependencies : [pthread_lib, atomic_dep, ], - ) - - pkgconfig.generate(libpipewire, -@@ -132,6 +128,4 @@ pkgconfig.generate(libpipewire, - ], - ) - --meson.override_dependency('lib@0@'.format(pipewire_name), pipewire_dep) -- - subdir('extensions') --- -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 deleted file mode 100644 index 3fff8eb27..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0007-Revert-meson-use-meson-variables-for-the-SMs-uninsta.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 4e8241675e68d5fb082d42ff597e681955eabbc4 Mon Sep 17 00:00:00 2001 -From: Ashok Sidipotu -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 deleted file mode 100644 index 751adbe5b..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0008-Revert-meson-declare-spa_dep-and-override_dependency.patch +++ /dev/null @@ -1,31 +0,0 @@ -From c5b9c082dafe2ad2ac118ffd39c5b88307f3357f Mon Sep 17 00:00:00 2001 -From: Ashok Sidipotu -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 deleted file mode 100644 index 6628c5c34..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0009-Revert-test-add-test-for-the-loop.patch +++ /dev/null @@ -1,32 +0,0 @@ -From bf29285fb6e534b754a3b0c7b33d2a0ed3b98b79 Mon Sep 17 00:00:00 2001 -From: Ashok Sidipotu -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 deleted file mode 100644 index 8bf945479..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0010-Revert-spa-improve-the-AEC-interface.patch +++ /dev/null @@ -1,502 +0,0 @@ -From 3ac842085c60a0c745bd3f8f0d8419e98220675b Mon Sep 17 00:00:00 2001 -From: Ashok Sidipotu -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 - #include -+#include - #include -+#include - --#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 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(data); -+ auto impl = reinterpret_cast(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(data); -+ auto impl = reinterpret_cast(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(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 - #include -@@ -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 -+ * -+ * 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 -+#include -+#include -+#include -+ -+#include -+ -+#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 deleted file mode 100644 index 4d62abcfc..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0011-Revert-module-echo-cancel-Move-backends-to-dynamic-l.patch +++ /dev/null @@ -1,1055 +0,0 @@ -From 7f14334d055da433521c32c622682f89fe2dd1c5 Mon Sep 17 00:00:00 2001 -From: Ashok Sidipotu -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 -- * -- * 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 --#include --#include --#include --#include -- --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 -- * © 2021 Arun Raghavan -- * -- * 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 --#include -- --#include --#include --#include --#include --#include -- --#include --#include --#include -- --struct impl_data { -- struct spa_handle handle; -- struct spa_log *log; -- std::unique_ptr apm; -- spa_audio_info_raw info; -- std::unique_ptr 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(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(new webrtc::ExtendedFilter(extended_filter)); -- config.Set(new webrtc::DelayAgnostic(delay_agnostic)); -- config.Set(new webrtc::ExperimentalAgc(experimental_agc)); -- config.Set(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::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(info->channels); -- impl->rec_buffer = std::make_unique(info->channels); -- impl->out_buffer = std::make_unique(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(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(play[j]) + config.num_frames() * i; -- impl->rec_buffer[j] = const_cast(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(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 - #include -@@ -44,14 +43,10 @@ - #include - #include - #include --#include - #include --#include - #include - #include - #include --#include --#include - - #include - #include -@@ -59,6 +54,8 @@ - - #include - -+#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 = `: the echo cancellation library Currently supported: -- * `aec/libspa-aec-exaudio`. Leave unset to use the default method (`aec/libspa-aec-exaudio`). -+ * - `aec.method = `: the echo cancellation method. Currently supported: -+ * `webrtc`. Leave unset to use the default method (`webrtc`). - * - `aec.args = `: 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= ] " - "[ buffer.max_size= ] " - "[ buffer.play_delay= ] " -- "[ library.name = ] " -+ "[ aec.method= ] " - "[ aec.args= ] " - "[ source.props= ] " - "[ sink.props= ] " }, -@@ -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 --#include --#include --#include --#include -- --#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 -+ * © 2021 Arun Raghavan -+ * -+ * 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 -+#include -+ -+#include "echo-cancel.h" -+ -+#include -+ -+#include -+#include -+#include -+ -+struct impl { -+ std::unique_ptr apm; -+ spa_audio_info_raw info; -+ std::unique_ptr play_buffer, rec_buffer, out_buffer; -+ -+ impl(std::unique_ptr apm, const spa_audio_info_raw& info) -+ : apm(std::move(apm)), -+ info(info), -+ play_buffer(std::make_unique(info.channels)), -+ rec_buffer(std::make_unique(info.channels)), -+ out_buffer(std::make_unique(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(new webrtc::ExtendedFilter(extended_filter)); -+ config.Set(new webrtc::DelayAgnostic(delay_agnostic)); -+ config.Set(new webrtc::ExperimentalAgc(experimental_agc)); -+ config.Set(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::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(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(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(play[j]) + config.num_frames() * i; -+ impl->rec_buffer[j] = const_cast(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 --#include - #include --#include - - #include - -+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 deleted file mode 100644 index 69731a4f1..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0012-Miscellanous-changes-to-account-for-lower-version-of.patch +++ /dev/null @@ -1,166 +0,0 @@ -From b781a4dbb45191a4b2746d5fe12d6f907681441c Mon Sep 17 00:00:00 2001 -From: Ashok Sidipotu -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/0013-Revert-loop-remove-destroy-list.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0013-Revert-loop-remove-destroy-list.patch deleted file mode 100644 index 8a988b024..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0013-Revert-loop-remove-destroy-list.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 16f63a3c8fa227625bade5a9edea22354b347d18 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= -Date: Fri, 18 Feb 2022 18:36:36 +0100 -Subject: [PATCH] Revert "loop: remove destroy list" - -This reverts commit c474846c42967c44db069a23b76a29da6f496f33. -In addition, `s->loop` is also checked before dispatching a source. - -The destroy list is needed in the presence of threads. The -issue is that a source may be destroyed between `epoll_wait()` -returning and thread loop lock being acquired. If this -source is active, then a use-after-free will be triggered -when the thread loop acquires the lock and starts dispatching -the sources. - - thread 1 thread 2 - ---------- ---------- - loop_iterate - spa_loop_control_hook_before - // release lock - - pw_thread_loop_lock - - spa_system_pollfd_wait - // assume it returns with source A - - pw_loop_destroy_source(..., A) - // frees storage of A - - pw_thread_loop_unlock - spa_loop_control_hook_after - // acquire the lock - - for (...) { - struct spa_source *s = ep[i].data; - s->rmask = ep[i].events; - // use-after-free if `s` refers to - // the previously freed `A` - -Fixes #2147 - -Upstream-Status: Backport [https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/16f63a3c] -Signed-off-by: Scott Murray - ---- - spa/plugins/support/loop.c | 19 +++++++++++++++++-- - 1 file changed, 17 insertions(+), 2 deletions(-) - -diff --git a/spa/plugins/support/loop.c b/spa/plugins/support/loop.c -index 0588ce770..04739eb2a 100644 ---- a/spa/plugins/support/loop.c -+++ b/spa/plugins/support/loop.c -@@ -75,6 +75,7 @@ struct impl { - struct spa_system *system; - - struct spa_list source_list; -+ struct spa_list destroy_list; - struct spa_hook_list hooks_list; - - int poll_fd; -@@ -325,6 +326,14 @@ static void loop_leave(void *object) - impl->thread = 0; - } - -+static inline void process_destroy(struct impl *impl) -+{ -+ struct source_impl *source, *tmp; -+ spa_list_for_each_safe(source, tmp, &impl->destroy_list, link) -+ free(source); -+ spa_list_init(&impl->destroy_list); -+} -+ - static int loop_iterate(void *object, int timeout) - { - struct impl *impl = object; -@@ -354,11 +363,14 @@ static int loop_iterate(void *object, int timeout) - } - for (i = 0; i < nfds; i++) { - struct spa_source *s = ep[i].data; -- if (SPA_LIKELY(s && s->rmask)) { -+ if (SPA_LIKELY(s && s->rmask && s->loop)) { - s->priv = NULL; - s->func(s); - } - } -+ if (SPA_UNLIKELY(!spa_list_is_empty(&impl->destroy_list))) -+ process_destroy(impl); -+ - return nfds; - } - -@@ -712,7 +724,7 @@ static void loop_destroy_source(void *object, struct spa_source *source) - spa_system_close(impl->impl->system, source->fd); - source->fd = -1; - } -- free(source); -+ spa_list_insert(&impl->impl->destroy_list, &impl->link); - } - - static const struct spa_loop_methods impl_loop = { -@@ -783,6 +795,8 @@ static int impl_clear(struct spa_handle *handle) - spa_list_consume(source, &impl->source_list, link) - loop_destroy_source(impl, &source->source); - -+ process_destroy(impl); -+ - spa_system_close(impl->system, impl->ack_fd); - spa_system_close(impl->system, impl->poll_fd); - -@@ -844,6 +858,7 @@ impl_init(const struct spa_handle_factory *factory, - impl->poll_fd = res; - - spa_list_init(&impl->source_list); -+ spa_list_init(&impl->destroy_list); - spa_hook_list_init(&impl->hooks_list); - - impl->buffer_data = SPA_PTR_ALIGN(impl->buffer_mem, MAX_ALIGN, uint8_t); --- -2.35.1 - diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.47.bbappend b/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.47.bbappend index 5c0d065b7..0b6f3ec1c 100644 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.47.bbappend +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.47.bbappend @@ -1,3 +1,8 @@ +SRC_URI += "\ + file://0001-systemd-Do-not-override-rootprefix.patch \ + file://0002-Revert-loop-remove-destroy-list.patch \ +" + PACKAGECONFIG = "\ ${@bb.utils.contains('DISTRO_FEATURES', 'bluez5', 'bluez', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa pipewire-alsa', '', d)} \ @@ -6,22 +11,6 @@ PACKAGECONFIG = "\ gstreamer v4l2 \ " -SRC_URI += "\ - file://0001-Revert-treewide-meson.build-use-project_-build-sourc.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 \ - file://0013-Revert-loop-remove-destroy-list.patch \ -" - do_install:append() { # install symlinks to alsalib configuration files for i in 50-pipewire.conf 99-pipewire-default.conf; do -- cgit 1.2.3-korg