From b58b5529403c1d86a74cd973abf5796a9da4c348 Mon Sep 17 00:00:00 2001 From: Dylan Reid Date: Thu, 6 Dec 2018 19:47:18 +0000 Subject: devices: Add an Ac97 PCI device The Ac97 device provides the guest with an audio playback device. All input devices are stubbed out. Only playback at 48kHz is supported. The device is emulated by `Ac97Dev` which interfaces with the PCI bus. `Ac97Dev` uses `Ac97` to drive audio functions and emulate the device registers. Physical Ac97 devices consist of two parts, the bus master and a mixer. These two sets of registers are emulated by the `Ac97BusMaster` and `Ac97Mixer` structures. `Ac97BusMaster` handles audio samples and uses `Ac97Mixer` to determine the configuration of the audio backend. BUG=chromium:781398 TEST=crosvm run --disable-sandbox --null-audio --rwdisk gentoo.ext4 -c2 -m2048 -p 'root=/dev/vda snd_intel8x0.inside_vm=1 snd_intel8x0.ac97_clock=48000' vmlinux.bin and play audio with aplay -d2 -Dhw:0,0 -f dat /dev/urandom CQ-DEPEND=CL:1402264 CQ-DEPEND=CL:1421588 CQ-DEPEND=CL:1433794 CQ-DEPEND=CL:1432835 Change-Id: I9985ffad753bccc1bf468ebbdacec0876560a5e0 Signed-off-by: Dylan Reid Reviewed-on: https://chromium-review.googlesource.com/1366544 Commit-Ready: Chih-Yang Hsia Tested-by: kokoro Tested-by: Chih-Yang Hsia Reviewed-by: Chih-Yang Hsia --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index dd720fb..29ad554 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,6 +68,7 @@ sys_util = "*" [patch.crates-io] assertions = { path = "assertions" } +audio_streams = { path = "../../third_party/adhd/audio_streams" } # ignored by ebuild data_model = { path = "data_model" } poll_token_derive = { path = "sys_util/poll_token_derive" } sync = { path = "sync" } -- cgit 1.4.1