Skip to content

Commit

Permalink
Update audio effects xml
Browse files Browse the repository at this point in the history
This patch adds updated effects xml, which includes
aidl libraries that are needed for applying audio
effects.

Tracked-On: OAM-127080
Tracked-On: OAM-127135
Tracked-On: OAM-126151
Signed-off-by: padmashree mandri <[email protected]>
  • Loading branch information
padmashree9110 authored and sysopenci committed Nov 19, 2024
1 parent d9eb677 commit 964300e
Showing 1 changed file with 85 additions and 43 deletions.
128 changes: 85 additions & 43 deletions groups/audio/project-celadon/default/effect/audio_effects_config.xml
Original file line number Diff line number Diff line change
@@ -1,73 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<audio_effects_conf version="2.0" xmlns="http://schemas.android.com/audio/audio_effects_conf/v2_0">
<!-- List of effect libraries to load.
Each library element must contain a "name" attribute and a "path" attribute giving the
name of a library .so file in /vendor/lib/soundfx on the target
<!-- Overview.
This example config file was copy from existing one: frameworks/av/media/libeffects/data/
audio_effects.xml, with effect library names updated to AIDL libraries we currently have.
All "library" attributes in "effect" element must must match a "library" element with the
same value of the "name" attribute.
All "effect" attributes in "preprocess" and "postprocess" element must match an "effect"
element with the same value of the "name" attribute.
If offloadable effects are present, the AOSP library libeffectproxy.so must be listed as
well as one library for the SW implementation and one library for the DSP implementation:
<library name="proxy" path="libeffectproxy.so"/>
<library name="some_fx_sw" path="lib_some_fx_sw.so"/>
<library name="some_fx_hw" path="lib_some_fx_hw.so"/>
AIDL EffectFactory are relying on the "name" attribute in "effect" element to identify the
effect type, so it's necessary to have the mapping from name to effect type UUID. Make
sure to either use existing effect name as key of
::android::hardware::audio::effect::kUuidNameTypeMap, or add a new {name, typeUUID} map
item to the kUuidNameTypeMap.
Existing audio_effects.xml should working without any change as long as:
1. "path" attribute of "library" element matches with the actual effect library name.
2. "name" attribute of "effect" and "effectProxy" element correctly added as key of
kUuidNameTypeMap, with value matches Identity.type in Descriptor.aidl.
3. "uuid" attribute of "effect" element matches Identity.uuid in Descriptor.aidl.
4. "uuid" attribute of "effectProxy" element matches Identity.proxy in Descriptor.aidl.
-->

If the audio HAL implements support for AOSP software audio pre-processing effects,
the following library must be added:
<library name="pre_processing" path="libaudiopreprocessing.so"/>
<!-- List of effect libraries to load.
Each library element must contain a "name" attribute and a "path" attribute giving the
name of a library .so file on the target device.
-->
<libraries>
<library name="bundle" path="libbundlewrapper.so"/>
<library name="reverb" path="libreverbwrapper.so"/>
<library name="visualizer" path="libvisualizer.so"/>
<library name="downmix" path="libdownmix.so"/>
<library name="loudness_enhancer" path="libldnhncr.so"/>
<library name="dynamics_processing" path="libdynproc.so"/>
<library name="aecsw" path="libaecsw.so"/>
<library name="agc1sw" path="libagc1sw.so"/>
<library name="agc2sw" path="libagc2sw.so"/>
<library name="bassboostsw" path="libbassboostsw.so"/>
<library name="bundle" path="libbundleaidl.so"/>
<library name="downmix" path="libdownmixaidl.so"/>
<library name="dynamics_processing" path="libdynamicsprocessingaidl.so"/>
<library name="equalizersw" path="libequalizersw.so"/>
<library name="haptic_generator" path="libhapticgeneratoraidl.so"/>
<library name="loudness_enhancer" path="libloudnessenhanceraidl.so"/>
<library name="nssw" path="libnssw.so"/>
<library name="env_reverbsw" path="libenvreverbsw.so"/>
<library name="pre_processing" path="libpreprocessingaidl.so"/>
<library name="preset_reverbsw" path="libpresetreverbsw.so"/>
<library name="reverb" path="libreverbaidl.so"/>
<library name="virtualizersw" path="libvirtualizersw.so"/>
<library name="visualizer" path="libvisualizeraidl.so"/>
<library name="volumesw" path="libvolumesw.so"/>
<library name="extensioneffect" path="libextensioneffect.so"/>
<library name="spatializersw" path="libspatializersw.so"/>
</libraries>

