diff options
author | Fletcher Woodruff <fletcherw@chromium.org> | 2019-08-12 11:46:47 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-28 01:07:56 +0000 |
commit | 7eae7735ee3485605d2ec7ba0685588b7a38b37b (patch) | |
tree | a2055a77649a489624b7b5b4dfbf08607655b9cf /src/linux.rs | |
parent | 020fbf04c2ac112f34b87306b5fbb75e7a02a81a (diff) | |
download | crosvm-7eae7735ee3485605d2ec7ba0685588b7a38b37b.tar crosvm-7eae7735ee3485605d2ec7ba0685588b7a38b37b.tar.gz crosvm-7eae7735ee3485605d2ec7ba0685588b7a38b37b.tar.bz2 crosvm-7eae7735ee3485605d2ec7ba0685588b7a38b37b.tar.lz crosvm-7eae7735ee3485605d2ec7ba0685588b7a38b37b.tar.xz crosvm-7eae7735ee3485605d2ec7ba0685588b7a38b37b.tar.zst crosvm-7eae7735ee3485605d2ec7ba0685588b7a38b37b.zip |
ac97: switch to ShmStreamSource
Convert playback and capture for the AC97 device to use the zero-copy ShmStreamSource instead of the old StreamSource. In the process, rework start_playback and start_capture unit tests so they rely less on sleep statements. BUG=chromium:968724 BUG=chromium:1006035 TEST="sox -n -r 48000 -b 16 output.raw synth 5 sine 330 && aplay -f dat output.raw" within a VM, check that sine wave is played accurately. Change-Id: Ie9cddbc5285a9505872c9951a8a1da01de70eb88 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1749950 Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Fletcher Woodruff <fletcherw@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Diffstat (limited to 'src/linux.rs')
-rw-r--r-- | src/linux.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/linux.rs b/src/linux.rs index f5d2d1c..be2df22 100644 --- a/src/linux.rs +++ b/src/linux.rs @@ -27,7 +27,7 @@ use std::time::{Duration, SystemTime, UNIX_EPOCH}; use libc::{self, c_int, gid_t, uid_t}; -use audio_streams::DummyStreamSource; +use audio_streams::shm_streams::NullShmStreamSource; #[cfg(feature = "gpu")] use devices::virtio::EventDevice; use devices::virtio::{self, VirtioDevice}; @@ -1171,7 +1171,7 @@ fn create_devices( } if cfg.null_audio { - let server = Box::new(DummyStreamSource::new()); + let server = Box::new(NullShmStreamSource::new()); let null_audio = devices::Ac97Dev::new(mem.clone(), server); pci_devices.push(( |