Skip to content

Commit 0f7e4b4

Browse files
committed
test-case: fix check-audio-equalizer for function topology
Update the script to support multi topology input. Signed-off-by: Mateusz Junkier <mateusz.junkier@intel.com>
1 parent a3faf7f commit 0f7e4b4

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

test-case/check-audio-equalizer.sh

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ my_dir=$(dirname "${BASH_SOURCE[0]}")
2222
# shellcheck source=case-lib/lib.sh
2323
source "$my_dir"/../case-lib/lib.sh
2424

25-
OPT_NAME['t']='tplg' OPT_DESC['t']="tplg file, default value is env TPLG: $TPLG"
25+
OPT_NAME['t']='tplg' OPT_DESC['t']="tplg file(s), separated by : or , default value is env TPLG: $TPLG"
2626
OPT_HAS_ARG['t']=1 OPT_VAL['t']="$TPLG"
2727

2828
OPT_NAME['d']='duration' OPT_DESC['d']='aplay duration in second'
@@ -39,8 +39,13 @@ tplg=${OPT_VAL['t']}
3939
duration=${OPT_VAL['d']}
4040
loop_cnt=${OPT_VAL['l']}
4141

42+
# func_pipeline_export validates topology input and exports TPLG_FILES as
43+
# comma-separated absolute paths, possibly containing multiple files.
44+
tplg_files=${tplg//:/,}
45+
4246
# import only EQ pipeline from topology
4347
func_pipeline_export "$tplg" "eq:any"
48+
tplg_files=${TPLG_FILES:-$tplg_files}
4449
sofcard=${SOFCARD:-0}
4550

4651
start_test
@@ -81,10 +86,24 @@ func_test_eq()
8186
func_test_filter()
8287
{
8388
local testfilter=$1
89+
local tplg_file filter_id
90+
8491
dlogi "Get amixer control id for $testfilter"
85-
Filterid=$("$my_dir"/../tools/topo_effect_kcontrols.py "$tplg" "$testfilter")
92+
93+
Filterid=""
94+
IFS=',' read -r -a tplg_array <<< "$tplg_files"
95+
for tplg_file in "${tplg_array[@]}"; do
96+
[ -n "$tplg_file" ] || continue
97+
filter_id=$("$my_dir"/../tools/topo_effect_kcontrols.py "$tplg_file" "$testfilter" 2>/dev/null || true)
98+
if [ -n "$filter_id" ]; then
99+
Filterid=$filter_id
100+
dlogi "Found $testfilter in topology: $tplg_file"
101+
break
102+
fi
103+
done
104+
86105
if [ -z "$Filterid" ]; then
87-
die "can't find $testfilter"
106+
die "can't find $testfilter in any topology: $tplg_files"
88107
fi
89108

90109
if is_ipc4; then

0 commit comments

Comments
 (0)