From d30ff8fb80bb28840b467d9cc4ec72da7bc8d5c1 Mon Sep 17 00:00:00 2001 From: Shunkai Yao Date: Mon, 13 Mar 2023 23:24:14 +0000 Subject: [PATCH] Add some Effect type UUID and offload indicater in common parameter Bug: 271500140 Test: atest --test-mapping hardware/interfaces/audio/aidl/vts:presubmit Change-Id: I61ebf268600564cb5abddc90979070b675a85541 --- .../hardware/audio/effect/Descriptor.aidl | 20 +++--- .../hardware/audio/effect/Parameter.aidl | 1 + .../hardware/audio/effect/Descriptor.aidl | 65 +++++++++++-------- .../android/hardware/audio/effect/Flags.aidl | 14 ++-- .../hardware/audio/effect/Parameter.aidl | 8 +++ 5 files changed, 64 insertions(+), 44 deletions(-) diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Descriptor.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Descriptor.aidl index 0baac3dfb7..82dae97d24 100644 --- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Descriptor.aidl +++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Descriptor.aidl @@ -36,20 +36,22 @@ package android.hardware.audio.effect; parcelable Descriptor { android.hardware.audio.effect.Descriptor.Common common; android.hardware.audio.effect.Capability capability; - const String EFFECT_TYPE_UUID_ENV_REVERB = "c2e5d5f0-94bd-4763-9cac-4e234d06839e"; - const String EFFECT_TYPE_UUID_PRESET_REVERB = "47382d60-ddd8-11db-bf3a-0002a5d5c51b"; - const String EFFECT_TYPE_UUID_EQUALIZER = "0bed4300-ddd6-11db-8f34-0002a5d5c51b"; - const String EFFECT_TYPE_UUID_BASS_BOOST = "0634f220-ddd4-11db-a0fc-0002a5d5c51b"; - const String EFFECT_TYPE_UUID_VIRTUALIZER = "37cc2c00-dddd-11db-8577-0002a5d5c51b"; + const String EFFECT_TYPE_UUID_AEC = "7b491460-8d4d-11e0-bd61-0002a5d5c51b"; const String EFFECT_TYPE_UUID_AGC1 = "0a8abfe0-654c-11e0-ba26-0002a5d5c51b"; const String EFFECT_TYPE_UUID_AGC2 = "ae3c653b-be18-4ab8-8938-418f0a7f06ac"; - const String EFFECT_TYPE_UUID_AEC = "7b491460-8d4d-11e0-bd61-0002a5d5c51b"; - const String EFFECT_TYPE_UUID_NS = "58b4b260-8e06-11e0-aa8e-0002a5d5c51b"; - const String EFFECT_TYPE_UUID_LOUDNESS_ENHANCER = "fe3199be-aed0-413f-87bb-11260eb63cf1"; + const String EFFECT_TYPE_UUID_BASS_BOOST = "0634f220-ddd4-11db-a0fc-0002a5d5c51b"; + const String EFFECT_TYPE_UUID_DOWNMIX = "381e49cc-a858-4aa2-87f6-e8388e7601b2"; const String EFFECT_TYPE_UUID_DYNAMICS_PROCESSING = "7261676f-6d75-7369-6364-28e2fd3ac39e"; + const String EFFECT_TYPE_UUID_ENV_REVERB = "c2e5d5f0-94bd-4763-9cac-4e234d06839e"; + const String EFFECT_TYPE_UUID_EQUALIZER = "0bed4300-ddd6-11db-8f34-0002a5d5c51b"; const String EFFECT_TYPE_UUID_HAPTIC_GENERATOR = "1411e6d6-aecd-4021-a1cf-a6aceb0d71e5"; + const String EFFECT_TYPE_UUID_LOUDNESS_ENHANCER = "fe3199be-aed0-413f-87bb-11260eb63cf1"; + const String EFFECT_TYPE_UUID_NS = "58b4b260-8e06-11e0-aa8e-0002a5d5c51b"; + const String EFFECT_TYPE_UUID_PRESET_REVERB = "47382d60-ddd8-11db-bf3a-0002a5d5c51b"; const String EFFECT_TYPE_UUID_SPATIALIZER = "ccd4cf09-a79d-46c2-9aae-06a1698d6c8f"; - const String EFFECT_TYPE_UUID_VOLUME = "09e8ede0-ddde-11db-b4f6-0002a5d5c51b"; + const String EFFECT_TYPE_UUID_VIRTUALIZER = "37cc2c00-dddd-11db-8577-0002a5d5c51b"; + const String EFFECT_TYPE_UUID_VISUALIZER = "d069d9e0-8329-11df-9168-0002a5d5c51b"; + const String EFFECT_TYPE_UUID_VOLUME = "fa81a2b8-588b-11ed-9b6a-0242ac120002"; @VintfStability parcelable Identity { android.media.audio.common.AudioUuid type; diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Parameter.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Parameter.aidl index b50a2f19b1..0422bd92c7 100644 --- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Parameter.aidl +++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Parameter.aidl @@ -38,6 +38,7 @@ union Parameter { android.media.audio.common.AudioDeviceDescription[] deviceDescription; android.media.audio.common.AudioMode mode; android.media.audio.common.AudioSource source; + boolean offload; android.hardware.audio.effect.Parameter.VolumeStereo volumeStereo; android.hardware.audio.effect.Parameter.Specific specific; @VintfStability diff --git a/audio/aidl/android/hardware/audio/effect/Descriptor.aidl b/audio/aidl/android/hardware/audio/effect/Descriptor.aidl index 01ca1c6cbe..2fbc401f0f 100644 --- a/audio/aidl/android/hardware/audio/effect/Descriptor.aidl +++ b/audio/aidl/android/hardware/audio/effect/Descriptor.aidl @@ -37,25 +37,10 @@ parcelable Descriptor { * UUID for effect types, these definitions are in sync with SDK, see @c AudioEffect.java. */ /** - * UUID for environmental reverberation effect type. + * UUID for Acoustic Echo Canceler (AEC) type. */ - const String EFFECT_TYPE_UUID_ENV_REVERB = "c2e5d5f0-94bd-4763-9cac-4e234d06839e"; - /** - * UUID for preset reverberation effect type. - */ - const String EFFECT_TYPE_UUID_PRESET_REVERB = "47382d60-ddd8-11db-bf3a-0002a5d5c51b"; - /** - * UUID for equalizer effect type. - */ - const String EFFECT_TYPE_UUID_EQUALIZER = "0bed4300-ddd6-11db-8f34-0002a5d5c51b"; - /** - * UUID for bass boost effect type. - */ - const String EFFECT_TYPE_UUID_BASS_BOOST = "0634f220-ddd4-11db-a0fc-0002a5d5c51b"; - /** - * UUID for virtualizer effect type. - */ - const String EFFECT_TYPE_UUID_VIRTUALIZER = "37cc2c00-dddd-11db-8577-0002a5d5c51b"; + const String EFFECT_TYPE_UUID_AEC = "7b491460-8d4d-11e0-bd61-0002a5d5c51b"; + /** * UUID for Automatic Gain Control V1 (AGC1) type. */ @@ -65,33 +50,57 @@ parcelable Descriptor { */ const String EFFECT_TYPE_UUID_AGC2 = "ae3c653b-be18-4ab8-8938-418f0a7f06ac"; /** - * UUID for Acoustic Echo Canceler (AEC) type. + * UUID for bass boost effect type. */ - const String EFFECT_TYPE_UUID_AEC = "7b491460-8d4d-11e0-bd61-0002a5d5c51b"; + const String EFFECT_TYPE_UUID_BASS_BOOST = "0634f220-ddd4-11db-a0fc-0002a5d5c51b"; /** - * UUID for Noise Suppressor (NS) type. + * UUID for downmix effect type. */ - const String EFFECT_TYPE_UUID_NS = "58b4b260-8e06-11e0-aa8e-0002a5d5c51b"; - /** - * UUID for Loudness Enhancer type. - */ - const String EFFECT_TYPE_UUID_LOUDNESS_ENHANCER = "fe3199be-aed0-413f-87bb-11260eb63cf1"; + const String EFFECT_TYPE_UUID_DOWNMIX = "381e49cc-a858-4aa2-87f6-e8388e7601b2"; /** * UUID for Dynamics Processing type. */ const String EFFECT_TYPE_UUID_DYNAMICS_PROCESSING = "7261676f-6d75-7369-6364-28e2fd3ac39e"; + /** + * UUID for environmental reverberation effect type. + */ + const String EFFECT_TYPE_UUID_ENV_REVERB = "c2e5d5f0-94bd-4763-9cac-4e234d06839e"; + /** + * UUID for equalizer effect type. + */ + const String EFFECT_TYPE_UUID_EQUALIZER = "0bed4300-ddd6-11db-8f34-0002a5d5c51b"; /** * UUID for Haptic Generator type. */ const String EFFECT_TYPE_UUID_HAPTIC_GENERATOR = "1411e6d6-aecd-4021-a1cf-a6aceb0d71e5"; + /** + * UUID for Loudness Enhancer type. + */ + const String EFFECT_TYPE_UUID_LOUDNESS_ENHANCER = "fe3199be-aed0-413f-87bb-11260eb63cf1"; + /** + * UUID for Noise Suppressor (NS) type. + */ + const String EFFECT_TYPE_UUID_NS = "58b4b260-8e06-11e0-aa8e-0002a5d5c51b"; + /** + * UUID for preset reverberation effect type. + */ + const String EFFECT_TYPE_UUID_PRESET_REVERB = "47382d60-ddd8-11db-bf3a-0002a5d5c51b"; /** * UUID for Spatializer type. */ const String EFFECT_TYPE_UUID_SPATIALIZER = "ccd4cf09-a79d-46c2-9aae-06a1698d6c8f"; /** - * UUID for Volume type. The volume effect is used for automated tests only. + * UUID for virtualizer effect type. */ - const String EFFECT_TYPE_UUID_VOLUME = "09e8ede0-ddde-11db-b4f6-0002a5d5c51b"; + const String EFFECT_TYPE_UUID_VIRTUALIZER = "37cc2c00-dddd-11db-8577-0002a5d5c51b"; + /** + * UUID for visualizer effect type. + */ + const String EFFECT_TYPE_UUID_VISUALIZER = "d069d9e0-8329-11df-9168-0002a5d5c51b"; + /** + * UUID for Volume effect type. + */ + const String EFFECT_TYPE_UUID_VOLUME = "fa81a2b8-588b-11ed-9b6a-0242ac120002"; /** * This structure completely identifies an effect implementation. diff --git a/audio/aidl/android/hardware/audio/effect/Flags.aidl b/audio/aidl/android/hardware/audio/effect/Flags.aidl index 1612234118..28685c3e03 100644 --- a/audio/aidl/android/hardware/audio/effect/Flags.aidl +++ b/audio/aidl/android/hardware/audio/effect/Flags.aidl @@ -112,31 +112,31 @@ parcelable Flags { HardwareAccelerator hwAcceleratorMode = HardwareAccelerator.NONE; /** - * Effect instance set this flag to true if it requires update on if the playback thread the - * effect attached to is offloaded or not. In this case the framework must call + * Effect instance sets this flag to true if it requires updates on whether the playback thread + * the effect is attached to is offloaded or not. In this case the framework must call * IEffect.setParameter(Parameter.offload) to notify effect instance when playback thread * offload changes. */ boolean offloadIndication; /** - * Effect instance set this flag to true if it requires device change update. In this case the + * Effect instance sets this flag to true if it requires device change update. In this case the * framework must call IEffect.setParameter(Parameter.device) to notify effect instance when the * device changes. */ boolean deviceIndication; /** - * Effect instance set this flag to true if it requires audio mode change update. In this case + * Effect instance sets this flag to true if it requires audio mode change update. In this case * the framework must call IEffect.setParameter(Parameter.mode) to notify effect instance when * the audio mode changes. */ boolean audioModeIndication; /** - * Effect instance set this flag to true if it requires audio source change update. In this case - * the framework must call IEffect.setParameter(Parameter.source) to notify effect instance when - * the audio source changes. + * Effect instance sets this flag to true if it requires audio source change update. In this + * case the framework must call IEffect.setParameter(Parameter.source) to notify effect instance + * when the audio source changes. */ boolean audioSourceIndication; diff --git a/audio/aidl/android/hardware/audio/effect/Parameter.aidl b/audio/aidl/android/hardware/audio/effect/Parameter.aidl index 229c621a3d..0954055878 100644 --- a/audio/aidl/android/hardware/audio/effect/Parameter.aidl +++ b/audio/aidl/android/hardware/audio/effect/Parameter.aidl @@ -135,17 +135,25 @@ union Parameter { * Effect must implement setParameter(deviceDescription) if Flags.deviceIndication set to true. */ AudioDeviceDescription[] deviceDescription; + /** * Used by audio framework to set the audio mode to effect engine. * Effect must implement setParameter(mode) if Flags.audioModeIndication set to true. */ AudioMode mode; + /** * Used by audio framework to set the audio source to effect engine. * Effect must implement setParameter(source) if Flags.audioSourceIndication set to true. */ AudioSource source; + /** + * Used by audio framework to indicate whether the playback thread the effect is attached to is + * offloaded or not. + */ + boolean offload; + /** * The volume gain for left and right channel, left and right equals to same value if it's mono. */