Commit graph

3 commits

Author SHA1 Message Date
Mu-Le Lee
6fb22fbab0 Refactor android_audio
This commit does some refactors to android_audio:
1. Makes unused trait function unimplemented!()
2. Replaces match with Ok

Bug=b:325930215
Test=play and capture sound on a Pixel device
Test=arecord -D hw:0,0 -f dat /tmp/tmp
Test=aplay -D hw:0,0 -f dat /tmp/tmp
Test=./tools/dev_container
Test=cargo build
Test=cargo build -F audio_aaudio,libaaudio_stub
Test=./tools/run_tests
Test=./tools/presubmit

Change-Id: Ie983e317f3cbea9c187b34126a4c260de55852cc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5632640
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Mu-Le Lee <mulelee@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
2024-07-08 20:26:39 +00:00
Mu-Le Lee
6a64d4078d Implement microphone for virtio-snd aaudio backend
This change implements audio capture for Android with Android AAudio NDK
library. The API stub is provided in libaaudio_stub.rs

Bug=b:325930215
Test=play and capture sound on a Pixel device
Test=arecord -D hw:0,0 -f dat /tmp/tmp
Test=aplay -D hw:0,0 -f dat /tmp/tmp
Test=./tools/dev_container
Test=cargo build
Test=cargo build -F audio_aaudio,libaaudio_stub
Test=./tools/run_tests
Test=./tools/presubmit

Change-Id: Ice53cb2687cf368679e9cb123b6dc2ae5481884a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5632639
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Commit-Queue: Mu-Le Lee <mulelee@google.com>
Reviewed-by: Jiyong Park <jiyong@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
2024-07-08 20:26:33 +00:00
Mu-Le Lee
ec39c307da Implement virtio-snd aaudio stream to support audio in android
This change introduces feature audio_aaudio on top of the support of
virtio-snd-multiple-backend. The android_audio uses the Android
AAudio NDK library to play audio. A libaaudio_stub is provided for
building and testing on non-android environment.

Bug=b:325930215
Test=Play Youtube video on panther
Test=./tools/dev_container
Test=cargo build
Test=cargo build -F audio_aaudio,libaaudio_stub
Test=./tools/run_tests
Test=./tools/presubmit

Change-Id: I7c275433bf94d4a347720ce0ffa9127ffcb66a1e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5556704
Reviewed-by: Jiyong Park <jiyong@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Auto-Submit: Mu-Le Lee <mulelee@google.com>
Commit-Queue: Mu-Le Lee <mulelee@google.com>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
2024-05-31 05:32:38 +00:00