Skip to content

Commit d981ba6

Browse files
committed
Tools: Testbench: Add to README.md example of controls usage
The added example generates a sine wave file and processed it with various stereo mixer control settings. Since the example topology contains also a DRC it is switched off as demo with switch control. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 2f2c883 commit d981ba6

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

tools/testbench/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,37 @@ directions, use -p 1,2,3,4 and provide multiple input and output
6464
files separated with comma. Use e.g. -i i1.raw,i2.raw
6565
-o o1.raw,o2.raw.
6666

67+
### Apply controls to simulation
68+
69+
The testbench supports shell script like amixer and sleep commands for
70+
the controls. Create e.g. this script file as controls.sh:
71+
72+
```
73+
#!/bin/sh
74+
75+
# Example test sequence for DRC and volume components
76+
77+
amixer -c0 cset name='Post Mixer Analog Playback DRC switch' off
78+
amixer -c0 cset name='Post Mixer Analog Playback Volume' 40,30
79+
sleep 1
80+
amixer -c0 cset name='Post Mixer Analog Playback Volume' 0
81+
sleep 1
82+
amixer -c0 cset name='Post Mixer Analog Playback Volume' 45
83+
```
84+
85+
Then generarate sine wave (997 Hz, -3 dB level, 3 seconds) with sox
86+
and check the impact to processed signal with next commands:
87+
88+
```
89+
sox -n --encoding signed-integer -L -r 48000 -c 2 -b 32 in.raw synth 3 sine 997 norm -3
90+
91+
tools/testbench/build_testbench/install/bin/sof-testbench4 -r 48000 -c 2 -b S32_LE -p 1,2 \
92+
-t tools/build_tools/topology/topology2/production/sof-hda-generic.tplg \
93+
-i in.raw -o out.raw -s controls.sh
94+
95+
sox --encoding signed-integer -L -r 48000 -c 2 -b 32 out.raw out.wav
96+
```
97+
6798
### Run testbench with helper script
6899

69100
The scripts/sof-testbench-helper.sh simplifies the task. See the help

0 commit comments

Comments
 (0)