summary refs log tree commit diff
diff options
context:
space:
mode:
authorFletcher Woodruff <fletcherw@chromium.org>2019-10-11 11:45:18 -0600
committerCommit Bot <commit-bot@chromium.org>2019-10-22 20:57:08 +0000
commit95dbad3db64a6bf16bc08985d660f8e7436cc478 (patch)
tree320122027d4cb0d30c075ff4c049362eae5a3615
parent187fd02b592e72ea95900b673fc7544ecb60d30e (diff)
downloadcrosvm-95dbad3db64a6bf16bc08985d660f8e7436cc478.tar
crosvm-95dbad3db64a6bf16bc08985d660f8e7436cc478.tar.gz
crosvm-95dbad3db64a6bf16bc08985d660f8e7436cc478.tar.bz2
crosvm-95dbad3db64a6bf16bc08985d660f8e7436cc478.tar.lz
crosvm-95dbad3db64a6bf16bc08985d660f8e7436cc478.tar.xz
crosvm-95dbad3db64a6bf16bc08985d660f8e7436cc478.tar.zst
crosvm-95dbad3db64a6bf16bc08985d660f8e7436cc478.zip
ac97: add sample format to create_*_stream
The audio_streams interface now supports specifying a sample format.
Update call sites to indicate that the desired format is S16LE.

BUG=chromium:1010667
TEST=aplay within vm

Cq-Depend: chromium:1856646
Change-Id: Ib69ff9b39196905f0f429eaf771f6f92901bfc71
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1856586
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Fletcher Woodruff <fletcherw@chromium.org>
Commit-Queue: Fletcher Woodruff <fletcherw@chromium.org>
-rw-r--r--devices/src/pci/ac97_bus_master.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/devices/src/pci/ac97_bus_master.rs b/devices/src/pci/ac97_bus_master.rs
index 83c0021..57f0545 100644
--- a/devices/src/pci/ac97_bus_master.rs
+++ b/devices/src/pci/ac97_bus_master.rs
@@ -14,7 +14,7 @@ use std::time::Instant;
 
 use audio_streams::{
     capture::{CaptureBuffer, CaptureBufferStream},
-    PlaybackBuffer, PlaybackBufferStream, StreamControl, StreamSource,
+    PlaybackBuffer, PlaybackBufferStream, SampleFormat, StreamControl, StreamSource,
 };
 use data_model::{VolatileMemory, VolatileSlice};
 use sync::Mutex;
@@ -509,6 +509,7 @@ impl Ac97BusMaster {
             Ac97Function::Input => {
                 let (stream_control, input_stream) = self.audio_server.new_capture_stream(
                     num_channels,
+                    SampleFormat::S16LE,
                     DEVICE_SAMPLE_RATE,
                     buffer_frames,
                 )?;
@@ -532,6 +533,7 @@ impl Ac97BusMaster {
             Ac97Function::Output => {
                 let (stream_control, output_stream) = self.audio_server.new_playback_stream(
                     num_channels,
+                    SampleFormat::S16LE,
                     DEVICE_SAMPLE_RATE,
                     buffer_frames,
                 )?;