crosvm/libcras_stub
Pattara Teerapong e4f6374761 devices: snd: Use PCM device client_type and stream_type for CRAS
Read PCM device parameters and set CRAS client's client type and stream
type. Fallback to the virtio snd device's client type and
CRAS_STREAM_TYPE_DEFAULT if not set.

Resize the PCM device config of the provided parameters to match the
number of PCM devices.

Also add unit test for the virtio-snd::new function which checks the
PCM device config resizing and the data that are derived from the
parameters.

BUG=b:269984052
TEST=cargo test --features audio,audio_cras
TEST=FEATURES=test emerge-amd64-generic crosvm
TEST=Setting client_type and stream_type on ARCVM

Change-Id: I692881a1e4117f8c67b162d2966acfab9282011a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4275361
Commit-Queue: Pattara Teerapong <pteerapong@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
2023-03-02 06:22:40 +00:00
..
src devices: snd: Use PCM device client_type and stream_type for CRAS 2023-03-02 06:22:40 +00:00
Cargo.toml Fix remaining Chrome/Chromium OS instances 2023-01-03 22:14:30 +00:00
README.md

Stub crate for libcras

libcras is used by ChromeOS to play audio through the cras server.

In ChromeOS builds, the audio_cras cargo feature is enabled and this crate is replaced with the actual libcras implementation.

On other platforms, the feature flag will remain disabled and this crate is used to satisfy cargo dependencies on libcras.