-
Notifications
You must be signed in to change notification settings - Fork 48
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
check-pause-resume: handle volume MAX output in expect #931
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,18 +96,21 @@ do | |
dlogi "Entering expect script with: | ||
$cmd $SOF_ALSA_OPTS $cmd_opts -D $dev -r $rate -c $channel -f $fmt -vv -i $file_name -q" | ||
|
||
# NOTE: Purposely we don't handle 'Volume MAX' case. So that the MAX output can fall into | ||
# 'anything else' case and error out. | ||
# FIXME: share this expect script as a common function | ||
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. |
||
expect <<END | ||
spawn $cmd $SOF_ALSA_OPTS $cmd_opts -D $dev -r $rate -c $channel -f $fmt -vv -i $file_name -q | ||
set i 1 | ||
expect { | ||
"*#*+*\%" { | ||
-re "#.*\%\r" { | ||
set sleep_t [expr int([expr rand() * $rnd_range]) + $rnd_min ] | ||
puts "\r(\$i/$repeat_count) Wait for \$sleep_t ms before pause" | ||
send " " | ||
after \$sleep_t | ||
exp_continue | ||
} | ||
"*PAUSE*" { | ||
"=== PAUSE ===" { | ||
set sleep_t [expr int([expr rand() * $rnd_range]) + $rnd_min ] | ||
puts "\r(\$i/$repeat_count) Wait for \$sleep_t ms before resume" | ||
send " " | ||
|
@@ -116,13 +119,28 @@ expect { | |
if { \$i > $repeat_count } { exit 0 } | ||
exp_continue | ||
} | ||
-re ".*\:.*\n"|"Hardware PCM card.*\n" { | ||
puts "\rexpect ignore dump-hw-params" | ||
after 10 | ||
exp_continue | ||
} | ||
default { | ||
puts "\rError: timeout or eof detected, exit 1" | ||
exit 1 | ||
} | ||
# this is conventional default, anything else hit here | ||
"^?*\n" { | ||
puts "\rError: unexpected output detected, exit 1. $expect_out(0,string)" | ||
exit 1 | ||
} | ||
} | ||
exit 1 | ||
END | ||
ret=$? | ||
#flush the output | ||
echo | ||
if [ $ret -ne 0 ]; then | ||
echo "Expect block return $ret" | ||
func_lib_lsof_error_dump "$snd" | ||
sof-process-kill.sh || | ||
dlogw "Kill process catch error" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why volume is MAX is separate question
No, that's why this test failed in the first place.
If the ALSA settings are not correct, this PR is not useful.
Fix the ALSA settings first, then we can refine expect scripts.
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.
As usual, keep the broken ALSA settings in your backpocket to "test the test" locally. A test that can't fail is useless (green failure).
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.
I said suddenly seeing Volume MAX is sperate issue, mostly it is due to alsa settings. This PR doesn't fix that.
Agreed, that's why I restored alsa setting from working device from day 1, although I see some weird values. I can re-set if @libinyang can confirm.