-
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
base: master
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 |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| #!/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" | ||
|
|
||
| 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 "# " { } timeout { exit 5 } | ||
| DONE | ||
| } | ||
|
|
||
| # Clean up any existing semu processes before starting tests | ||
| cleanup | ||
|
|
||
| # Test sound device | ||
| test_sound | ||
| echo "✓ sound test passed" | ||
|
|
||
| exit 0 |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,12 +12,13 @@ A minimalist RISC-V system emulator capable of running Linux the kernel and corr | |||||||||
| - Three types of I/O support using VirtIO standard: | ||||||||||
| - virtio-blk acquires disk image from the host. | ||||||||||
| - virtio-net is mapped as TAP interface. | ||||||||||
| - virtio-snd uses [PortAudio](https://github.com/PortAudio/portaudio) for sound playback on the host with one limitations: | ||||||||||
| - As some unknown issues in guest Linux OS (confirmed in v6.7 and v6.12), you need | ||||||||||
| to adjust the buffer size to more than four times of period size, or | ||||||||||
| the program cannot write the PCM frames into guest OS ALSA stack. | ||||||||||
| - virtio-snd uses [PortAudio](https://github.com/PortAudio/portaudio) for sound playback and capture on the host with one limitation: | ||||||||||
| - As a confirmed issue that `semu` cannot send/receive PCM frames in time, causing | ||||||||||
| the ALSA stack stuck in XRUN state until `semu` being rebooted. | ||||||||||
|
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. P3: Grammar error: "until Prompt for AI agents
Suggested change
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. P3: Grammar issue: 'stuck' should be 'to get stuck' and 'being rebooted' should be 'is rebooted'. Prompt for AI agents
Suggested change
|
||||||||||
| - For playback, you can try to adjust the buffer size to more than four times of period size. | ||||||||||
| - For instance, the following buffer/period size settings on `aplay` has been tested | ||||||||||
| with broken and stutter effects yet complete with no any errors: `aplay --buffer-size=32768 --period-size=4096 /usr/share/sounds/alsa/Front_Center.wav`. | ||||||||||
| - For capture, ALSA usually get stuck in XRUN state, so you may need to try multiple times. | ||||||||||
|
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. P3: Grammar error: subject-verb agreement. "ALSA usually get stuck" should be "ALSA usually gets stuck". Prompt for AI agents
Suggested change
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. P3: Subject-verb agreement error: "ALSA usually get stuck" should be "ALSA usually gets stuck". Prompt for AI agents
Suggested change
|
||||||||||
|
|
||||||||||
| ## Prerequisites | ||||||||||
|
|
||||||||||
|
|
||||||||||
Uh oh!
There was an error while loading. Please reload this page.
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.
P1: The sound test runs unconditionally for all matrix variants, including when
matrix.dependency == 'none'where no sound library is installed. This will likely cause the test to fail. Consider adding a condition similar to the install step.Prompt for AI agents