diff --git a/test-case/multiple-pause-resume.sh b/test-case/multiple-pause-resume.sh index b5268d5d..0df264a4 100755 --- a/test-case/multiple-pause-resume.sh +++ b/test-case/multiple-pause-resume.sh @@ -121,30 +121,12 @@ func_pause_resume_pipeline() # expr rand(): produces random numbers between 0 and 1 # after ms: Ms must be an integer giving a time in milliseconds. # The command sleeps for ms milliseconds and then returns. - dlogi "$pcm to command: $cmd -D $dev -r $rate -c $channel -f $fmt -vv -i $file -q" - expect < $repeat_count } { exit 0 } - exp_continue - } -} -exit 1 -END + + local shortname="cmd$idx $cmd $pcm" + + dlogi "Starting: apause.exp $cmd -D $dev -r $rate -c $channel -f $fmt -vv -i $file &" + "$TOPDIR"/case-lib/apause.exp "$shortname" "$repeat_count" "$rnd_min" "$rnd_range" \ + "$cmd" -D "$dev" -r "$rate" -c "$channel" -f "$fmt" -vv -i "$file" & } # to prevent infinite loop, 5 second per a repeat is plenty @@ -163,6 +145,9 @@ do do func_pause_resume_pipeline "$idx" pid_lst=("${pid_lst[@]}" $!) + # Stagger a bit to avoid preambles interleaved with each other. + # It's very far from perfect but it helps a little bit. + sleep 0.1 done # wait for expect script finished dlogi "wait for expect process finished"