AIDL effect: Add all aosp effect parameters definition
Bug: 238913361
Test: atest VtsHalAudioEffectTargetTest
atest VtsHalAudioEffectFactoryTargetTest
atest VtsHalEqualizerTargetTest
Change-Id: Ice5cac10956c419c04be44f9142b5b2935cacf3b
diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp
index 4e50b7a..e58ae6a 100644
--- a/audio/aidl/Android.bp
+++ b/audio/aidl/Android.bp
@@ -148,16 +148,26 @@
name: "android.hardware.audio.effect",
vendor_available: true,
srcs: [
+ "android/hardware/audio/effect/BassBoost.aidl",
"android/hardware/audio/effect/Capability.aidl",
"android/hardware/audio/effect/CommandId.aidl",
"android/hardware/audio/effect/Descriptor.aidl",
+ "android/hardware/audio/effect/Downmix.aidl",
+ "android/hardware/audio/effect/DynamicsProcessing.aidl",
"android/hardware/audio/effect/Equalizer.aidl",
"android/hardware/audio/effect/Flags.aidl",
+ "android/hardware/audio/effect/HapticGenerator.aidl",
"android/hardware/audio/effect/IEffect.aidl",
"android/hardware/audio/effect/IFactory.aidl",
+ "android/hardware/audio/effect/LoudnessEnhancer.aidl",
"android/hardware/audio/effect/Parameter.aidl",
"android/hardware/audio/effect/Processing.aidl",
+ "android/hardware/audio/effect/Reverb.aidl",
"android/hardware/audio/effect/State.aidl",
+ "android/hardware/audio/effect/VendorExtension.aidl",
+ "android/hardware/audio/effect/Virtualizer.aidl",
+ "android/hardware/audio/effect/Visualizer.aidl",
+ "android/hardware/audio/effect/Volume.aidl",
],
imports: [
"android.hardware.common-V2",
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/BassBoost.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/BassBoost.aidl
new file mode 100644
index 0000000..979ebb8
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/BassBoost.aidl
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.audio.effect;
+@VintfStability
+union BassBoost {
+ android.hardware.audio.effect.VendorExtension vendor;
+ int strengthPm;
+ @VintfStability
+ union Id {
+ int vendorExtensionTag;
+ android.hardware.audio.effect.BassBoost.Tag commonTag;
+ }
+ @VintfStability
+ parcelable Capability {
+ ParcelableHolder extension;
+ boolean strengthSupported;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Capability.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Capability.aidl
index 11acf5e..06f2bfe 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Capability.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Capability.aidl
@@ -34,10 +34,15 @@
package android.hardware.audio.effect;
@VintfStability
union Capability {
- android.hardware.audio.effect.Capability.VendorEffectCapability vendor;
+ android.hardware.audio.effect.VendorExtension vendorExtension;
+ android.hardware.audio.effect.BassBoost.Capability bassBoost;
+ android.hardware.audio.effect.Downmix.Capability downmix;
+ android.hardware.audio.effect.DynamicsProcessing.Capability dynamicsProcessing;
android.hardware.audio.effect.Equalizer.Capability equalizer;
- @VintfStability
- parcelable VendorEffectCapability {
- ParcelableHolder extension;
- }
+ android.hardware.audio.effect.HapticGenerator.Capability hapticGenerator;
+ android.hardware.audio.effect.LoudnessEnhancer.Capability loudnessEnhancer;
+ android.hardware.audio.effect.Reverb.Capability reverb;
+ android.hardware.audio.effect.Virtualizer.Capability virtualizer;
+ android.hardware.audio.effect.Visualizer.Capability visualizer;
+ android.hardware.audio.effect.Volume.Capability volume;
}
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 4707011..990d369 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
@@ -54,11 +54,11 @@
android.media.audio.common.AudioUuid type;
android.media.audio.common.AudioUuid uuid;
@nullable android.media.audio.common.AudioUuid proxy;
- android.hardware.audio.effect.Flags flags;
}
@VintfStability
parcelable Common {
android.hardware.audio.effect.Descriptor.Identity id;
+ android.hardware.audio.effect.Flags flags;
int cpuLoad;
int memoryUsage;
@utf8InCpp String name;
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Downmix.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Downmix.aidl
new file mode 100644
index 0000000..76f8ce5
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Downmix.aidl
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.audio.effect;
+@VintfStability
+union Downmix {
+ android.hardware.audio.effect.VendorExtension vendor;
+ android.hardware.audio.effect.Downmix.Type type;
+ @VintfStability
+ union Id {
+ int vendorExtensionTag;
+ android.hardware.audio.effect.Downmix.Tag commonTag;
+ }
+ @VintfStability
+ parcelable Capability {
+ ParcelableHolder extension;
+ }
+ @VintfStability
+ enum Type {
+ STRIP = 0,
+ FOLD = 1,
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/DynamicsProcessing.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/DynamicsProcessing.aidl
new file mode 100644
index 0000000..ed4dc80
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/DynamicsProcessing.aidl
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.audio.effect;
+@VintfStability
+union DynamicsProcessing {
+ android.hardware.audio.effect.VendorExtension vendorExtension;
+ android.hardware.audio.effect.DynamicsProcessing.EngineArchitecture engineArchitecture;
+ android.hardware.audio.effect.DynamicsProcessing.BandChannelConfig preEq;
+ android.hardware.audio.effect.DynamicsProcessing.BandChannelConfig postEq;
+ android.hardware.audio.effect.DynamicsProcessing.EqBandConfig preEqBand;
+ android.hardware.audio.effect.DynamicsProcessing.EqBandConfig postEqBand;
+ android.hardware.audio.effect.DynamicsProcessing.BandChannelConfig mbc;
+ android.hardware.audio.effect.DynamicsProcessing.MbcBandConfig mbcBand;
+ android.hardware.audio.effect.DynamicsProcessing.LimiterConfig limiter;
+ float inputGainDb;
+ @VintfStability
+ union Id {
+ int vendorExtensionTag;
+ android.hardware.audio.effect.DynamicsProcessing.Tag commonTag;
+ }
+ @VintfStability
+ parcelable Capability {
+ ParcelableHolder extension;
+ }
+ enum ResolutionPreference {
+ FAVOR_FREQUENCY_RESOLUTION = 0,
+ FAVOR_TIME_RESOLUTION = 1,
+ }
+ @VintfStability
+ parcelable BandEnablement {
+ boolean inUse;
+ int bandCount;
+ }
+ @VintfStability
+ parcelable EngineArchitecture {
+ android.hardware.audio.effect.DynamicsProcessing.ResolutionPreference resolutionPreference = android.hardware.audio.effect.DynamicsProcessing.ResolutionPreference.FAVOR_FREQUENCY_RESOLUTION;
+ float preferredFrameDurationMs;
+ android.hardware.audio.effect.DynamicsProcessing.BandEnablement preEqBand;
+ android.hardware.audio.effect.DynamicsProcessing.BandEnablement postEqBand;
+ android.hardware.audio.effect.DynamicsProcessing.BandEnablement mbcBand;
+ boolean limiterInUse;
+ }
+ @VintfStability
+ parcelable BandChannelConfig {
+ int channel;
+ android.hardware.audio.effect.DynamicsProcessing.BandEnablement enablement;
+ }
+ @VintfStability
+ parcelable EqBandConfig {
+ int channel;
+ int band;
+ boolean enable;
+ float cutoffFrequency;
+ float gain;
+ }
+ @VintfStability
+ parcelable MbcBandConfig {
+ int channel;
+ int band;
+ boolean enable;
+ float cutoffFrequencyHz;
+ float gainDb;
+ float attackTimeMs;
+ float releaseTimeMs;
+ float ratio;
+ float thresholdDb;
+ float kneeWidthDb;
+ float noiseGateThresholdDb;
+ float expanderRatio;
+ float preGainDb;
+ float postGainDb;
+ }
+ @VintfStability
+ parcelable LimiterConfig {
+ int channel;
+ boolean enable;
+ boolean inUse;
+ int linkGroup;
+ float attackTimeMs;
+ float releaseTimeMs;
+ float ratio;
+ float thresholdDb;
+ float postGainDb;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Equalizer.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Equalizer.aidl
index f7af300..d825eac 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Equalizer.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Equalizer.aidl
@@ -34,12 +34,13 @@
package android.hardware.audio.effect;
@VintfStability
union Equalizer {
- android.hardware.audio.effect.Equalizer.VendorExtension vendor;
+ android.hardware.audio.effect.VendorExtension vendorExtension;
android.hardware.audio.effect.Equalizer.BandLevel[] bandLevels;
int preset;
@VintfStability
- parcelable VendorExtension {
- ParcelableHolder extension;
+ union Id {
+ int vendorExtensionTag;
+ android.hardware.audio.effect.Equalizer.Tag commonTag;
}
@VintfStability
parcelable Capability {
@@ -50,13 +51,13 @@
@VintfStability
parcelable BandLevel {
int index;
- int level;
+ int levelMb;
}
@VintfStability
parcelable BandFrequency {
int index;
- int min;
- int max;
+ int minMh;
+ int maxMh;
}
@VintfStability
parcelable Preset {
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/HapticGenerator.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/HapticGenerator.aidl
new file mode 100644
index 0000000..40a8d72
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/HapticGenerator.aidl
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.audio.effect;
+@VintfStability
+union HapticGenerator {
+ android.hardware.audio.effect.VendorExtension vendorExtension;
+ android.hardware.audio.effect.HapticGenerator.HapticScale hapticScale;
+ android.hardware.audio.effect.HapticGenerator.VibratorInformation vibratorInfo;
+ @VintfStability
+ union Id {
+ int vendorExtensionTag;
+ android.hardware.audio.effect.HapticGenerator.Tag commonTag;
+ }
+ @VintfStability
+ parcelable Capability {
+ android.hardware.audio.effect.VendorExtension extension;
+ }
+ @Backing(type="int") @VintfStability
+ enum VibratorScale {
+ MUTE = -100,
+ VERY_LOW = -2,
+ LOW = -1,
+ NONE = 0,
+ HIGH = 1,
+ VERY_HIGH = 2,
+ }
+ @VintfStability
+ parcelable HapticScale {
+ int id;
+ android.hardware.audio.effect.HapticGenerator.VibratorScale scale = android.hardware.audio.effect.HapticGenerator.VibratorScale.MUTE;
+ }
+ @VintfStability
+ parcelable VibratorInformation {
+ float resonantFrequencyHz;
+ float qFactor;
+ float maxAmplitude;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/IEffect.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/IEffect.aidl
index e5c96f5..8c196e7 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/IEffect.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/IEffect.aidl
@@ -34,7 +34,7 @@
package android.hardware.audio.effect;
@VintfStability
interface IEffect {
- android.hardware.audio.effect.IEffect.OpenEffectReturn open(in android.hardware.audio.effect.Parameter.Common common, in android.hardware.audio.effect.Parameter.Specific specific);
+ android.hardware.audio.effect.IEffect.OpenEffectReturn open(in android.hardware.audio.effect.Parameter.Common common, in @nullable android.hardware.audio.effect.Parameter.Specific specific);
void close();
android.hardware.audio.effect.Descriptor getDescriptor();
void command(in android.hardware.audio.effect.CommandId commandId);
@@ -44,13 +44,13 @@
@FixedSize @VintfStability
parcelable Status {
int status;
- int fmqByteConsumed;
- int fmqByteProduced;
+ int fmqConsumed;
+ int fmqProduced;
}
@VintfStability
parcelable OpenEffectReturn {
android.hardware.common.fmq.MQDescriptor<android.hardware.audio.effect.IEffect.Status,android.hardware.common.fmq.SynchronizedReadWrite> statusMQ;
- android.hardware.common.fmq.MQDescriptor<byte,android.hardware.common.fmq.SynchronizedReadWrite> inputDataMQ;
- android.hardware.common.fmq.MQDescriptor<byte,android.hardware.common.fmq.SynchronizedReadWrite> outputDataMQ;
+ android.hardware.common.fmq.MQDescriptor<float,android.hardware.common.fmq.SynchronizedReadWrite> inputDataMQ;
+ android.hardware.common.fmq.MQDescriptor<float,android.hardware.common.fmq.SynchronizedReadWrite> outputDataMQ;
}
}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/IFactory.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/IFactory.aidl
index a22c591..5b85d33 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/IFactory.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/IFactory.aidl
@@ -34,7 +34,7 @@
package android.hardware.audio.effect;
@VintfStability
interface IFactory {
- android.hardware.audio.effect.Descriptor.Identity[] queryEffects(in @nullable android.media.audio.common.AudioUuid type, in @nullable android.media.audio.common.AudioUuid implementation);
+ android.hardware.audio.effect.Descriptor.Identity[] queryEffects(in @nullable android.media.audio.common.AudioUuid type, in @nullable android.media.audio.common.AudioUuid implementation, in @nullable android.media.audio.common.AudioUuid proxy);
android.hardware.audio.effect.Processing[] queryProcessing(in @nullable android.hardware.audio.effect.Processing.Type type);
android.hardware.audio.effect.IEffect createEffect(in android.media.audio.common.AudioUuid implUuid);
void destroyEffect(in android.hardware.audio.effect.IEffect handle);
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/LoudnessEnhancer.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/LoudnessEnhancer.aidl
new file mode 100644
index 0000000..5c6ca16
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/LoudnessEnhancer.aidl
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.audio.effect;
+@VintfStability
+union LoudnessEnhancer {
+ android.hardware.audio.effect.VendorExtension vendor;
+ int gainMb;
+ @VintfStability
+ union Id {
+ int vendorExtensionTag;
+ android.hardware.audio.effect.LoudnessEnhancer.Tag commonTag;
+ }
+ @VintfStability
+ parcelable Capability {
+ android.hardware.audio.effect.VendorExtension extension;
+ }
+}
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 547112a..321c286 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
@@ -35,18 +35,25 @@
@VintfStability
union Parameter {
android.hardware.audio.effect.Parameter.Common common;
- android.media.audio.common.AudioDeviceType device;
+ android.media.audio.common.AudioDeviceDescription deviceDescription;
android.media.audio.common.AudioMode mode;
android.media.audio.common.AudioSource source;
- android.hardware.audio.effect.Parameter.Volume volume;
- boolean offload;
- android.hardware.audio.effect.Parameter.VendorEffectParameter vendorEffect;
+ android.hardware.audio.effect.Parameter.VolumeStereo volumeStereo;
android.hardware.audio.effect.Parameter.Specific specific;
@VintfStability
union Id {
- int commonTag;
- int vendorTag;
- android.hardware.audio.effect.Parameter.Specific.Id specificId;
+ int vendorEffectTag;
+ android.hardware.audio.effect.BassBoost.Id bassBoostTag;
+ android.hardware.audio.effect.Downmix.Id downmixTag;
+ android.hardware.audio.effect.DynamicsProcessing.Id dynamicsProcessingTag;
+ android.hardware.audio.effect.Equalizer.Id equalizerTag;
+ android.hardware.audio.effect.HapticGenerator.Id hapticGeneratorTag;
+ android.hardware.audio.effect.LoudnessEnhancer.Id loudnessEnhancerTag;
+ android.hardware.audio.effect.Reverb.Id reverbTag;
+ android.hardware.audio.effect.Virtualizer.Id virtualizerTag;
+ android.hardware.audio.effect.Visualizer.Id visualizerTag;
+ android.hardware.audio.effect.Volume.Id volumeTag;
+ android.hardware.audio.effect.Parameter.Tag commonTag;
}
@VintfStability
parcelable Common {
@@ -56,21 +63,22 @@
android.media.audio.common.AudioConfig output;
}
@VintfStability
- parcelable Volume {
+ parcelable VolumeStereo {
float left;
float right;
}
@VintfStability
- parcelable VendorEffectParameter {
- ParcelableHolder extension;
- }
- @VintfStability
union Specific {
- android.hardware.audio.effect.Parameter.Specific.Id id;
+ android.hardware.audio.effect.VendorExtension vendorEffect;
+ android.hardware.audio.effect.BassBoost bassBoost;
+ android.hardware.audio.effect.Downmix downmix;
+ android.hardware.audio.effect.DynamicsProcessing dynamicsProcessing;
android.hardware.audio.effect.Equalizer equalizer;
- @VintfStability
- union Id {
- android.hardware.audio.effect.Equalizer.Tag equalizerTag = android.hardware.audio.effect.Equalizer.Tag.vendor;
- }
+ android.hardware.audio.effect.LoudnessEnhancer loudnessEnhancer;
+ android.hardware.audio.effect.HapticGenerator hapticGenerator;
+ android.hardware.audio.effect.Reverb reverb;
+ android.hardware.audio.effect.Virtualizer virtualizer;
+ android.hardware.audio.effect.Visualizer visualizer;
+ android.hardware.audio.effect.Volume volume;
}
}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Reverb.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Reverb.aidl
new file mode 100644
index 0000000..8ad4848
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Reverb.aidl
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.audio.effect;
+@VintfStability
+union Reverb {
+ android.hardware.audio.effect.VendorExtension vendor;
+ int roomLevelMb;
+ int roomHfLevelMb;
+ int decayTimeMs;
+ int decayHfRatioPm;
+ int levelMb;
+ int delayMs;
+ int diffusionPm;
+ int densityPm;
+ boolean bypass;
+ @VintfStability
+ union Id {
+ int vendorExtensionTag;
+ android.hardware.audio.effect.Reverb.Tag commonTag;
+ }
+ @VintfStability
+ parcelable Capability {
+ android.hardware.audio.effect.VendorExtension extension;
+ int maxDecayTimeMs;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/VendorExtension.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/VendorExtension.aidl
new file mode 100644
index 0000000..b806334
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/VendorExtension.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.audio.effect;
+@VintfStability
+parcelable VendorExtension {
+ ParcelableHolder extension;
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Virtualizer.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Virtualizer.aidl
new file mode 100644
index 0000000..d4fb9e0
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Virtualizer.aidl
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.audio.effect;
+@VintfStability
+union Virtualizer {
+ android.hardware.audio.effect.VendorExtension vendor;
+ int strengthPm;
+ @VintfStability
+ union Id {
+ int vendorExtensionTag;
+ android.hardware.audio.effect.Virtualizer.Tag commonTag;
+ }
+ @VintfStability
+ parcelable Capability {
+ android.hardware.audio.effect.VendorExtension extension;
+ boolean strengthSupported;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Visualizer.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Visualizer.aidl
new file mode 100644
index 0000000..9ee19f0
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Visualizer.aidl
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.audio.effect;
+@VintfStability
+union Visualizer {
+ android.hardware.audio.effect.Visualizer.Id id;
+ android.hardware.audio.effect.VendorExtension vendor;
+ android.hardware.audio.effect.Visualizer.GetOnlyParameters getOnlyParameters;
+ android.hardware.audio.effect.Visualizer.SetOnlyParameters setOnlyParameters;
+ int captureSizeBytes;
+ android.hardware.audio.effect.Visualizer.ScalingMode scalingMode;
+ android.hardware.audio.effect.Visualizer.MeasurementMode measurementMode;
+ @VintfStability
+ union Id {
+ int vendorExtensionTag;
+ android.hardware.audio.effect.Visualizer.GetOnlyParameters.Tag getOnlyParamTag;
+ android.hardware.audio.effect.Visualizer.SetOnlyParameters.Tag setOnlyParamTag;
+ android.hardware.audio.effect.Visualizer.Tag commonTag;
+ }
+ @VintfStability
+ parcelable Capability {
+ android.hardware.audio.effect.VendorExtension extension;
+ int maxLatencyMs;
+ android.hardware.audio.effect.Visualizer.CaptureSizeRange captureSizeRange;
+ }
+ @VintfStability
+ parcelable CaptureSizeRange {
+ int minBytes;
+ int maxBytes;
+ }
+ @VintfStability
+ enum ScalingMode {
+ NORMALIZED = 0,
+ AS_PLAYED = 1,
+ }
+ @VintfStability
+ enum MeasurementMode {
+ NONE = 0,
+ PEAK_RMS = 1,
+ }
+ @VintfStability
+ union GetOnlyParameters {
+ android.hardware.audio.effect.Visualizer.GetOnlyParameters.Measurement measurement;
+ byte[] captureBytes;
+ @VintfStability
+ parcelable Measurement {
+ int rms;
+ int peak;
+ }
+ }
+ @VintfStability
+ union SetOnlyParameters {
+ int latencyMs;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Volume.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Volume.aidl
new file mode 100644
index 0000000..8c836b0
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Volume.aidl
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.audio.effect;
+@VintfStability
+union Volume {
+ android.hardware.audio.effect.VendorExtension vendor;
+ int levelDb;
+ boolean mute;
+ @VintfStability
+ union Id {
+ int vendorExtensionTag;
+ android.hardware.audio.effect.Volume.Tag commonTag;
+ }
+ @VintfStability
+ parcelable Capability {
+ android.hardware.audio.effect.VendorExtension extension;
+ int maxLevel;
+ }
+}
diff --git a/audio/aidl/android/hardware/audio/effect/BassBoost.aidl b/audio/aidl/android/hardware/audio/effect/BassBoost.aidl
new file mode 100644
index 0000000..810c188
--- /dev/null
+++ b/audio/aidl/android/hardware/audio/effect/BassBoost.aidl
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.audio.effect;
+
+import android.hardware.audio.effect.VendorExtension;
+
+/**
+ * Bass boost is an audio effect to boost or amplify low frequencies of the sound. It is comparable
+ * to a simple equalizer but limited to one band amplification in the low frequency range.
+ *
+ * All parameters defined in union BassBoost must be gettable and settable. The capabilities defined
+ * in BassBoost.Capability can only acquired with IEffect.getDescriptor() and not settable.
+ */
+@VintfStability
+union BassBoost {
+ /**
+ * Effect parameter tag to identify the parameters for getParameter().
+ */
+ @VintfStability
+ union Id {
+ int vendorExtensionTag;
+ BassBoost.Tag commonTag;
+ }
+
+ /**
+ * Vendor BassBoost implementation definition for additional parameters.
+ */
+ VendorExtension vendor;
+
+ /**
+ * Capability supported by BassBoost implementation.
+ */
+ @VintfStability
+ parcelable Capability {
+ /**
+ * BassBoost capability extension, vendor can use this extension in case existing capability
+ * definition not enough.
+ */
+ ParcelableHolder extension;
+ /**
+ * Indicates whether setting strength is supported. False value indicates only one strength
+ * is supported and setParameter() method will return EX_ILLEGAL_ARGUMENT.
+ */
+ boolean strengthSupported;
+ }
+
+ /**
+ * The per mille strength of the bass boost effect.
+ *
+ * If the implementation does not support per mille accuracy for setting the strength, it is
+ * allowed to round the given strength to the nearest supported value. In this case {@link
+ * #IEffect.getParameter()} method should return the rounded value that was actually set.
+ *
+ * The valid range for strength is [0, 1000].
+ */
+ int strengthPm;
+}
diff --git a/audio/aidl/android/hardware/audio/effect/Capability.aidl b/audio/aidl/android/hardware/audio/effect/Capability.aidl
index e792f86..f741f33 100644
--- a/audio/aidl/android/hardware/audio/effect/Capability.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Capability.aidl
@@ -16,7 +16,17 @@
package android.hardware.audio.effect;
+import android.hardware.audio.effect.BassBoost;
+import android.hardware.audio.effect.Downmix;
+import android.hardware.audio.effect.DynamicsProcessing;
import android.hardware.audio.effect.Equalizer;
+import android.hardware.audio.effect.HapticGenerator;
+import android.hardware.audio.effect.LoudnessEnhancer;
+import android.hardware.audio.effect.Reverb;
+import android.hardware.audio.effect.VendorExtension;
+import android.hardware.audio.effect.Virtualizer;
+import android.hardware.audio.effect.Visualizer;
+import android.hardware.audio.effect.Volume;
/**
* Effect capability definitions.
@@ -33,14 +43,19 @@
* the ParcelableHolder in each effect capability definition. For example:
* Equalizer.Capability.extension.
*/
- @VintfStability
- parcelable VendorEffectCapability {
- ParcelableHolder extension;
- }
- VendorEffectCapability vendor;
+ VendorExtension vendorExtension;
/**
- * Equalizer capability definition.
+ * Effect capabilities.
*/
+ BassBoost.Capability bassBoost;
+ Downmix.Capability downmix;
+ DynamicsProcessing.Capability dynamicsProcessing;
Equalizer.Capability equalizer;
+ HapticGenerator.Capability hapticGenerator;
+ LoudnessEnhancer.Capability loudnessEnhancer;
+ Reverb.Capability reverb;
+ Virtualizer.Capability virtualizer;
+ Visualizer.Capability visualizer;
+ Volume.Capability volume;
}
diff --git a/audio/aidl/android/hardware/audio/effect/Descriptor.aidl b/audio/aidl/android/hardware/audio/effect/Descriptor.aidl
index 562c249..47c88dc 100644
--- a/audio/aidl/android/hardware/audio/effect/Descriptor.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Descriptor.aidl
@@ -107,10 +107,6 @@
* implementation is part of a proxy effect.
*/
@nullable AudioUuid proxy;
- /**
- * Capability flags defined for the effect implementation.
- */
- Flags flags;
}
/**
@@ -123,6 +119,10 @@
*/
Identity id;
/**
+ * Capability flags defined for the effect implementation.
+ */
+ Flags flags;
+ /**
* CPU load indication expressed in 0.1 MIPS units as estimated on an ARM9E core (ARMv5TE)
* with 0 WS.
*/
diff --git a/audio/aidl/android/hardware/audio/effect/Downmix.aidl b/audio/aidl/android/hardware/audio/effect/Downmix.aidl
new file mode 100644
index 0000000..ee57baf
--- /dev/null
+++ b/audio/aidl/android/hardware/audio/effect/Downmix.aidl
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.audio.effect;
+
+import android.hardware.audio.effect.VendorExtension;
+
+/**
+ * Downmix specific definitions.
+ *
+ * All parameters defined in union Downmix must be gettable and settable. The capabilities defined
+ * in Downmix.Capability can only acquired with IEffect.getDescriptor() and not settable.
+ */
+@VintfStability
+union Downmix {
+ /**
+ * Effect parameter tag to identify the parameters for getParameter().
+ */
+ @VintfStability
+ union Id {
+ int vendorExtensionTag;
+ Downmix.Tag commonTag;
+ }
+
+ /**
+ * Vendor Downmix implementation definition for additional parameters.
+ */
+ VendorExtension vendor;
+
+ /**
+ * Capability supported by Downmix implementation.
+ */
+ @VintfStability
+ parcelable Capability {
+ /**
+ * Downmix capability extension, vendor can use this extension in case existing capability
+ * definition not enough.
+ */
+ ParcelableHolder extension;
+ }
+
+ @VintfStability
+ enum Type {
+ /**
+ * Throw away the extra channels.
+ */
+ STRIP,
+ /**
+ * Mix the extra channels with FL/FR.
+ */
+ FOLD,
+ }
+
+ /**
+ * Type of downmix.
+ */
+ Type type;
+}
diff --git a/audio/aidl/android/hardware/audio/effect/DynamicsProcessing.aidl b/audio/aidl/android/hardware/audio/effect/DynamicsProcessing.aidl
new file mode 100644
index 0000000..ee5dcad
--- /dev/null
+++ b/audio/aidl/android/hardware/audio/effect/DynamicsProcessing.aidl
@@ -0,0 +1,301 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.audio.effect;
+
+import android.hardware.audio.effect.VendorExtension;
+
+/**
+ * DynamicsProcessing specific definitions.
+ *
+ * All parameters defined in union DynamicsProcessing must be gettable and settable. The
+ * capabilities defined in DynamicsProcessing.Capability can only acquired with
+ * IEffect.getDescriptor() and not settable.
+ */
+@VintfStability
+union DynamicsProcessing {
+ /**
+ * Effect parameter tag to identify the parameters for getParameter().
+ */
+ @VintfStability
+ union Id {
+ int vendorExtensionTag;
+ DynamicsProcessing.Tag commonTag;
+ }
+
+ /**
+ * Vendor DynamicsProcessing implementation definition for additional parameters.
+ */
+ VendorExtension vendorExtension;
+
+ /**
+ * Capability supported by DynamicsProcessing implementation.
+ */
+ @VintfStability
+ parcelable Capability {
+ /**
+ * DynamicsProcessing capability extension, vendor can use this extension in case existing
+ * capability definition not enough.
+ */
+ ParcelableHolder extension;
+ }
+
+ /**
+ * Resolution preference definition.
+ */
+ enum ResolutionPreference {
+ /**
+ * Favors frequency domain based implementation.
+ */
+ FAVOR_FREQUENCY_RESOLUTION,
+ /**
+ * Favors tme domain based implementation.
+ */
+ FAVOR_TIME_RESOLUTION,
+ }
+
+ /**
+ * Band enablement configuration.
+ */
+ @VintfStability
+ parcelable BandEnablement {
+ /**
+ * True if multi-band stage is in use.
+ */
+ boolean inUse;
+ /**
+ * Number of bands configured for this stage.
+ */
+ int bandCount;
+ }
+
+ /**
+ * Effect engine configuration. Set the enablement of all stages.
+ */
+ @VintfStability
+ parcelable EngineArchitecture {
+ /**
+ * Resolution preference.
+ */
+ ResolutionPreference resolutionPreference = ResolutionPreference.FAVOR_FREQUENCY_RESOLUTION;
+ /**
+ * Preferred frame duration in milliseconds (ms).
+ */
+ float preferredFrameDurationMs;
+ /**
+ * PreEq stage (Multi-band Equalizer) configuration.
+ */
+ BandEnablement preEqBand;
+ /**
+ * PostEq stage (Multi-band Equalizer) configuration.
+ */
+ BandEnablement postEqBand;
+ /**
+ * MBC stage (Multi-band Compressor) configuration.
+ */
+ BandEnablement mbcBand;
+ /**
+ * True if Limiter stage is in use.
+ */
+ boolean limiterInUse;
+ }
+
+ /**
+ * Band enablement configuration for a specific channel.
+ */
+ @VintfStability
+ parcelable BandChannelConfig {
+ /**
+ * Channel index.
+ */
+ int channel;
+ /**
+ * Channel index.
+ */
+ BandEnablement enablement;
+ }
+
+ /**
+ * Equalizer band configuration for a specific channel and band.
+ */
+ @VintfStability
+ parcelable EqBandConfig {
+ /**
+ * Channel index.
+ */
+ int channel;
+ /**
+ * Band index, must in the range of [0, bandCount-1].
+ */
+ int band;
+ /**
+ * True if EQ stage is enabled.
+ */
+ boolean enable;
+ /**
+ * Topmost frequency number (in Hz) this band will process.
+ */
+ float cutoffFrequency;
+ /**
+ * Gain factor in decibels (dB).
+ */
+ float gain;
+ }
+
+ /**
+ * MBC configuration for a specific channel and band.
+ */
+ @VintfStability
+ parcelable MbcBandConfig {
+ /**
+ * Channel index.
+ */
+ int channel;
+ /**
+ * Band index, must in the range of [0, bandCount-1].
+ */
+ int band;
+ /**
+ * True if MBC stage is enabled.
+ */
+ boolean enable;
+ /**
+ * Topmost frequency number (in Hz) this band will process.
+ */
+ float cutoffFrequencyHz;
+ /**
+ * Gain factor in decibels (dB).
+ */
+ float gainDb;
+ /**
+ * Attack Time for compressor in milliseconds (ms).
+ */
+ float attackTimeMs;
+ /**
+ * Release Time for compressor in milliseconds (ms).
+ */
+ float releaseTimeMs;
+ /**
+ * Compressor ratio (N:1) (input:output).
+ */
+ float ratio;
+ /**
+ * Compressor threshold measured in decibels (dB) from 0 dB Full Scale (dBFS).
+ */
+ float thresholdDb;
+ /**
+ * Width in decibels (dB) around compressor threshold point.
+ */
+ float kneeWidthDb;
+ /**
+ * Noise gate threshold in decibels (dB) from 0 dB Full Scale (dBFS).
+ */
+ float noiseGateThresholdDb;
+ /**
+ * Expander ratio (1:N) (input:output) for signals below the Noise Gate Threshold.
+ */
+ float expanderRatio;
+ /**
+ * Gain applied to the signal BEFORE the compression in dB.
+ */
+ float preGainDb;
+ /**
+ * Gain applied to the signal AFTER compression in dB.
+ */
+ float postGainDb;
+ }
+
+ /**
+ * Limiter configuration for a specific channel.
+ */
+ @VintfStability
+ parcelable LimiterConfig {
+ /**
+ * Channel index.
+ */
+ int channel;
+ /**
+ * True if Limiter stage is enabled.
+ */
+ boolean enable;
+ /**
+ * True if Limiter stage is in use.
+ */
+ boolean inUse;
+ /**
+ * Index of group assigned to this Limiter. Only limiters that share the same linkGroup
+ * index will react together.
+ */
+ int linkGroup;
+ /**
+ * Attack Time for compressor in milliseconds (ms).
+ */
+ float attackTimeMs;
+ /**
+ * Release Time for compressor in milliseconds (ms).
+ */
+ float releaseTimeMs;
+ /**
+ * Compressor ratio (N:1) (input:output).
+ */
+ float ratio;
+ /**
+ * Compressor threshold measured in decibels (dB) from 0 dB Full Scale (dBFS).
+ */
+ float thresholdDb;
+ /**
+ * Gain applied to the signal AFTER compression in dB.
+ */
+ float postGainDb;
+ }
+
+ /**
+ * Effect engine architecture.
+ */
+ EngineArchitecture engineArchitecture;
+ /**
+ * PreEq stage per channel configuration.
+ */
+ BandChannelConfig preEq;
+ /**
+ * PostEq stage per channel configuration.
+ */
+ BandChannelConfig postEq;
+ /**
+ * PreEq stage per band configuration.
+ */
+ EqBandConfig preEqBand;
+ /**
+ * PostEq stage per band configuration.
+ */
+ EqBandConfig postEqBand;
+ /**
+ * MBC stage per channel configuration.
+ */
+ BandChannelConfig mbc;
+ /**
+ * PostEq stage per band configuration.
+ */
+ MbcBandConfig mbcBand;
+ /**
+ * Limiter stage configuration.
+ */
+ LimiterConfig limiter;
+ /**
+ * Input gain factor in decibels (dB). 0 dB means no change in level.
+ */
+ float inputGainDb;
+}
diff --git a/audio/aidl/android/hardware/audio/effect/Equalizer.aidl b/audio/aidl/android/hardware/audio/effect/Equalizer.aidl
index 7fe9bb2..79a1c4f 100644
--- a/audio/aidl/android/hardware/audio/effect/Equalizer.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Equalizer.aidl
@@ -16,7 +16,7 @@
package android.hardware.audio.effect;
-import android.media.audio.common.AudioProfile;
+import android.hardware.audio.effect.VendorExtension;
/**
* Equalizer specific definitions.
@@ -27,13 +27,18 @@
@VintfStability
union Equalizer {
/**
- * Vendor Equalizer implementation definition for additional parameters.
+ * Effect parameter tag to identify the parameters for getParameter().
*/
@VintfStability
- parcelable VendorExtension {
- ParcelableHolder extension;
+ union Id {
+ int vendorExtensionTag;
+ Equalizer.Tag commonTag;
}
- VendorExtension vendor;
+
+ /**
+ * Vendor Equalizer implementation definition for additional parameters.
+ */
+ VendorExtension vendorExtension;
/**
* Capability MUST be supported by Equalizer implementation.
@@ -58,22 +63,22 @@
}
/**
- * Level setting for each band.
+ * Level setting for each band in millibels.
*/
@VintfStability
parcelable BandLevel {
int index;
- int level;
+ int levelMb;
}
/**
- * Supported minimal and maximal frequency for each band.
+ * Supported minimal and maximal frequency for each band in millihertz.
*/
@VintfStability
parcelable BandFrequency {
int index;
- int min;
- int max;
+ int minMh;
+ int maxMh;
}
/**
diff --git a/audio/aidl/android/hardware/audio/effect/HapticGenerator.aidl b/audio/aidl/android/hardware/audio/effect/HapticGenerator.aidl
new file mode 100644
index 0000000..944155f
--- /dev/null
+++ b/audio/aidl/android/hardware/audio/effect/HapticGenerator.aidl
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.audio.effect;
+
+import android.hardware.audio.effect.VendorExtension;
+
+/**
+ * HapticGenerator specific definitions. HapticGenerator effect provide HapticGenerator control and
+ * mute/unmute functionality.
+ *
+ * All parameters defined in union HapticGenerator must be gettable and settable. The capabilities
+ * defined in HapticGenerator.Capability can only acquired with IEffect.getDescriptor() and not
+ * settable.
+ */
+@VintfStability
+union HapticGenerator {
+ /**
+ * Effect parameter tag to identify the parameters for getParameter().
+ */
+ @VintfStability
+ union Id {
+ int vendorExtensionTag;
+ HapticGenerator.Tag commonTag;
+ }
+
+ /**
+ * Vendor HapticGenerator implementation definition for additional parameters.
+ */
+ VendorExtension vendorExtension;
+
+ /**
+ * Capability supported by HapticGenerator implementation.
+ */
+ @VintfStability
+ parcelable Capability {
+ /**
+ * HapticGenerator capability extension, vendor can use this extension in case existing
+ * capability definition not enough.
+ */
+ VendorExtension extension;
+ }
+
+ @VintfStability
+ @Backing(type="int")
+ enum VibratorScale {
+ MUTE = -100,
+ VERY_LOW = -2,
+ LOW = -1,
+ NONE = 0,
+ HIGH = 1,
+ VERY_HIGH = 2,
+ }
+
+ @VintfStability
+ parcelable HapticScale {
+ /**
+ * Audio track ID.
+ */
+ int id;
+ /**
+ * Haptic intensity.
+ */
+ VibratorScale scale = VibratorScale.MUTE;
+ }
+
+ /**
+ * Vibrator information including resonant frequency, Q factor.
+ */
+ @VintfStability
+ parcelable VibratorInformation {
+ /**
+ * Resonant frequency in Hz.
+ */
+ float resonantFrequencyHz;
+ float qFactor;
+ float maxAmplitude;
+ }
+
+ HapticScale hapticScale;
+ VibratorInformation vibratorInfo;
+}
diff --git a/audio/aidl/android/hardware/audio/effect/IEffect.aidl b/audio/aidl/android/hardware/audio/effect/IEffect.aidl
index 5dd390f..3b957d7 100644
--- a/audio/aidl/android/hardware/audio/effect/IEffect.aidl
+++ b/audio/aidl/android/hardware/audio/effect/IEffect.aidl
@@ -44,13 +44,15 @@
*/
int status;
/**
- * The amount of bytes consumed by the effect instance.
+ * The amount of audio data samples in the floating point format consumed by the effect
+ * instance.
*/
- int fmqByteConsumed;
+ int fmqConsumed;
/**
- * The amount of bytes produced by the effect instance.
+ * The amount of audio data samples in the floating point format produced by the effect
+ * instance.
*/
- int fmqByteProduced;
+ int fmqProduced;
}
/**
@@ -65,11 +67,11 @@
/**
* Message queue for input data buffer.
*/
- MQDescriptor<byte, SynchronizedReadWrite> inputDataMQ;
+ MQDescriptor<float, SynchronizedReadWrite> inputDataMQ;
/**
* Message queue for output data buffer.
*/
- MQDescriptor<byte, SynchronizedReadWrite> outputDataMQ;
+ MQDescriptor<float, SynchronizedReadWrite> outputDataMQ;
}
/**
@@ -79,13 +81,15 @@
* the effect instance must be able to handle all IEffect interface calls.
*
* @param common Parameters which MUST pass from client at open time.
+ * @param specific Effect specific parameters which can optional pass from client at open time.
*
* @throws EX_ILLEGAL_ARGUMENT if the effect instance receive unsupported command.
* @throws a EX_UNSUPPORTED_OPERATION if device capability/resource is not enough or system
* failure happens.
* @note Open an already-opened effect instance should do nothing and should not throw an error.
*/
- OpenEffectReturn open(in Parameter.Common common, in Parameter.Specific specific);
+ OpenEffectReturn open(
+ in Parameter.Common common, in @nullable Parameter.Specific specific);
/**
* Called by the client to close the effect instance, processing thread should be destroyed and
diff --git a/audio/aidl/android/hardware/audio/effect/IFactory.aidl b/audio/aidl/android/hardware/audio/effect/IFactory.aidl
index e56c24f..5943359 100644
--- a/audio/aidl/android/hardware/audio/effect/IFactory.aidl
+++ b/audio/aidl/android/hardware/audio/effect/IFactory.aidl
@@ -39,11 +39,14 @@
* null, used as a filter for effect type UUIDs.
* @param implementation Indicates the particular implementation of the effect in that type.
* This is an optional parameter, pass in null if this parameter is not necessary; if
- * non null, used as a filter for effect type UUIDs.
+ * non null, used as a filter for effect implementation UUIDs.
+ * @param proxy Indicates the proxy UUID filter to query.
+ * This is an optional parameter, pass in null if this parameter is not necessary; if
+ * non null, used as a filter for effect proxy UUIDs.
* @return List of effect identities supported and filtered by type/implementation UUID.
*/
- Descriptor.Identity[] queryEffects(
- in @nullable AudioUuid type, in @nullable AudioUuid implementation);
+ Descriptor.Identity[] queryEffects(in @nullable AudioUuid type,
+ in @nullable AudioUuid implementation, in @nullable AudioUuid proxy);
/**
* Return a list of defined processings, with the optional filter by Processing type.
diff --git a/audio/aidl/android/hardware/audio/effect/LoudnessEnhancer.aidl b/audio/aidl/android/hardware/audio/effect/LoudnessEnhancer.aidl
new file mode 100644
index 0000000..0441f10
--- /dev/null
+++ b/audio/aidl/android/hardware/audio/effect/LoudnessEnhancer.aidl
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.audio.effect;
+
+import android.hardware.audio.effect.VendorExtension;
+
+/**
+ * LoudnessEnhancer specific definitions.
+ *
+ * All parameters defined in union LoudnessEnhancer must be gettable and settable. The capabilities
+ * defined in LoudnessEnhancer.Capability can only acquired with IEffect.getDescriptor() and not
+ * settable.
+ */
+@VintfStability
+union LoudnessEnhancer {
+ /**
+ * Effect parameter tag to identify the parameters for getParameter().
+ */
+ @VintfStability
+ union Id {
+ int vendorExtensionTag;
+ LoudnessEnhancer.Tag commonTag;
+ }
+
+ /**
+ * Vendor LoudnessEnhancer implementation definition for additional parameters.
+ */
+ VendorExtension vendor;
+
+ /**
+ * Capability supported by LoudnessEnhancer implementation.
+ */
+ @VintfStability
+ parcelable Capability {
+ /**
+ * LoudnessEnhancer capability extension, vendor can use this extension in case existing
+ * capability definition not enough.
+ */
+ VendorExtension extension;
+ }
+
+ /**
+ * The maximum gain in millibels (mB) applied to the signal to process, default value is 0 which
+ * corresponds to no amplification.
+ */
+ int gainMb;
+}
diff --git a/audio/aidl/android/hardware/audio/effect/Parameter.aidl b/audio/aidl/android/hardware/audio/effect/Parameter.aidl
index 739c9ff..e7d3d5e 100644
--- a/audio/aidl/android/hardware/audio/effect/Parameter.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Parameter.aidl
@@ -16,9 +16,19 @@
package android.hardware.audio.effect;
+import android.hardware.audio.effect.BassBoost;
+import android.hardware.audio.effect.Downmix;
+import android.hardware.audio.effect.DynamicsProcessing;
import android.hardware.audio.effect.Equalizer;
+import android.hardware.audio.effect.HapticGenerator;
+import android.hardware.audio.effect.LoudnessEnhancer;
+import android.hardware.audio.effect.Reverb;
+import android.hardware.audio.effect.VendorExtension;
+import android.hardware.audio.effect.Virtualizer;
+import android.hardware.audio.effect.Visualizer;
+import android.hardware.audio.effect.Volume;
import android.media.audio.common.AudioConfig;
-import android.media.audio.common.AudioDeviceType;
+import android.media.audio.common.AudioDeviceDescription;
import android.media.audio.common.AudioMode;
import android.media.audio.common.AudioSource;
@@ -28,9 +38,8 @@
* There are three groups of parameters:
* 1. Common parameters are essential parameters, MUST pass to effects at open() interface.
* 2. Parameters defined for a specific effect type.
- * 3. Extension parameters for vendor.
+ * 3. Extension parameters ParcelableHolder can be used for vendor effect definition.
*
- * For all supported parameter, implementation MUST support both set and get.
*/
@VintfStability
union Parameter {
@@ -44,17 +53,38 @@
@VintfStability
union Id {
/**
- * Common parameter tag.
+ * Parameter tag defined for vendor effects. Use int here so there is flexibility for vendor
+ * to define different tag.
*/
- int commonTag;
+ int vendorEffectTag;
/**
- * Vendor defined parameter tag.
+ * Parameter tag defined for nested parameters. Can be used to get any parameter defined in
+ * nested Union structure.
+ *
+ * Example:
+ * To get BassBoost strength in param from effectInstance:
+ * IEffect effectInstance;
+ * Parameter param;
+ * BassBoost::Id bassId = BassBoost::Id::make<BassBoost::Id::tag>(BassBoost::strengthPm);
+ * Parameter::Id id = Parameter::Id::make<Parameter::Id::bassBoostTag>(bassId);
+ * effectInstance.getParameter(id, ¶m);
+ *
*/
- int vendorTag;
+ BassBoost.Id bassBoostTag;
+ Downmix.Id downmixTag;
+ DynamicsProcessing.Id dynamicsProcessingTag;
+ Equalizer.Id equalizerTag;
+ HapticGenerator.Id hapticGeneratorTag;
+ LoudnessEnhancer.Id loudnessEnhancerTag;
+ Reverb.Id reverbTag;
+ Virtualizer.Id virtualizerTag;
+ Visualizer.Id visualizerTag;
+ Volume.Id volumeTag;
/**
- * Specific effect parameter tag.
+ * Non-nested parameter tag. Can be used to get any parameter defined in Union Parameter
+ * directly.
*/
- Specific.Id specificId;
+ Parameter.Tag commonTag;
}
/**
@@ -85,7 +115,7 @@
* Used by audio framework to set the device type to effect engine.
* Effect must implement setParameter(device) if Flags.deviceIndication set to true.
*/
- AudioDeviceType device;
+ 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.
@@ -101,7 +131,7 @@
* The volume gain for left and right channel, left and right equals to same value if it's mono.
*/
@VintfStability
- parcelable Volume {
+ parcelable VolumeStereo {
float left;
float right;
}
@@ -109,38 +139,24 @@
* Used by audio framework to delegate volume control to effect engine.
* Effect must implement setParameter(volume) if Flags.volume set to Volume.IND.
*/
- Volume volume;
-
- /**
- * Used by audio framework to delegate offload information to effect engine.
- * Effect must implement setParameter(offload) if Flags.offloadSupported set to true.
- */
- boolean offload;
-
- /**
- * Parameters for vendor extension effect implementation usage.
- */
- @VintfStability
- parcelable VendorEffectParameter {
- ParcelableHolder extension;
- }
- VendorEffectParameter vendorEffect;
+ VolumeStereo volumeStereo;
/**
* Parameters MUST be supported by a Specific type of effect.
*/
@VintfStability
union Specific {
- @VintfStability
- union Id {
- /**
- * Equalizer.Tag to identify the parameters in Equalizer.
- */
- Equalizer.Tag equalizerTag = Equalizer.Tag.vendor;
- }
- Id id;
-
+ VendorExtension vendorEffect;
+ BassBoost bassBoost;
+ Downmix downmix;
+ DynamicsProcessing dynamicsProcessing;
Equalizer equalizer;
+ LoudnessEnhancer loudnessEnhancer;
+ HapticGenerator hapticGenerator;
+ Reverb reverb;
+ Virtualizer virtualizer;
+ Visualizer visualizer;
+ Volume volume;
}
Specific specific;
}
diff --git a/audio/aidl/android/hardware/audio/effect/Reverb.aidl b/audio/aidl/android/hardware/audio/effect/Reverb.aidl
new file mode 100644
index 0000000..f60c2ea
--- /dev/null
+++ b/audio/aidl/android/hardware/audio/effect/Reverb.aidl
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.audio.effect;
+
+import android.hardware.audio.effect.VendorExtension;
+
+/**
+ * Reverb specific definitions.
+ *
+ * All parameters defined in union Reverb must be gettable and settable. The capabilities defined in
+ * Reverb.Capability can only acquired with IEffect.getDescriptor() and not settable.
+ */
+@VintfStability
+union Reverb {
+ /**
+ * Effect parameter tag to identify the parameters for getParameter().
+ */
+ @VintfStability
+ union Id {
+ int vendorExtensionTag;
+ Reverb.Tag commonTag;
+ }
+
+ /**
+ * Vendor Reverb implementation definition for additional parameters.
+ */
+ VendorExtension vendor;
+
+ /**
+ * Capability supported by effect implementation.
+ */
+ @VintfStability
+ parcelable Capability {
+ VendorExtension extension;
+
+ /**
+ * Max decay time supported in millisecond.
+ */
+ int maxDecayTimeMs;
+ }
+
+ /**
+ * Room level apply to the reverb effect in millibels.
+ */
+ int roomLevelMb;
+ /**
+ * Room HF level apply to the reverb effect in millibels.
+ */
+ int roomHfLevelMb;
+ /**
+ * Delay time apply to the reverb effect in milliseconds.
+ */
+ int decayTimeMs;
+ /**
+ * HF decay ratio in permilles.
+ */
+ int decayHfRatioPm;
+ /**
+ * Reverb level in millibels.
+ */
+ int levelMb;
+ /**
+ * Reverb delay in milliseconds.
+ */
+ int delayMs;
+ /**
+ * Diffusion in permilles.
+ */
+ int diffusionPm;
+ /**
+ * Density in permilles.
+ */
+ int densityPm;
+ /**
+ * Bypass reverb and copy input to output if set to true.
+ */
+ boolean bypass;
+}
diff --git a/audio/aidl/android/hardware/audio/effect/VendorExtension.aidl b/audio/aidl/android/hardware/audio/effect/VendorExtension.aidl
new file mode 100644
index 0000000..c60f01a
--- /dev/null
+++ b/audio/aidl/android/hardware/audio/effect/VendorExtension.aidl
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.audio.effect;
+
+/**
+ * Vendor exntension implementation definition, can be used for additional parameters.
+ */
+@VintfStability
+parcelable VendorExtension {
+ ParcelableHolder extension;
+}
diff --git a/audio/aidl/android/hardware/audio/effect/Virtualizer.aidl b/audio/aidl/android/hardware/audio/effect/Virtualizer.aidl
new file mode 100644
index 0000000..9d039bc
--- /dev/null
+++ b/audio/aidl/android/hardware/audio/effect/Virtualizer.aidl
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.audio.effect;
+
+import android.hardware.audio.effect.VendorExtension;
+
+/**
+ * Virtualizer specific definitions. An audio virtualizer is a general name for an effect to
+ * spatialize audio channels.
+ *
+ * All parameters defined in union Virtualizer must be gettable and settable. The capabilities
+ * defined in Virtualizer.Capability can only acquired with IEffect.getDescriptor() and not
+ * settable.
+ */
+@VintfStability
+union Virtualizer {
+ /**
+ * Effect parameter tag to identify the parameters for getParameter().
+ */
+ @VintfStability
+ union Id {
+ int vendorExtensionTag;
+ Virtualizer.Tag commonTag;
+ }
+
+ /**
+ * Vendor Virtualizer implementation definition for additional parameters.
+ */
+ VendorExtension vendor;
+
+ /**
+ * Capability supported by Virtualizer implementation.
+ */
+ @VintfStability
+ parcelable Capability {
+ /**
+ * Virtualizer capability extension, vendor can use this extension in case existing
+ * capability definition not enough.
+ */
+ VendorExtension extension;
+ /**
+ * Indicates whether setting strength is supported. False value indicates only one strength
+ * is supported and setParameter() method will always return EX_ILLEGAL_ARGUMENT.
+ */
+ boolean strengthSupported;
+ }
+
+ /**
+ * The per mille strength of the virtualizer effect.
+ *
+ * If the implementation does not support per mille accuracy for setting the strength, it is
+ * allowed to round the given strength to the nearest supported value. In this case {@link
+ * #IEffect.getParameter()} method should return the rounded value that was actually set.
+ *
+ * The valid range for strength is [0, 1000].
+ */
+ int strengthPm;
+}
diff --git a/audio/aidl/android/hardware/audio/effect/Visualizer.aidl b/audio/aidl/android/hardware/audio/effect/Visualizer.aidl
new file mode 100644
index 0000000..4c1b71a
--- /dev/null
+++ b/audio/aidl/android/hardware/audio/effect/Visualizer.aidl
@@ -0,0 +1,167 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.audio.effect;
+
+import android.hardware.audio.effect.VendorExtension;
+
+/**
+ * Visualizer specific definitions. Visualizer enables application to retrieve part of the currently
+ * playing audio for visualization purpose
+ *
+ * All parameters defined in union Visualizer other than these in GetOnlyParameters and
+ * SetOnlyParameters must be gettable and settable. The capabilities defined in
+ * Visualizer.Capability can only acquired with IEffect.getDescriptor() and not settable.
+ *
+ */
+@VintfStability
+union Visualizer {
+ /**
+ * Effect parameter tag to identify the parameters for getParameter().
+ */
+ @VintfStability
+ union Id {
+ int vendorExtensionTag;
+ GetOnlyParameters.Tag getOnlyParamTag;
+ SetOnlyParameters.Tag setOnlyParamTag;
+ Visualizer.Tag commonTag;
+ }
+ Id id;
+
+ /**
+ * Vendor Visualizer implementation definition for additional parameters.
+ */
+ VendorExtension vendor;
+
+ /**
+ * Capability supported by Visualizer implementation.
+ */
+ @VintfStability
+ parcelable Capability {
+ /**
+ * Visualizer capability extension, vendor can use this extension in case existing
+ * capability definition not enough.
+ */
+ VendorExtension extension;
+ /**
+ * Max latency supported in millseconds.
+ */
+ int maxLatencyMs;
+ /**
+ * Capture size range.
+ */
+ CaptureSizeRange captureSizeRange;
+ }
+
+ /**
+ * Supported capture size range in bytes.
+ */
+ @VintfStability
+ parcelable CaptureSizeRange {
+ int minBytes;
+ int maxBytes;
+ }
+
+ /**
+ * Type of scaling applied on the captured visualization data.
+ */
+ @VintfStability
+ enum ScalingMode {
+ /**
+ * Defines a capture mode where amplification is applied based on the content of the
+ * captured data. This is the default Visualizer mode, and is suitable for music
+ * visualization.
+ */
+ NORMALIZED = 0,
+ /**
+ * Defines a capture mode where the playback volume will affect (scale) the range of the
+ * captured data. A low playback volume will lead to low sample and fft values, and
+ * vice-versa.
+ */
+ AS_PLAYED,
+ }
+
+ /**
+ * Measurement modes to be performed.
+ */
+ @VintfStability
+ enum MeasurementMode {
+ /**
+ * No measurements are performed.
+ */
+ NONE = 0,
+ /**
+ * Defines a measurement mode which computes the peak and RMS value in mB below the "full
+ * scale", where 0mB is normally the maximum sample value (but see the note below). Minimum
+ * value depends on the resolution of audio samples used by the audio framework. The value
+ * of -9600mB is the minimum value for 16-bit audio systems and -14400mB or below for "high
+ * resolution" systems. Values for peak and RMS can be retrieved with {@link
+ * #getMeasurementPeakRms(MeasurementPeakRms)}.
+ */
+ PEAK_RMS,
+ }
+
+ /**
+ * Any parameter defined in this union must be gettable via getParameter(), but must not
+ * settable.
+ */
+ @VintfStability
+ union GetOnlyParameters {
+ /**
+ * Get the current measurements.
+ */
+ @VintfStability
+ parcelable Measurement {
+ int rms;
+ int peak;
+ }
+ Measurement measurement;
+
+ /**
+ * Gets the latest PCM capture, size of returned vector equals to @c captureSize.
+ */
+ byte[] captureBytes;
+ }
+ GetOnlyParameters getOnlyParameters;
+
+ /**
+ * Any parameter defined in this union must be settable via setParameter(), but must not
+ * gettable.
+ */
+ @VintfStability
+ union SetOnlyParameters {
+ /**
+ * Used by framework to inform the visualizer about the downstream latency (audio hardware
+ * driver estimated latency in milliseconds).
+ */
+ int latencyMs;
+ }
+ SetOnlyParameters setOnlyParameters;
+
+ /**
+ * Current capture size in bytes. The capture size must be a power of 2 in the range
+ * Capability.captureSizeRange.
+ */
+ int captureSizeBytes;
+ /**
+ * Visualizer capture mode
+ */
+ ScalingMode scalingMode;
+ /**
+ * Visualizer measurement mode.
+ */
+ MeasurementMode measurementMode;
+}
diff --git a/audio/aidl/android/hardware/audio/effect/Volume.aidl b/audio/aidl/android/hardware/audio/effect/Volume.aidl
new file mode 100644
index 0000000..a3ce2f6
--- /dev/null
+++ b/audio/aidl/android/hardware/audio/effect/Volume.aidl
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.audio.effect;
+
+import android.hardware.audio.effect.VendorExtension;
+
+/**
+ * Volume specific definitions. Volume effect provide volume control and mute/unmute functionality.
+ *
+ * All parameters defined in union Volume must be gettable and settable. The capabilities defined in
+ * Volume.Capability can only acquired with IEffect.getDescriptor() and not settable.
+ */
+@VintfStability
+union Volume {
+ /**
+ * Effect parameter tag to identify the parameters for getParameter().
+ */
+ @VintfStability
+ union Id {
+ int vendorExtensionTag;
+ Volume.Tag commonTag;
+ }
+
+ /**
+ * Vendor Volume implementation definition for additional parameters.
+ */
+ VendorExtension vendor;
+
+ /**
+ * Capability supported by Volume implementation.
+ */
+ @VintfStability
+ parcelable Capability {
+ /**
+ * Volume capability extension, vendor can use this extension in case existing capability
+ * definition not enough.
+ */
+ VendorExtension extension;
+
+ /**
+ * Volume strength supported in dB.
+ */
+ int maxLevel;
+ }
+
+ /**
+ * Current level in dB.
+ */
+ int levelDb;
+ /**
+ * Mute volume if true, when volume set to mute, the current level still saved and take effect
+ * when unmute.
+ */
+ boolean mute;
+}