Skip to content
This repository was archived by the owner on Jan 17, 2019. It is now read-only.

Commit 905be3a

Browse files
authored
Merge pull request #7 from singalsu/topic/add_src_tests_proposal_v1
Topic/add src tests proposal v1
2 parents f756455 + 1abae16 commit 905be3a

38 files changed

Lines changed: 3377 additions & 0 deletions

test/README

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
SOF Audio Processing Components Tests
2+
=====================================
3+
4+
This is a set of test scripts to test that performance requirements
5+
are met. The tests are currently for measured audio objective quality
6+
parameters. The used criteria for performance is only an initial
7+
assumption and need to be adjusted for various applications needs.
8+
9+
The scripts support currently support the next list of objective
10+
quality parameters. The test scripts need Matlab(R) [2] or GNU Octave
11+
scientific programming language [3].
12+
13+
- Gain
14+
- Frequency Response
15+
- THD+N vs. Frequency
16+
- Dynamic Range
17+
- Attenuation of Alias Products
18+
- Attenuation of Image Products
19+
20+
Note: The metric is an effort to follow AES17 [1] recommendation for
21+
parameters and test procedures. This was created to help developers to
22+
quickly check their work but has not been verified to be
23+
compliant. Professional equipment and formal calibration process is
24+
recommended for professional applications where both accurate absolute
25+
and relative metric is needed.
26+
27+
Note: The test bench uses by default raw binary data files. It is
28+
possible to convert with SoX (v14.4.1) [4] the raw data to e.g. wav
29+
format for other audio tools and subjective listening.
30+
31+
$ sox -b 32 -c 2 -r 48000 -L -e signed-integer fr_test_out.raw fr_test_out.wav
32+
33+
For debugging purposes it is possible to switch from test scripts the
34+
test vectors format to txt for easy manual data creation and
35+
inspection.
36+
37+
38+
Tests for component SRC
39+
-----------------------
40+
41+
The top level shell script to launch tests is src_test.sh. See script
42+
src_run.sh for assumed install location of SOF host test bench
43+
executable and component libraries. Exit code 0 indicates success and
44+
exit code 1 indicates failed test cases.
45+
46+
The default in/out rates matrix to test is defined in the beginning of
47+
script src_test.m. The matrix can be also passed from calling function
48+
src_test_top.m if need.
49+
50+
The key objective quality parameters requiremements are in the
51+
beginning of script src_test.m as well under comment Generic test
52+
pass/fail criteria.
53+
54+
Test run creates plots into directory "plots". Brief text format
55+
reports are placed to directory "reports".
56+
57+
58+
References
59+
----------
60+
61+
[1] AES17-1015 standard, http://www.aes.org/publications/standards/search.cfm?docID=21
62+
[2] Matlab(R), https://www.mathworks.com/products/matlab.html
63+
[3] GNU Octave, https://www.gnu.org/software/octave/
64+
[4] SoX - Sound eXchange, http://sox.sourceforge.net/

test/src_run.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
# SRC specifics
4+
COMP=src
5+
BITS_IN=$1
6+
BITS_OUT=$2
7+
FS1=$3
8+
FS2=$4
9+
FN_IN=$5
10+
FN_OUT=$6
11+
12+
# The HOST_ROOT path need to be retrived from SOFT .configure command
13+
HOST_ROOT=../../host-root
14+
HOST_EXE=$HOST_ROOT/bin/testbench
15+
HOST_LIB=$HOST_ROOT/lib
16+
17+
# Topology
18+
INFMT=s${BITS_IN}le
19+
OUTFMT=s${BITS_IN}le
20+
MCLK=24576k
21+
TPLG=../topology/test/test-playback-ssp2-I2S-${COMP}-${INFMT}-${OUTFMT}-48k-${MCLK}-nocodec.tplg
22+
23+
# If binary test vectors
24+
if [ ${FN_IN: -4} == ".raw" ]; then
25+
CMDFMT="-b S${BITS_IN}_LE"
26+
else
27+
CMDFMT=""
28+
fi
29+
30+
# Run command
31+
CMD0=$HOST_EXE
32+
CMD1="-d -x $FS1 -y $FS2 -i $FN_IN -o $FN_OUT -t $TPLG -a src=libsof_${COMP}.so $CMDFMT"
33+
CMD="$CMD0 $CMD1"
34+
export LD_LIBRARY_PATH=$HOST_LIB
35+
36+
# Run test bench
37+
echo "Command: $CMD0"
38+
echo "Arg: $CMD1"
39+
$CMD

0 commit comments

Comments
 (0)