Commit Graph

24 Commits

Author SHA1 Message Date
Seppo Ingalsuo 869666061b Tools: Test: Audio: Fix syntax error in test_run.m
The fprintf() command prints only "#!/bin/sh". For some reason
this has been ignored by interpreter but as clear error it is
better to fix.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-06-06 15:32:45 +03:00
Seppo Ingalsuo 0cb752d362 Tools: Test: Audio: Valgrind run related fixes
The changes to scripts/host-testbench.sh and earlier to process_test.m
have unintentionally dropped valgrind run from test.

This patch enables valgrind for process_test.m runs and fixes
issue in test run octave side function to silently ignore
error about failed shell command. Normally test fail when there
is no data or incorrect data, but a valgrind failure with correct
test output was passed.

Valgrind output becomes visible if testbench run trace stderr
redirection to file is disabled. If not done valgrind error would
stop the test but the analysis would not be printed to console.

Fixes: 6b744bcc63 ("host-testbench.sh: use process_test.m for 8 components")

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-06-06 15:32:45 +03:00
Seppo Ingalsuo b4af9d93a1 Tools: Test: Changes for process_test.m run with xt-xcc
This patch adds to process_test() sixth argument to run the tests
with xt-run environment with argument set to 'xt-run' or
'xt-run --turbo'.

The set and print of LD_LIBRARY_PATH is no more needed with static
testbench version.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-05-04 18:07:52 +03:00
Seppo Ingalsuo d472a2e73d Tools: Test: Audio: Fix BITS_OUT in test run configuration
This patch fixes a mistake with test run configuration for
testbech tests where input and output word lengths are not
the same.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-02-01 16:39:20 +00:00
Seppo Ingalsuo dccae1c5b2 Tools: Test: Audio: Reduce testing verbosity in test measure scripts
These prints are normally not useful and slow down test with a
lot of scrolled text output.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-12-02 15:30:14 +00:00
Seppo Ingalsuo 00c51bde78 Tools: Test: Audio: In markers find fail show the captured waveform
This patch adds to chirp test (executed first usually) plot of
audio waveform to help understand why the audio markers were not
found. The reasons like very low level or corruption or large
time shift can be seen from the plot easily.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-11-18 10:10:16 +00:00
Seppo Ingalsuo 5471357792 Tools: Test: Audio: Replace the gaussian dither with triangular
The gaussian (or other normal distribution shape) dither impacts
too much 16 bit signals. The triangular probability density
function (TDPF) is a sufficient compromise between added noise energy
and de-correlation of PCM samples.

