Skip to content

Commit 7c7458c

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 8be2ad6 commit 7c7458c

27 files changed

+99
-27
lines changed

test-case/check-audio-equalizer.sh

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ func_test_eq()
4949
{
5050
local id=$1
5151
local conf=$2
52+
local double_quoted_id=\""$id"\"
5253

53-
dlogc "sof-ctl -Dhw:$sofcard -n $id -s $conf"
54-
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" || {
5556
dloge "Equalizer setting failure with $conf"
5657
return 1
5758
}
@@ -65,30 +66,41 @@ func_test_eq()
6566
}
6667

6768
# this function performs IIR/FIR filter test
68-
# param1 must be must be iir or fir
69+
# param1 must be must be component name
6970
func_test_filter()
7071
{
7172
local testfilter=$1
7273
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)
74+
Filterid=$("$my_dir"/../tools/topo_effect_kcontrols.py "$tplg" "$testfilter")
7675
if [ -z "$Filterid" ]; then
7776
die "can't find $testfilter"
7877
fi
7978

80-
declare -a FilterList=($(ls -d "${my_dir}"/eqctl/eq_"${testfilter}"_*.txt))
81-
nFilterList=${#FilterList[@]}
82-
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=$(find "${my_dir}/eqctl/$ipc_dir/$comp_dir/" -name '*.txt' | wc -l)
94+
dlogi "$testfilter list, num= $nFilterList"
8395
if [ "$nFilterList" -eq 0 ]; then
8496
die "$testfilter flter coeff list error!"
8597
fi
8698

87-
for i in $(seq 1 $loop_cnt)
99+
for i in $(seq 1 "$loop_cnt")
88100
do
89101
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" || {
102+
for config in "${my_dir}/eqctl/$ipc_dir/$comp_dir"/*.txt; do
103+
func_test_eq "$Filterid" "$config" || {
92104
dloge "EQ test failed with $config"
93105
: $((failed_cnt++))
94106
}
@@ -111,7 +123,7 @@ do
111123
rate=$(func_pipeline_parse_value "$idx" rate)
112124
fmt=$(func_pipeline_parse_value "$idx" fmt)
113125
type=$(func_pipeline_parse_value "$idx" type)
114-
eq_support=$(func_pipeline_parse_value "$idx" eq)
126+
eq_support=($(func_pipeline_parse_value "$idx" eq))
115127

116128
case $type in
117129
"playback")
@@ -124,12 +136,10 @@ do
124136
;;
125137
esac
126138

127-
dlogi "eq_support= $eq_support"
139+
dlogi "eq_support= ${eq_support[*]}"
128140
# 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
141+
for comp_id in "${eq_support[@]}"; do
142+
func_test_filter "$comp_id"
133143
done
134144

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