Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .ci/test-sound.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ 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} \\n" } timeout { exit 3 }
expect " Mono" { } timeout { exit 4 }
expect "# " { send "aplay -C -d 3 -f S16_LE > /dev/null \\n" } timeout { exit 5 }
expect " Mono" { } timeout { exit 6 }
DONE

ret="$?"
Expand All @@ -43,6 +45,8 @@ MESSAGES=("OK!" \
"Fail to login" \
"Fail to run playback commands" \
"Playback fails" \
"Fail to run capture commands" \
"Capture fails" \
)

if [ "$ret" -eq 0 ]; then
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
- Due to the emulation part, `semu` cannot send/receive PCM frames in time, causing
the ALSA stack will get stuck in XRUN state until you reboot `semu`.
- 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 gets stuck in XRUN state, so you may need to try multiple times.

## Prerequisites

Expand Down
Loading
Loading