-
Notifications
You must be signed in to change notification settings - Fork 64
Implement VirtIO sound device capture #115
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
Open
Cuda-Chen
wants to merge
8
commits into
sysprog21:master
Choose a base branch
from
Cuda-Chen:add-virtio-snd-rx
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+416
−127
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
71e1db1
Implement VirtIO sound device capture
Cuda-Chen 9b84ef1
Add TX signal lock guard
Cuda-Chen 832f6bd
Refine
Cuda-Chen 9997cdc
refine
Cuda-Chen 30e87d7
refine tx
Cuda-Chen 18e9aae
refine tx/rx handler
Cuda-Chen 28b9238
apply suggestion
Cuda-Chen 8c68308
test
Cuda-Chen 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| # Source common functions and settings | ||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| export SCRIPT_DIR | ||
| source "${SCRIPT_DIR}/common.sh" | ||
|
|
||
| SAMPLE_SOUND="/usr/share/sounds/alsa/Front_Center.wav" | ||
|
|
||
| # Override timeout for sound tests | ||
| # Sound tests need different timeout: 30s for Linux, 900s for macOS | ||
| case "${OS_TYPE}" in | ||
| Darwin) | ||
| TIMEOUT=900 | ||
| ;; | ||
| Linux) | ||
| TIMEOUT=30 | ||
| ;; | ||
| *) | ||
| TIMEOUT=30 | ||
| ;; | ||
| esac | ||
|
|
||
| test_sound() { | ||
| ASSERT expect <<DONE | ||
| set timeout ${TIMEOUT} | ||
| spawn make check | ||
| expect "buildroot login:" { send "root\\n" } timeout { exit 1 } | ||
| expect "# " { send "uname -a\\n" } timeout { exit 2 } | ||
|
|
||
| expect "riscv32 GNU/Linux" { send "aplay ${SAMPLE_SOUND} --fatal-errors > /dev/null\\n" } timeout { exit 3 } | ||
| expect "# " { send "aplay -C -d 3 --fatal-errors -f S16_LE > /dev/null\\n" } timeout { exit 4 } | ||
| expect "# " { send "aplay -L\\n" } | ||
| expect "# " { } | ||
| DONE | ||
| echo "✓ sound test passed" | ||
| } | ||
|
|
||
| # Clean up any existing semu processes before starting tests | ||
| cleanup | ||
|
|
||
| # Test sound device | ||
| test_sound | ||
|
|
||
| ret="$?" | ||
|
|
||
| MESSAGES=("OK!" \ | ||
| "Fail to boot" \ | ||
| "Fail to login" \ | ||
| "Playback fails" \ | ||
| "Capture fails" \ | ||
| ) | ||
|
|
||
| if [ "$ret" -eq 0 ]; then | ||
| print_success "${MESSAGES["$ret"]}" | ||
| else | ||
| print_error "${MESSAGES["$ret"]}" | ||
| fi | ||
|
|
||
| exit "$ret" | ||
This file contains hidden or 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 | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -69,6 +69,10 @@ jobs: | |||||||
| run: sudo .ci/test-netdev.sh | ||||||||
| shell: bash | ||||||||
| timeout-minutes: 10 | ||||||||
| - name: sound test | ||||||||
|
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. P1: The sound test runs unconditionally for all matrix variants, including when Prompt for AI agents
Suggested change
|
||||||||
| run: .ci/test-sound.sh | ||||||||
| shell: bash | ||||||||
| timeout-minutes: 5 | ||||||||
|
|
||||||||
| semu-macOS: | ||||||||
| runs-on: macos-latest | ||||||||
|
|
@@ -118,6 +122,10 @@ jobs: | |||||||
| shell: bash | ||||||||
| timeout-minutes: 20 | ||||||||
| if: ${{ success() }} | ||||||||
| - name: sound test | ||||||||
| run: .ci/test-sound.sh | ||||||||
| shell: bash | ||||||||
| timeout-minutes: 20 | ||||||||
|
|
||||||||
| coding_style: | ||||||||
| runs-on: ubuntu-24.04 | ||||||||
|
|
||||||||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.