Skip to content

Commit d53bb77

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 daf6881 commit d53bb77

27 files changed

+98
-25
lines changed

test-case/check-audio-equalizer.sh

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ func_opt_parse_option "$@"
3737
tplg=${OPT_VAL['t']}
3838
duration=${OPT_VAL['d']}
3939
loop_cnt=${OPT_VAL['l']}
40+
ipc4="false"
4041

4142
# import only EQ pipeline from topology
4243
func_pipeline_export "$tplg" "eq:any"
@@ -49,9 +50,10 @@ func_test_eq()
4950
{
5051
local id=$1
5152
local conf=$2
53+
local double_quoted_id=\""$id"\"
5254

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

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

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

87100
for i in $(seq 1 $loop_cnt)
88101
do
89102
dlogi "===== [$i/$loop_cnt] Test $testfilter config list, $testfilter amixer control id=$Filterid ====="
90-
for config in "${FilterList[@]}"; do
91-
func_test_eq "$Filterid" "$my_dir/$config" || {
103+
for config in "${my_dir}"/eqctl/$ipc_dir/$comp_dir/*.txt; do
104+
func_test_eq "$Filterid" "$config" || {
92105
dloge "EQ test failed with $config"
93106
: $((failed_cnt++))
94107
}
@@ -111,7 +124,7 @@ do
111124
rate=$(func_pipeline_parse_value "$idx" rate)
112125
fmt=$(func_pipeline_parse_value "$idx" fmt)
113126
type=$(func_pipeline_parse_value "$idx" type)
114-
eq_support=$(func_pipeline_parse_value "$idx" eq)
127+
eq_support=($(func_pipeline_parse_value "$idx" eq))
115128

116129
case $type in
117130
"playback")
@@ -126,10 +139,8 @@ do
126139

127140
dlogi "eq_support= $eq_support"
128141
# if IIR/FIR filter is avilable, test with coef list
129-
for filter_type in iir fir; do
130-
if echo "$eq_support" | grep -q -i $filter_type; then
131-
func_test_filter $filter_type
132-
fi
142+
for comp_id in "${eq_support[@]}"; do
143+
func_test_filter "$comp_id"
133144
done
134145

135146
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)