Skip to content

Commit

Permalink
check-pause-release-suspend-resume: add a delay time before
Browse files Browse the repository at this point in the history
pausing the audio stream

There's a latency when starting audio stream, if pause
the audio stream directly after it starts, it may lead
to some unexpected errors. Add a delay to ensure that
audio stream is in a normal state before pusing.

Signed-off-by: Keqiao Zhang <[email protected]>
  • Loading branch information
keqiaozhang committed Mar 25, 2022
1 parent d127aa0 commit f4e0c64
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test-case/check-pause-release-suspend-resume.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,17 @@ OPT_HAS_ARG['s']=0 OPT_VAL['s']=1
OPT_NAME['T']='type' OPT_DESC['T']="specify the sleep type for suspend/resume:s2idle/deep"
OPT_HAS_ARG['T']=1 OPT_VAL['T']=""

OPT_NAME['d']='delay' OPT_DESC['d']='delay time before pausing aplay/arecord process, unit is ms'
OPT_HAS_ARG['d']=1 OPT_VAL['d']='2000'

func_opt_parse_option "$@"

repeat_count=${OPT_VAL['l']}
interval=${OPT_VAL['i']}
test_mode=${OPT_VAL['m']}
file_name=${OPT_VAL['F']}
tplg=${OPT_VAL['t']}
delay=${OPT_VAL['d']}

case $test_mode in
"playback")
Expand Down Expand Up @@ -139,6 +143,8 @@ do
expect {
"#*+*\%" {
# audio stream (aplay or arecord) is active now and playing
# delay time before pausing aplay/arecord process
after $delay
puts "\r===== (\$i/$repeat_count) pb_pbm: Pause $cmd, then wait for ===== "
puts "\r(\$i/$repeat_count) pb_pbm: $interval ms after pause"
send " "
Expand Down

0 comments on commit f4e0c64

Please sign in to comment.