From 81114ab1bab947526f4d98a43b0e20fe5ea7f347 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Fri, 11 Apr 2025 16:58:34 +0300 Subject: [PATCH 1/4] Tools: Test: Audio: Fix tdfb_test.m for moved paths This patch fixes the path to the data files needed for the beamformer component test. Without this none of the tests can run. Signed-off-by: Seppo Ingalsuo --- tools/test/audio/tdfb_test.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/test/audio/tdfb_test.m b/tools/test/audio/tdfb_test.m index ab153c04f803..01e74cf931cd 100644 --- a/tools/test/audio/tdfb_test.m +++ b/tools/test/audio/tdfb_test.m @@ -9,13 +9,13 @@ function tdfb_test() % determine. So far only visual check enabled. % SPDX-License-Identifier: BSD-3-Clause -% Copyright(c) 2020 Intel Corporation. All rights reserved. +% Copyright(c) 2020-2025 Intel Corporation. % Author: Seppo Ingalsuo % General settings cfg.delete_files = 1; cfg.do_plots = 1; -cfg.tunepath = '../../tune/tdfb/data'; +cfg.tunepath = '../../../src/audio/tdfb/tune/data'; % Arrays to test. Since the two beams configurations are merge of two designs (pm90deg) % need to specify a compatible data file identifier for a single beam design (az0el0deg) @@ -25,7 +25,7 @@ function tdfb_test() %% Prepare addpath('std_utils'); addpath('test_utils'); -addpath('../../tune/tdfb'); +addpath('../../../src/audio/tdfb/tune'); for i = 1:length(array_data_list) From 463f26f17fde61801392422b3d28f01a39bd8746 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Fri, 11 Apr 2025 17:05:11 +0300 Subject: [PATCH 2/4] Tools: Test: Audio: Fix the arrays to test in tdfb_test.m The test topologies for tplg2/IPC4 do not currently support other but the 2-mic array beamformer, so the other arrays are removed for now from the test to avoid the script to fail. Signed-off-by: Seppo Ingalsuo --- tools/test/audio/tdfb_test.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/test/audio/tdfb_test.m b/tools/test/audio/tdfb_test.m index 01e74cf931cd..e29f8d882431 100644 --- a/tools/test/audio/tdfb_test.m +++ b/tools/test/audio/tdfb_test.m @@ -19,8 +19,8 @@ function tdfb_test() % Arrays to test. Since the two beams configurations are merge of two designs (pm90deg) % need to specify a compatible data file identifier for a single beam design (az0el0deg) -array_data_list = {'line2_50mm_az0el0deg_48khz', 'line4_28mm_az0el0deg_48khz', 'circular8_100mm_az0el0deg_48khz'}; -tdfb_name_list = {'', 'line4_28mm_pm90deg_48khz', 'circular8_100mm_pm30deg_48khz'}; +array_data_list = {'line2_50mm_az0el0deg_48khz'}; +tdfb_name_list = {''}; %% Prepare addpath('std_utils'); From 94d75785c76e1de92643d38c297cc81182106140 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Fri, 11 Apr 2025 17:12:09 +0300 Subject: [PATCH 3/4] Tools: Test: Audio: setup kcontrols in tdfb_test.m This change adds to sof-testbench4 command line option "-s tdfb_enable.sh" that sets beamformer control to suitable state for test run. The source tracking feature is switched off, then beam angle is set +/- 90 degrees, and processing is switched on. Signed-off-by: Seppo Ingalsuo --- tools/test/audio/tdfb_enable.sh | 5 +++++ tools/test/audio/tdfb_test.m | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 tools/test/audio/tdfb_enable.sh diff --git a/tools/test/audio/tdfb_enable.sh b/tools/test/audio/tdfb_enable.sh new file mode 100644 index 000000000000..ce7422be62ca --- /dev/null +++ b/tools/test/audio/tdfb_enable.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +amixer -c0 cset name='Analog Playback TDFB track' off +amixer -c0 cset name='Analog Playback TDFB angle set' 90 +amixer -c0 cset name='Analog Playback TDFB beam' on diff --git a/tools/test/audio/tdfb_test.m b/tools/test/audio/tdfb_test.m index e29f8d882431..f0c41d876bfe 100644 --- a/tools/test/audio/tdfb_test.m +++ b/tools/test/audio/tdfb_test.m @@ -72,7 +72,7 @@ function tdfb_test() test.nch_out = bf.num_output_channels; test.ch_in = 1:test.nch_in; test.ch_out = 1:test.nch_out; -test.extra_opts=''; +test.extra_opts='-s tdfb_enable.sh'; if length(arrayid) test.comp = sprintf('tdfb_%s', arrayid); end From 635c6fa2bec8cb4d29793d78150254cfe089c595 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Fri, 11 Apr 2025 17:14:21 +0300 Subject: [PATCH 4/4] Tools: Test: Audio: Add option to run tdfb_test.m with xt-run The option for xt-run enables to run the xtensa build of sof-testbench4. Signed-off-by: Seppo Ingalsuo --- tools/test/audio/tdfb_test.m | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/test/audio/tdfb_test.m b/tools/test/audio/tdfb_test.m index f0c41d876bfe..3dcf1fecf535 100644 --- a/tools/test/audio/tdfb_test.m +++ b/tools/test/audio/tdfb_test.m @@ -1,8 +1,8 @@ -function tdfb_test() +function tdfb_test(xtrun) -% tdfb_test() +% tdfb_test(xtrun) % Inputs -% None +% xtrun - set to 'xt-run' or 'xt-run --turbo' to test with xt-testbench % % Outputs % None, to be added later when automatic pass/fail is possible to @@ -12,10 +12,15 @@ function tdfb_test() % Copyright(c) 2020-2025 Intel Corporation. % Author: Seppo Ingalsuo +if nargin < 1 + xtrun = ''; +end + % General settings cfg.delete_files = 1; cfg.do_plots = 1; cfg.tunepath = '../../../src/audio/tdfb/tune/data'; +cfg.xtrun = xtrun; % Arrays to test. Since the two beams configurations are merge of two designs (pm90deg) % need to specify a compatible data file identifier for a single beam design (az0el0deg) @@ -119,6 +124,7 @@ function tdfb_test() test = test_defaults(bf, tdfb); test.fn_in = fullfile(cfg.tunepath, simcap_fn); test.fn_out = 'sinerot.raw'; +test.xtrun = cfg.xtrun; % Run test test = test_run_comp(test);