<!-- list of effects to load.
Each "effect" element must contain a "name", "library" and a "uuid" attribute.
The value of the "library" element must correspond to the name of one library element in
Each "effect" element must contain a "name", "library" and a "uuid" attribute, an optional
"type" attribute can be used to add any customized effect type.
The value of the "library" attribute must correspond to the name of one library element in
the "libraries" element.
The "name" attribute is indicative, only the value of the "uuid" attribute designates
the effect.
The uuid is the implementation specific UUID as specified by the effect vendor. This is not
the generic effect type UUID.
The "name" attribute used to specific effect type, and should be mapping to a key of
aidl::android::hardware::audio::effect::kUuidNameTypeMap.
The "uuid" attribute is the implementation specific UUID as specified by the effect vendor.
Offloadable effects are described by an "effectProxy" element which contains one "libsw"
element containing the "uuid" and "library" for the SW implementation and one "libhw"
element containing the "uuid" and "library" for the DSP implementation.
The "uuid" value for the "effectProxy" element must be unique and will override the default
uuid in the AOSP proxy effect implementation.
Effect proxy can be supported with "effectProxy" element, each sub-element should contain
"library" and "uuid" attribute, all other attributes were ignored. Framework side use
result of IFactory.queryEffects() to decide which effect implementation should be part of
proxy and which not.
If the audio HAL implements support for AOSP software audio pre-processing effects,
the following effects can be added:
<effect name="agc" library="pre_processing" uuid="aa8130e0-66fc-11e0-bad0-0002a5d5c51b"/>
<effect name="aec" library="pre_processing" uuid="bb392ec0-8d4d-11e0-a896-0002a5d5c51b"/>
<effect name="ns" library="pre_processing" uuid="c06c8400-8e06-11e0-9cb6-0002a5d5c51b"/>
Only "name", "library", "uuid", and "type" attributes in "effects" element are meaningful
and parsed out by EffectConfig class, all other attributes are ignored.
Only "name" and "uuid" attributes in "effectProxy" element are meaningful and parsed out
by EffectConfig class, all other attributes are ignored.
-->

