Repository navigation
qa: add simultaneous playback/capture stress test scripts #742
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
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 |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| aplay -Dhw:0,1 -f dat -c 2 /dev/zero & | ||
| # Get its PID | ||
| PID_1=$! | ||
|
|
||
| arecord -Dhw:0,1 -f dat -c 2 /dev/null & | ||
|
Member
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. The duplex PCM should be passed as an arg and so should playback PCM. |
||
| # Get its PID | ||
| PID_2=$! | ||
|
|
||
| aplay -Dhw:0,0 -f dat -c 2 /dev/zero & | ||
| # Get its PID | ||
| PID_3=$! | ||
|
|
||
| # Wait for 5 seconds | ||
| sleep 5 | ||
|
Member
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. sleep time should be an arg (it can be fractional) |
||
| # Kill them | ||
| kill $PID_1 | ||
| RET_1=$? | ||
| kill $PID_2 | ||
| RET_2=$? | ||
| kill $PID_3 | ||
| RET_3=$? | ||
|
|
||
| if [ $RET_1 -ne 0 ] || [ $RET_2 -ne 0 ] || [ $RET_3 -ne 0 ] | ||
| #if [ $RET_1 -ne 0 ] || [ $RET_2 -ne 0 ] | ||
| then | ||
| echo "stopping failed!" | ||
| exit -1 | ||
| else | ||
| exit 0 | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| i=0 | ||
|
Member
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. Needs comments, licence etc. Better name is "test-iterate.sh" |
||
| MAXLOOPS=1000 | ||
|
Member
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. argument |
||
| while [ $i -lt $MAXLOOPS ]; do | ||
| echo "iterate $i ..." | ||
| ./sim.sh | ||
|
Member
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. test we run should be argument. |
||
| if [ $? -eq 0 ]; then | ||
| let i+=1 | ||
| else | ||
| exit 1 | ||
| fi | ||
| sleep 1 | ||
|
Member
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. sleep should also be argument.
Member
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. and by default I would make it 0.1 seconds. |
||
| done | ||
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.
Each test will need comments at the top describing what it does and any arguments it takes. Also SPDX style comment stating BSD licence. The file name here is not very meaningful either, this test does a duplex stream on 0,1 and a playback on 0,0 e.g. "test-duplex-plus-playback.sh" is probably a better name.