@@ -22,7 +22,7 @@ my_dir=$(dirname "${BASH_SOURCE[0]}")
2222# shellcheck source=case-lib/lib.sh
2323source " $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 "
2626OPT_HAS_ARG[' t' ]=1 OPT_VAL[' t' ]=" $TPLG "
2727
2828OPT_NAME[' d' ]=' duration' OPT_DESC[' d' ]=' aplay duration in second'
@@ -39,8 +39,13 @@ tplg=${OPT_VAL['t']}
3939duration=${OPT_VAL['d']}
4040loop_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
4347func_pipeline_export " $tplg " " eq:any"
48+ tplg_files=${TPLG_FILES:- $tplg_files }
4449sofcard=${SOFCARD:- 0}
4550
4651start_test
@@ -81,10 +86,24 @@ func_test_eq()
8186func_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