From debe203be9bf5e842b082751f53cb0502be02db1 Mon Sep 17 00:00:00 2001 From: Ashok Sidipotu Date: Thu, 24 Feb 2022 11:46:15 +0530 Subject: pipewire: Update pw to v0.3.47 and wp to v0.4.8 Highlights of Pipewire. - Removed check and warnings to catch leaked listeners on the proxy. - Fix critical bug where alsa devices would not show when the kernel was compiled without VERBOSE_PROCFS - Almost all limits on number of ports, clients and nodes are removed. - Many more bug fixes and imporovements. Highlights of Wireplumber. - Added bluetooth profile auto-switching support between A2DP and HFP modes - Better default audio sources and sinks selection - Backported a fix for a known issue with selecting the default devices on top of 0.4.8 (ae6c9a5e) - Many more bug fixes and imporovements. Change-Id: Id5414aed065593893a237437a8c77645cbf15804 Signed-off-by: Ashok Sidipotu Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/27220 Reviewed-by: Jan-Simon Moeller Tested-by: Jan-Simon Moeller --- ...wide-meson.build-use-project_-build-sourc.patch | 101 +- ...wide-meson.build-use-dependency-variable-.patch | 1129 ------------------- ...-treewide-meson.build-use-feature.allowed.patch | 277 +++++ ...n-declare-spa_dep-and-override_dependency.patch | 83 -- ...wide-meson.build-use-dependency-variable-.patch | 1141 ++++++++++++++++++++ ...emd-correctly-prefix-systemd-system-units.patch | 25 - ...wide-meson.build-simplify-get_variable-ca.patch | 130 +++ ...wide-meson.build-get-SPA_PLUGIN_DIR-from-.patch | 124 +++ ...k-set-a-default-channel-map-if-the-number.patch | 77 -- ...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 +++ .../recipes-multimedia/pipewire/pipewire_0.3.43.bb | 316 ------ .../pipewire/pipewire_0.3.43.bbappend | 29 - .../recipes-multimedia/pipewire/pipewire_0.3.47.bb | 318 ++++++ .../pipewire/pipewire_0.3.47.bbappend | 36 + ...s-add-pipewire-env-variables-when-running.patch | 139 +++ ...ninstalled-build-this-script-with-the-mes.patch | 78 -- ...s-add-pipewire-env-variables-when-running.patch | 138 --- ...ninstalled-build-this-script-with-the-mes.patch | 77 ++ ...x-va_list-APIs-for-different-architecture.patch | 214 ++++ .../wireplumber/wireplumber_git.bb | 11 +- 26 files changed, 4398 insertions(+), 1960 deletions(-) delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-treewide-meson.build-use-dependency-variable-.patch create 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-meson-declare-spa_dep-and-override_dependency.patch create 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-systemd-correctly-prefix-systemd-system-units.patch create mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-Revert-treewide-meson.build-simplify-get_variable-ca.patch create 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/0005-pipewiresink-set-a-default-channel-map-if-the-number.patch create mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0006-Revert-meson-declare-spa_dep-and-override_dependency.patch create mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0007-Revert-meson-use-meson-variables-for-the-SMs-uninsta.patch create mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0008-Revert-meson-declare-spa_dep-and-override_dependency.patch create mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0009-Revert-test-add-test-for-the-loop.patch create mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0010-Revert-spa-improve-the-AEC-interface.patch create mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0011-Revert-module-echo-cancel-Move-backends-to-dynamic-l.patch create 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_0.3.43.bb delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.43.bbappend create mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.47.bb create mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.47.bbappend create mode 100644 meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-Revert-tests-add-pipewire-env-variables-when-running.patch delete mode 100644 meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-Revert-wp-uninstalled-build-this-script-with-the-mes.patch delete mode 100644 meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0002-Revert-tests-add-pipewire-env-variables-when-running.patch create mode 100644 meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0002-Revert-wp-uninstalled-build-this-script-with-the-mes.patch create mode 100644 meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0003-spa-json-fix-va_list-APIs-for-different-architecture.patch diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-Revert-treewide-meson.build-use-project_-build-sourc.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-Revert-treewide-meson.build-use-project_-build-sourc.patch index 42f01086a..89507df60 100644 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-Revert-treewide-meson.build-use-project_-build-sourc.patch +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-Revert-treewide-meson.build-use-project_-build-sourc.patch @@ -1,24 +1,21 @@ -From e850a4c080c80fc218224521727996062ebb9487 Mon Sep 17 00:00:00 2001 +From 7bf582601f73c5f796b23a7cc2868424b03a0fd1 Mon Sep 17 00:00:00 2001 From: Ashok Sidipotu Date: Fri, 14 Jan 2022 16:12:55 +0530 -Subject: [PATCH 1/4] Revert "treewide: meson.build: use +Subject: [PATCH 01/12] Revert "treewide: meson.build: use project_{build,source}_root()" This reverts commit 8ed46a283fa1f8623b940eaeb9f7cbcc52eebf0e. Upstream-Status: Inappropriate[meson version dependent] --- - doc/meson.build | 34 ++++++++++++++-------------- - meson.build | 8 +++---- - spa/plugins/audioconvert/meson.build | 4 ++-- - spa/tests/meson.build | 4 ++-- - src/daemon/meson.build | 6 ++--- - src/modules/meson.build | 6 ++--- - src/tests/meson.build | 6 ++--- - test/meson.build | 4 ++-- - 8 files changed, 36 insertions(+), 36 deletions(-) + doc/meson.build | 34 +++++++++++++++++----------------- + meson.build | 8 ++++---- + spa/tests/meson.build | 4 ++-- + src/daemon/meson.build | 6 +++--- + test/meson.build | 4 ++-- + 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/doc/meson.build b/doc/meson.build -index 0e6d7f8e3..082780145 100644 +index 7e876bce5..95fecffc2 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -1,8 +1,8 @@ @@ -32,7 +29,7 @@ index 0e6d7f8e3..082780145 100644 dot_found = find_program('dot', required: false).found() summary({'dot (used with doxygen)': dot_found}, bool_yn: true, section: 'Optional programs') -@@ -49,35 +49,35 @@ extra_docs = [ +@@ -48,35 +48,35 @@ extra_docs = [ inputs = [] foreach extra : extra_docs @@ -81,7 +78,7 @@ index 0e6d7f8e3..082780145 100644 ] # Example files (in order from simple to esoteric) -@@ -118,8 +118,8 @@ input_dirs += [ 'doc/examples.dox' ] +@@ -141,8 +141,8 @@ input_dirs += [ 'doc/pipewire-tools.dox' ] doxyfile_conf.set('inputs', ' '.join(inputs + input_dirs)) doxyfile_conf.set('cssfiles', ' '.join(cssfiles)) doxyfile_conf.set('path_prefixes', ' '.join(path_prefixes)) @@ -93,10 +90,10 @@ index 0e6d7f8e3..082780145 100644 doxyfile = configure_file(input: 'Doxyfile.in', output: 'Doxyfile', diff --git a/meson.build b/meson.build -index b1ea32f7a..67e697c15 100644 +index 440845e37..338192073 100644 --- a/meson.build +++ b/meson.build -@@ -304,9 +304,9 @@ includes_inc = include_directories('include') +@@ -247,9 +247,9 @@ includes_inc = include_directories('include') pipewire_inc = include_directories('src') makedata = configuration_data() @@ -109,7 +106,7 @@ index b1ea32f7a..67e697c15 100644 if version_arr.length() == 4 makedata.set('TAG', 'HEAD') else -@@ -498,7 +498,7 @@ endif +@@ -436,7 +436,7 @@ endif setenv = find_program('pw-uninstalled.sh') run_target('pw-uninstalled', command : [setenv, @@ -118,30 +115,8 @@ index b1ea32f7a..67e697c15 100644 '-v@0@'.format(pipewire_version)] ) -diff --git a/spa/plugins/audioconvert/meson.build b/spa/plugins/audioconvert/meson.build -index de9f491af..4d15271f5 100644 ---- a/spa/plugins/audioconvert/meson.build -+++ b/spa/plugins/audioconvert/meson.build -@@ -140,7 +140,7 @@ foreach a : test_apps - install : installed_tests_enabled, - install_dir : installed_tests_execdir / 'audioconvert'), - env : [ -- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')), -+ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), - ]) - - if installed_tests_enabled -@@ -170,7 +170,7 @@ foreach a : benchmark_apps - install : installed_tests_enabled, - install_dir : installed_tests_execdir / 'audioconvert'), - env : [ -- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')), -+ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), - ]) - - if installed_tests_enabled diff --git a/spa/tests/meson.build b/spa/tests/meson.build -index 990df87bd..9e2a211e2 100644 +index c73c887f4..9c78dcbd2 100644 --- a/spa/tests/meson.build +++ b/spa/tests/meson.build @@ -5,7 +5,7 @@ find = find_program('find', required: false) @@ -153,17 +128,17 @@ index 990df87bd..9e2a211e2 100644 '-name', '*.h', '-not', '-name', 'type-info.h', '-type', 'f', -@@ -40,7 +40,7 @@ foreach a : benchmark_apps +@@ -41,7 +41,7 @@ foreach a : benchmark_apps install_dir : installed_tests_execdir, ), env : [ -- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')), +- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable('plugindir')), + 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), ] ) diff --git a/src/daemon/meson.build b/src/daemon/meson.build -index 44a574337..5e64287a1 100644 +index a2e4c55e3..647d7393d 100644 --- a/src/daemon/meson.build +++ b/src/daemon/meson.build @@ -18,9 +18,9 @@ conf_config.set('pulse_comment', '#') @@ -178,7 +153,7 @@ index 44a574337..5e64287a1 100644 conf_config_uninstalled.set('pulse_comment', '') build_ms = 'media-session' in get_option('session-managers') -@@ -105,7 +105,7 @@ custom_target('pipewire-uninstalled', +@@ -106,7 +106,7 @@ custom_target('pipewire-uninstalled', install: false, input: pipewire_exec, output: 'pipewire-uninstalled', @@ -187,42 +162,8 @@ index 44a574337..5e64287a1 100644 ) #desktop_file = i18n.merge_file( -diff --git a/src/modules/meson.build b/src/modules/meson.build -index 93dc70173..45852f3b9 100644 ---- a/src/modules/meson.build -+++ b/src/modules/meson.build -@@ -370,9 +370,9 @@ test('pw-test-protocol-native', - install_dir : installed_tests_execdir, - ), - env : [ -- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')), -- 'PIPEWIRE_CONFIG_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'confdatadir')), -- 'PIPEWIRE_MODULE_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'moduledir')), -+ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), -+ 'PIPEWIRE_CONFIG_DIR=@0@/src/daemon/'.format(meson.build_root()), -+ 'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.build_root()) - ] - ) - -diff --git a/src/tests/meson.build b/src/tests/meson.build -index 3e8d05012..1b03967fb 100644 ---- a/src/tests/meson.build -+++ b/src/tests/meson.build -@@ -13,9 +13,9 @@ foreach a : test_apps - install : installed_tests_enabled, - install_dir : installed_tests_execdir), - env : [ -- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')), -- 'PIPEWIRE_CONFIG_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'confdatadir')), -- 'PIPEWIRE_MODULE_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'moduledir')), -+ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), -+ 'PIPEWIRE_CONFIG_DIR=@0@/src/daemon/'.format(meson.build_root()), -+ 'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.build_root()) - ]) - - if installed_tests_enabled diff --git a/test/meson.build b/test/meson.build -index 20bdcb210..89f2bc2ec 100644 +index 74908d587..eca92eb24 100644 --- a/test/meson.build +++ b/test/meson.build @@ -14,8 +14,8 @@ pwtest_deps = [ @@ -237,5 +178,5 @@ index 20bdcb210..89f2bc2ec 100644 pwtest_inc = [ -- -2.34.1 +2.35.1 diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-treewide-meson.build-use-dependency-variable-.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-treewide-meson.build-use-dependency-variable-.patch deleted file mode 100644 index 4131e6c27..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-treewide-meson.build-use-dependency-variable-.patch +++ /dev/null @@ -1,1129 +0,0 @@ -From cbe87dc5390c91523a9f0bc3eb126fa500c351e2 Mon Sep 17 00:00:00 2001 -From: Ashok Sidipotu -Date: Fri, 14 Jan 2022 18:23:54 +0530 -Subject: [PATCH 2/4] 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 | 41 +++++++------- - spa/plugins/alsa/acp/meson.build | 4 +- - spa/plugins/alsa/meson.build | 7 +-- - spa/plugins/audioconvert/meson.build | 33 ++++++------ - 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 | 80 ++++++++++++++-------------- - src/modules/spa/meson.build | 16 +++--- - src/pipewire/meson.build | 4 +- - test/meson.build | 11 ++-- - 27 files changed, 160 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 4ad37cdb4..2717b86d6 100644 ---- a/spa/meson.build -+++ b/spa/meson.build -@@ -5,28 +5,7 @@ - #pthread_lib = dependencies('threads') - #mathlib = cc.find_library('m', required : false) - --spa_dep = declare_dependency( -- include_directories : [ -- include_directories('include'), -- ], -- 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') - -@@ -76,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 4d15271f5..6f4fd968b 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, -@@ -192,8 +192,9 @@ 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 b13e23cf4..eca9c9eb5 100644 ---- a/spa/plugins/bluez5/meson.build -+++ b/spa/plugins/bluez5/meson.build -@@ -56,8 +56,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') - -@@ -65,26 +65,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 -@@ -92,9 +92,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 -@@ -108,9 +108,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 9e2a211e2..146cfe08a 100644 ---- a/spa/tests/meson.build -+++ b/spa/tests/meson.build -@@ -20,7 +20,7 @@ if find.found() - configuration: c) - executable('spa-include-test-@0@'.format(spa_header.underscorify()), - src, -- dependencies: [ spa_dep ], -+ include_directories: [spa_inc], - install: false) - endif - endforeach -@@ -35,7 +35,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 5e64287a1..104a6dbf3 100644 ---- a/src/daemon/meson.build -+++ b/src/daemon/meson.build -@@ -86,16 +86,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 45852f3b9..61a53bd6f 100644 ---- a/src/modules/meson.build -+++ b/src/modules/meson.build -@@ -30,20 +30,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 = [] -@@ -53,7 +53,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'] -@@ -63,7 +63,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'] -@@ -73,7 +73,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 -@@ -99,7 +99,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, -@@ -120,7 +120,7 @@ endif - - 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, -@@ -130,17 +130,17 @@ 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 = build_machine.system() == 'linux' - 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, -@@ -152,7 +152,7 @@ summary({'rt': build_module_rt}, bool_yn: true, section: 'Optional Modules') - build_module_rtkit = dbus_dep.found() - if build_module_rtkit - pipewire_module_rtkit = shared_library('pipewire-module-rtkit', [ 'module-rtkit.c' ], -- include_directories : [configinc], -+ include_directories : [configinc, spa_inc], - install : true, - install_dir : modules_install_dir, - install_rpath: modules_install_dir, -@@ -164,7 +164,7 @@ summary({'rtkit': build_module_rtkit}, bool_yn: true, section: 'Optional Modules - 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, -@@ -178,20 +178,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] -@@ -207,7 +207,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, -@@ -281,7 +281,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, -@@ -293,7 +293,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, -@@ -304,7 +304,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, -@@ -313,20 +313,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', -@@ -338,12 +338,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', -@@ -351,12 +351,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', -@@ -364,8 +364,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, - ), -@@ -391,7 +391,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, -@@ -413,11 +413,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() -@@ -426,7 +426,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, -@@ -440,7 +440,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, -@@ -454,7 +454,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, -@@ -470,7 +470,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, -@@ -479,7 +479,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 89f2bc2ec..87e211431 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) - ) - -@@ -80,7 +76,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, -@@ -95,7 +91,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', -@@ -107,7 +103,6 @@ test('test-spa', - 'test-spa-node.c', - 'test-spa-pod.c', - include_directories: pwtest_inc, -- dependencies: [ spa_dep ], - link_with: pwtest_lib) - ) - --- -2.34.1 - diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-treewide-meson.build-use-feature.allowed.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-treewide-meson.build-use-feature.allowed.patch new file mode 100644 index 000000000..eaef35c2e --- /dev/null +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-Revert-treewide-meson.build-use-feature.allowed.patch @@ -0,0 +1,277 @@ +From 6dec8c7faf57a1bd0162a4e790ed031945588d98 Mon Sep 17 00:00:00 2001 +From: Ashok Sidipotu +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-meson-declare-spa_dep-and-override_dependency.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-Revert-meson-declare-spa_dep-and-override_dependency.patch deleted file mode 100644 index 47e4f3cc2..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-Revert-meson-declare-spa_dep-and-override_dependency.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 83b7f6457e5dca3ee2145e35f361f1520d24be42 Mon Sep 17 00:00:00 2001 -From: Ashok Sidipotu -Date: Fri, 14 Jan 2022 18:30:44 +0530 -Subject: [PATCH 3/4] Revert "meson: declare spa_dep and override_dependency() - for spa and pipewire" - -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 67e697c15..476f722b7 100644 ---- a/meson.build -+++ b/meson.build -@@ -1,7 +1,7 @@ - project('pipewire', ['c' ], - version : '0.3.43', - license : [ 'MIT', 'LGPL-2.1-or-later', 'GPL-2.0-only' ], -- meson_version : '>= 0.56.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.34.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 new file mode 100644 index 000000000..40735422f --- /dev/null +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-Revert-treewide-meson.build-use-dependency-variable-.patch @@ -0,0 +1,1141 @@ +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-systemd-correctly-prefix-systemd-system-units.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-Revert-systemd-correctly-prefix-systemd-system-units.patch deleted file mode 100644 index 8b975d07f..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-Revert-systemd-correctly-prefix-systemd-system-units.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 85d47ff146f1bda2f94d32b5b392024089c6f564 Mon Sep 17 00:00:00 2001 -From: Ashok Sidipotu -Date: Fri, 14 Jan 2022 20:51:09 +0530 -Subject: [PATCH 4/4] Revert "systemd: correctly prefix systemd system units" - -This reverts commit 5054b48c9de655b4b48f7c801cb305d9eb122520. - -Upstream-Status: Inappropriate[this systemd configuration is in not relvent to AGL] ---- - src/daemon/systemd/system/meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/daemon/systemd/system/meson.build b/src/daemon/systemd/system/meson.build -index 7e1c223f8..4d942c1ab 100644 ---- a/src/daemon/systemd/system/meson.build -+++ b/src/daemon/systemd/system/meson.build -@@ -1,4 +1,4 @@ --systemd_system_services_dir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir', pkgconfig_define : [ 'rootprefix', prefix]) -+systemd_system_services_dir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir', pkgconfig_define : [ 'prefix', prefix]) - - install_data(sources : 'pipewire.socket', - install_dir : systemd_system_services_dir) --- -2.34.1 - diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-Revert-treewide-meson.build-simplify-get_variable-ca.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-Revert-treewide-meson.build-simplify-get_variable-ca.patch new file mode 100644 index 000000000..bd7e3804f --- /dev/null +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-Revert-treewide-meson.build-simplify-get_variable-ca.patch @@ -0,0 +1,130 @@ +From 82c58fbde3d85465dc4b6e0af460124f67d1e485 Mon Sep 17 00:00:00 2001 +From: Ashok Sidipotu +Date: Thu, 24 Feb 2022 11:36:15 +0530 +Subject: [PATCH 04/12] Revert "treewide: meson.build: simplify + `get_variable()` calls" + +This reverts commit ec465966bcc783203041de09dce5c315bb0a6f76. +Upstream-Status: Inappropriate[meson version dependent] +--- + meson.build | 8 ++++---- + spa/plugins/audioconvert/meson.build | 4 ++-- + spa/tests/meson.build | 2 +- + src/daemon/systemd/system/meson.build | 2 +- + src/daemon/systemd/user/meson.build | 2 +- + src/modules/meson.build | 6 +++--- + src/tests/meson.build | 6 +++--- + 7 files changed, 15 insertions(+), 15 deletions(-) + +diff --git a/meson.build b/meson.build +index 9d806198a..7040e39ac 100644 +--- a/meson.build ++++ b/meson.build +@@ -445,11 +445,11 @@ devenv = environment() + builddir = meson.project_build_root() + srcdir = meson.project_source_root() + +-devenv.set('PIPEWIRE_CONFIG_DIR', pipewire_dep.get_variable('confdatadir')) +-devenv.set('PIPEWIRE_MODULE_DIR', pipewire_dep.get_variable('moduledir')) ++devenv.set('PIPEWIRE_CONFIG_DIR', pipewire_dep.get_variable(internal: 'confdatadir')) ++devenv.set('PIPEWIRE_MODULE_DIR', pipewire_dep.get_variable(internal: 'moduledir')) + +-devenv.set('SPA_PLUGIN_DIR', spa_dep.get_variable('plugindir')) +-devenv.set('SPA_DATA_DIR', spa_dep.get_variable('datadir')) ++devenv.set('SPA_PLUGIN_DIR', spa_dep.get_variable(internal: 'plugindir')) ++devenv.set('SPA_DATA_DIR', spa_dep.get_variable(internal: 'datadir')) + + devenv.set('GST_PLUGIN_PATH', builddir / 'src'/ 'gst') + +diff --git a/spa/plugins/audioconvert/meson.build b/spa/plugins/audioconvert/meson.build +index 55e88ccc4..42332a538 100644 +--- a/spa/plugins/audioconvert/meson.build ++++ b/spa/plugins/audioconvert/meson.build +@@ -140,7 +140,7 @@ foreach a : test_apps + install : installed_tests_enabled, + install_dir : installed_tests_execdir / 'audioconvert'), + env : [ +- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable('plugindir')), ++ 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')), + ]) + + if installed_tests_enabled +@@ -170,7 +170,7 @@ foreach a : benchmark_apps + install : installed_tests_enabled, + install_dir : installed_tests_execdir / 'audioconvert'), + env : [ +- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable('plugindir')), ++ 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')), + ]) + + if installed_tests_enabled +diff --git a/spa/tests/meson.build b/spa/tests/meson.build +index ea00a2cfe..0b26fdf02 100644 +--- a/spa/tests/meson.build ++++ b/spa/tests/meson.build +@@ -42,7 +42,7 @@ foreach a : benchmark_apps + install_dir : installed_tests_execdir, + ), + env : [ +- 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), ++ 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')), + ] + ) + +diff --git a/src/daemon/systemd/system/meson.build b/src/daemon/systemd/system/meson.build +index 84ca0b068..b3e5f1f41 100644 +--- a/src/daemon/systemd/system/meson.build ++++ b/src/daemon/systemd/system/meson.build +@@ -1,4 +1,4 @@ +-systemd_system_services_dir = systemd.get_variable('systemdsystemunitdir', pkgconfig_define : [ 'rootprefix', prefix]) ++systemd_system_services_dir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir', pkgconfig_define : [ 'rootprefix', prefix]) + if get_option('systemd-system-unit-dir') != '' + systemd_system_services_dir = get_option('systemd-system-unit-dir') + endif +diff --git a/src/daemon/systemd/user/meson.build b/src/daemon/systemd/user/meson.build +index d17f3794f..a24f9b174 100644 +--- a/src/daemon/systemd/user/meson.build ++++ b/src/daemon/systemd/user/meson.build +@@ -1,4 +1,4 @@ +-systemd_user_services_dir = systemd.get_variable('systemduserunitdir', pkgconfig_define : [ 'prefix', prefix]) ++systemd_user_services_dir = systemd.get_variable(pkgconfig: 'systemduserunitdir', pkgconfig_define : [ 'prefix', prefix]) + if get_option('systemd-user-unit-dir') != '' + systemd_user_services_dir = get_option('systemd-user-unit-dir') + endif +diff --git a/src/modules/meson.build b/src/modules/meson.build +index ba30275ab..c1225e3e0 100644 +--- a/src/modules/meson.build ++++ b/src/modules/meson.build +@@ -372,9 +372,9 @@ test('pw-test-protocol-native', + install_dir : installed_tests_execdir, + ), + env : [ +- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable('plugindir')), +- 'PIPEWIRE_CONFIG_DIR=@0@'.format(pipewire_dep.get_variable('confdatadir')), +- 'PIPEWIRE_MODULE_DIR=@0@'.format(pipewire_dep.get_variable('moduledir')), ++ 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')), ++ 'PIPEWIRE_CONFIG_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'confdatadir')), ++ 'PIPEWIRE_MODULE_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'moduledir')), + ] + ) + +diff --git a/src/tests/meson.build b/src/tests/meson.build +index 3e03a4c75..3e8d05012 100644 +--- a/src/tests/meson.build ++++ b/src/tests/meson.build +@@ -13,9 +13,9 @@ foreach a : test_apps + install : installed_tests_enabled, + install_dir : installed_tests_execdir), + env : [ +- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable('plugindir')), +- 'PIPEWIRE_CONFIG_DIR=@0@'.format(pipewire_dep.get_variable('confdatadir')), +- 'PIPEWIRE_MODULE_DIR=@0@'.format(pipewire_dep.get_variable('moduledir')), ++ 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')), ++ 'PIPEWIRE_CONFIG_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'confdatadir')), ++ 'PIPEWIRE_MODULE_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'moduledir')), + ]) + + if installed_tests_enabled +-- +2.35.1 + diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-Revert-treewide-meson.build-get-SPA_PLUGIN_DIR-from-.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-Revert-treewide-meson.build-get-SPA_PLUGIN_DIR-from-.patch new file mode 100644 index 000000000..f2a9d0d09 --- /dev/null +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-Revert-treewide-meson.build-get-SPA_PLUGIN_DIR-from-.patch @@ -0,0 +1,124 @@ +From cf7b3a0db10cf0bcd140800ef547199703fdf16e Mon Sep 17 00:00:00 2001 +From: Ashok Sidipotu +Date: Thu, 24 Feb 2022 11:54:54 +0530 +Subject: [PATCH 05/12] Revert "treewide: meson.build: get SPA_PLUGIN_DIR from + dependency" + +This reverts commit 26eb66fb5b56bb5534745a8e223bd099cf5fe4fa. +Upstream-Status: Inappropriate[meson version dependent] +--- + meson.build | 4 ++-- + spa/plugins/audioconvert/meson.build | 4 ++-- + spa/tests/meson.build | 2 +- + src/modules/meson.build | 13 +++---------- + src/tests/meson.build | 6 +++--- + 5 files changed, 11 insertions(+), 18 deletions(-) + +diff --git a/meson.build b/meson.build +index 7040e39ac..1b87bd004 100644 +--- a/meson.build ++++ b/meson.build +@@ -448,8 +448,8 @@ srcdir = meson.project_source_root() + devenv.set('PIPEWIRE_CONFIG_DIR', pipewire_dep.get_variable(internal: 'confdatadir')) + devenv.set('PIPEWIRE_MODULE_DIR', pipewire_dep.get_variable(internal: 'moduledir')) + +-devenv.set('SPA_PLUGIN_DIR', spa_dep.get_variable(internal: 'plugindir')) +-devenv.set('SPA_DATA_DIR', spa_dep.get_variable(internal: 'datadir')) ++ devenv.set('SPA_PLUGIN_DIR', builddir / 'spa' / 'plugins') ++ devenv.set('SPA_DATA_DIR', srcdir / 'spa' / 'plugins') + + devenv.set('GST_PLUGIN_PATH', builddir / 'src'/ 'gst') + +diff --git a/spa/plugins/audioconvert/meson.build b/spa/plugins/audioconvert/meson.build +index 42332a538..3aa0f3846 100644 +--- a/spa/plugins/audioconvert/meson.build ++++ b/spa/plugins/audioconvert/meson.build +@@ -140,7 +140,7 @@ foreach a : test_apps + install : installed_tests_enabled, + install_dir : installed_tests_execdir / 'audioconvert'), + env : [ +- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')), ++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()), + ]) + + if installed_tests_enabled +@@ -170,7 +170,7 @@ foreach a : benchmark_apps + install : installed_tests_enabled, + install_dir : installed_tests_execdir / 'audioconvert'), + env : [ +- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')), ++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()), + ]) + + if installed_tests_enabled +diff --git a/spa/tests/meson.build b/spa/tests/meson.build +index 0b26fdf02..d995cfaa4 100644 +--- a/spa/tests/meson.build ++++ b/spa/tests/meson.build +@@ -42,7 +42,7 @@ foreach a : benchmark_apps + install_dir : installed_tests_execdir, + ), + env : [ +- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')), ++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()), + ] + ) + +diff --git a/src/modules/meson.build b/src/modules/meson.build +index c1225e3e0..bd7d3f711 100644 +--- a/src/modules/meson.build ++++ b/src/modules/meson.build +@@ -140,12 +140,6 @@ pipewire_module_rt = shared_library('pipewire-module-rt', [ 'module-rt.c' ], + install_rpath: modules_install_dir, + dependencies : [dbus_dep, mathlib, dl_lib, pipewire_dep], + ) +-<<<<<<< HEAD +-# TODO: This serves as a temporary alias to prevent breaking existing setups +-# while `module-rtkit` is being migrated to `module-rt` +-pipewire_module_rtkit = shared_library('pipewire-module-rtkit', [ 'module-rt.c' ], +- include_directories : [configinc], +-======= + endif + summary({'rt': build_module_rt}, bool_yn: true, section: 'Optional Modules') + +@@ -153,7 +147,6 @@ build_module_rtkit = dbus_dep.found() + if build_module_rtkit + pipewire_module_rtkit = shared_library('pipewire-module-rtkit', [ 'module-rtkit.c' ], + include_directories : [configinc, spa_inc], +->>>>>>> Revert "treewide: meson.build: use dependency variable for SPA" + install : true, + install_dir : modules_install_dir, + install_rpath: modules_install_dir, +@@ -372,9 +365,9 @@ test('pw-test-protocol-native', + install_dir : installed_tests_execdir, + ), + env : [ +- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')), +- 'PIPEWIRE_CONFIG_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'confdatadir')), +- 'PIPEWIRE_MODULE_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'moduledir')), ++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()), ++ 'PIPEWIRE_CONFIG_DIR=@0@/src/daemon/'.format(meson.project_build_root()), ++ 'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.project_build_root()) + ] + ) + +diff --git a/src/tests/meson.build b/src/tests/meson.build +index 3e8d05012..9a595d431 100644 +--- a/src/tests/meson.build ++++ b/src/tests/meson.build +@@ -13,9 +13,9 @@ foreach a : test_apps + install : installed_tests_enabled, + install_dir : installed_tests_execdir), + env : [ +- 'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable(internal: 'plugindir')), +- 'PIPEWIRE_CONFIG_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'confdatadir')), +- 'PIPEWIRE_MODULE_DIR=@0@'.format(pipewire_dep.get_variable(internal: 'moduledir')), ++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()), ++ 'PIPEWIRE_CONFIG_DIR=@0@/src/daemon/'.format(meson.project_build_root()), ++ 'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.project_build_root()) + ]) + + if installed_tests_enabled +-- +2.35.1 + diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-pipewiresink-set-a-default-channel-map-if-the-number.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-pipewiresink-set-a-default-channel-map-if-the-number.patch deleted file mode 100644 index 3b1b2a490..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-pipewiresink-set-a-default-channel-map-if-the-number.patch +++ /dev/null @@ -1,77 +0,0 @@ -From ee2e6412d37d012fbf8d25bd37271a5ee92b3ad4 Mon Sep 17 00:00:00 2001 -From: George Kiagiadakis -Date: Thu, 3 Feb 2022 15:08:57 +0200 -Subject: [PATCH] pipewiresink: set a default channel map if the number of - channels is fixed - -This allows remaping streams using pipewiresink to match the channel layout -of the target device -Upstream-Status: Backport [from master/0.3.46] ---- - src/gst/gstpipewireformat.c | 42 ++++++++++++++++++++++++++++++++++++- - 1 file changed, 41 insertions(+), 1 deletion(-) - -diff --git a/src/gst/gstpipewireformat.c b/src/gst/gstpipewireformat.c -index dca90267c..c8ce7ba62 100644 ---- a/src/gst/gstpipewireformat.c -+++ b/src/gst/gstpipewireformat.c -@@ -445,6 +445,44 @@ handle_video_fields (ConvertData *d) - return TRUE; - } - -+static void -+set_default_channels (struct spa_pod_builder *b, uint32_t channels) -+{ -+ uint32_t position[SPA_AUDIO_MAX_CHANNELS] = {0}; -+ gboolean ok = TRUE; -+ -+ switch (channels) { -+ case 8: -+ position[6] = SPA_AUDIO_CHANNEL_SL; -+ position[7] = SPA_AUDIO_CHANNEL_SR; -+ SPA_FALLTHROUGH -+ case 6: -+ position[5] = SPA_AUDIO_CHANNEL_LFE; -+ SPA_FALLTHROUGH -+ case 5: -+ position[4] = SPA_AUDIO_CHANNEL_FC; -+ SPA_FALLTHROUGH -+ case 4: -+ position[2] = SPA_AUDIO_CHANNEL_RL; -+ position[3] = SPA_AUDIO_CHANNEL_RR; -+ SPA_FALLTHROUGH -+ case 2: -+ position[0] = SPA_AUDIO_CHANNEL_FL; -+ position[1] = SPA_AUDIO_CHANNEL_FR; -+ break; -+ case 1: -+ position[0] = SPA_AUDIO_CHANNEL_MONO; -+ break; -+ default: -+ ok = FALSE; -+ break; -+ } -+ -+ if (ok) -+ spa_pod_builder_add (b, SPA_FORMAT_AUDIO_position, -+ SPA_POD_Array(sizeof(uint32_t), SPA_TYPE_Id, channels, position), 0); -+} -+ - static gboolean - handle_audio_fields (ConvertData *d) - { -@@ -538,8 +576,10 @@ handle_audio_fields (ConvertData *d) - } - if (i > 0) { - choice = spa_pod_builder_pop(&d->b, &f); -- if (i == 1) -+ if (i == 1) { - choice->body.type = SPA_CHOICE_None; -+ set_default_channels (&d->b, v); -+ } - } - } - return TRUE; --- -2.34.1 - diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/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 new file mode 100644 index 000000000..fe44c07ed --- /dev/null +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0006-Revert-meson-declare-spa_dep-and-override_dependency.patch @@ -0,0 +1,82 @@ +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 new file mode 100644 index 000000000..3fff8eb27 --- /dev/null +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0007-Revert-meson-use-meson-variables-for-the-SMs-uninsta.patch @@ -0,0 +1,47 @@ +From 4e8241675e68d5fb082d42ff597e681955eabbc4 Mon Sep 17 00:00:00 2001 +From: Ashok Sidipotu +Date: Thu, 24 Feb 2022 12:37:27 +0530 +Subject: [PATCH 07/12] Revert "meson: use meson variables for the SMs' + uninstalled scripts" + +This reverts commit d5825b8551c34cefabf278a6b5ed04bc6ab0f301. +Upstream-Status: Inappropriate[meson version dependent] +--- + src/daemon/meson.build | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +diff --git a/src/daemon/meson.build b/src/daemon/meson.build +index 28cbe4467..cd17d23c3 100644 +--- a/src/daemon/meson.build ++++ b/src/daemon/meson.build +@@ -46,17 +46,21 @@ elif default_sm == 'media-session' + ms_bindir = ms_proj.get_variable('media_session_bin_dir', pipewire_bindir) + conf_config.set('session_manager_path', ms_bindir / 'pipewire-media-session') + +- ms_uninstalled = ms_proj.get_variable('media_session_uninstalled') +- conf_config_uninstalled.set('session_manager_path', ms_uninstalled.full_path()) +- conf_config_uninstalled.set('session_manager_args', 'pipewire-media-session') ++ conf_config_uninstalled.set('session_manager_path', ++ meson.source_root() / 'subprojects' / 'media-session' / 'media-session-uninstalled.sh') ++ conf_config_uninstalled.set('session_manager_args', ++ '-b ' + meson.build_root() / 'subprojects' / 'media-session' + ' pipewire-media-session') + conf_config_uninstalled.set('sm_comment', '') + elif default_sm == 'wireplumber' + wp_bindir = wp_proj.get_variable('wireplumber_bin_dir', pipewire_bindir) ++ + conf_config.set('session_manager_path', wp_bindir / 'wireplumber') + +- wp_uninstalled = wp_proj.get_variable('wireplumber_uninstalled') +- conf_config_uninstalled.set('session_manager_path', wp_uninstalled.full_path()) +- conf_config_uninstalled.set('session_manager_args', 'wireplumber') ++ # wp-uninstalled.sh -b path/to/wp/build/root wireplumber ++ conf_config_uninstalled.set('session_manager_path', ++ meson.source_root() / 'subprojects' / 'wireplumber' / 'wp-uninstalled.sh') ++ conf_config_uninstalled.set('session_manager_args', ++ '-b ' + meson.build_root() / 'subprojects' / 'wireplumber' + ' wireplumber') + conf_config_uninstalled.set('sm_comment', '') + else + conf_config_uninstalled.set('session_manager_path', default_sm) +-- +2.35.1 + diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0008-Revert-meson-declare-spa_dep-and-override_dependency.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0008-Revert-meson-declare-spa_dep-and-override_dependency.patch new file mode 100644 index 000000000..751adbe5b --- /dev/null +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0008-Revert-meson-declare-spa_dep-and-override_dependency.patch @@ -0,0 +1,31 @@ +From c5b9c082dafe2ad2ac118ffd39c5b88307f3357f Mon Sep 17 00:00:00 2001 +From: Ashok Sidipotu +Date: Thu, 24 Feb 2022 16:12:23 +0530 +Subject: [PATCH 08/12] Revert "meson: declare spa_dep and + override_dependency() for spa and pipewire" + +This reverts commit 7ab5c35cadc075bcdf44031f1f7d95352cf9a13b. +--- + src/pipewire/meson.build | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/src/pipewire/meson.build b/src/pipewire/meson.build +index 5cfaba3f9..2dd5d790e 100644 +--- a/src/pipewire/meson.build ++++ b/src/pipewire/meson.build +@@ -121,11 +121,6 @@ pkgconfig.generate(libpipewire, + description : 'PipeWire Interface', + version : pipewire_version, + extra_cflags : '-D_REENTRANT', +- variables : ['moduledir=${libdir}/@0@'.format(pipewire_name)], +- uninstalled_variables : [ +- 'moduledir=${prefix}/src/modules', +- 'confdatadir=${prefix}/src/daemon', +- ], +-) ++ variables : ['moduledir=${libdir}/@0@'.format(pipewire_name)]) + + subdir('extensions') +-- +2.35.1 + diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0009-Revert-test-add-test-for-the-loop.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0009-Revert-test-add-test-for-the-loop.patch new file mode 100644 index 000000000..6628c5c34 --- /dev/null +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0009-Revert-test-add-test-for-the-loop.patch @@ -0,0 +1,32 @@ +From bf29285fb6e534b754a3b0c7b33d2a0ed3b98b79 Mon Sep 17 00:00:00 2001 +From: Ashok Sidipotu +Date: Thu, 24 Feb 2022 16:13:54 +0530 +Subject: [PATCH 09/12] Revert "test: add test for the loop" + +This reverts commit 5ac5ebfe19618f303c2bb4f0f9295baba0299961. +--- + test/meson.build | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/test/meson.build b/test/meson.build +index 4108ac14b..87e211431 100644 +--- a/test/meson.build ++++ b/test/meson.build +@@ -71,14 +71,6 @@ test('test-client', + link_with: pwtest_lib) + ) + +-test('test-loop', +- executable('test-loop', +- 'test-loop.c', +- include_directories: pwtest_inc, +- dependencies: [ spa_dep ], +- link_with: pwtest_lib) +-) +- + test('test-context', + executable('test-context', + 'test-context.c', +-- +2.35.1 + diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0010-Revert-spa-improve-the-AEC-interface.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0010-Revert-spa-improve-the-AEC-interface.patch new file mode 100644 index 000000000..8bf945479 --- /dev/null +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0010-Revert-spa-improve-the-AEC-interface.patch @@ -0,0 +1,502 @@ +From 3ac842085c60a0c745bd3f8f0d8419e98220675b Mon Sep 17 00:00:00 2001 +From: Ashok Sidipotu +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 new file mode 100644 index 000000000..4d62abcfc --- /dev/null +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0011-Revert-module-echo-cancel-Move-backends-to-dynamic-l.patch @@ -0,0 +1,1055 @@ +From 7f14334d055da433521c32c622682f89fe2dd1c5 Mon Sep 17 00:00:00 2001 +From: Ashok Sidipotu +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 new file mode 100644 index 000000000..69731a4f1 --- /dev/null +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0012-Miscellanous-changes-to-account-for-lower-version-of.patch @@ -0,0 +1,166 @@ +From b781a4dbb45191a4b2746d5fe12d6f907681441c Mon Sep 17 00:00:00 2001 +From: Ashok Sidipotu +Date: Thu, 24 Feb 2022 12:28:59 +0530 +Subject: [PATCH 12/12] Miscellanous changes to account for lower version of + meson in agl + +Upstream-Status: Inappropriate[meson version dependent] +--- + meson.build | 30 ++++++++++++++------------- + spa/plugins/audioconvert/meson.build | 4 ++-- + spa/tests/meson.build | 2 +- + src/daemon/systemd/system/meson.build | 5 +---- + src/modules/meson.build | 18 +++------------- + src/tests/meson.build | 6 +++--- + 6 files changed, 26 insertions(+), 39 deletions(-) + +diff --git a/meson.build b/meson.build +index af60472f8..7106eeaad 100644 +--- a/meson.build ++++ b/meson.build +@@ -440,25 +440,27 @@ run_target('pw-uninstalled', + '-v@0@'.format(pipewire_version)] + ) + +-devenv = environment() ++if meson.version().version_compare('>=0.58.0') ++ devenv = environment() + +-builddir = meson.project_build_root() +-srcdir = meson.project_source_root() ++ builddir = meson.build_root() ++ srcdir = meson.source_root() + +-devenv.set('PIPEWIRE_CONFIG_DIR', pipewire_dep.get_variable(internal: 'confdatadir')) +-devenv.set('PIPEWIRE_MODULE_DIR', pipewire_dep.get_variable(internal: 'moduledir')) ++ devenv.set('PIPEWIRE_CONFIG_DIR', pipewire_dep.get_variable(internal: 'confdatadir')) ++ devenv.set('PIPEWIRE_MODULE_DIR', pipewire_dep.get_variable(internal: 'moduledir')) + +- devenv.set('SPA_PLUGIN_DIR', builddir / 'spa' / 'plugins') +- devenv.set('SPA_DATA_DIR', srcdir / 'spa' / 'plugins') ++ devenv.set('SPA_PLUGIN_DIR', builddir / 'spa' / 'plugins') ++ devenv.set('SPA_DATA_DIR', srcdir / 'spa' / 'plugins') + +-devenv.set('GST_PLUGIN_PATH', builddir / 'src'/ 'gst') ++ devenv.set('GST_PLUGIN_PATH', builddir / 'src'/ 'gst') + +-devenv.set('ALSA_PLUGIN_DIR', builddir / 'pipewire-alsa' / 'alsa-plugins') +-devenv.set('ACP_PATHS_DIR', srcdir / 'spa' / 'plugins' / 'alsa' / 'mixer' / 'paths') +-devenv.set('ACP_PROFILES_DIR', srcdir / 'spa' / 'plugins' / 'alsa' / 'mixer' / 'profile-sets') ++ devenv.set('ALSA_PLUGIN_DIR', builddir / 'pipewire-alsa' / 'alsa-plugins') ++ devenv.set('ACP_PATHS_DIR', srcdir / 'spa' / 'plugins' / 'alsa' / 'mixer' / 'paths') ++ devenv.set('ACP_PROFILES_DIR', srcdir / 'spa' / 'plugins' / 'alsa' / 'mixer' / 'profile-sets') + +-devenv.set('LD_LIBRARY_PATH', builddir / 'pipewire-jack' / 'src') ++ devenv.set('LD_LIBRARY_PATH', builddir / 'pipewire-jack' / 'src') + +-devenv.set('PW_UNINSTALLED', '1') ++ devenv.set('PW_UNINSTALLED', '1') + +-meson.add_devenv(devenv) ++ meson.add_devenv(devenv) ++endif +diff --git a/spa/plugins/audioconvert/meson.build b/spa/plugins/audioconvert/meson.build +index 3aa0f3846..6f4fd968b 100644 +--- a/spa/plugins/audioconvert/meson.build ++++ b/spa/plugins/audioconvert/meson.build +@@ -140,7 +140,7 @@ foreach a : test_apps + install : installed_tests_enabled, + install_dir : installed_tests_execdir / 'audioconvert'), + env : [ +- 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()), ++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), + ]) + + if installed_tests_enabled +@@ -170,7 +170,7 @@ foreach a : benchmark_apps + install : installed_tests_enabled, + install_dir : installed_tests_execdir / 'audioconvert'), + env : [ +- 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()), ++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), + ]) + + if installed_tests_enabled +diff --git a/spa/tests/meson.build b/spa/tests/meson.build +index d995cfaa4..ea00a2cfe 100644 +--- a/spa/tests/meson.build ++++ b/spa/tests/meson.build +@@ -42,7 +42,7 @@ foreach a : benchmark_apps + install_dir : installed_tests_execdir, + ), + env : [ +- 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()), ++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), + ] + ) + +diff --git a/src/daemon/systemd/system/meson.build b/src/daemon/systemd/system/meson.build +index b3e5f1f41..4d942c1ab 100644 +--- a/src/daemon/systemd/system/meson.build ++++ b/src/daemon/systemd/system/meson.build +@@ -1,7 +1,4 @@ +-systemd_system_services_dir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir', pkgconfig_define : [ 'rootprefix', prefix]) +-if get_option('systemd-system-unit-dir') != '' +- systemd_system_services_dir = get_option('systemd-system-unit-dir') +-endif ++systemd_system_services_dir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir', pkgconfig_define : [ 'prefix', prefix]) + + install_data(sources : 'pipewire.socket', + install_dir : systemd_system_services_dir) +diff --git a/src/modules/meson.build b/src/modules/meson.build +index 568b32c50..8cf4f781d 100644 +--- a/src/modules/meson.build ++++ b/src/modules/meson.build +@@ -150,18 +150,6 @@ pipewire_module_rt = shared_library('pipewire-module-rt', [ 'module-rt.c' ], + endif + summary({'rt': build_module_rt}, bool_yn: true, section: 'Optional Modules') + +-build_module_rtkit = dbus_dep.found() +-if build_module_rtkit +-pipewire_module_rtkit = shared_library('pipewire-module-rtkit', [ 'module-rtkit.c' ], +- include_directories : [configinc, spa_inc], +- install : true, +- install_dir : modules_install_dir, +- install_rpath: modules_install_dir, +- dependencies : [dbus_dep, mathlib, dl_lib, pipewire_dep], +-) +-endif +-summary({'rt': build_module_rt}, bool_yn: true, section: 'Optional Modules') +- + build_module_portal = dbus_dep.found() + if build_module_portal + pipewire_module_portal = shared_library('pipewire-module-portal', [ 'module-portal.c' ], +@@ -372,9 +360,9 @@ test('pw-test-protocol-native', + install_dir : installed_tests_execdir, + ), + env : [ +- 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()), +- 'PIPEWIRE_CONFIG_DIR=@0@/src/daemon/'.format(meson.project_build_root()), +- 'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.project_build_root()) ++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), ++ 'PIPEWIRE_CONFIG_DIR=@0@/src/daemon/'.format(meson.build_root()), ++ 'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.build_root()) + ] + ) + +diff --git a/src/tests/meson.build b/src/tests/meson.build +index 9a595d431..1b03967fb 100644 +--- a/src/tests/meson.build ++++ b/src/tests/meson.build +@@ -13,9 +13,9 @@ foreach a : test_apps + install : installed_tests_enabled, + install_dir : installed_tests_execdir), + env : [ +- 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.project_build_root()), +- 'PIPEWIRE_CONFIG_DIR=@0@/src/daemon/'.format(meson.project_build_root()), +- 'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.project_build_root()) ++ 'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), ++ 'PIPEWIRE_CONFIG_DIR=@0@/src/daemon/'.format(meson.build_root()), ++ 'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.build_root()) + ]) + + if installed_tests_enabled +-- +2.35.1 + diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.43.bb b/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.43.bb deleted file mode 100644 index f1d4b3863..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.43.bb +++ /dev/null @@ -1,316 +0,0 @@ -# This recipe was written by Carlos Rafael Giani -# for meta-oe -# -# The intention is to keep this synced with meta-oe and remove it when we -# can depend on meta-oe to provide this recipe for us -# -# AGL-specific overrides and configuration should go in the .bbappend file -# -SUMMARY = "Multimedia processing server for Linux" -DESCRIPTION = "Linux server for handling and routing audio and video streams between applications and multimedia I/O devices" -HOMEPAGE = "https://pipewire.org/" -BUGTRACKER = "https://gitlab.freedesktop.org/pipewire/pipewire/issues" -LICENSE = "MIT & GPL-2.0-only & LGPL-2.1-or-later" - -LIC_FILES_CHKSUM = " \ - file://LICENSE;md5=2158739e172e58dc9ab1bdd2d6ec9c72 \ - file://COPYING;md5=97be96ca4fab23e9657ffa590b931c1a \ -" -SECTION = "multimedia" - -DEPENDS = "dbus" - -# v0.3.43 -SRCREV = "07724b7aefa8a23a016727b53f4e426ecd63d248" -SRC_URI = "git://gitlab.freedesktop.org/pipewire/pipewire.git;branch=master;protocol=https" - -S = "${WORKDIR}/git" - -inherit meson pkgconfig systemd manpages gettext useradd - -USERADD_PACKAGES = "${PN}" - -GROUPADD_PARAM:${PN} = "--system pipewire" - -USERADD_PARAM:${PN} = "--system --home / --no-create-home \ - --comment 'PipeWire multimedia daemon' \ - --gid pipewire --groups audio,video \ - pipewire" - -# For "EVL", look up https://evlproject.org/ . It involves -# a specially prepared kernel, and is currently unavailable -# in Yocto. -# -# FFmpeg and Vulkan aren't really supported - at the current -# stage (version 0.3.22), these are just experiments, not -# actual features. -# -# libcamera support currently does not build successfully. -# -# systemd user service files are disabled because per-user -# PipeWire instances aren't really something that makes -# much sense in an embedded environment. A system-wide -# instance does. -# -# manpage generation requires xmltoman, which is not available. -# -# Dont build any session managers along with pipewire -# wireplumber is the session manger used in AGL and it will -# be build in a different recipe -# -EXTRA_OEMESON += " \ - -Daudiotestsrc=enabled \ - -Devl=disabled \ - -Dsystemd-user-service=disabled \ - -Dtests=disabled \ - -Dudevrulesdir=${nonarch_base_libdir}/udev/rules.d/ \ - -Dvideotestsrc=enabled \ - -Dffmpeg=disabled \ - -Dvulkan=disabled \ - -Dlibcamera=disabled \ - -Dman=disabled \ - -Dsession-managers=[] \ -" - -PACKAGECONFIG ??= "\ - ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \ - ${@bb.utils.filter('DISTRO_FEATURES', 'alsa systemd', d)} \ - gstreamer jack v4l2 \ -" - -# "jack" and "pipewire-jack" packageconfigs cannot be both enabled, -# since "jack" imports libjack, and "pipewire-jack" generates -# libjack.so* files, thus colliding with the libpack package. This -# is why these two are marked in their respective packageconfigs -# as being in conflict. - -PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib udev" -PACKAGECONFIG[bluez] = "-Dbluez5=enabled,-Dbluez5=disabled,bluez5 sbc" -PACKAGECONFIG[docs] = "-Ddocs=enabled,-Ddocs=disabled,doxygen-native" -PACKAGECONFIG[gstreamer] = "-Dgstreamer=enabled,-Dgstreamer=disabled,glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base" -PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack,,,pipewire-jack" -PACKAGECONFIG[sdl2] = "-Dsdl2=enabled,-Dsdl2=disabled,virtual/libsdl2" -PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1" -PACKAGECONFIG[systemd] = "-Dsystemd=enabled -Dsystemd-system-service=enabled ,-Dsystemd=disabled -Dsystemd-system-service=disabled,systemd" -PACKAGECONFIG[v4l2] = "-Dv4l2=enabled,-Dv4l2=disabled,udev" -PACKAGECONFIG[pipewire-alsa] = "-Dpipewire-alsa=enabled,-Dpipewire-alsa=disabled,alsa-lib" -PACKAGECONFIG[pipewire-jack] = "-Dpipewire-jack=enabled -Dlibjack-path=${libdir}/${PW_MODULE_SUBDIR}/jack,-Dpipewire-jack=disabled,jack,,,jack" -PACKAGECONFIG[pipewire-v4l2] = "-Dpipewire-v4l2=enabled -Dpipewire-v4l2=${libdir}/${PW_MODULE_SUBDIR}/v4l2,-Dpipewire-v4l2=disabled,v4l2" - -PACKAGESPLITFUNCS:prepend = " split_dynamic_packages " -PACKAGESPLITFUNCS:append = " set_dynamic_metapkg_rdepends " -PACKAGESPLITFUNCS:append = " fixup_dynamic_pkg_licenses " - -SPA_SUBDIR = "spa-0.2" -PW_MODULE_SUBDIR = "pipewire-0.3" - -remove_unused_installed_files() { - # jack.conf is used by pipewire-jack (not the JACK SPA plugin). - # Remove it if pipewire-jack is not built to avoid creating the - # pipewire-jack package. - if ${@bb.utils.contains('PACKAGECONFIG', 'pipewire-jack', 'false', 'true', d)}; then - rm -f "${D}${datadir}/pipewire/jack.conf" - fi -} - -do_install[postfuncs] += "remove_unused_installed_files" - -python fixup_dynamic_pkg_licenses () { - #dynamic packages inherit currently whatever is specified in LICENSE (thus multiple) - packages = (d.getVar('PACKAGES') or "").split() - - for pkg in packages: - # we manually assign the LICENSES here to cover all packages (even dynamically created ones) - d.setVar("LICENSE:" + pkg ,"MIT") - - # next handle special cases - # ==> LICENSE:${PN}-spa-plugins-alsa = "LGPL-2.1-or-later" - if "pipewire-spa-plugins-alsa" in pkg: - d.setVar("LICENSE:pipewire-spa-plugins-alsa", "LGPL-2.1-or-later") - # ==> LICENSE:${PN}-alsa-card-profile = "LGPL-2.1-or-later" - if "pipewire-alsa-card-profile" in pkg: - d.setVar("LICENSE:pipewire-alsa-card-profile", "LGPL-2.1-or-later") - # ==> LICENSE:${PN}-jack = "GPL-2.0-only" - if "pipewire-jack" in pkg: - d.setVar("LICENSE:pipewire-jack", "GPL-2.0-only") -} - -python split_dynamic_packages () { - # Create packages for each SPA plugin. These plugins are located - # in individual subdirectories, so a recursive search is needed. - spa_libdir = d.expand('${libdir}/${SPA_SUBDIR}') - do_split_packages(d, spa_libdir, r'^libspa-(.*)\.so$', d.expand('${PN}-spa-plugins-%s'), 'PipeWire SPA plugin for %s', extra_depends='', recursive=True) - - # Create packages for each PipeWire module. - pw_module_libdir = d.expand('${libdir}/${PW_MODULE_SUBDIR}') - do_split_packages(d, pw_module_libdir, r'^libpipewire-module-(.*)\.so$', d.expand('${PN}-modules-%s'), 'PipeWire %s module', extra_depends='', recursive=False) -} - -python set_dynamic_metapkg_rdepends () { - import os - import oe.utils - - # Go through all generated SPA plugin and PipeWire module packages - # (excluding the main package and the -meta package itself) and - # add them to the -meta package as RDEPENDS. - - base_pn = d.getVar('PN') - - spa_pn = base_pn + '-spa-plugins' - spa_metapkg = spa_pn + '-meta' - - pw_module_pn = base_pn + '-modules' - pw_module_metapkg = pw_module_pn + '-meta' - - d.setVar('ALLOW_EMPTY:' + spa_metapkg, "1") - d.setVar('FILES:' + spa_metapkg, "") - - d.setVar('ALLOW_EMPTY:' + pw_module_metapkg, "1") - d.setVar('FILES:' + pw_module_metapkg, "") - - blacklist = [ spa_pn, spa_metapkg, pw_module_pn, pw_module_metapkg ] - spa_metapkg_rdepends = [] - pw_module_metapkg_rdepends = [] - pkgdest = d.getVar('PKGDEST') - - for pkg in oe.utils.packages_filter_out_system(d): - if pkg in blacklist: - continue - - is_spa_pkg = pkg.startswith(spa_pn) - is_pw_module_pkg = pkg.startswith(pw_module_pn) - if not is_spa_pkg and not is_pw_module_pkg: - continue - - if pkg in spa_metapkg_rdepends or pkg in pw_module_metapkg_rdepends: - continue - - # See if the package is empty by looking at the contents of its - # PKGDEST subdirectory. If this subdirectory is empty, then then - # package is empty as well. Empty packages do not get added to - # the meta package's RDEPENDS. - pkgdir = os.path.join(pkgdest, pkg) - if os.path.exists(pkgdir): - dir_contents = os.listdir(pkgdir) or [] - else: - dir_contents = [] - is_empty = len(dir_contents) == 0 - if not is_empty: - if is_spa_pkg: - spa_metapkg_rdepends.append(pkg) - if is_pw_module_pkg: - pw_module_metapkg_rdepends.append(pkg) - - d.setVar('RDEPENDS:' + spa_metapkg, ' '.join(spa_metapkg_rdepends)) - d.setVar('DESCRIPTION:' + spa_metapkg, spa_pn + ' meta package') - - d.setVar('RDEPENDS:' + pw_module_metapkg, ' '.join(pw_module_metapkg_rdepends)) - d.setVar('DESCRIPTION:' + pw_module_metapkg, pw_module_pn + ' meta package') -} - -PACKAGES =+ "\ - libpipewire \ - ${PN}-tools \ - ${PN}-pulse \ - ${PN}-alsa \ - ${PN}-jack \ - ${PN}-v4l2 \ - ${PN}-spa-plugins \ - ${PN}-spa-plugins-meta \ - ${PN}-spa-tools \ - ${PN}-modules \ - ${PN}-modules-meta \ - ${PN}-alsa-card-profile \ - gstreamer1.0-pipewire \ -" - -PACKAGES_DYNAMIC = "^${PN}-spa-plugins.* ^${PN}-modules.*" - -SYSTEMD_SERVICE:${PN} = "pipewire.service" -CONFFILES:${PN} += "${datadir}/pipewire/pipewire.conf" -FILES:${PN} = " \ - ${datadir}/pipewire/pipewire.conf \ - ${datadir}/pipewire/filter-chain \ - ${systemd_user_unitdir}/pipewire.* \ - ${bindir}/pipewire \ -" - -FILES:${PN}-dev += " \ - ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so \ -" - -CONFFILES:libpipewire += "${datadir}/pipewire/client.conf" -FILES:libpipewire = " \ - ${datadir}/pipewire/client.conf \ - ${libdir}/libpipewire-*.so.* \ -" -# Add the bare minimum modules and plugins required to be able -# to use libpipewire. Without these, it is essentially unusable. -RDEPENDS:libpipewire += " \ - ${PN}-modules-client-node \ - ${PN}-modules-protocol-native \ - ${PN}-spa-plugins-support \ -" - -FILES:${PN}-tools = " \ - ${bindir}/pw-* \ -" - -# This is a shim daemon that is intended to be used as a -# drop-in PulseAudio replacement, providing a pulseaudio-compatible -# socket that can be used by applications that use libpulse. -CONFFILES:${PN}-pulse += "${datadir}/pipewire/pipewire-pulse.conf" - -FILES:${PN}-pulse = " \ - ${datadir}/pipewire/pipewire-pulse.conf \ - ${systemd_user_unitdir}/pipewire-pulse.* \ - ${bindir}/pipewire-pulse \ -" -RDEPENDS:${PN}-pulse += " \ - ${PN}-modules-protocol-pulse \ -" - -# alsa plugin to redirect audio to pipewire -FILES:${PN}-alsa = "\ - ${libdir}/alsa-lib/* \ - ${datadir}/alsa/alsa.conf.d/* \ -" - -#lib to emulate v4l2 system calls on top of PipeWire -FILES:${PN}-v4l2 = "\ - ${libdir}/${PW_MODULE_SUBDIR}/v4l2/libpw-v4l2.so \ -" - -# jack drop-in libraries to redirect audio to pipewire -CONFFILES:${PN}-jack = "${datadir}/pipewire/jack.conf" -FILES:${PN}-jack = "\ - ${datadir}/pipewire/jack.conf \ - ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so.* \ -" -# Dynamic packages (see set_dynamic_metapkg_rdepends). -FILES:${PN}-spa-plugins-bluez5 += " \ - ${datadir}/${SPA_SUBDIR}/bluez5/bluez-hardware.conf \ -" -RRECOMMENDS:${PN}-spa-plugins += "${PN}-spa-plugins-meta" - -FILES:${PN}-spa-tools = " \ - ${bindir}/spa-* \ -" - -# Dynamic packages (see set_dynamic_metapkg_rdepends). -FILES:${PN}-modules = "" -RRECOMMENDS:${PN}-modules += "${PN}-modules-meta" - -CONFFILES:${PN}-modules-rtkit = "${datadir}/pipewire/client-rt.conf" -FILES:${PN}-modules-rtkit += " \ - ${datadir}/pipewire/client-rt.conf \ - " - -FILES:${PN}-alsa-card-profile = " \ - ${datadir}/alsa-card-profile/* \ - ${nonarch_base_libdir}/udev/rules.d/90-pipewire-alsa.rules \ -" - -FILES:gstreamer1.0-pipewire = " \ - ${libdir}/gstreamer-1.0/* \ -" diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.43.bbappend b/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.43.bbappend deleted file mode 100644 index 8d3df64cb..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.43.bbappend +++ /dev/null @@ -1,29 +0,0 @@ -PACKAGECONFIG = "\ - ${@bb.utils.contains('DISTRO_FEATURES', 'bluez5', 'bluez', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa pipewire-alsa', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', 'sndfile', '', d)} \ - ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \ - gstreamer v4l2 \ -" - -SRC_URI += "\ - file://0001-Revert-treewide-meson.build-use-project_-build-sourc.patch \ - file://0002-Revert-treewide-meson.build-use-dependency-variable-.patch \ - file://0003-Revert-meson-declare-spa_dep-and-override_dependency.patch \ - file://0004-Revert-systemd-correctly-prefix-systemd-system-units.patch \ - file://0005-pipewiresink-set-a-default-channel-map-if-the-number.patch \ -" - -do_install:append() { - # install symlinks to alsalib configuration files - for i in 50-pipewire.conf 99-pipewire-default.conf; do - if [ -f ${D}${datadir}/alsa/alsa.conf.d/${i} ]; then - mkdir -p ${D}${sysconfdir}/alsa/conf.d - ln -s ${datadir}/alsa/alsa.conf.d/${i} ${D}${sysconfdir}/alsa/conf.d/${i} - fi - done -} - -FILES:${PN}-alsa:append = "\ - ${sysconfdir}/alsa/conf.d/* \ -" diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.47.bb b/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.47.bb new file mode 100644 index 000000000..c7479bec9 --- /dev/null +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.47.bb @@ -0,0 +1,318 @@ +# This recipe was written by Carlos Rafael Giani +# for meta-oe +# +# The intention is to keep this synced with meta-oe and remove it when we +# can depend on meta-oe to provide this recipe for us +# +# AGL-specific overrides and configuration should go in the .bbappend file +# +SUMMARY = "Multimedia processing server for Linux" +DESCRIPTION = "Linux server for handling and routing audio and video streams between applications and multimedia I/O devices" +HOMEPAGE = "https://pipewire.org/" +BUGTRACKER = "https://gitlab.freedesktop.org/pipewire/pipewire/issues" +LICENSE = "MIT & GPL-2.0-only & LGPL-2.1-or-later" + +LIC_FILES_CHKSUM = " \ + file://LICENSE;md5=2158739e172e58dc9ab1bdd2d6ec9c72 \ + file://COPYING;md5=97be96ca4fab23e9657ffa590b931c1a \ +" +SECTION = "multimedia" + +DEPENDS = "dbus" + +# v0.3.47 +SRCREV = "2af393889358723a2789caa3c856700b1c968ef0" +SRC_URI = "git://gitlab.freedesktop.org/pipewire/pipewire.git;branch=master;protocol=https" + +S = "${WORKDIR}/git" + +inherit meson pkgconfig systemd manpages gettext useradd + +USERADD_PACKAGES = "${PN}" + +GROUPADD_PARAM:${PN} = "--system pipewire" + +USERADD_PARAM:${PN} = "--system --home / --no-create-home \ + --comment 'PipeWire multimedia daemon' \ + --gid pipewire --groups audio,video \ + pipewire" + +# For "EVL", look up https://evlproject.org/ . It involves +# a specially prepared kernel, and is currently unavailable +# in Yocto. +# +# FFmpeg and Vulkan aren't really supported - at the current +# stage (version 0.3.22), these are just experiments, not +# actual features. +# +# libcamera support currently does not build successfully. +# +# systemd user service files are disabled because per-user +# PipeWire instances aren't really something that makes +# much sense in an embedded environment. A system-wide +# instance does. +# +# manpage generation requires xmltoman, which is not available. +# +# Dont build any session managers along with pipewire +# wireplumber is the session manger used in AGL and it will +# be build in a different recipe +# +EXTRA_OEMESON += " \ + -Daudiotestsrc=enabled \ + -Devl=disabled \ + -Dsystemd-user-service=disabled \ + -Dtests=disabled \ + -Dudevrulesdir=${nonarch_base_libdir}/udev/rules.d/ \ + -Dvideotestsrc=enabled \ + -Dffmpeg=disabled \ + -Dvulkan=disabled \ + -Dlibcamera=disabled \ + -Dman=disabled \ + -Dsession-managers=[] \ +" + +PACKAGECONFIG ??= "\ + ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'alsa systemd', d)} \ + gstreamer jack v4l2 \ +" + +# "jack" and "pipewire-jack" packageconfigs cannot be both enabled, +# since "jack" imports libjack, and "pipewire-jack" generates +# libjack.so* files, thus colliding with the libpack package. This +# is why these two are marked in their respective packageconfigs +# as being in conflict. + +PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib udev" +PACKAGECONFIG[bluez] = "-Dbluez5=enabled,-Dbluez5=disabled,bluez5 sbc" +PACKAGECONFIG[docs] = "-Ddocs=enabled,-Ddocs=disabled,doxygen-native" +PACKAGECONFIG[gstreamer] = "-Dgstreamer=enabled,-Dgstreamer=disabled,glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base" +PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack,,,pipewire-jack" +PACKAGECONFIG[sdl2] = "-Dsdl2=enabled,-Dsdl2=disabled,virtual/libsdl2" +PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1" +PACKAGECONFIG[systemd] = "-Dsystemd=enabled -Dsystemd-system-service=enabled ,-Dsystemd=disabled -Dsystemd-system-service=disabled,systemd" +PACKAGECONFIG[v4l2] = "-Dv4l2=enabled,-Dv4l2=disabled,udev" +PACKAGECONFIG[pipewire-alsa] = "-Dpipewire-alsa=enabled,-Dpipewire-alsa=disabled,alsa-lib" +PACKAGECONFIG[pipewire-jack] = "-Dpipewire-jack=enabled -Dlibjack-path=${libdir}/${PW_MODULE_SUBDIR}/jack,-Dpipewire-jack=disabled,jack,,,jack" +PACKAGECONFIG[pipewire-v4l2] = "-Dpipewire-v4l2=enabled -Dpipewire-v4l2=${libdir}/${PW_MODULE_SUBDIR}/v4l2,-Dpipewire-v4l2=disabled,v4l2" + +PACKAGESPLITFUNCS:prepend = " split_dynamic_packages " +PACKAGESPLITFUNCS:append = " set_dynamic_metapkg_rdepends " +PACKAGESPLITFUNCS:append = " fixup_dynamic_pkg_licenses " + +SPA_SUBDIR = "spa-0.2" +PW_MODULE_SUBDIR = "pipewire-0.3" + +remove_unused_installed_files() { + # jack.conf is used by pipewire-jack (not the JACK SPA plugin). + # Remove it if pipewire-jack is not built to avoid creating the + # pipewire-jack package. + if ${@bb.utils.contains('PACKAGECONFIG', 'pipewire-jack', 'false', 'true', d)}; then + rm -f "${D}${datadir}/pipewire/jack.conf" + fi +} + +do_install[postfuncs] += "remove_unused_installed_files" + +python fixup_dynamic_pkg_licenses () { + #dynamic packages inherit currently whatever is specified in LICENSE (thus multiple) + packages = (d.getVar('PACKAGES') or "").split() + + for pkg in packages: + # we manually assign the LICENSES here to cover all packages (even dynamically created ones) + d.setVar("LICENSE:" + pkg ,"MIT") + + # next handle special cases + # ==> LICENSE:${PN}-spa-plugins-alsa = "LGPL-2.1-or-later" + if "pipewire-spa-plugins-alsa" in pkg: + d.setVar("LICENSE:pipewire-spa-plugins-alsa", "LGPL-2.1-or-later") + # ==> LICENSE:${PN}-alsa-card-profile = "LGPL-2.1-or-later" + if "pipewire-alsa-card-profile" in pkg: + d.setVar("LICENSE:pipewire-alsa-card-profile", "LGPL-2.1-or-later") + # ==> LICENSE:${PN}-jack = "GPL-2.0-only" + if "pipewire-jack" in pkg: + d.setVar("LICENSE:pipewire-jack", "GPL-2.0-only") +} + +python split_dynamic_packages () { + # Create packages for each SPA plugin. These plugins are located + # in individual subdirectories, so a recursive search is needed. + spa_libdir = d.expand('${libdir}/${SPA_SUBDIR}') + do_split_packages(d, spa_libdir, r'^libspa-(.*)\.so$', d.expand('${PN}-spa-plugins-%s'), 'PipeWire SPA plugin for %s', extra_depends='', recursive=True) + + # Create packages for each PipeWire module. + pw_module_libdir = d.expand('${libdir}/${PW_MODULE_SUBDIR}') + do_split_packages(d, pw_module_libdir, r'^libpipewire-module-(.*)\.so$', d.expand('${PN}-modules-%s'), 'PipeWire %s module', extra_depends='', recursive=False) +} + +python set_dynamic_metapkg_rdepends () { + import os + import oe.utils + + # Go through all generated SPA plugin and PipeWire module packages + # (excluding the main package and the -meta package itself) and + # add them to the -meta package as RDEPENDS. + + base_pn = d.getVar('PN') + + spa_pn = base_pn + '-spa-plugins' + spa_metapkg = spa_pn + '-meta' + + pw_module_pn = base_pn + '-modules' + pw_module_metapkg = pw_module_pn + '-meta' + + d.setVar('ALLOW_EMPTY:' + spa_metapkg, "1") + d.setVar('FILES:' + spa_metapkg, "") + + d.setVar('ALLOW_EMPTY:' + pw_module_metapkg, "1") + d.setVar('FILES:' + pw_module_metapkg, "") + + blacklist = [ spa_pn, spa_metapkg, pw_module_pn, pw_module_metapkg ] + spa_metapkg_rdepends = [] + pw_module_metapkg_rdepends = [] + pkgdest = d.getVar('PKGDEST') + + for pkg in oe.utils.packages_filter_out_system(d): + if pkg in blacklist: + continue + + is_spa_pkg = pkg.startswith(spa_pn) + is_pw_module_pkg = pkg.startswith(pw_module_pn) + if not is_spa_pkg and not is_pw_module_pkg: + continue + + if pkg in spa_metapkg_rdepends or pkg in pw_module_metapkg_rdepends: + continue + + # See if the package is empty by looking at the contents of its + # PKGDEST subdirectory. If this subdirectory is empty, then then + # package is empty as well. Empty packages do not get added to + # the meta package's RDEPENDS. + pkgdir = os.path.join(pkgdest, pkg) + if os.path.exists(pkgdir): + dir_contents = os.listdir(pkgdir) or [] + else: + dir_contents = [] + is_empty = len(dir_contents) == 0 + if not is_empty: + if is_spa_pkg: + spa_metapkg_rdepends.append(pkg) + if is_pw_module_pkg: + pw_module_metapkg_rdepends.append(pkg) + + d.setVar('RDEPENDS:' + spa_metapkg, ' '.join(spa_metapkg_rdepends)) + d.setVar('DESCRIPTION:' + spa_metapkg, spa_pn + ' meta package') + + d.setVar('RDEPENDS:' + pw_module_metapkg, ' '.join(pw_module_metapkg_rdepends)) + d.setVar('DESCRIPTION:' + pw_module_metapkg, pw_module_pn + ' meta package') +} + +PACKAGES =+ "\ + libpipewire \ + ${PN}-tools \ + ${PN}-pulse \ + ${PN}-alsa \ + ${PN}-jack \ + ${PN}-v4l2 \ + ${PN}-spa-plugins \ + ${PN}-spa-plugins-meta \ + ${PN}-spa-tools \ + ${PN}-modules \ + ${PN}-modules-meta \ + ${PN}-alsa-card-profile \ + gstreamer1.0-pipewire \ +" + +PACKAGES_DYNAMIC = "^${PN}-spa-plugins.* ^${PN}-modules.*" + +SYSTEMD_SERVICE:${PN} = "pipewire.service" +CONFFILES:${PN} += "${datadir}/pipewire/pipewire.conf" +FILES:${PN} = " \ + ${datadir}/pipewire/pipewire.conf \ + ${datadir}/pipewire/filter-chain \ + ${systemd_user_unitdir}/pipewire.* \ + ${bindir}/pipewire \ +" + +FILES:${PN}-dev += " \ + ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so \ +" + +CONFFILES:libpipewire += "${datadir}/pipewire/client.conf" +FILES:libpipewire = " \ + ${datadir}/pipewire/client.conf \ + ${datadir}/pipewire/client-rt.conf \ + ${datadir}/pipewire/minimal.conf \ + ${libdir}/libpipewire-*.so.* \ +" +# Add the bare minimum modules and plugins required to be able +# to use libpipewire. Without these, it is essentially unusable. +RDEPENDS:libpipewire += " \ + ${PN}-modules-client-node \ + ${PN}-modules-protocol-native \ + ${PN}-spa-plugins-support \ +" + +FILES:${PN}-tools = " \ + ${bindir}/pw-* \ +" + +# This is a shim daemon that is intended to be used as a +# drop-in PulseAudio replacement, providing a pulseaudio-compatible +# socket that can be used by applications that use libpulse. +CONFFILES:${PN}-pulse += "${datadir}/pipewire/pipewire-pulse.conf" + +FILES:${PN}-pulse = " \ + ${datadir}/pipewire/pipewire-pulse.conf \ + ${systemd_user_unitdir}/pipewire-pulse.* \ + ${bindir}/pipewire-pulse \ +" +RDEPENDS:${PN}-pulse += " \ + ${PN}-modules-protocol-pulse \ +" + +# alsa plugin to redirect audio to pipewire +FILES:${PN}-alsa = "\ + ${libdir}/alsa-lib/* \ + ${datadir}/alsa/alsa.conf.d/* \ +" + +#lib to emulate v4l2 system calls on top of PipeWire +FILES:${PN}-v4l2 = "\ + ${libdir}/${PW_MODULE_SUBDIR}/v4l2/libpw-v4l2.so \ +" + +# jack drop-in libraries to redirect audio to pipewire +CONFFILES:${PN}-jack = "${datadir}/pipewire/jack.conf" +FILES:${PN}-jack = "\ + ${datadir}/pipewire/jack.conf \ + ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so.* \ +" +# Dynamic packages (see set_dynamic_metapkg_rdepends). +FILES:${PN}-spa-plugins-bluez5 += " \ + ${datadir}/${SPA_SUBDIR}/bluez5/bluez-hardware.conf \ +" +RRECOMMENDS:${PN}-spa-plugins += "${PN}-spa-plugins-meta" + +FILES:${PN}-spa-tools = " \ + ${bindir}/spa-* \ +" + +# Dynamic packages (see set_dynamic_metapkg_rdepends). +FILES:${PN}-modules = "" +RRECOMMENDS:${PN}-modules += "${PN}-modules-meta" + +CONFFILES:${PN}-modules-rtkit = "${datadir}/pipewire/client-rt.conf" +FILES:${PN}-modules-rtkit += " \ + ${datadir}/pipewire/client-rt.conf \ + " + +FILES:${PN}-alsa-card-profile = " \ + ${datadir}/alsa-card-profile/* \ + ${nonarch_base_libdir}/udev/rules.d/90-pipewire-alsa.rules \ +" + +FILES:gstreamer1.0-pipewire = " \ + ${libdir}/gstreamer-1.0/* \ +" diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.47.bbappend b/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.47.bbappend new file mode 100644 index 000000000..8c8467b52 --- /dev/null +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.47.bbappend @@ -0,0 +1,36 @@ +PACKAGECONFIG = "\ + ${@bb.utils.contains('DISTRO_FEATURES', 'bluez5', 'bluez', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa pipewire-alsa', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', 'sndfile', '', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \ + 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 \ +" + +do_install:append() { + # install symlinks to alsalib configuration files + for i in 50-pipewire.conf 99-pipewire-default.conf; do + if [ -f ${D}${datadir}/alsa/alsa.conf.d/${i} ]; then + mkdir -p ${D}${sysconfdir}/alsa/conf.d + ln -s ${datadir}/alsa/alsa.conf.d/${i} ${D}${sysconfdir}/alsa/conf.d/${i} + fi + done +} + +FILES:${PN}-alsa:append = "\ + ${sysconfdir}/alsa/conf.d/* \ +" diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-Revert-tests-add-pipewire-env-variables-when-running.patch b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-Revert-tests-add-pipewire-env-variables-when-running.patch new file mode 100644 index 000000000..88301d56f --- /dev/null +++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-Revert-tests-add-pipewire-env-variables-when-running.patch @@ -0,0 +1,139 @@ +From 1197f31d2b681d0cf0ca1309d50c8ab8ea80ac5e Mon Sep 17 00:00:00 2001 +From: Ashok Sidipotu +Date: Thu, 2 Dec 2021 16:57:54 +0530 +Subject: [PATCH 1/2] Revert "tests: add pipewire env variables when running + tests, tidy up common_env" + +This reverts commit c24db9f3539f9b7ebe9e74c991cc3037f28ea22c. + +Upstream-Status: Inappropriate[meson version dependent] +--- + tests/meson.build | 31 ------------------------------- + tests/modules/meson.build | 9 ++++++--- + tests/wp/meson.build | 10 +++++++--- + tests/wplua/meson.build | 15 +++++++++++---- + 4 files changed, 24 insertions(+), 41 deletions(-) + +diff --git a/tests/meson.build b/tests/meson.build +index 0e06568..9238d5b 100644 +--- a/tests/meson.build ++++ b/tests/meson.build +@@ -28,37 +28,6 @@ if valgrind.found() + timeout_multiplier: 2) + endif + +-# The common test environment +-common_test_env = environment({ +- 'HOME': '/invalid', +- 'XDG_RUNTIME_DIR': '/invalid', +- 'PIPEWIRE_RUNTIME_DIR': '/tmp', +- 'XDG_CONFIG_HOME': meson.current_build_dir() / '.config', +- 'XDG_STATE_HOME': meson.current_build_dir() / '.local' / 'state', +- 'FILE_MONITOR_DIR': meson.current_build_dir() / '.local' / 'file_monitor', +- 'WIREPLUMBER_CONFIG_DIR': '/invalid', +- 'WIREPLUMBER_DATA_DIR': '/invalid', +- 'WIREPLUMBER_MODULE_DIR': meson.current_build_dir() / '..' / 'modules', +- 'WIREPLUMBER_DEBUG': '7', +-}) +- +-spa_plugindir = spa_dep.get_variable( +- pkgconfig: 'plugindir', internal: 'plugindir', default_value: '') +-pipewire_moduledir = pipewire_dep.get_variable( +- pkgconfig: 'moduledir', internal: 'moduledir', default_value: '') +-pipewire_confdatadir = pipewire_dep.get_variable( +- pkgconfig: 'confdatadir', internal: 'confdatadir', default_value: '') +- +-if spa_plugindir != '' +- common_test_env.set('SPA_PLUGIN_DIR', spa_plugindir) +-endif +-if pipewire_moduledir != '' +- common_test_env.set('PIPEWIRE_MODULE_DIR', pipewire_moduledir) +-endif +-if pipewire_confdatadir != '' +- common_test_env.set('PIPEWIRE_CONFIG_DIR', pipewire_confdatadir) +-endif +- + subdir('wp') + subdir('wplua') + subdir('modules') +diff --git a/tests/modules/meson.build b/tests/modules/meson.build +index ffab80b..2fc46dc 100644 +--- a/tests/modules/meson.build ++++ b/tests/modules/meson.build +@@ -1,7 +1,10 @@ + common_deps = [gobject_dep, gio_dep, wp_dep, pipewire_dep] +-common_env = common_test_env +-common_env.set('G_TEST_SRCDIR', meson.current_source_dir()) +-common_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) ++common_env = environment({ ++ 'G_TEST_SRCDIR': meson.current_source_dir(), ++ 'G_TEST_BUILDDIR': meson.current_build_dir(), ++ 'WIREPLUMBER_MODULE_DIR': meson.current_build_dir() / '..' / '..' / 'modules', ++ 'WIREPLUMBER_DEBUG': '7', ++}) + common_args = [ + '-DG_LOG_USE_STRUCTURED', + ] +diff --git a/tests/wp/meson.build b/tests/wp/meson.build +index 178564d..b64ccae 100644 +--- a/tests/wp/meson.build ++++ b/tests/wp/meson.build +@@ -1,7 +1,11 @@ + common_deps = [gobject_dep, gio_dep, wp_dep, pipewire_dep] +-common_env = common_test_env +-common_env.set('G_TEST_SRCDIR', meson.current_source_dir()) +-common_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) ++common_env = environment({ ++ 'G_TEST_SRCDIR': meson.current_source_dir(), ++ 'G_TEST_BUILDDIR': meson.current_build_dir(), ++ 'XDG_CONFIG_HOME': meson.current_build_dir() / '.config', ++ 'WIREPLUMBER_MODULE_DIR': meson.current_build_dir() / '..' / '..' / 'modules', ++ 'WIREPLUMBER_DEBUG': '7', ++}) + common_args = [ + '-DG_LOG_USE_STRUCTURED', + ] +diff --git a/tests/wplua/meson.build b/tests/wplua/meson.build +index a7ff033..fcf4b51 100644 +--- a/tests/wplua/meson.build ++++ b/tests/wplua/meson.build +@@ -1,13 +1,18 @@ + common_deps = [wplua_dep, pipewire_dep, wp_dep] +-common_env = common_test_env +-common_env.set('G_TEST_SRCDIR', meson.current_source_dir()) +-common_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) +-common_env.set('WIREPLUMBER_DATA_DIR', meson.current_source_dir()) ++common_env = environment({ ++ 'G_TEST_SRCDIR': meson.current_source_dir(), ++ 'G_TEST_BUILDDIR': meson.current_build_dir(), ++ 'WIREPLUMBER_CONFIG_DIR': '/invalid', ++ 'WIREPLUMBER_DATA_DIR': meson.current_source_dir(), ++ 'WIREPLUMBER_MODULE_DIR': meson.current_build_dir() / '..' / '..' / 'modules', ++ 'WIREPLUMBER_DEBUG': '7', ++}) + + test( + 'test-wplua', + executable('test-wplua', 'wplua.c', dependencies: common_deps), + env: common_env, ++ workdir : meson.current_source_dir(), + ) + + script_tester = executable('script-tester', +@@ -20,6 +25,7 @@ test( + script_tester, + args: ['pod.lua'], + env: common_env, ++ workdir : meson.current_source_dir(), + ) + test( + 'test-lua-json', +@@ -32,4 +38,5 @@ test( + script_tester, + args: ['monitor-rules.lua'], + env: common_env, ++ workdir : meson.current_source_dir(), + ) +-- +2.35.1 + diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-Revert-wp-uninstalled-build-this-script-with-the-mes.patch b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-Revert-wp-uninstalled-build-this-script-with-the-mes.patch deleted file mode 100644 index 658b89946..000000000 --- a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-Revert-wp-uninstalled-build-this-script-with-the-mes.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 78cde5e91ba5d9aa7bfe918ce6bad3b4af30c796 Mon Sep 17 00:00:00 2001 -From: Ashok Sidipotu -Date: Fri, 14 Jan 2022 20:14:56 +0530 -Subject: [PATCH] Revert "wp-uninstalled: build this script with the meson dirs - filled in" - -This reverts commit 52aaf96179584292f493c4b329bc2c409e6d3dee. - -Upstream-Status: Inappropriate[meson version dependent] ---- - meson.build | 31 ------------------------------- - wp-uninstalled.sh | 11 ++--------- - 2 files changed, 2 insertions(+), 40 deletions(-) - -diff --git a/meson.build b/meson.build -index 1f9c9d8..7e02b29 100644 ---- a/meson.build -+++ b/meson.build -@@ -120,34 +120,3 @@ subdir('src') - if get_option('tests') - subdir('tests') - endif -- --conf_uninstalled = configuration_data() --conf_uninstalled.set('MESON', '') --conf_uninstalled.set('MESON_SOURCE_ROOT', meson.project_source_root()) --conf_uninstalled.set('MESON_BUILD_ROOT', meson.project_build_root()) -- --wp_uninstalled = configure_file( -- input : 'wp-uninstalled.sh', -- output : 'wp-uninstalled.sh.in', -- configuration : conf_uninstalled, --) -- --wireplumber_uninstalled = custom_target('wp-uninstalled', -- output : 'wp-uninstalled.sh', -- input : wp_uninstalled, -- build_by_default : true, -- command : ['cp', '@INPUT@', '@OUTPUT@'], --) -- --if meson.version().version_compare('>= 0.58') -- builddir = meson.project_build_root() -- srcdir = meson.project_source_root() -- -- devenv = environment({ -- 'WIREPLUMBER_MODULE_DIR': builddir / 'modules', -- 'WIREPLUMBER_CONFIG_DIR': srcdir / 'src' / 'config', -- 'WIREPLUMBER_DATA_DIR': srcdir / 'src', -- }) -- -- meson.add_devenv(devenv) --endif -diff --git a/wp-uninstalled.sh b/wp-uninstalled.sh -index 79e53f2..d6279ff 100755 ---- a/wp-uninstalled.sh -+++ b/wp-uninstalled.sh -@@ -2,15 +2,8 @@ - - set -e - --# This is unset by meson --# shellcheck disable=SC2157 --if [ -z "@MESON@" ]; then -- SOURCEDIR="@MESON_SOURCE_ROOT@" -- BUILDDIR="@MESON_BUILD_ROOT@" --else -- SOURCEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -- BUILDDIR=$(find "${SOURCEDIR}" -maxdepth 2 -name build.ninja -printf "%h\n" -quit 2>/dev/null || echo "${SOURCEDIR}/build") --fi -+SOURCEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -+BUILDDIR=${SOURCEDIR}/build - CONFIGDIR=config - - while getopts ":b:c:" opt; do --- -2.33.1 - diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0002-Revert-tests-add-pipewire-env-variables-when-running.patch b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0002-Revert-tests-add-pipewire-env-variables-when-running.patch deleted file mode 100644 index 7a24d1554..000000000 --- a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0002-Revert-tests-add-pipewire-env-variables-when-running.patch +++ /dev/null @@ -1,138 +0,0 @@ -From 4ea8ddc256df636208479a5b64bf8bdc6e413aca Mon Sep 17 00:00:00 2001 -From: Ashok Sidipotu -Date: Thu, 2 Dec 2021 16:57:54 +0530 -Subject: [PATCH] Revert "tests: add pipewire env variables when running tests, - tidy up common_env" - -This reverts commit c24db9f3539f9b7ebe9e74c991cc3037f28ea22c. - -Upstream-Status: Inappropriate[meson version dependent] ---- - tests/meson.build | 31 ------------------------------- - tests/modules/meson.build | 9 ++++++--- - tests/wp/meson.build | 10 +++++++--- - tests/wplua/meson.build | 15 +++++++++++---- - 4 files changed, 24 insertions(+), 41 deletions(-) - -diff --git a/tests/meson.build b/tests/meson.build -index 0e06568..9238d5b 100644 ---- a/tests/meson.build -+++ b/tests/meson.build -@@ -28,37 +28,6 @@ if valgrind.found() - timeout_multiplier: 2) - endif - --# The common test environment --common_test_env = environment({ -- 'HOME': '/invalid', -- 'XDG_RUNTIME_DIR': '/invalid', -- 'PIPEWIRE_RUNTIME_DIR': '/tmp', -- 'XDG_CONFIG_HOME': meson.current_build_dir() / '.config', -- 'XDG_STATE_HOME': meson.current_build_dir() / '.local' / 'state', -- 'FILE_MONITOR_DIR': meson.current_build_dir() / '.local' / 'file_monitor', -- 'WIREPLUMBER_CONFIG_DIR': '/invalid', -- 'WIREPLUMBER_DATA_DIR': '/invalid', -- 'WIREPLUMBER_MODULE_DIR': meson.current_build_dir() / '..' / 'modules', -- 'WIREPLUMBER_DEBUG': '7', --}) -- --spa_plugindir = spa_dep.get_variable( -- pkgconfig: 'plugindir', internal: 'plugindir', default_value: '') --pipewire_moduledir = pipewire_dep.get_variable( -- pkgconfig: 'moduledir', internal: 'moduledir', default_value: '') --pipewire_confdatadir = pipewire_dep.get_variable( -- pkgconfig: 'confdatadir', internal: 'confdatadir', default_value: '') -- --if spa_plugindir != '' -- common_test_env.set('SPA_PLUGIN_DIR', spa_plugindir) --endif --if pipewire_moduledir != '' -- common_test_env.set('PIPEWIRE_MODULE_DIR', pipewire_moduledir) --endif --if pipewire_confdatadir != '' -- common_test_env.set('PIPEWIRE_CONFIG_DIR', pipewire_confdatadir) --endif -- - subdir('wp') - subdir('wplua') - subdir('modules') -diff --git a/tests/modules/meson.build b/tests/modules/meson.build -index ffab80b..2fc46dc 100644 ---- a/tests/modules/meson.build -+++ b/tests/modules/meson.build -@@ -1,7 +1,10 @@ - common_deps = [gobject_dep, gio_dep, wp_dep, pipewire_dep] --common_env = common_test_env --common_env.set('G_TEST_SRCDIR', meson.current_source_dir()) --common_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) -+common_env = environment({ -+ 'G_TEST_SRCDIR': meson.current_source_dir(), -+ 'G_TEST_BUILDDIR': meson.current_build_dir(), -+ 'WIREPLUMBER_MODULE_DIR': meson.current_build_dir() / '..' / '..' / 'modules', -+ 'WIREPLUMBER_DEBUG': '7', -+}) - common_args = [ - '-DG_LOG_USE_STRUCTURED', - ] -diff --git a/tests/wp/meson.build b/tests/wp/meson.build -index adc9cef..e75640c 100644 ---- a/tests/wp/meson.build -+++ b/tests/wp/meson.build -@@ -1,7 +1,11 @@ - common_deps = [gobject_dep, gio_dep, wp_dep, pipewire_dep] --common_env = common_test_env --common_env.set('G_TEST_SRCDIR', meson.current_source_dir()) --common_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) -+common_env = environment({ -+ 'G_TEST_SRCDIR': meson.current_source_dir(), -+ 'G_TEST_BUILDDIR': meson.current_build_dir(), -+ 'XDG_CONFIG_HOME': meson.current_build_dir() / '.config', -+ 'WIREPLUMBER_MODULE_DIR': meson.current_build_dir() / '..' / '..' / 'modules', -+ 'WIREPLUMBER_DEBUG': '7', -+}) - common_args = [ - '-DG_LOG_USE_STRUCTURED', - ] -diff --git a/tests/wplua/meson.build b/tests/wplua/meson.build -index 128cc30..cd45c1c 100644 ---- a/tests/wplua/meson.build -+++ b/tests/wplua/meson.build -@@ -1,13 +1,18 @@ - common_deps = [wplua_dep, pipewire_dep, wp_dep] --common_env = common_test_env --common_env.set('G_TEST_SRCDIR', meson.current_source_dir()) --common_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) --common_env.set('WIREPLUMBER_DATA_DIR', meson.current_source_dir()) -+common_env = environment({ -+ 'G_TEST_SRCDIR': meson.current_source_dir(), -+ 'G_TEST_BUILDDIR': meson.current_build_dir(), -+ 'WIREPLUMBER_CONFIG_DIR': '/invalid', -+ 'WIREPLUMBER_DATA_DIR': meson.current_source_dir(), -+ 'WIREPLUMBER_MODULE_DIR': meson.current_build_dir() / '..' / '..' / 'modules', -+ 'WIREPLUMBER_DEBUG': '7', -+}) - - test( - 'test-wplua', - executable('test-wplua', 'wplua.c', dependencies: common_deps), - env: common_env, -+ workdir : meson.current_source_dir(), - ) - - script_tester = executable('script-tester', -@@ -20,10 +25,12 @@ test( - script_tester, - args: ['pod.lua'], - env: common_env, -+ workdir : meson.current_source_dir(), - ) - test( - 'test-lua-monitor-rules', - script_tester, - args: ['monitor-rules.lua'], - env: common_env, -+ workdir : meson.current_source_dir(), - ) --- -2.33.1 - diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0002-Revert-wp-uninstalled-build-this-script-with-the-mes.patch b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0002-Revert-wp-uninstalled-build-this-script-with-the-mes.patch new file mode 100644 index 000000000..d20634d8b --- /dev/null +++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0002-Revert-wp-uninstalled-build-this-script-with-the-mes.patch @@ -0,0 +1,77 @@ +From 8e959b7894047030edca21a04dd91994e8868a1f Mon Sep 17 00:00:00 2001 +From: Ashok Sidipotu +Date: Fri, 25 Feb 2022 06:05:43 +0530 +Subject: [PATCH 2/2] Revert "wp-uninstalled: build this script with the meson + dirs filled in" + +This reverts commit 52aaf96179584292f493c4b329bc2c409e6d3dee. +Upstream-Status: Inappropriate[meson version dependent] +--- + meson.build | 31 ------------------------------- + wp-uninstalled.sh | 11 ++--------- + 2 files changed, 2 insertions(+), 40 deletions(-) + +diff --git a/meson.build b/meson.build +index e4323dc..185248f 100644 +--- a/meson.build ++++ b/meson.build +@@ -120,34 +120,3 @@ subdir('src') + if get_option('tests') + subdir('tests') + endif +- +-conf_uninstalled = configuration_data() +-conf_uninstalled.set('MESON', '') +-conf_uninstalled.set('MESON_SOURCE_ROOT', meson.project_source_root()) +-conf_uninstalled.set('MESON_BUILD_ROOT', meson.project_build_root()) +- +-wp_uninstalled = configure_file( +- input : 'wp-uninstalled.sh', +- output : 'wp-uninstalled.sh.in', +- configuration : conf_uninstalled, +-) +- +-wireplumber_uninstalled = custom_target('wp-uninstalled', +- output : 'wp-uninstalled.sh', +- input : wp_uninstalled, +- build_by_default : true, +- command : ['cp', '@INPUT@', '@OUTPUT@'], +-) +- +-if meson.version().version_compare('>= 0.58') +- builddir = meson.project_build_root() +- srcdir = meson.project_source_root() +- +- devenv = environment({ +- 'WIREPLUMBER_MODULE_DIR': builddir / 'modules', +- 'WIREPLUMBER_CONFIG_DIR': srcdir / 'src' / 'config', +- 'WIREPLUMBER_DATA_DIR': srcdir / 'src', +- }) +- +- meson.add_devenv(devenv) +-endif +diff --git a/wp-uninstalled.sh b/wp-uninstalled.sh +index 79e53f2..d6279ff 100755 +--- a/wp-uninstalled.sh ++++ b/wp-uninstalled.sh +@@ -2,15 +2,8 @@ + + set -e + +-# This is unset by meson +-# shellcheck disable=SC2157 +-if [ -z "@MESON@" ]; then +- SOURCEDIR="@MESON_SOURCE_ROOT@" +- BUILDDIR="@MESON_BUILD_ROOT@" +-else +- SOURCEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +- BUILDDIR=$(find "${SOURCEDIR}" -maxdepth 2 -name build.ninja -printf "%h\n" -quit 2>/dev/null || echo "${SOURCEDIR}/build") +-fi ++SOURCEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" ++BUILDDIR=${SOURCEDIR}/build + CONFIGDIR=config + + while getopts ":b:c:" opt; do +-- +2.35.1 + diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0003-spa-json-fix-va_list-APIs-for-different-architecture.patch b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0003-spa-json-fix-va_list-APIs-for-different-architecture.patch new file mode 100644 index 000000000..9d0c68d58 --- /dev/null +++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0003-spa-json-fix-va_list-APIs-for-different-architecture.patch @@ -0,0 +1,214 @@ +From ae6c9a5e612c343dd307fe34a1a282b7a4f17a5c Mon Sep 17 00:00:00 2001 +From: Julian Bouzas +Date: Wed, 9 Feb 2022 07:59:59 -0500 +Subject: [PATCH 3/3] spa-json: fix va_list APIs for different architectures + +The va_list type might not always be a pointer in some architectures, so we +cannot guarantee it will be modified after using it for a second time in another +function. This fixes the issue by using macros so args does not get copied, and +always gets modified when using it more than once. + +Upstream-Status: Backport +--- + lib/wp/spa-json.c | 156 ++++++++++++++++++++++++---------------------- + 1 file changed, 80 insertions(+), 76 deletions(-) + +diff --git a/lib/wp/spa-json.c b/lib/wp/spa-json.c +index f14f395..c5e59a3 100644 +--- a/lib/wp/spa-json.c ++++ b/lib/wp/spa-json.c +@@ -363,33 +363,33 @@ wp_spa_json_new_string (const gchar *value) + wp_spa_json_builder_new_formatted ("\"%s\"", value)); + } + +-static void +-wp_spa_json_builder_add_value (WpSpaJsonBuilder *self, const gchar *fmt, +- va_list args) +-{ +- switch (*fmt) { +- case 'n': +- wp_spa_json_builder_add_null (self); +- break; +- case 'b': +- wp_spa_json_builder_add_boolean (self, va_arg(args, gboolean)); +- break; +- case 'i': +- wp_spa_json_builder_add_int (self, va_arg(args, gint)); +- break; +- case 'f': +- wp_spa_json_builder_add_float (self, (float)va_arg(args, double)); +- break; +- case 's': +- wp_spa_json_builder_add_string (self, va_arg(args, const gchar *)); +- break; +- case 'J': +- wp_spa_json_builder_add_json (self, va_arg(args, WpSpaJson *)); +- break; +- default: +- return; +- } +-} ++/* Args is not a pointer in some architectures, so this needs to be a macro to ++ * avoid args being copied */ ++#define wp_spa_json_builder_add_value(self,fmt,args) \ ++do { \ ++ switch (*fmt) { \ ++ case 'n': \ ++ wp_spa_json_builder_add_null (self); \ ++ break; \ ++ case 'b': \ ++ wp_spa_json_builder_add_boolean (self, va_arg(args, gboolean)); \ ++ break; \ ++ case 'i': \ ++ wp_spa_json_builder_add_int (self, va_arg(args, gint)); \ ++ break; \ ++ case 'f': \ ++ wp_spa_json_builder_add_float (self, (float)va_arg(args, double)); \ ++ break; \ ++ case 's': \ ++ wp_spa_json_builder_add_string (self, va_arg(args, const gchar *)); \ ++ break; \ ++ case 'J': \ ++ wp_spa_json_builder_add_json (self, va_arg(args, WpSpaJson *)); \ ++ break; \ ++ default: \ ++ break; \ ++ } \ ++} while(false) + + /*! + * \brief Creates a spa json of type array +@@ -724,48 +724,46 @@ wp_spa_json_parse_object_valist (WpSpaJson *self, va_list args) + return res; + } + +-static gboolean +-wp_spa_json_parse_value (const gchar *data, int len, const gchar *fmt, +- va_list args) +-{ +- switch (*fmt) { +- case 'n': +- if (!spa_json_is_null (data, len)) +- return FALSE; +- break; +- case 'b': +- if (!wp_spa_json_parse_boolean_internal (data, len, +- va_arg(args, gboolean *))) +- return FALSE; +- break; +- case 'i': +- if (spa_json_parse_int (data, len, va_arg(args, gint *)) < 0) +- return FALSE; +- break; +- case 'f': +- if (spa_json_parse_float (data, len, +- (float *)va_arg(args, double *)) < 0) +- return FALSE; +- break; +- case 's': { +- gchar *str = wp_spa_json_parse_string_internal (data, len); +- if (!str) +- return FALSE; +- *va_arg(args, gchar **) = str; +- break; +- } +- case 'J': { +- WpSpaJson *j = wp_spa_json_new (data, len); +- if (!j) +- return FALSE; +- *va_arg(args, WpSpaJson **) = j; +- break; +- } +- default: +- return FALSE; +- } +- return TRUE; +-} ++/* Args is not a pointer in some architectures, so this needs to be a macro to ++ * avoid args being copied */ ++#define wp_spa_json_parse_value(data,len,fmt,args) \ ++do { \ ++ switch (*fmt) { \ ++ case 'n': \ ++ if (!spa_json_is_null (data, len)) \ ++ return FALSE; \ ++ break; \ ++ case 'b': \ ++ if (!wp_spa_json_parse_boolean_internal (data, len, \ ++ va_arg(args, gboolean *))) \ ++ return FALSE; \ ++ break; \ ++ case 'i': \ ++ if (spa_json_parse_int (data, len, va_arg(args, gint *)) < 0) \ ++ return FALSE; \ ++ break; \ ++ case 'f': \ ++ if (spa_json_parse_float (data, len, va_arg(args, float *)) < 0) \ ++ return FALSE; \ ++ break; \ ++ case 's': { \ ++ gchar *str = wp_spa_json_parse_string_internal (data, len); \ ++ if (!str) \ ++ return FALSE; \ ++ *va_arg(args, gchar **) = str; \ ++ break; \ ++ } \ ++ case 'J': { \ ++ WpSpaJson *j = wp_spa_json_new (data, len); \ ++ if (!j) \ ++ return FALSE; \ ++ *va_arg(args, WpSpaJson **) = j; \ ++ break; \ ++ } \ ++ default: \ ++ return FALSE; \ ++ } \ ++} while(false) + + /*! + * \brief Parses the object property values of a spa json object +@@ -827,8 +825,7 @@ wp_spa_json_object_get_valist (WpSpaJson *self, va_list args) + value = g_value_get_boxed (&item); + + if (g_strcmp0 (key_str, lookup_key) == 0) { +- if (!wp_spa_json_parse_value (value->data, value->size, lookup_fmt, args)) +- return FALSE; ++ wp_spa_json_parse_value (value->data, value->size, lookup_fmt, args); + lookup_key = va_arg(args, const gchar *); + if (!lookup_key) + return TRUE; +@@ -1366,9 +1363,12 @@ gboolean + wp_spa_json_parser_get_value (WpSpaJsonParser *self, const gchar *fmt, + va_list args) + { +- return wp_spa_json_parser_advance (self) && +- wp_spa_json_parse_value (self->curr.cur, +- self->curr.end - self->curr.cur, fmt, args); ++ if (wp_spa_json_parser_advance (self)) { ++ wp_spa_json_parse_value (self->curr.cur, self->curr.end - self->curr.cur, ++ fmt, args); ++ return TRUE; ++ } ++ return FALSE; + } + + /*! +@@ -1419,9 +1419,13 @@ wp_spa_json_parser_get_valist (WpSpaJsonParser *self, va_list args) + if (!format) + return TRUE; + +- /* parse value */ +- if (!wp_spa_json_parser_get_value (self, format, args)) ++ /* advance */ ++ if (!wp_spa_json_parser_advance (self)) + return FALSE; ++ ++ /* parse value */ ++ wp_spa_json_parse_value (self->curr.cur, self->curr.end - self->curr.cur, ++ format, args); + } while (TRUE); + + return FALSE; +-- +2.35.1 + diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb index a08ebbbed..f42b12770 100644 --- a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb +++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb @@ -14,16 +14,17 @@ DEPENDS = "glib-2.0 glib-2.0-native pipewire lua" SRC_URI = "\ git://gitlab.freedesktop.org/pipewire/wireplumber.git;protocol=https;branch=master \ " -# v0.4.7 -SRCREV = "afb177b5e0840d54dc41d02920702c3c9580ce02" +# v0.4.8 +SRCREV = "e14bb72dcc85e2130d0ea96768e5ae3b375a041e" # patches to be able to compile with lower version of meson that is available in AGL. SRC_URI += "\ - file://0001-Revert-wp-uninstalled-build-this-script-with-the-mes.patch \ - file://0002-Revert-tests-add-pipewire-env-variables-when-running.patch \ + file://0001-Revert-tests-add-pipewire-env-variables-when-running.patch \ + file://0002-Revert-wp-uninstalled-build-this-script-with-the-mes.patch \ + file://0003-spa-json-fix-va_list-APIs-for-different-architecture.patch \ " -PV = "0.4.5" +PV = "0.4.8" S = "${WORKDIR}/git" WPAPI="0.4" -- cgit 1.2.3-korg