From 14a5857a71f3786479bc0a3d5a83f085ba5e1aa5 Mon Sep 17 00:00:00 2001 From: VickyX_Intel_Ubuntu Date: Tue, 31 Aug 2021 14:43:15 +0800 Subject: [PATCH 1/3] Rename the caheck-pause-release-suspend-resume.sh to check-pause-suspend-resume-release.sh. And optimize this case to support all the PCM. Signed-off-by: VickyX_Intel_Ubuntu --- ... => check-pause-suspend-resume-release.sh} | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) rename test-case/{check-pause-release-suspend-resume.sh => check-pause-suspend-resume-release.sh} (72%) diff --git a/test-case/check-pause-release-suspend-resume.sh b/test-case/check-pause-suspend-resume-release.sh similarity index 72% rename from test-case/check-pause-release-suspend-resume.sh rename to test-case/check-pause-suspend-resume-release.sh index 1494948c..1117184f 100755 --- a/test-case/check-pause-release-suspend-resume.sh +++ b/test-case/check-pause-suspend-resume-release.sh @@ -56,17 +56,8 @@ source $(dirname ${BASH_SOURCE[0]})/../case-lib/lib.sh OPT_NAME['m']='mode' OPT_DESC['m']='test mode. Example: playback; capture' OPT_HAS_ARG['m']=1 OPT_VAL['m']='playback' -OPT_NAME['p']='pcm' OPT_DESC['p']='audio pcm. Example: hw:0,0' -OPT_HAS_ARG['p']=1 OPT_VAL['p']='hw:0,0' - -OPT_NAME['f']='fmt' OPT_DESC['f']='audio format value' -OPT_HAS_ARG['f']=1 OPT_VAL['f']='S16_LE' - -OPT_NAME['c']='channel' OPT_DESC['c']='audio channel count' -OPT_HAS_ARG['c']=1 OPT_VAL['c']='2' - -OPT_NAME['r']='rate' OPT_DESC['r']='audio rate' -OPT_HAS_ARG['r']=1 OPT_VAL['r']='48000' +OPT_NAME['p']='pcm' OPT_DESC['p']='run test case on specified pipelines' +OPT_HAS_ARG['p']=1 OPT_VAL['p']='id:any' OPT_NAME['F']='file' OPT_DESC['F']='file name. Example: /dev/zero; /dev/null' OPT_HAS_ARG['F']=1 OPT_VAL['F']='' @@ -75,21 +66,22 @@ OPT_NAME['l']='loop' OPT_DESC['l']='loop count' OPT_HAS_ARG['l']=1 OPT_VAL['l']=5 OPT_NAME['i']='sleep-period' OPT_DESC['i']='sleep period of aplay, unit is ms' -OPT_HAS_ARG['i']=1 OPT_VAL['i']='100' +OPT_HAS_ARG['i']=1 OPT_VAL['i']='200' OPT_NAME['s']='sof-logger' OPT_DESC['s']="Open sof-logger trace the data will store at $LOG_ROOT" OPT_HAS_ARG['s']=0 OPT_VAL['s']=1 +OPT_NAME['t']='tplg' OPT_DESC['t']='tplg file, default value is env TPLG: $TPLG' +OPT_HAS_ARG['t']=1 OPT_VAL['t']="$TPLG" + func_opt_parse_option "$@" +setup_kernel_check_point -pcm=${OPT_VAL['p']} -fmt=${OPT_VAL['f']} -channel=${OPT_VAL['c']} -rate=${OPT_VAL['r']} repeat_count=${OPT_VAL['l']} sleep_period=${OPT_VAL['i']} test_mode=${OPT_VAL['m']} file_name=${OPT_VAL['F']} +tplg=${OPT_VAL['t']} case $test_mode in "playback") @@ -107,29 +99,36 @@ esac [[ -z $file_name ]] && file_name=$dummy_file - logger_disabled || func_lib_start_log_collect -setup_kernel_check_point +func_pipeline_export "$tplg" "type:$test_mode & ${OPT_VAL['p']}" + +for idx in $(seq 0 $(expr $PIPELINE_COUNT - 1)) +do + channel=$(func_pipeline_parse_value "$idx" channel) + rate=$(func_pipeline_parse_value "$idx" rate) + fmt=$(func_pipeline_parse_value "$idx" fmt) + dev=$(func_pipeline_parse_value "$idx" dev) + snd=$(func_pipeline_parse_value "$idx" snd) -dlogi "Entering audio stream expect script with: $cmd -D $pcm -r $rate -c $channel -f $fmt -vv -i $dummy_file -q" -dlogi "Will enter suspend-resume cycle during paused period of audio stream process" + dlogi "Entering audio stream expect script with: $cmd -D $dev -r $rate -c $channel -f $fmt -vv -i $file_name -q" + dlogi "Will enter suspend-resume cycle during paused period of audio stream process" -rm -rf /tmp/sof-test.lock + rm -rf /tmp/sof-test.lock -# expect is tcl language script -# catch: Evaluate script and trap exceptional returns -# after ms: Ms must be an integer giving a time in milliseconds. -# The command sleeps for ms milliseconds and then returns. -expect <