-
Notifications
You must be signed in to change notification settings - Fork 59
test-speaker: add argument for loop count #677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,8 +20,11 @@ source $(dirname ${BASH_SOURCE[0]})/../case-lib/lib.sh | |
| OPT_NAME['t']='tplg' OPT_DESC['t']='tplg file, default value is env TPLG: $TPLG' | ||
| OPT_HAS_ARG['t']=1 OPT_VAL['t']="$TPLG" | ||
|
|
||
| OPT_NAME['l']='loop' OPT_DESC['l']='option of speaker-test' | ||
| OPT_HAS_ARG['l']=1 OPT_VAL['l']=3 | ||
| OPT_NAME['l']='loop' OPT_DESC['l']='stress loops count' | ||
| OPT_HAS_ARG['l']=1 OPT_VAL['l']=1 | ||
|
|
||
| OPT_NAME['L']='nloops' OPT_DESC['L']='option of speaker-test, loop number of .wav files, 0 = infinite' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What .wav files? |
||
| OPT_HAS_ARG['L']=1 OPT_VAL['L']=3 | ||
|
|
||
| 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 | ||
|
|
@@ -31,27 +34,32 @@ tplg=${OPT_VAL['t']} | |
| [[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect | ||
|
|
||
| func_pipeline_export "$tplg" "type:playback" | ||
| tcnt=${OPT_VAL['l']} | ||
| tcnt=${OPT_VAL['L']} | ||
| tloop=${OPT_VAL['l']} | ||
| setup_kernel_check_point | ||
| for idx in $(seq 0 $(expr $PIPELINE_COUNT - 1)) | ||
| for loop in $(seq 1 $tloop) | ||
| 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) | ||
|
|
||
| dlogc "speaker-test -D $dev -r $rate -c $channel -f $fmt -l $tcnt -t wav -P 8" | ||
| speaker-test -D $dev -r $rate -c $channel -f $fmt -l $tcnt -t wav -P 8 2>&1 |tee $LOG_ROOT/result_$idx.txt | ||
| resultRet=$? | ||
|
|
||
| if [[ $resultRet -eq 0 ]]; then | ||
| grep -nr -E "error|failed" $LOG_ROOT/result_$idx.txt | ||
| if [[ $? -eq 0 ]]; then | ||
| func_lib_lsof_error_dump $snd | ||
| die "speaker test failed" | ||
| dlogi "===== Starting iteration $loop of $tloop =====" | ||
| 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) | ||
|
|
||
| dlogc "speaker-test -D $dev -r $rate -c $channel -f $fmt -l $tcnt -t wav -P 8" | ||
| speaker-test -D $dev -r $rate -c $channel -f $fmt -l $tcnt -t wav -P 8 2>&1 |tee $LOG_ROOT/result_$loop_$idx.txt | ||
| resultRet=$? | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realize the code was already like this before this PR but here Please make sure this test fails when speaker test fails and fix it first if it does not; there's no point enhancing a test that does not even report failures in the first place. A very simple way to test the test is to temporarily pass a broken parameter. Isn't a simple |
||
|
|
||
| if [[ $resultRet -eq 0 ]]; then | ||
| grep -nr -E "error|failed" $LOG_ROOT/result_$idx.txt | ||
| if [[ $? -eq 0 ]]; then | ||
| func_lib_lsof_error_dump $snd | ||
| die "speaker test failed" | ||
| fi | ||
| fi | ||
| fi | ||
| done | ||
| done | ||
|
|
||
| sof-kernel-log-check.sh "$KERNEL_CHECKPOINT" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"stress loops count" would apply to either option, please use a description that makes a difference with the other option. Maybe something like "How many times speaker-test is run" versus "speaker-test --nloops option"