mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-05 18:20:34 +00:00
34b48775ab
If frame_size is not "power of 2" (e.g. 12 bytes in 6channel/S16_LE), current write implementation will trigger io::copy error since - io::copy will split reader into multiple buffers with len() = "power of 2" if writer.capacity() >= DEFAULT_BUF_SIZE (which is 8192) and - trigger early return since current write don't support incomplete frames writing. Changes: - Remove redundant write impl - Fix write implementation in AudioBuffer - Add io_copy_audio_buffer unit test BUG=b:199001477 BUG=b:201382814 TEST=`cargo test` TEST=`cargo clippy --all-targets --all-features -- -D warnings` TEST=`aplay -Dhw:0,0 -f dat /dev/zeros -c 6` with virtio-snd Change-Id: Ia6b587ab20f474d8c620b69940ca0cc7095da6db Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3331976 Reviewed-by: Woody Chow <woodychow@google.com> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Chih-Yang Hsia <paulhsia@chromium.org> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |
Audio Server and Stream interfaces
The audio_streams
crate provides a basic interface for playing audio.
This will be used to enable playback to various audio subsystems such as
Alsa and cras. To start, an empty playback example NoopStreamSource
is provided.