Skip to content

Commit ea1fd6f

Browse files
committed
Test-case: check-audio-equalizer: 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 026ec47 commit ea1fd6f

27 files changed

+125
-25
lines changed

test-case/check-audio-equalizer.sh

Lines changed: 27 additions & 16 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"
@@ -48,9 +49,10 @@ func_test_eq()
4849
{
4950
local id=$1
5051
local conf=$2
52+
local double_quoted_id=\""$id"\"
5153

52-
dlogc "sof-ctl -Dhw:$sofcard -n $id -s $conf"
53-
sof-ctl -Dhw:"$sofcard" -n "$id" -s "$conf" || {
54+
dlogc "sof-ctl -Dhw:$sofcard -c name=$double_quoted_id -s $conf"
55+
sof-ctl -Dhw:"$sofcard" -c name="$double_quoted_id" -s "$conf" || {
5456
dloge "Equalizer setting failure with $conf"
5557
return 1
5658
}
@@ -64,30 +66,41 @@ func_test_eq()
6466
}
6567

6668
# this function performs IIR/FIR filter test
67-
# param1 must be must be iir or fir
69+
# param1 must be must be component name
6870
func_test_filter()
6971
{
7072
local testfilter=$1
7173
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)
74+
Filterid=`$my_dir/../tools/topo_effect_kcontrols.py $tplg $testfilter`
7575
if [ -z "$Filterid" ]; then
7676
die "can't find $testfilter"
7777
fi
7878

79-
declare -a FilterList=($(ls -d "${my_dir}"/eqctl/eq_"${testfilter}"_*.txt))
80-
nFilterList=${#FilterList[@]}
81-
dlogi "$testfilter list, num= $nFilterList, coeff files= ${FilterList[*]}"
79+
if is_ipc4; then
80+
ipc_dir="ipc4"
81+
else
82+
ipc_dir="ipc3"
83+
fi
84+
85+
if [[ ${Filterid^^} == *"IIR"* ]]; then
86+
comp_dir="eq_iir"
87+
elif [[ ${Filterid^^} == *"FIR"* ]]; then
88+
comp_dir="eq_fir"
89+
else
90+
die "Not supported control: $Filterid"
91+
fi
92+
93+
nFilterList=$(ls -1 "${my_dir}"/eqctl/$ipc_dir/$comp_dir/*.txt | wc -l)
94+
dlogi "$testfilter list, num= $nFilterList"
8295
if [ "$nFilterList" -eq 0 ]; then
8396
die "$testfilter flter coeff list error!"
8497
fi
8598

8699
for i in $(seq 1 $loop_cnt)
87100
do
88101
dlogi "===== [$i/$loop_cnt] Test $testfilter config list, $testfilter amixer control id=$Filterid ====="
89-
for config in "${FilterList[@]}"; do
90-
func_test_eq "$Filterid" "$my_dir/$config" || {
102+
for config in "${my_dir}"/eqctl/$ipc_dir/$comp_dir/*.txt; do
103+
func_test_eq "$Filterid" "$config" || {
91104
dloge "EQ test failed with $config"
92105
: $((failed_cnt++))
93106
}
@@ -110,7 +123,7 @@ do
110123
rate=$(func_pipeline_parse_value "$idx" rate)
111124
fmt=$(func_pipeline_parse_value "$idx" fmt)
112125
type=$(func_pipeline_parse_value "$idx" type)
113-
eq_support=$(func_pipeline_parse_value "$idx" eq)
126+
eq_support=($(func_pipeline_parse_value "$idx" eq))
114127

115128
case $type in
116129
"playback")
@@ -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)