Skip to content

Commit 3a4e221

Browse files
committed
Test-case: check-audio-equalizers: Updates for IPC4 systems
This patch updates the test check-audio-equalizer.sh to work with IPC4 topologies with different naming for controls. The control name no more includes the component name, so the search for controls is changed. A tool topo_effect_kcontrols.py is used to find bytes controls for given component. The blobs to test with sof-ctl are updated from SOF git repository. The ipc3 or ipc4 directory is chosen based on runtime check of DUT ipc version. The sof-ctl usage is changed. The control is now referenced with the text control name instead of numid. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 4f9592d commit 3a4e221

31 files changed

Lines changed: 125 additions & 21 deletions

test-case/check-audio-equalizer.sh

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func_opt_parse_option "$@"
3636
tplg=${OPT_VAL['t']}
3737
duration=${OPT_VAL['d']}
3838
loop_cnt=${OPT_VAL['l']}
39+
ipc4="false"
3940

4041
# import only EQ pipeline from topology
4142
func_pipeline_export "$tplg" "eq:any"
@@ -49,8 +50,8 @@ func_test_eq()
4950
local id=$1
5051
local conf=$2
5152

52-
dlogc "sof-ctl -Dhw:$sofcard -n $id -s $conf"
53-
sof-ctl -Dhw:"$sofcard" -n "$id" -s "$conf" || {
53+
dlogc "sof-ctl -Dhw:$sofcard -c name='$id' -s $conf"
54+
sof-ctl -Dhw:"$sofcard" -c name=\""$id"\" -s "$conf" || {
5455
dloge "Equalizer setting failure with $conf"
5556
return 1
5657
}
@@ -64,19 +65,31 @@ func_test_eq()
6465
}
6566

6667
# this function performs IIR/FIR filter test
67-
# param1 must be must be iir or fir
68+
# param1 must be must be component name
6869
func_test_filter()
6970
{
7071
local testfilter=$1
7172
dlogi "Get amixer control id for $testfilter"
72-
# TODO: Need to match alsa control id with the filter in the pipeline,
73-
# currently the test discards EQ pipelines except first one.
74-
Filterid=$(amixer -D hw:"$sofcard" controls | sed -n -e "/eq${testfilter}/I "'s/numid=\([0-9]*\),.*/\1/p' | head -1)
73+
Filterid=`$my_dir/../tools/topo_effect_kcontrols.py $tplg $testfilter`
7574
if [ -z "$Filterid" ]; then
7675
die "can't find $testfilter"
7776
fi
7877

79-
declare -a FilterList=($(ls -d "${my_dir}"/eqctl/eq_"${testfilter}"_*.txt))
78+
if is_ipc4; then
79+
ipc_dir="ipc4"
80+
else
81+
ipc_dir="ipc3"
82+
fi
83+
84+
if [[ ${Filterid^^} == *"IIR"* ]]; then
85+
comp_dir="eq_iir"
86+
elif [[ ${Filterid^^} == *"FIR"* ]]; then
87+
comp_dir="eq_fir"
88+
else
89+
die "Not supported control: $Filterid"
90+
fi
91+
92+
declare -a FilterList=($(ls -d "${my_dir}"/eqctl/$ipc_dir/$comp_dir/*.txt))
8093
nFilterList=${#FilterList[@]}
8194
dlogi "$testfilter list, num= $nFilterList, coeff files= ${FilterList[*]}"
8295
if [ "$nFilterList" -eq 0 ]; then
@@ -87,7 +100,7 @@ func_test_filter()
87100
do
88101
dlogi "===== [$i/$loop_cnt] Test $testfilter config list, $testfilter amixer control id=$Filterid ====="
89102
for config in "${FilterList[@]}"; do
90-
func_test_eq "$Filterid" "$my_dir/$config" || {
103+
func_test_eq "$Filterid" "$config" || {
91104
dloge "EQ test failed with $config"
92105
: $((failed_cnt++))
93106
}
@@ -125,10 +138,8 @@ do
125138

126139
dlogi "eq_support= $eq_support"
127140
# if IIR/FIR filter is avilable, test with coef list
128-
for filter_type in iir fir; do
129-
if echo "$eq_support" | grep -q -i $filter_type; then
130-
func_test_filter $filter_type
131-
fi
141+
for comp_id in $eq_support; do
142+
func_test_filter $comp_id
132143
done
133144

134145
done

test-case/eqctl/eq_fir_flat.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

test-case/eqctl/eq_fir_loudness.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

test-case/eqctl/eq_fir_mid.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

test-case/eqctl/eq_fir_pass.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

test-case/eqctl/eq_iir_bandpass.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

test-case/eqctl/eq_iir_bassboost.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

test-case/eqctl/eq_iir_flat.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

test-case/eqctl/eq_iir_loudness.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

test-case/eqctl/eq_iir_pass.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)