From 7eae7735ee3485605d2ec7ba0685588b7a38b37b Mon Sep 17 00:00:00 2001 From: Fletcher Woodruff Date: Mon, 12 Aug 2019 11:46:47 -0600 Subject: 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 Commit-Queue: Fletcher Woodruff Reviewed-by: Dylan Reid Reviewed-by: Chih-Yang Hsia --- src/linux.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/linux.rs') 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(( -- cgit 1.4.1