<effects>
<effect name="automatic_gain_control_v2" library="pre_processing" uuid="89f38e65-d4d2-4d64-ad0e-2b3e799ea886"/>
<effect name="bassboost" library="bundle" uuid="8631f300-72e2-11df-b57e-0002a5d5c51b"/>
<effect name="virtualizer" library="bundle" uuid="1d4033c0-8557-11df-9f2d-0002a5d5c51b"/>
<effect name="equalizer" library="bundle" uuid="ce772f20-847d-11df-bb17-0002a5d5c51b"/>
<effect name="volume" library="bundle" uuid="119341a0-8469-11df-81f9-0002a5d5c51b"/>
<effect name="downmix" library="downmix" uuid="93f04452-e4fe-41cc-91f9-e475b6d1d69f"/>
<effect name="dynamics_processing" library="dynamics_processing" uuid="e0e6539b-1781-7261-676f-6d7573696340"/>
<effect name="haptic_generator" library="haptic_generator" uuid="97c4acd1-8b82-4f2f-832e-c2fe5d7a9931"/>
<effect name="loudness_enhancer" library="loudness_enhancer" uuid="fa415329-2034-4bea-b5dc-5b381c8d1e2c"/>
<effect name="reverb_env_aux" library="reverb" uuid="4a387fc0-8ab3-11df-8bad-0002a5d5c51b"/>
<effect name="reverb_env_ins" library="reverb" uuid="c7a511a0-a3bb-11df-860e-0002a5d5c51b"/>
<effect name="reverb_pre_aux" library="reverb" uuid="f29a1400-a3bb-11df-8ddc-0002a5d5c51b"/>
<effect name="reverb_pre_ins" library="reverb" uuid="172cdf00-a3bc-11df-a72f-0002a5d5c51b"/>
<effect name="virtualizer" library="bundle" uuid="1d4033c0-8557-11df-9f2d-0002a5d5c51b"/>
<effect name="visualizer" library="visualizer" uuid="d069d9e0-8329-11df-9168-0002a5d5c51b"/>
<effect name="downmix" library="downmix" uuid="93f04452-e4fe-41cc-91f9-e475b6d1d69f"/>
<effect name="loudness_enhancer" library="loudness_enhancer" uuid="fa415329-2034-4bea-b5dc-5b381c8d1e2c"/>
<effect name="dynamics_processing" library="dynamics_processing" uuid="e0e6539b-1781-7261-676f-6d7573696340"/>
<effect name="volume" library="bundle" uuid="119341a0-8469-11df-81f9-0002a5d5c51b"/>
<effect name="equalizer" library="bundle" uuid="ce772f20-847d-11df-bb17-0002a5d5c51b"/>
<effect name="extension_effect" library="extensioneffect" uuid="fa81dd00-588b-11ed-9b6a-0242ac120002" type="fa81de0e-588b-11ed-9b6a-0242ac120002"/>
<effect name="acoustic_echo_canceler" library="pre_processing" uuid="bb392ec0-8d4d-11e0-a896-0002a5d5c51b"/>
<effect name="noise_suppression" library="pre_processing" uuid="c06c8400-8e06-11e0-9cb6-0002a5d5c51b"/>
<effect name="spatializer" library="spatializersw" uuid="fa81a880-588b-11ed-9b6a-0242ac120002"/>
</effects>

<preprocess>
<stream type="voice_communication">
<apply effect="acoustic_echo_canceler"/>
<apply effect="noise_suppression"/>
</stream>
</preprocess>

<!-- Audio pre processor configurations.
The pre processor configuration is described in a "preprocess" element and consists in a
list of elements each describing pre processor settings for a given use case or "stream".
Each stream element has a "type" attribute corresponding to the input source used.
Valid types are:
"mic", "camcorder", "voice_recognition", "voice_communication"
Valid types are these defined in system/hardware/interfaces/media/aidl/android/media/audio/
common/AudioSource.aidl.
Each "stream" element contains a list of "apply" elements indicating one effect to apply.
The effect to apply is designated by its name in the "effects" elements.
If there are more than one effect apply to one stream, the audio framework will apply them
in the same equence as they listed in "stream" element.
<preprocess>
<stream type="voice_communication">
Expand All @@ -81,10 +121,12 @@
The post processor configuration is described in a "postprocess" element and consists in a
list of elements each describing post processor settings for a given use case or "stream".
Each stream element has a "type" attribute corresponding to the stream type used.
Valid types are:
"music", "ring", "alarm", "notification", "voice_call"
Valid types are these defined in system/hardware/interfaces/media/aidl/android/media/audio/
common/AudioStreamType.aidl.
Each "stream" element contains a list of "apply" elements indicating one effect to apply.
The effect to apply is designated by its name in the "effects" elements.
If there are more than one effect apply to one stream, the audio framework will apply them
in the same equence as they listed in "stream" element.
<postprocess>
<stream type="music">
Expand Down

0 comments on commit 964300e

Please sign in to comment.