mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-11 04:26:38 +00:00
ac97: Create CrasClient with unified socket
Since Termina and ARCVM need both playback and capture functionalities, we create CrasClient with CrasSocketType::Unified. BUG=b:155048379 TEST=Apply full patch set and test with VMs Cq-Depend: chromium:2165697 Cq-Depend: chromium:2167813 Change-Id: Id4fb12423eb05859528406ae7ed5e62b46909a56 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2167312 Reviewed-by: Dylan Reid <dgreid@chromium.org> Tested-by: Chih-Yang Hsia <paulhsia@chromium.org> Commit-Queue: Chih-Yang Hsia <paulhsia@chromium.org>
This commit is contained in:
parent
9f0b9e9785
commit
7b8f776cb8
1 changed files with 5 additions and 3 deletions
|
@ -12,7 +12,7 @@ use audio_streams::{
|
|||
shm_streams::{NullShmStreamSource, ShmStreamSource},
|
||||
StreamEffect,
|
||||
};
|
||||
use libcras::{CrasClient, CrasClientType};
|
||||
use libcras::{CrasClient, CrasClientType, CrasSocketType};
|
||||
use resources::{Alloc, MmioType, SystemAllocator};
|
||||
use sys_util::{error, EventFd, GuestMemory};
|
||||
|
||||
|
@ -117,8 +117,10 @@ impl Ac97Dev {
|
|||
}
|
||||
|
||||
fn create_cras_audio_device(params: Ac97Parameters, mem: GuestMemory) -> Result<Ac97Dev> {
|
||||
let mut server =
|
||||
Box::new(CrasClient::new().map_err(|e| pci_device::Error::CreateCrasClientFailed(e))?);
|
||||
let mut server = Box::new(
|
||||
CrasClient::with_type(CrasSocketType::Unified)
|
||||
.map_err(|e| pci_device::Error::CreateCrasClientFailed(e))?,
|
||||
);
|
||||
server.set_client_type(CrasClientType::CRAS_CLIENT_TYPE_CROSVM);
|
||||
if params.capture {
|
||||
server.enable_cras_capture();
|
||||
|
|
Loading…
Reference in a new issue