From ff080742276aab065fa6a093e93db1fe63579323 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Tue, 15 Jan 2019 18:31:49 -0800 Subject: [PATCH] add new audio sources for audio capture This commit adds the following audio capture sources: - AUDIO_SOURCE_VOICE_PERFORMANCE: for real time live performances like Karaoke. - AUDIO_SOURCE_ECHO_REFERENCE: for capturing the reference signal to suppress by an echo canceller. Protected by privileged permission CAPTURE_AUDIO_OUTPUT. Also added device AUDIO_DEVICE_IN_ECHO_REFERENCE selected when the requested capture source is AUDIO_SOURCE_ECHO_REFERENCE. Bug: 118203066 Test: CTS tests for audio capture Change-Id: Ia93550b278733ae9cc5cda731b014421002fde35 --- audio/common/5.0/types.hal | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/audio/common/5.0/types.hal b/audio/common/5.0/types.hal index dab74645ff..b4e947096f 100644 --- a/audio/common/5.0/types.hal +++ b/audio/common/5.0/types.hal @@ -133,7 +133,18 @@ enum AudioSource : int32_t { * and raw signal analysis. */ UNPROCESSED = 9, - + /** + * Source for capturing audio meant to be processed in real time and played back for live + * performance (e.g karaoke). The capture path will minimize latency and coupling with + * playback path. + */ + VOICE_PERFORMANCE = 10, + /** + * Source for an echo canceller to capture the reference signal to be cancelled. + * The echo reference signal will be captured as close as possible to the DAC in order + * to include all post processing applied to the playback path. + */ + ECHO_REFERENCE = 1997, FM_TUNER = 1998, }; @@ -598,6 +609,7 @@ enum AudioDevice : uint32_t { IN_PROXY = BIT_IN | 0x1000000, IN_USB_HEADSET = BIT_IN | 0x2000000, IN_BLUETOOTH_BLE = BIT_IN | 0x4000000, + IN_ECHO_REFERENCE = BIT_IN | 0x10000000, IN_DEFAULT = BIT_IN | BIT_DEFAULT, // Note that the 2.0 IN_ALL* have been moved to helper functions