This change improves for 48 kHz 16 bit audio measurement the THD+N
from -62.6 dB to -73.6 dB.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-11-18 10:10:16 +00:00
Seppo Ingalsuo c9d603bb11 Tools: Test: Fix mistake in script test_run.m
Remove the extra argument for fprintf(). For some reason there was
no harm seen but this should trigger an error when run in Octave or
Matlab.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-03-09 15:44:06 +00:00
Seppo Ingalsuo e6f677959b Tools: Test: Audio: Fix typos in tools/test/audio/*
This patch fixes the typos in audio test Matlab code.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-09 09:52:17 +00:00
Seppo Ingalsuo 3faaf4c145 Tools: Audio: Test: In Matlab tests by default put trace to /dev/null
The trace print slows down the test a lot while the testbench
trace output is not needed usually in these audio quality
tests. The test script can set .trace to redirect trace to a file
that is also a lot faster than scrolling the trace in Matlab
or Octave shell.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-01-26 14:09:57 +00:00
Seppo Ingalsuo 15bf883ead Tools: Test: Audio: Fix incorrect valgrind run control in audio test
The value for VALGRIND in the run command parameters needs to
be true or false. The value "no" causes an error in comp_run.sh
script run.

Fixes 30012d1454

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-01-26 14:09:57 +00:00
Seppo Ingalsuo 30012d1454 Tools: Testbench: Support for different in/out channels count and other
This patch adds to command line switch -n for output channels count.
Existing -c is for in channels, new -n is for out channels count. Out
channels count is same as input if -n is not present. Switch -q is
added to quiet the trace output if it is not needed.

The Matlab language test scripts for components are updated to use
the -t config.sh interface of comp_run.sh. It allows more flexible
control of input and output streams.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-01-24 11:23:21 +00:00
Keyon Jie 2db847b7b2 tools: test: mix_sweep: correct the start index
The i0 is already the start index, so no need the '+1' for i1
calculation, correct it.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-04-09 13:27:45 +08:00
sriram a47a8a6a21 audio: tools: fix matlab/octave directory compatibility
To support exist function - fullfile() path addition is to prevent Matlab (differently than Octave)
to give false positive with some other directory location with it's search path

Added correction to isempty.

Signed-off-by: ShriramShastry <malladi.sastry@intel.com>
2021-01-22 15:28:32 +00:00
Seppo Ingalsuo 3c073b478f Tools: Test: Fix for sine vector orientations mismatch
The generation of multiple tone frequencies failed due accidental
square matrix generation when mixed row and column vectors were added.
The new version uses only vectors in first dimension and avoids the
problem.

The license text format also is changed to current.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-10-05 15:25:00 +01:00
Seppo Ingalsuo 51fc4e1220 Tools: Test: Audio: Add missing test utility function
The script to load back to Matlab or Octave the test input data
was missing from previous patch that introduced TDFB (beamformer)
component.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-10-03 10:24:52 +01:00
Seppo Ingalsuo 167d0a0667 Tools: Test: Improve processing components objective quality tests
The main change in this patch is to allow process_test to use
frequency dependent masks for frequency response and THD+N. It
allows tests with pass/fail criteria for components like EQs
and DCblock. SRC test not really changed but the small changes
in passing test controls are updated there as well.

In EQs tests the process test can decode the theoretical response
from setup blob. The measured frequency response is compared to
that.

The test print and plot output look is improved for nicer reports.
The runtime plots opening is disabled for batch mode operation
but the plots now appear to test output directory in png format.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-07 17:30:40 +01:00
Seppo Ingalsuo 31a6a27ece Tools: Test: Relax signal level pass criteria in quick chirp test
The criteria of overall -3 dB RMS attenuation was too tight
for sample EQ responses to pass. With new -6 dB criteria the
used EQ loudness responses do not trigger error.

The chirp test is only a quick generic component health check so this
is not critical. The other AES17 tests will catch minor characteristic
changes.

The other changes are cosmetic and improve result print and plot
output look.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-07 17:30:40 +01:00
Seppo Ingalsuo 509a906426 Tools: Test: Improve Matlab compatibility
The function getpid() is only available in Octave. Instead use
a random integer number as identification to avoid conflict with
possible several simultaneous simulations with temporary files.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-07 17:30:40 +01:00
Seppo Ingalsuo 80f6e0698f Tools: Test: Add objective quality tests for processing components
This patch adds an Octave test script process_test.m to audio processing
components like FIR and IIR EQ.

Parts of src_test.m are moved to common functions to ease printing of
test results matrix.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-04-16 11:48:22 +01:00
Seppo Ingalsuo 1dbd14b30d Testbench: Improve test begin and end marker tones find
Chirp test signals confused the test signal begin marker position
seek and caused false test fails. The test stimulus may produce
stronger cross correlation level than the actual marker. Also
the check omitted that the cross correlation max could be negative
so the test was changed into power domain and use first/last
cross correlation peak above threshold as test begin/end position.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-10-21 21:20:11 +02:00
Seppo Ingalsuo 573e0b17b3 Tools: Audio quality test for ssh accessible device
This patch adds a shell script sof_test_perf.sh that measures
gain, frequency response, and total harmonic distortion plus
noise for a remote device.

Matlab or Octave is needed. The shell script launches by default
Octave to process the signal generation and test results analysis
scripts.

The remote device must be set to be accessible by ssh without
passwords. An external high quality USB sound card is recommended
as analog interface to connect to test device's analog interface.

The configuration file sof_test_perf_config.m must be edited for
the remote device's user account, audio device, audio format, and
capture sound card audio device, and audio format.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-09-17 15:40:29 +01:00
Seppo Ingalsuo 31e67a227c Testbench: Update SRC tests criteria for lower 16 bit quality data
The tests created lot of unnecessary fails when testing with S16_LE
format. The test pass criteria for THD+N, DR is relaxed for tests
with 16 bit data.

Since the gain of SRC conversions was lowered to -1 dB the test
case for gain need to be updated. The gain is retrieved from
src_param() function. An exception is added for FS1 == FS2 case
when data is passed through. In that case expected gain is 0 dB.

The frequency response measurement grid does not necessarily cover
the exact upper frequency of pass-band. Therefore the min. upper
passband frequency is scaled by 0.99. This avoids measurement
technique related fails in test.

The chirp spectra test case was updated to use for RMS level criteria
for testing the level of signal. The peak level was less robust and
caused unnecessary test fails.

The option to not open plot windows during test is set. It improves
speed of test and avoids display clutter.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-05-11 09:28:44 +02:00
Curtis Malainey 5b5888ce07 Move SOFT into sub folder for SOF merge
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2018-11-24 23:27:24 -08:00