Audio V4: Split system and vendor Audio.h
audio.h and its dependencies (audio-effect.h, sound_trigger.h...)
used to be shared between system and vendor code.
This led to multiple problems:
1) Such sharing contradicts the Treble policy of
strict independence of framework and vendor code.
2) When audio.h was changed, every vendor needed to update
its code in the next release. This meant that audio*.h
headers were mostly changed in backward compatible manner.
Nevertheless, for P the HIDL interface and thus the audio.h
interface are changed in backward incompatible way.
(Some enum are becoming 64 bit long).
3) As the headers were common, some API used only by the framework
needed to be visible to the vendors (mostly enum values).
4) Treble policy is to support at least one previous HAL version
As a result the audio*.h headers are now duplicated,
one set for the framework, and one for the vendor.
Each set will evolve independently. After this split,
the framework-only APIs will be removed from the vendor headers
and vice versa.
The split is implements as such:
+ for system code
- NOT moving the libaudio_system_headers
Eg: system/audio.h and system/audio_effects/effect_equalizer.h
are still in system/media/audio
- the legacy audio HAL API that were in libhardware headers
are now in libaudiohal_legacy_headers
Eg: hardware/audio.h and hardware/audio_effect.h
are now in frameworks/av/media/libaudiohal/legacy/
+ for vendor code
- moving libaudio_system_headers and the legacy audio HAL API
that were in libhardware_headers in
android.hardware.audio.common.legacy@2.0
Note that those headers are now versioned, so migrating to a @4.0
HIDL HAL will mean changing the legacy dependency too.
Eg: system/audio.h, system/audio-effect.h, hardware/audio.h
are now in hardware/interfaces/audio/common/2.0/legacy
- the legacy audio effect HAL API that was in libaudioeffects
is now moved in android.hardware.audio.effect.legacy@2.0
Eg: audio_effects/effect*.h are now in
hardware/interfaces/audio/effect/2.0/legacy
- the legacy sound trigger HAL API that were in libhardware_headers
is now moved in android.hardware.soundtrigger.legacy@2.0
Eg: hardware/sound_trigger.h is now in
hardware/interfaces/audio/effect/2.0/legacy
libaudioutil being used by both system and vendor, had
to be renamed for system to libaudioutil_system.
Vendor libs that now depend on the audio.h of a specific
version and are not extensively referenced in non google code,
append @2.0 to their name.
Note that headers that are not expected to change in the 4.0 HAL are
left in all-versions folder to avoid duplication.
This is an implementation detail as the versioned libraries export
the all-versions headers.
Note that strict vendor-system separation is enforced by the
build-system. The system headers are not available for vendor
libs and vice-versa.
Note that this patch is split between numerous git repository (>10),
all the commits having the same Change-id for searchability.
Note that audio_policy.h is no longer exposed to vendors
as the legacy audio policy HAL API was never officially supported.
As a result the audiopolicy stub implementation has been removed.
Test: compile taimen-userdebug walleye-userdebug
sailfish-userdebug marlin-userdebug
gce_x86_phone-userdebug gce_x86_phone
full-eng aosp_arm aosp_x86-eng
Test: check that the emulator booted and played audio
Test: full QA on sailfish-userdebug and taimen-userdebug
Bug: 38184704
Change-Id: I950f4e0a55613d72e32eba31bd563cb5bafe2d1a
Signed-off-by: Kevin Rocard <krocard@google.com>
diff --git a/audio/effect/2.0/default/Android.bp b/audio/effect/2.0/default/Android.bp
index db00988..d32a9d9 100644
--- a/audio/effect/2.0/default/Android.bp
+++ b/audio/effect/2.0/default/Android.bp
@@ -41,9 +41,9 @@
header_libs: [
"android.hardware.audio.common.util@all-versions",
"android.hardware.audio.effect@all-versions-impl",
- "libaudio_system_headers",
+ "android.hardware.audio.common.legacy@2.0",
+ "android.hardware.audio.effect.legacy@2.0",
"libaudioclient_headers",
- "libeffects_headers",
"libhardware_headers",
"libmedia_headers",
],
diff --git a/audio/effect/2.0/legacy/Android.bp b/audio/effect/2.0/legacy/Android.bp
new file mode 100644
index 0000000..68de70e
--- /dev/null
+++ b/audio/effect/2.0/legacy/Android.bp
@@ -0,0 +1,12 @@
+cc_library_headers {
+ name: "android.hardware.audio.effect.legacy@2.0",
+ vendor: true,
+ header_libs: [
+ "android.hardware.audio.common.legacy@2.0",
+ "android.hardware.audio.effect.legacy@all-versions",
+ ],
+ export_header_lib_headers: [
+ "android.hardware.audio.common.legacy@2.0",
+ "android.hardware.audio.effect.legacy@all-versions",
+ ],
+}
diff --git a/audio/effect/2.0/legacy/OWNERS b/audio/effect/2.0/legacy/OWNERS
new file mode 100644
index 0000000..6fdc97c
--- /dev/null
+++ b/audio/effect/2.0/legacy/OWNERS
@@ -0,0 +1,3 @@
+elaurent@google.com
+krocard@google.com
+mnaganov@google.com
diff --git a/audio/effect/all-versions/default/Android.bp b/audio/effect/all-versions/default/Android.bp
index ed2a093..47d74a8 100644
--- a/audio/effect/all-versions/default/Android.bp
+++ b/audio/effect/all-versions/default/Android.bp
@@ -9,7 +9,6 @@
shared_libs: [
"libbase",
"libcutils",
- "libeffects",
"libfmq",
"libhidlbase",
"libhidlmemory",
@@ -21,9 +20,7 @@
],
header_libs: [
- "libaudio_system_headers",
"libaudioclient_headers",
- "libeffects_headers",
"libhardware_headers",
"libmedia_headers",
"android.hardware.audio.common.util@all-versions",
diff --git a/audio/effect/all-versions/legacy/Android.bp b/audio/effect/all-versions/legacy/Android.bp
new file mode 100644
index 0000000..bcf81b3
--- /dev/null
+++ b/audio/effect/all-versions/legacy/Android.bp
@@ -0,0 +1,11 @@
+cc_library_headers {
+ name: "android.hardware.audio.effect.legacy@all-versions",
+ vendor: true,
+ export_include_dirs: ["include"],
+ header_libs: [
+ "android.hardware.audio.common.legacy@all-versions",
+ ],
+ export_header_lib_headers: [
+ "android.hardware.audio.common.legacy@all-versions",
+ ],
+}
diff --git a/audio/effect/all-versions/legacy/OWNERS b/audio/effect/all-versions/legacy/OWNERS
new file mode 100644
index 0000000..6fdc97c
--- /dev/null
+++ b/audio/effect/all-versions/legacy/OWNERS
@@ -0,0 +1,3 @@
+elaurent@google.com
+krocard@google.com
+mnaganov@google.com
diff --git a/audio/effect/all-versions/legacy/include/audio_effects/effect_aec.h b/audio/effect/all-versions/legacy/include/audio_effects/effect_aec.h
new file mode 100644
index 0000000..f48749a
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/audio_effects/effect_aec.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+/*
+ * USAGE NOTE: Only include this header when _implementing_ a particular
+ * effect. When access to UUID and properties is enough, include the
+ * corresponding header from system/audio_effects/, which doesn't include
+ * hardware/audio_effect.h.
+ *
+ * Only code that immediately calls into HAL or implements an effect
+ * can import hardware/audio_effect.h.
+ */
+
+#ifndef ANDROID_EFFECT_AEC_H_
+#define ANDROID_EFFECT_AEC_H_
+
+#include <hardware/audio_effect.h>
+#include <system/audio_effects/effect_aec.h>
+
+#endif /*ANDROID_EFFECT_AEC_H_*/
diff --git a/audio/effect/all-versions/legacy/include/audio_effects/effect_agc.h b/audio/effect/all-versions/legacy/include/audio_effects/effect_agc.h
new file mode 100644
index 0000000..466ea96
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/audio_effects/effect_agc.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+/*
+ * USAGE NOTE: Only include this header when _implementing_ a particular
+ * effect. When access to UUID and properties is enough, include the
+ * corresponding header from system/audio_effects/, which doesn't include
+ * hardware/audio_effect.h.
+ *
+ * Only code that immediately calls into HAL or implements an effect
+ * can import hardware/audio_effect.h.
+ */
+
+#ifndef ANDROID_EFFECT_AGC_H_
+#define ANDROID_EFFECT_AGC_H_
+
+#include <hardware/audio_effect.h>
+#include <system/audio_effects/effect_agc.h>
+
+#endif /*ANDROID_EFFECT_AGC_H_*/
diff --git a/audio/effect/all-versions/legacy/include/audio_effects/effect_bassboost.h b/audio/effect/all-versions/legacy/include/audio_effects/effect_bassboost.h
new file mode 100644
index 0000000..157452e
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/audio_effects/effect_bassboost.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+/*
+ * USAGE NOTE: Only include this header when _implementing_ a particular
+ * effect. When access to UUID and properties is enough, include the
+ * corresponding header from system/audio_effects/, which doesn't include
+ * hardware/audio_effect.h.
+ *
+ * Only code that immediately calls into HAL or implements an effect
+ * can import hardware/audio_effect.h.
+ */
+
+#ifndef ANDROID_EFFECT_BASSBOOST_H_
+#define ANDROID_EFFECT_BASSBOOST_H_
+
+#include <hardware/audio_effect.h>
+#include <system/audio_effects/effect_bassboost.h>
+
+#endif /*ANDROID_EFFECT_BASSBOOST_H_*/
diff --git a/audio/effect/all-versions/legacy/include/audio_effects/effect_downmix.h b/audio/effect/all-versions/legacy/include/audio_effects/effect_downmix.h
new file mode 100644
index 0000000..26b849b
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/audio_effects/effect_downmix.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+/*
+ * USAGE NOTE: Only include this header when _implementing_ a particular
+ * effect. When access to UUID and properties is enough, include the
+ * corresponding header from system/audio_effects/, which doesn't include
+ * hardware/audio_effect.h.
+ *
+ * Only code that immediately calls into HAL or implements an effect
+ * can import hardware/audio_effect.h.
+ */
+
+#ifndef ANDROID_EFFECT_DOWNMIX_H_
+#define ANDROID_EFFECT_DOWNMIX_H_
+
+#include <hardware/audio_effect.h>
+#include <system/audio_effects/effect_downmix.h>
+
+#endif /*ANDROID_EFFECT_DOWNMIX_H_*/
diff --git a/audio/effect/all-versions/legacy/include/audio_effects/effect_environmentalreverb.h b/audio/effect/all-versions/legacy/include/audio_effects/effect_environmentalreverb.h
new file mode 100644
index 0000000..dd474c2
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/audio_effects/effect_environmentalreverb.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+/*
+ * USAGE NOTE: Only include this header when _implementing_ a particular
+ * effect. When access to UUID and properties is enough, include the
+ * corresponding header from system/audio_effects/, which doesn't include
+ * hardware/audio_effect.h.
+ *
+ * Only code that immediately calls into HAL or implements an effect
+ * can import hardware/audio_effect.h.
+ */
+
+#ifndef ANDROID_EFFECT_ENVIRONMENTALREVERB_H_
+#define ANDROID_EFFECT_ENVIRONMENTALREVERB_H_
+
+#include <hardware/audio_effect.h>
+#include <system/audio_effects/effect_environmentalreverb.h>
+
+#endif /*ANDROID_EFFECT_ENVIRONMENTALREVERB_H_*/
diff --git a/audio/effect/all-versions/legacy/include/audio_effects/effect_equalizer.h b/audio/effect/all-versions/legacy/include/audio_effects/effect_equalizer.h
new file mode 100644
index 0000000..3059ec2
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/audio_effects/effect_equalizer.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+/*
+ * USAGE NOTE: Only include this header when _implementing_ a particular
+ * effect. When access to UUID and properties is enough, include the
+ * corresponding header from system/audio_effects/, which doesn't include
+ * hardware/audio_effect.h.
+ *
+ * Only code that immediately calls into HAL or implements an effect
+ * can import hardware/audio_effect.h.
+ */
+
+#ifndef ANDROID_EFFECT_EQUALIZER_H_
+#define ANDROID_EFFECT_EQUALIZER_H_
+
+#include <hardware/audio_effect.h>
+#include <system/audio_effects/effect_equalizer.h>
+
+#endif /*ANDROID_EFFECT_EQUALIZER_H_*/
diff --git a/audio/effect/all-versions/legacy/include/audio_effects/effect_loudnessenhancer.h b/audio/effect/all-versions/legacy/include/audio_effects/effect_loudnessenhancer.h
new file mode 100644
index 0000000..f37ba45
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/audio_effects/effect_loudnessenhancer.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2013 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.
+ */
+
+/*
+ * USAGE NOTE: Only include this header when _implementing_ a particular
+ * effect. When access to UUID and properties is enough, include the
+ * corresponding header from system/audio_effects/, which doesn't include
+ * hardware/audio_effect.h.
+ *
+ * Only code that immediately calls into HAL or implements an effect
+ * can import hardware/audio_effect.h.
+ */
+
+#ifndef ANDROID_EFFECT_LOUDNESS_ENHANCER_H_
+#define ANDROID_EFFECT_LOUDNESS_ENHANCER_H_
+
+#include <hardware/audio_effect.h>
+#include <system/audio_effects/effect_loudnessenhancer.h>
+
+#endif /*ANDROID_EFFECT_LOUDNESS_ENHANCER_H_*/
diff --git a/audio/effect/all-versions/legacy/include/audio_effects/effect_ns.h b/audio/effect/all-versions/legacy/include/audio_effects/effect_ns.h
new file mode 100644
index 0000000..3bd8a41
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/audio_effects/effect_ns.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+/*
+ * USAGE NOTE: Only include this header when _implementing_ a particular
+ * effect. When access to UUID and properties is enough, include the
+ * corresponding header from system/audio_effects/, which doesn't include
+ * hardware/audio_effect.h.
+ *
+ * Only code that immediately calls into HAL or implements an effect
+ * can import hardware/audio_effect.h.
+ */
+
+#ifndef ANDROID_EFFECT_NS_H_
+#define ANDROID_EFFECT_NS_H_
+
+#include <hardware/audio_effect.h>
+#include <system/audio_effects/effect_ns.h>
+
+#endif /*ANDROID_EFFECT_NS_H_*/
diff --git a/audio/effect/all-versions/legacy/include/audio_effects/effect_presetreverb.h b/audio/effect/all-versions/legacy/include/audio_effects/effect_presetreverb.h
new file mode 100644
index 0000000..eac1f5f
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/audio_effects/effect_presetreverb.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+/*
+ * USAGE NOTE: Only include this header when _implementing_ a particular
+ * effect. When access to UUID and properties is enough, include the
+ * corresponding header from system/audio_effects/, which doesn't include
+ * hardware/audio_effect.h.
+ *
+ * Only code that immediately calls into HAL or implements an effect
+ * can import hardware/audio_effect.h.
+ */
+
+#ifndef ANDROID_EFFECT_PRESETREVERB_H_
+#define ANDROID_EFFECT_PRESETREVERB_H_
+
+#include <hardware/audio_effect.h>
+#include <system/audio_effects/effect_presetreverb.h>
+
+#endif /*ANDROID_EFFECT_PRESETREVERB_H_*/
diff --git a/audio/effect/all-versions/legacy/include/audio_effects/effect_virtualizer.h b/audio/effect/all-versions/legacy/include/audio_effects/effect_virtualizer.h
new file mode 100644
index 0000000..aeecfa5
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/audio_effects/effect_virtualizer.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+/*
+ * USAGE NOTE: Only include this header when _implementing_ a particular
+ * effect. When access to UUID and properties is enough, include the
+ * corresponding header from system/audio_effects/, which doesn't include
+ * hardware/audio_effect.h.
+ *
+ * Only code that immediately calls into HAL or implements an effect
+ * can import hardware/audio_effect.h.
+ */
+
+#ifndef ANDROID_EFFECT_VIRTUALIZER_H_
+#define ANDROID_EFFECT_VIRTUALIZER_H_
+
+#include <hardware/audio_effect.h>
+#include <system/audio_effects/effect_virtualizer.h>
+
+#endif /*ANDROID_EFFECT_VIRTUALIZER_H_*/
diff --git a/audio/effect/all-versions/legacy/include/audio_effects/effect_visualizer.h b/audio/effect/all-versions/legacy/include/audio_effects/effect_visualizer.h
new file mode 100644
index 0000000..47217e7
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/audio_effects/effect_visualizer.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+/*
+ * USAGE NOTE: Only include this header when _implementing_ a particular
+ * effect. When access to UUID and properties is enough, include the
+ * corresponding header from system/audio_effects/, which doesn't include
+ * hardware/audio_effect.h.
+ *
+ * Only code that immediately calls into HAL or implements an effect
+ * can import hardware/audio_effect.h.
+ */
+
+#ifndef ANDROID_EFFECT_VISUALIZER_H_
+#define ANDROID_EFFECT_VISUALIZER_H_
+
+#include <hardware/audio_effect.h>
+#include <system/audio_effects/effect_visualizer.h>
+
+#endif /*ANDROID_EFFECT_VISUALIZER_H_*/
diff --git a/audio/effect/all-versions/legacy/include/media/EffectsFactoryApi.h b/audio/effect/all-versions/legacy/include/media/EffectsFactoryApi.h
new file mode 100644
index 0000000..e08fd0b
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/media/EffectsFactoryApi.h
@@ -0,0 +1,188 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+#ifndef ANDROID_EFFECTSFACTORYAPI_H_
+#define ANDROID_EFFECTSFACTORYAPI_H_
+
+#include <cutils/compiler.h>
+#include <errno.h>
+#include <hardware/audio_effect.h>
+#include <stdint.h>
+#include <sys/types.h>
+
+#if __cplusplus
+extern "C" {
+#endif
+
+/////////////////////////////////////////////////
+// Effect factory interface
+/////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Function: EffectQueryNumberEffects
+//
+// Description: Returns the number of different effects in all loaded libraries.
+// Each effect must have a different effect uuid (see
+// effect_descriptor_t). This function together with EffectQueryEffect()
+// is used to enumerate all effects present in all loaded libraries.
+// Each time EffectQueryNumberEffects() is called, the factory must
+// reset the index of the effect descriptor returned by next call to
+// EffectQueryEffect() to restart enumeration from the beginning.
+//
+// Input/Output:
+// pNumEffects: address where the number of effects should be returned.
+//
+// Output:
+// returned value: 0 successful operation.
+// -ENODEV factory failed to initialize
+// -EINVAL invalid pNumEffects
+// *pNumEffects: updated with number of effects in factory
+//
+////////////////////////////////////////////////////////////////////////////////
+ANDROID_API
+int EffectQueryNumberEffects(uint32_t* pNumEffects);
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Function: EffectQueryEffect
+//
+// Description: Returns a descriptor of the next available effect.
+// See effect_descriptor_t for a details on effect descriptor.
+// This function together with EffectQueryNumberEffects() is used to enumerate all
+// effects present in all loaded libraries. The enumeration sequence is:
+// EffectQueryNumberEffects(&num_effects);
+// for (i = 0; i < num_effects; i++)
+// EffectQueryEffect(i,...);
+//
+// Input/Output:
+// pDescriptor: address where to return the effect descriptor.
+//
+// Output:
+// returned value: 0 successful operation.
+// -ENOENT no more effect available
+// -ENODEV factory failed to initialize
+// -EINVAL invalid pDescriptor
+// -ENOSYS effect list has changed since last execution of
+// EffectQueryNumberEffects()
+// *pDescriptor: updated with the effect descriptor.
+//
+////////////////////////////////////////////////////////////////////////////////
+ANDROID_API
+int EffectQueryEffect(uint32_t index, effect_descriptor_t* pDescriptor);
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Function: EffectCreate
+//
+// Description: Creates an effect engine of the specified type and returns an
+// effect control interface on this engine. The function will allocate the
+// resources for an instance of the requested effect engine and return
+// a handle on the effect control interface.
+//
+// Input:
+// pEffectUuid: pointer to the effect uuid.
+// sessionId: audio session to which this effect instance will be attached. All effects
+// created with the same session ID are connected in series and process the same signal
+// stream. Knowing that two effects are part of the same effect chain can help the
+// library implement some kind of optimizations.
+// ioId: identifies the output or input stream this effect is directed to at audio HAL.
+// For future use especially with tunneled HW accelerated effects
+//
+// Input/Output:
+// pHandle: address where to return the effect handle.
+//
+// Output:
+// returned value: 0 successful operation.
+// -ENODEV factory failed to initialize
+// -EINVAL invalid pEffectUuid or pHandle
+// -ENOENT no effect with this uuid found
+// *pHandle: updated with the effect handle.
+//
+////////////////////////////////////////////////////////////////////////////////
+ANDROID_API
+int EffectCreate(const effect_uuid_t* pEffectUuid, int32_t sessionId, int32_t ioId,
+ effect_handle_t* pHandle);
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Function: EffectRelease
+//
+// Description: Releases the effect engine whose handle is given as argument.
+// All resources allocated to this particular instance of the effect are
+// released.
+//
+// Input:
+// handle: handle on the effect interface to be released.
+//
+// Output:
+// returned value: 0 successful operation.
+// -ENODEV factory failed to initialize
+// -EINVAL invalid interface handle
+//
+////////////////////////////////////////////////////////////////////////////////
+ANDROID_API
+int EffectRelease(effect_handle_t handle);
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Function: EffectGetDescriptor
+//
+// Description: Returns the descriptor of the effect which uuid is pointed
+// to by first argument.
+//
+// Input:
+// pEffectUuid: pointer to the effect uuid.
+//
+// Input/Output:
+// pDescriptor: address where to return the effect descriptor.
+//
+// Output:
+// returned value: 0 successful operation.
+// -ENODEV factory failed to initialize
+// -EINVAL invalid pEffectUuid or pDescriptor
+// -ENOENT no effect with this uuid found
+// *pDescriptor: updated with the effect descriptor.
+//
+////////////////////////////////////////////////////////////////////////////////
+ANDROID_API
+int EffectGetDescriptor(const effect_uuid_t* pEffectUuid, effect_descriptor_t* pDescriptor);
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Function: EffectIsNullUuid
+//
+// Description: Helper function to compare effect uuid to EFFECT_UUID_NULL
+//
+// Input:
+// pEffectUuid: pointer to effect uuid to compare to EFFECT_UUID_NULL.
+//
+// Output:
+// returned value: 0 if uuid is different from EFFECT_UUID_NULL.
+// 1 if uuid is equal to EFFECT_UUID_NULL.
+//
+////////////////////////////////////////////////////////////////////////////////
+ANDROID_API
+int EffectIsNullUuid(const effect_uuid_t* pEffectUuid);
+
+ANDROID_API
+int EffectDumpEffects(int fd);
+
+#if __cplusplus
+} // extern "C"
+#endif
+
+#endif /*ANDROID_EFFECTSFACTORYAPI_H_*/
diff --git a/audio/effect/all-versions/legacy/include/system/audio_effects/audio_effects_conf.h b/audio/effect/all-versions/legacy/include/system/audio_effects/audio_effects_conf.h
new file mode 100644
index 0000000..b68a6c2
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/system/audio_effects/audio_effects_conf.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#ifndef ANDROID_AUDIO_EFFECTS_CONF_H
+#define ANDROID_AUDIO_EFFECTS_CONF_H
+
+/////////////////////////////////////////////////
+// Definitions for effects configuration file (audio_effects.conf)
+/////////////////////////////////////////////////
+
+#define AUDIO_EFFECT_DEFAULT_CONFIG_FILE "/system/etc/audio_effects.conf"
+#define AUDIO_EFFECT_VENDOR_CONFIG_FILE "/vendor/etc/audio_effects.conf"
+#define LIBRARIES_TAG "libraries"
+#define PATH_TAG "path"
+
+#define EFFECTS_TAG "effects"
+#define LIBRARY_TAG "library"
+#define UUID_TAG "uuid"
+
+#define PREPROCESSING_TAG "pre_processing"
+#define OUTPUT_SESSION_PROCESSING_TAG "output_session_processing"
+
+#define PARAM_TAG "param"
+#define VALUE_TAG "value"
+#define INT_TAG "int"
+#define SHORT_TAG "short"
+#define FLOAT_TAG "float"
+#define BOOL_TAG "bool"
+#define STRING_TAG "string"
+
+// audio_source_t
+#define MIC_SRC_TAG "mic" // AUDIO_SOURCE_MIC
+#define VOICE_UL_SRC_TAG "voice_uplink" // AUDIO_SOURCE_VOICE_UPLINK
+#define VOICE_DL_SRC_TAG "voice_downlink" // AUDIO_SOURCE_VOICE_DOWNLINK
+#define VOICE_CALL_SRC_TAG "voice_call" // AUDIO_SOURCE_VOICE_CALL
+#define CAMCORDER_SRC_TAG "camcorder" // AUDIO_SOURCE_CAMCORDER
+#define VOICE_REC_SRC_TAG "voice_recognition" // AUDIO_SOURCE_VOICE_RECOGNITION
+#define VOICE_COMM_SRC_TAG "voice_communication" // AUDIO_SOURCE_VOICE_COMMUNICATION
+#define UNPROCESSED_SRC_TAG "unprocessed" // AUDIO_SOURCE_UNPROCESSED
+
+// audio_stream_type_t
+#define AUDIO_STREAM_DEFAULT_TAG "default"
+#define AUDIO_STREAM_VOICE_CALL_TAG "voice_call"
+#define AUDIO_STREAM_SYSTEM_TAG "system"
+#define AUDIO_STREAM_RING_TAG "ring"
+#define AUDIO_STREAM_MUSIC_TAG "music"
+#define AUDIO_STREAM_ALARM_TAG "alarm"
+#define AUDIO_STREAM_NOTIFICATION_TAG "notification"
+#define AUDIO_STREAM_BLUETOOTH_SCO_TAG "bluetooth_sco"
+#define AUDIO_STREAM_ENFORCED_AUDIBLE_TAG "enforced_audible"
+#define AUDIO_STREAM_DTMF_TAG "dtmf"
+#define AUDIO_STREAM_TTS_TAG "tts"
+
+#endif // ANDROID_AUDIO_EFFECTS_CONF_H
diff --git a/audio/effect/all-versions/legacy/include/system/audio_effects/effect_aec.h b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_aec.h
new file mode 100644
index 0000000..9785055
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_aec.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+#ifndef ANDROID_EFFECT_AEC_CORE_H_
+#define ANDROID_EFFECT_AEC_CORE_H_
+
+#include <system/audio_effect.h>
+
+#if __cplusplus
+extern "C" {
+#endif
+
+// The AEC type UUID is not defined by OpenSL ES and has been generated from
+// http://www.itu.int/ITU-T/asn1/uuid.html
+static const effect_uuid_t FX_IID_AEC_ = {
+ 0x7b491460, 0x8d4d, 0x11e0, 0xbd61, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
+const effect_uuid_t* const FX_IID_AEC = &FX_IID_AEC_;
+
+typedef enum {
+ AEC_PARAM_ECHO_DELAY, // echo delay in microseconds
+ AEC_PARAM_PROPERTIES
+} t_aec_params;
+
+// t_equalizer_settings groups all current aec settings for backup and restore.
+typedef struct s_aec_settings { uint32_t echoDelay; } t_aec_settings;
+
+#if __cplusplus
+} // extern "C"
+#endif
+
+#endif /*ANDROID_EFFECT_AEC_CORE_H_*/
diff --git a/audio/effect/all-versions/legacy/include/system/audio_effects/effect_agc.h b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_agc.h
new file mode 100644
index 0000000..319bcd4
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_agc.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+#ifndef ANDROID_EFFECT_AGC_CORE_H_
+#define ANDROID_EFFECT_AGC_CORE_H_
+
+#include <system/audio_effect.h>
+
+#if __cplusplus
+extern "C" {
+#endif
+
+// The AGC type UUID is not defined by OpenSL ES and has been generated from
+// http://www.itu.int/ITU-T/asn1/uuid.html
+static const effect_uuid_t FX_IID_AGC_ = {
+ 0x0a8abfe0, 0x654c, 0x11e0, 0xba26, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
+const effect_uuid_t* const FX_IID_AGC = &FX_IID_AGC_;
+
+typedef enum {
+ AGC_PARAM_TARGET_LEVEL, // target output level in millibel
+ AGC_PARAM_COMP_GAIN, // gain in the compression range in millibel
+ AGC_PARAM_LIMITER_ENA, // enable or disable limiter (boolean)
+ AGC_PARAM_PROPERTIES
+} t_agc_params;
+
+// t_agc_settings groups all current agc settings for backup and restore.
+typedef struct s_agc_settings {
+ int16_t targetLevel;
+ int16_t compGain;
+ bool limiterEnabled;
+} t_agc_settings;
+
+#if __cplusplus
+} // extern "C"
+#endif
+
+#endif /*ANDROID_EFFECT_AGC_CORE_H_*/
diff --git a/audio/effect/all-versions/legacy/include/system/audio_effects/effect_bassboost.h b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_bassboost.h
new file mode 100644
index 0000000..7828d66
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_bassboost.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+#ifndef ANDROID_EFFECT_BASSBOOST_CORE_H_
+#define ANDROID_EFFECT_BASSBOOST_CORE_H_
+
+#include <system/audio_effect.h>
+
+#if __cplusplus
+extern "C" {
+#endif
+
+#ifndef OPENSL_ES_H_
+static const effect_uuid_t SL_IID_BASSBOOST_ = {
+ 0x0634f220, 0xddd4, 0x11db, 0xa0fc, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
+const effect_uuid_t* const SL_IID_BASSBOOST = &SL_IID_BASSBOOST_;
+#endif // OPENSL_ES_H_
+
+/* enumerated parameter settings for BassBoost effect */
+typedef enum { BASSBOOST_PARAM_STRENGTH_SUPPORTED, BASSBOOST_PARAM_STRENGTH } t_bassboost_params;
+
+#if __cplusplus
+} // extern "C"
+#endif
+
+#endif /*ANDROID_EFFECT_BASSBOOST_CORE_H_*/
diff --git a/audio/effect/all-versions/legacy/include/system/audio_effects/effect_downmix.h b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_downmix.h
new file mode 100644
index 0000000..9f02e41
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_downmix.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+#ifndef ANDROID_EFFECT_DOWNMIX_CORE_H_
+#define ANDROID_EFFECT_DOWNMIX_CORE_H_
+
+#include <system/audio_effect.h>
+
+#if __cplusplus
+extern "C" {
+#endif
+
+#define EFFECT_UIID_DOWNMIX__ \
+ { \
+ 0x381e49cc, 0xa858, 0x4aa2, 0x87f6, { 0xe8, 0x38, 0x8e, 0x76, 0x01, 0xb2 } \
+ }
+static const effect_uuid_t EFFECT_UIID_DOWNMIX_ = EFFECT_UIID_DOWNMIX__;
+const effect_uuid_t* const EFFECT_UIID_DOWNMIX = &EFFECT_UIID_DOWNMIX_;
+
+/* enumerated parameter settings for downmix effect */
+typedef enum { DOWNMIX_PARAM_TYPE } downmix_params_t;
+
+typedef enum {
+ DOWNMIX_TYPE_INVALID = -1,
+ // throw away the extra channels
+ DOWNMIX_TYPE_STRIP = 0,
+ // mix the extra channels with FL/FR
+ DOWNMIX_TYPE_FOLD = 1,
+ DOWNMIX_TYPE_CNT,
+ DOWNMIX_TYPE_LAST = DOWNMIX_TYPE_CNT - 1
+} downmix_type_t;
+
+#if __cplusplus
+} // extern "C"
+#endif
+
+#endif /*ANDROID_EFFECT_DOWNMIX_CORE_H_*/
diff --git a/audio/effect/all-versions/legacy/include/system/audio_effects/effect_environmentalreverb.h b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_environmentalreverb.h
new file mode 100644
index 0000000..8caee32
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_environmentalreverb.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+#ifndef ANDROID_EFFECT_ENVIRONMENTALREVERB_CORE_H_
+#define ANDROID_EFFECT_ENVIRONMENTALREVERB_CORE_H_
+
+#include <system/audio_effect.h>
+
+#if __cplusplus
+extern "C" {
+#endif
+
+#ifndef OPENSL_ES_H_
+static const effect_uuid_t SL_IID_ENVIRONMENTALREVERB_ = {
+ 0xc2e5d5f0, 0x94bd, 0x4763, 0x9cac, {0x4e, 0x23, 0x4d, 0x6, 0x83, 0x9e}};
+const effect_uuid_t* const SL_IID_ENVIRONMENTALREVERB = &SL_IID_ENVIRONMENTALREVERB_;
+#endif // OPENSL_ES_H_
+
+/* enumerated parameter settings for environmental reverb effect */
+typedef enum {
+ // Parameters below are as defined in OpenSL ES specification for environmental reverb interface
+ REVERB_PARAM_ROOM_LEVEL, // in millibels, range -6000 to 0
+ REVERB_PARAM_ROOM_HF_LEVEL, // in millibels, range -4000 to 0
+ REVERB_PARAM_DECAY_TIME, // in milliseconds, range 100 to 20000
+ REVERB_PARAM_DECAY_HF_RATIO, // in permilles, range 100 to 1000
+ REVERB_PARAM_REFLECTIONS_LEVEL, // in millibels, range -6000 to 0
+ REVERB_PARAM_REFLECTIONS_DELAY, // in milliseconds, range 0 to 65
+ REVERB_PARAM_REVERB_LEVEL, // in millibels, range -6000 to 0
+ REVERB_PARAM_REVERB_DELAY, // in milliseconds, range 0 to 65
+ REVERB_PARAM_DIFFUSION, // in permilles, range 0 to 1000
+ REVERB_PARAM_DENSITY, // in permilles, range 0 to 1000
+ REVERB_PARAM_PROPERTIES,
+ REVERB_PARAM_BYPASS
+} t_env_reverb_params;
+
+// t_reverb_settings is equal to SLEnvironmentalReverbSettings defined in OpenSL ES specification.
+typedef struct s_reverb_settings {
+ int16_t roomLevel;
+ int16_t roomHFLevel;
+ uint32_t decayTime;
+ int16_t decayHFRatio;
+ int16_t reflectionsLevel;
+ uint32_t reflectionsDelay;
+ int16_t reverbLevel;
+ uint32_t reverbDelay;
+ int16_t diffusion;
+ int16_t density;
+} __attribute__((packed)) t_reverb_settings;
+
+#if __cplusplus
+} // extern "C"
+#endif
+
+#endif /*ANDROID_EFFECT_ENVIRONMENTALREVERB_CORE_H_*/
diff --git a/audio/effect/all-versions/legacy/include/system/audio_effects/effect_equalizer.h b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_equalizer.h
new file mode 100644
index 0000000..83fddcf
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_equalizer.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+#ifndef ANDROID_EFFECT_EQUALIZER_CORE_H_
+#define ANDROID_EFFECT_EQUALIZER_CORE_H_
+
+#include <system/audio_effect.h>
+
+#ifndef OPENSL_ES_H_
+static const effect_uuid_t SL_IID_EQUALIZER_ = {
+ 0x0bed4300, 0xddd6, 0x11db, 0x8f34, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
+const effect_uuid_t* const SL_IID_EQUALIZER = &SL_IID_EQUALIZER_;
+#endif // OPENSL_ES_H_
+
+#if __cplusplus
+extern "C" {
+#endif
+
+/* enumerated parameters for Equalizer effect */
+typedef enum {
+ EQ_PARAM_NUM_BANDS, // Gets the number of frequency bands that the equalizer
+ // supports.
+ EQ_PARAM_LEVEL_RANGE, // Returns the minimum and maximum band levels supported.
+ EQ_PARAM_BAND_LEVEL, // Gets/Sets the gain set for the given equalizer band.
+ EQ_PARAM_CENTER_FREQ, // Gets the center frequency of the given band.
+ EQ_PARAM_BAND_FREQ_RANGE, // Gets the frequency range of the given frequency band.
+ EQ_PARAM_GET_BAND, // Gets the band that has the most effect on the given
+ // frequency.
+ EQ_PARAM_CUR_PRESET, // Gets/Sets the current preset.
+ EQ_PARAM_GET_NUM_OF_PRESETS, // Gets the total number of presets the equalizer supports.
+ EQ_PARAM_GET_PRESET_NAME, // Gets the preset name based on the index.
+ EQ_PARAM_PROPERTIES // Gets/Sets all parameters at a time.
+} t_equalizer_params;
+
+// t_equalizer_settings groups all current equalizer setting for backup and restore.
+typedef struct s_equalizer_settings {
+ uint16_t curPreset;
+ uint16_t numBands;
+ uint16_t bandLevels[];
+} t_equalizer_settings;
+
+#if __cplusplus
+} // extern "C"
+#endif
+
+#endif /*ANDROID_EFFECT_EQUALIZER_CORE_H_*/
diff --git a/audio/effect/all-versions/legacy/include/system/audio_effects/effect_loudnessenhancer.h b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_loudnessenhancer.h
new file mode 100644
index 0000000..5c78013
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_loudnessenhancer.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+#ifndef ANDROID_EFFECT_LOUDNESS_ENHANCER_CORE_H_
+#define ANDROID_EFFECT_LOUDNESS_ENHANCER_CORE_H_
+
+#include <system/audio_effect.h>
+
+#if __cplusplus
+extern "C" {
+#endif
+
+// this effect is not defined in OpenSL ES as one of the standard effects
+static const effect_uuid_t FX_IID_LOUDNESS_ENHANCER_ = {
+ 0xfe3199be, 0xaed0, 0x413f, 0x87bb, {0x11, 0x26, 0x0e, 0xb6, 0x3c, 0xf1}};
+const effect_uuid_t* const FX_IID_LOUDNESS_ENHANCER = &FX_IID_LOUDNESS_ENHANCER_;
+
+#define LOUDNESS_ENHANCER_DEFAULT_TARGET_GAIN_MB 0 // mB
+
+// enumerated parameters for DRC effect
+// to keep in sync with frameworks/base/media/java/android/media/audiofx/LoudnessEnhancer.java
+typedef enum {
+ LOUDNESS_ENHANCER_PARAM_TARGET_GAIN_MB = 0, // target gain expressed in mB
+} t_level_monitor_params;
+
+#if __cplusplus
+} // extern "C"
+#endif
+
+#endif /*ANDROID_EFFECT_LOUDNESS_ENHANCER_CORE_H_*/
diff --git a/audio/effect/all-versions/legacy/include/system/audio_effects/effect_ns.h b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_ns.h
new file mode 100644
index 0000000..8b9ac76
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_ns.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+#ifndef ANDROID_EFFECT_NS_CORE_H_
+#define ANDROID_EFFECT_NS_CORE_H_
+
+#include <system/audio_effect.h>
+
+#if __cplusplus
+extern "C" {
+#endif
+
+// The NS type UUID is not defined by OpenSL ES and has been generated from
+// http://www.itu.int/ITU-T/asn1/uuid.html
+static const effect_uuid_t FX_IID_NS_ = {
+ 0x58b4b260, 0x8e06, 0x11e0, 0xaa8e, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
+const effect_uuid_t* const FX_IID_NS = &FX_IID_NS_;
+
+typedef enum {
+ NS_PARAM_LEVEL, // noise suppression level (t_ns_level)
+ NS_PARAM_PROPERTIES,
+ NS_PARAM_TYPE // noise suppression type (t_ns_type)
+} t_ns_params;
+
+// noise suppression level
+typedef enum { NS_LEVEL_LOW, NS_LEVEL_MEDIUM, NS_LEVEL_HIGH } t_ns_level;
+
+// noise suppression type
+typedef enum { NS_TYPE_SINGLE_CHANNEL, NS_TYPE_MULTI_CHANNEL } t_ns_type;
+
+// s_ns_settings groups all current ns settings for backup and restore.
+typedef struct s_ns_settings {
+ uint32_t level;
+ uint32_t type;
+} t_ns_settings;
+
+#if __cplusplus
+} // extern "C"
+#endif
+
+#endif /*ANDROID_EFFECT_NS_CORE_H_*/
diff --git a/audio/effect/all-versions/legacy/include/system/audio_effects/effect_presetreverb.h b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_presetreverb.h
new file mode 100644
index 0000000..6804fed
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_presetreverb.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+#ifndef ANDROID_EFFECT_PRESETREVERB_CORE_H_
+#define ANDROID_EFFECT_PRESETREVERB_CORE_H_
+
+#include <system/audio_effect.h>
+
+#if __cplusplus
+extern "C" {
+#endif
+
+#ifndef OPENSL_ES_H_
+static const effect_uuid_t SL_IID_PRESETREVERB_ = {
+ 0x47382d60, 0xddd8, 0x11db, 0xbf3a, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
+const effect_uuid_t* const SL_IID_PRESETREVERB = &SL_IID_PRESETREVERB_;
+#endif // OPENSL_ES_H_
+
+/* enumerated parameter settings for preset reverb effect */
+typedef enum { REVERB_PARAM_PRESET } t_preset_reverb_params;
+
+typedef enum {
+ REVERB_PRESET_NONE,
+ REVERB_PRESET_SMALLROOM,
+ REVERB_PRESET_MEDIUMROOM,
+ REVERB_PRESET_LARGEROOM,
+ REVERB_PRESET_MEDIUMHALL,
+ REVERB_PRESET_LARGEHALL,
+ REVERB_PRESET_PLATE,
+ REVERB_PRESET_LAST = REVERB_PRESET_PLATE
+} t_reverb_presets;
+
+#if __cplusplus
+} // extern "C"
+#endif
+
+#endif /*ANDROID_EFFECT_PRESETREVERB_CORE_H_*/
diff --git a/audio/effect/all-versions/legacy/include/system/audio_effects/effect_virtualizer.h b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_virtualizer.h
new file mode 100644
index 0000000..a6a31ec
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_virtualizer.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+#ifndef ANDROID_EFFECT_VIRTUALIZER_CORE_H_
+#define ANDROID_EFFECT_VIRTUALIZER_CORE_H_
+
+#include <system/audio_effect.h>
+
+#if __cplusplus
+extern "C" {
+#endif
+
+#ifndef OPENSL_ES_H_
+static const effect_uuid_t SL_IID_VIRTUALIZER_ = {
+ 0x37cc2c00, 0xdddd, 0x11db, 0x8577, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
+const effect_uuid_t* const SL_IID_VIRTUALIZER = &SL_IID_VIRTUALIZER_;
+#endif // OPENSL_ES_H_
+
+/* enumerated parameter settings for virtualizer effect */
+/* to keep in sync with frameworks/base/media/java/android/media/audiofx/Virtualizer.java */
+typedef enum {
+ VIRTUALIZER_PARAM_STRENGTH_SUPPORTED,
+ VIRTUALIZER_PARAM_STRENGTH,
+ // used with EFFECT_CMD_GET_PARAM
+ // format:
+ // parameters int32_t VIRTUALIZER_PARAM_VIRTUAL_SPEAKER_ANGLES
+ // audio_channel_mask_t input channel mask
+ // audio_devices_t audio output device
+ // output int32_t* an array of length 3 * the number of channels in the mask
+ // where entries are the succession of the channel mask
+ // of each speaker (i.e. a single bit is selected in the
+ // channel mask) followed by the azimuth and the
+ // elevation angles.
+ // status int -EINVAL if configuration is not supported or invalid or not forcing
+ // 0 if configuration is supported and the mode is forced
+ // notes:
+ // - all angles are expressed in degrees and are relative to the listener,
+ // - for azimuth: 0 is the direction the listener faces, 180 is behind the listener, and
+ // -90 is to her/his left,
+ // - for elevation: 0 is the horizontal plane, +90 is above the listener, -90 is below.
+ VIRTUALIZER_PARAM_VIRTUAL_SPEAKER_ANGLES,
+ // used with EFFECT_CMD_SET_PARAM
+ // format:
+ // parameters int32_t VIRTUALIZER_PARAM_FORCE_VIRTUALIZATION_MODE
+ // audio_devices_t audio output device
+ // status int -EINVAL if the device is not supported or invalid
+ // 0 if the device is supported and the mode is forced, or forcing
+ // was disabled for the AUDIO_DEVICE_NONE audio device.
+ VIRTUALIZER_PARAM_FORCE_VIRTUALIZATION_MODE,
+ // used with EFFECT_CMD_GET_PARAM
+ // format:
+ // parameters int32_t VIRTUALIZER_PARAM_VIRTUALIZATION_MODE
+ // output audio_device_t audio device reflecting the current virtualization mode,
+ // AUDIO_DEVICE_NONE when not virtualizing
+ // status int -EINVAL if an error occurred
+ // 0 if the output value is successfully retrieved
+ VIRTUALIZER_PARAM_VIRTUALIZATION_MODE
+} t_virtualizer_params;
+
+#if __cplusplus
+} // extern "C"
+#endif
+
+#endif /*ANDROID_EFFECT_VIRTUALIZER_CORE_H_*/
diff --git a/audio/effect/all-versions/legacy/include/system/audio_effects/effect_visualizer.h b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_visualizer.h
new file mode 100644
index 0000000..cc78e15
--- /dev/null
+++ b/audio/effect/all-versions/legacy/include/system/audio_effects/effect_visualizer.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+#ifndef ANDROID_EFFECT_VISUALIZER_CORE_H_
+#define ANDROID_EFFECT_VISUALIZER_CORE_H_
+
+#include <system/audio_effect.h>
+
+#if __cplusplus
+extern "C" {
+#endif
+
+#ifndef OPENSL_ES_H_
+static const effect_uuid_t SL_IID_VISUALIZATION_ = {
+ 0xe46b26a0, 0xdddd, 0x11db, 0x8afd, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
+const effect_uuid_t* const SL_IID_VISUALIZATION = &SL_IID_VISUALIZATION_;
+#endif // OPENSL_ES_H_
+
+#define VISUALIZER_CAPTURE_SIZE_MAX 1024 // maximum capture size in samples
+#define VISUALIZER_CAPTURE_SIZE_MIN 128 // minimum capture size in samples
+
+// to keep in sync with frameworks/base/media/java/android/media/audiofx/Visualizer.java
+#define VISUALIZER_SCALING_MODE_NORMALIZED 0
+#define VISUALIZER_SCALING_MODE_AS_PLAYED 1
+
+#define MEASUREMENT_MODE_NONE 0x0
+#define MEASUREMENT_MODE_PEAK_RMS 0x1
+
+#define MEASUREMENT_IDX_PEAK 0
+#define MEASUREMENT_IDX_RMS 1
+#define MEASUREMENT_COUNT 2
+
+/* enumerated parameters for Visualizer effect */
+typedef enum {
+ VISUALIZER_PARAM_CAPTURE_SIZE, // Sets the number PCM samples in the capture.
+ VISUALIZER_PARAM_SCALING_MODE, // Sets the way the captured data is scaled
+ VISUALIZER_PARAM_LATENCY, // Informs the visualizer about the downstream latency
+ VISUALIZER_PARAM_MEASUREMENT_MODE, // Sets which measurements are to be made
+} t_visualizer_params;
+
+/* commands */
+typedef enum {
+ VISUALIZER_CMD_CAPTURE = EFFECT_CMD_FIRST_PROPRIETARY, // Gets the latest PCM capture.
+ VISUALIZER_CMD_MEASURE, // Gets the current measurements
+} t_visualizer_cmds;
+
+// VISUALIZER_CMD_CAPTURE retrieves the latest PCM snapshot captured by the visualizer engine.
+// It returns the number of samples specified by VISUALIZER_PARAM_CAPTURE_SIZE
+// in 8 bit unsigned format (0 = 0x80)
+
+// VISUALIZER_CMD_MEASURE retrieves the lastest measurements as int32_t saved in the
+// MEASUREMENT_IDX_* array index order.
+
+#if __cplusplus
+} // extern "C"
+#endif
+
+#endif /*ANDROID_EFFECT_VISUALIZER_CORE_H_*/