From 87707a29293a89df8e2539b71be3ffdec9cbf3f9 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Tue, 16 Jun 2026 14:14:27 +0300 Subject: [PATCH 1/2] tools: test: audio: Add module specific initialize to process_test.m The modules phase_vocoder and tdfb are by default algorithms switched off for passthrough. To measure with process_test() the the true characteristic the controls need to be set to enable the processing. Signed-off-by: Seppo Ingalsuo --- tools/test/audio/process_test.m | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tools/test/audio/process_test.m b/tools/test/audio/process_test.m index 1af293b1967a..98928b86f0ed 100644 --- a/tools/test/audio/process_test.m +++ b/tools/test/audio/process_test.m @@ -427,12 +427,39 @@ % No need to collect trace test.trace = [tempname('/tmp') '.txt']; + + switch t.comp + case 'phase_vocoder' + [fh, name, msg] = mkstemp('/tmp/phase_vocoder_enable.sh.XXXXXX'); + if (fh < 0) + error("mkstemp() failed: %s", msg); + end + test.extra_opts = sprintf('-s %s', name); + test.extra_opts_file = name; + fprintf(fh, "amixer -c0 cset name='Analog Playback Phase Vocoder speed' 1.0\n"); + fprintf(fh, "amixer -c0 cset name='Analog Playback Phase Vocoder enable' on\n"); + fclose(fh); + case 'tdfb' + [fh, name, msg] = mkstemp('/tmp/tdfb_enable.sh.XXXXXX'); + if (fh < 0) + error("mkstemp() failed: %s", msg); + end + test.extra_opts = sprintf('-s %s', name); + test.extra_opts_file = name; + fprintf(fh, "amixer -c0 cset name='Analog Playback TDFB track' off\n"); + fprintf(fh, "amixer -c0 cset name='Analog Playback TDFB angle set' 90\n"); + fprintf(fh, "amixer -c0 cset name='Analog Playback TDFB beam' on\n"); + fclose(fh); + end end function test = test_run_process(test) delete_check(1, test.fn_out); test = test_run(test); delete_check(1, test.trace); + if isfield(test, 'extra_opts_file') && ~isempty(test.extra_opts_file) + delete_check(1, test.extra_opts_file); + end end function test_result_print(t, testverbose, testacronym, test) From 39de1e0bedd7dc6d69a86ad920fa982708ac5f51 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Tue, 16 Jun 2026 14:49:37 +0300 Subject: [PATCH 2/2] tools: test: audio: Fix tdfb module specific tests The init script tdfb_enable.sh was missing from upstream, so the script tdfb_test.m was not working. With this change, the enable script is created on the fly. The tdfb_direct_test.m had the same issue with a missing script from upstream. Additionally, the tdfb setup tool directory path is fixed as well as the tdfb tune data directory. The line4 and circular8 array tests are removed since they are not built by default. The production configuration line2 test is kept. Signed-off-by: Seppo Ingalsuo --- tools/test/audio/tdfb_direction_test.m | 22 +++++++++++++++++----- tools/test/audio/tdfb_test.m | 14 +++++++++++++- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/tools/test/audio/tdfb_direction_test.m b/tools/test/audio/tdfb_direction_test.m index 9152ee28c53f..ec11914da22a 100644 --- a/tools/test/audio/tdfb_direction_test.m +++ b/tools/test/audio/tdfb_direction_test.m @@ -15,17 +15,17 @@ function tdfb_direction_test() % 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) -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'); addpath('test_utils'); -addpath('../../tune/tdfb'); +addpath('../../../src/audio/tdfb/tune'); for i = 1:length(array_data_list) @@ -80,7 +80,16 @@ function tdfb_direction_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='-d 4'; +[fh, name, msg] = mkstemp('/tmp/tdfb_enable.sh.XXXXXX'); +if (fh < 0) + error("mkstemp() failed: %s", msg); +end +test.extra_opts = sprintf('-d 4 -s %s', name); +test.extra_opts_file = name; +fprintf(fh, "amixer -c0 cset name='Analog Playback TDFB track' on\n"); +fprintf(fh, "amixer -c0 cset name='Analog Playback TDFB angle set' 90\n"); +fprintf(fh, "amixer -c0 cset name='Analog Playback TDFB beam' on\n"); +fclose(fh); test.trace = 'tdfb_direction.txt'; if length(arrayid) test.comp = sprintf('tdfb_%s', arrayid); @@ -92,6 +101,9 @@ function tdfb_direction_test() delete_check(1, test.fn_out); test = test_run(test); +if isfield(test, 'extra_opts_file') && ~isempty(test.extra_opts_file) + delete_check(1, test.extra_opts_file); +end end diff --git a/tools/test/audio/tdfb_test.m b/tools/test/audio/tdfb_test.m index 0c75c3cf1053..1a4f7927ffb4 100644 --- a/tools/test/audio/tdfb_test.m +++ b/tools/test/audio/tdfb_test.m @@ -77,7 +77,16 @@ function tdfb_test(xtrun) test.nch_out = bf.num_output_channels; test.ch_in = 1:test.nch_in; test.ch_out = 1:test.nch_out; -test.extra_opts='-s tdfb_enable.sh'; +[fh, name, msg] = mkstemp('/tmp/tdfb_enable.sh.XXXXXX'); +if (fh < 0) + error("mkstemp() failed: %s", msg); +end +test.extra_opts = sprintf('-s %s', name); +test.extra_opts_file = name; +fprintf(fh, "amixer -c0 cset name='Analog Playback TDFB track' off\n"); +fprintf(fh, "amixer -c0 cset name='Analog Playback TDFB angle set' 90\n"); +fprintf(fh, "amixer -c0 cset name='Analog Playback TDFB beam' on\n"); +fclose(fh); if length(arrayid) test.comp = sprintf('tdfb_%s', arrayid); end @@ -88,6 +97,9 @@ function tdfb_test(xtrun) delete_check(1, test.fn_out); test = test_run(test); +if isfield(test, 'extra_opts_file') && ~isempty(test.extra_opts_file) + delete_check(1, test.extra_opts_file); +end end