77# # Preconditions:
88# # N/A
99# # Description:
10+ # # Get audio stream pipeline paremeters from the tplg file.
1011# # test audio stream (playback or capture) with pause/release as well as suspend/resume
1112# # fake pause/release with expect on audio stream process
1213# # have system enter suspend state for 5 secs
1314# # resume from suspend state
1415# # release audio stream from paused state
15- # # repeat
1616# # Case step:
1717# # 1. audio stream process is started
1818# # 2. audio stream process is then paused via mock spacebar press via expect
@@ -56,17 +56,8 @@ source $(dirname ${BASH_SOURCE[0]})/../case-lib/lib.sh
5656OPT_NAME[' m' ]=' mode' OPT_DESC[' m' ]=' test mode. Example: playback; capture'
5757OPT_HAS_ARG[' m' ]=1 OPT_VAL[' m' ]=' playback'
5858
59- OPT_NAME[' p' ]=' pcm' OPT_DESC[' p' ]=' audio pcm. Example: hw:0,0'
60- OPT_HAS_ARG[' p' ]=1 OPT_VAL[' p' ]=' hw:0,0'
61-
62- OPT_NAME[' f' ]=' fmt' OPT_DESC[' f' ]=' audio format value'
63- OPT_HAS_ARG[' f' ]=1 OPT_VAL[' f' ]=' S16_LE'
64-
65- OPT_NAME[' c' ]=' channel' OPT_DESC[' c' ]=' audio channel count'
66- OPT_HAS_ARG[' c' ]=1 OPT_VAL[' c' ]=' 2'
67-
68- OPT_NAME[' r' ]=' rate' OPT_DESC[' r' ]=' audio rate'
69- OPT_HAS_ARG[' r' ]=1 OPT_VAL[' r' ]=' 48000'
59+ OPT_NAME[' S' ]=' filter_string' OPT_DESC[' S' ]=' run this case on specified pipelines'
60+ OPT_HAS_ARG[' S' ]=1 OPT_VAL[' S' ]=' id:any'
7061
7162OPT_NAME[' F' ]=' file' OPT_DESC[' F' ]=' file name. Example: /dev/zero; /dev/null'
7263OPT_HAS_ARG[' F' ]=1 OPT_VAL[' F' ]=' '
@@ -80,16 +71,16 @@ OPT_HAS_ARG['i']=1 OPT_VAL['i']='500'
8071OPT_NAME[' s' ]=' sof-logger' OPT_DESC[' s' ]=" Open sof-logger trace the data will store at $LOG_ROOT "
8172OPT_HAS_ARG[' s' ]=0 OPT_VAL[' s' ]=1
8273
74+ OPT_NAME[' t' ]=' tplg' OPT_DESC[' t' ]=' tplg file, default value is env TPLG: $TPLG'
75+ OPT_HAS_ARG[' t' ]=1 OPT_VAL[' t' ]=" $TPLG "
76+
8377func_opt_parse_option " $@ "
8478
85- pcm=${OPT_VAL['p']}
86- fmt=${OPT_VAL['f']}
87- channel=${OPT_VAL['c']}
88- rate=${OPT_VAL['r']}
8979repeat_count=${OPT_VAL['l']}
9080sleep_period=${OPT_VAL['i']}
9181test_mode=${OPT_VAL['m']}
9282file_name=${OPT_VAL['F']}
83+ tplg=${OPT_VAL['t']}
9384
9485case $test_mode in
9586 " playback" )
10798
10899[[ -z $file_name ]] && file_name=$dummy_file
109100
110-
111101logger_disabled || func_lib_start_log_collect
112102
113103setup_kernel_check_point
@@ -122,7 +112,16 @@ rm -rf /tmp/sof-test.lock
122112# after ms: Ms must be an integer giving a time in milliseconds.
123113# The command sleeps for ms milliseconds and then returns.
124114expect << AUDIO
125- spawn $cmd -D $pcm -r $rate -c $channel -f $fmt -vv -i $dummy_file -q
115+
116+ func_pipeline_export "$tplg " "type:$test_mode & ${OPT_VAL['S']} "
117+
118+ channel=$( func_pipeline_parse_value " $idx " channel)
119+ rate=$( func_pipeline_parse_value " $idx " rate)
120+ fmt=$( func_pipeline_parse_value " $idx " fmt)
121+ dev=$( func_pipeline_parse_value " $idx " dev)
122+ snd=$( func_pipeline_parse_value " $idx " snd)
123+
124+ spawn $cmd -D $dev -r $rate -c $channel -f $fmt -vv -i $file_name -q
126125set i 1
127126set sleep_t $sleep_period
128127expect {
0 commit comments