Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions tools/test/audio/process_test.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Comment thread
singalsu marked this conversation as resolved.
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
Comment on lines 456 to +462
end

function test_result_print(t, testverbose, testacronym, test)
Expand Down
22 changes: 17 additions & 5 deletions tools/test/audio/tdfb_direction_test.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {''};
Comment on lines +22 to +23

%% Prepare
addpath('std_utils');
addpath('test_utils');
addpath('../../tune/tdfb');
addpath('../../../src/audio/tdfb/tune');

for i = 1:length(array_data_list)

Expand Down Expand Up @@ -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);
Comment thread
singalsu marked this conversation as resolved.
test.trace = 'tdfb_direction.txt';
if length(arrayid)
test.comp = sprintf('tdfb_%s', arrayid);
Expand All @@ -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
Comment on lines 102 to +106

end

Expand Down
14 changes: 13 additions & 1 deletion tools/test/audio/tdfb_test.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Comment thread
singalsu marked this conversation as resolved.
if length(arrayid)
test.comp = sprintf('tdfb_%s', arrayid);
end
Expand All @@ -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
Comment on lines 98 to +102

end

Expand Down
Loading