Shunkai Yao | 60b34b7 | 2022-11-10 17:16:50 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <audio_effects_conf version="2.0" xmlns="http://schemas.android.com/audio/audio_effects_conf/v2_0"> |
| 3 | <!-- Overview. |
| 4 | This example config file was copy from existing one: frameworks/av/media/libeffects/data/ |
| 5 | audio_effects.xml, with effect library names updated to AIDL libraries we currently have. |
| 6 | |
| 7 | All "library" attributes in "effect" element must must match a "library" element with the |
| 8 | same value of the "name" attribute. |
| 9 | All "effect" attributes in "preprocess" and "postprocess" element must match an "effect" |
| 10 | element with the same value of the "name" attribute. |
| 11 | |
| 12 | AIDL EffectFactory are relying on the "name" attribute in "effect" element to identify the |
| 13 | effect type, so it's necessary to have the mapping from name to effect type UUID. Make |
| 14 | sure to either use existing effect name as key of |
| 15 | ::android::hardware::audio::effect::kUuidNameTypeMap, or add a new {name, typeUUID} map |
| 16 | item to the kUuidNameTypeMap. |
| 17 | |
| 18 | Existing audio_effects.xml should working without any change as long as: |
| 19 | 1. "path" attribute of "library" element matches with the actual effect library name. |
| 20 | 2. "name" attribute of "effect" and "effectProxy" element correctly added as key of |
| 21 | kUuidNameTypeMap, with value matches Identity.type in Descriptor.aidl. |
| 22 | 3. "uuid" attribute of "effect" element matches Identity.uuid in Descriptor.aidl. |
| 23 | 4. "uuid" attribute of "effectProxy" element matches Identity.proxy in Descriptor.aidl. |
| 24 | --> |
| 25 | |
| 26 | <!-- List of effect libraries to load. |
| 27 | Each library element must contain a "name" attribute and a "path" attribute giving the |
| 28 | name of a library .so file on the target device. |
| 29 | --> |
| 30 | <libraries> |
Shunkai Yao | bd862b8 | 2022-12-20 00:11:41 +0000 | [diff] [blame] | 31 | <library name="aecsw" path="libaecsw.so"/> |
Shraddha Basantwani | cac2e68 | 2023-02-15 18:03:58 +0530 | [diff] [blame^] | 32 | <library name="agc1sw" path="libagc1sw.so"/> |
Shraddha Basantwani | 84ea32e | 2023-02-01 16:22:37 +0530 | [diff] [blame] | 33 | <library name="agc2sw" path="libagc2sw.so"/> |
Shunkai Yao | 60b34b7 | 2022-11-10 17:16:50 +0000 | [diff] [blame] | 34 | <library name="bassboostsw" path="libbassboostsw.so"/> |
| 35 | <library name="bundle" path="libbundleaidl.so"/> |
Shraddha Basantwani | 4ff8698 | 2022-12-13 16:31:49 +0530 | [diff] [blame] | 36 | <library name="downmix" path="libdownmixaidl.so"/> |
Ram Mohan | e4064ce | 2022-12-20 18:05:14 +0530 | [diff] [blame] | 37 | <library name="dynamics_processing" path="libdynamicsprocessingaidl.so"/> |
Shunkai Yao | 60b34b7 | 2022-11-10 17:16:50 +0000 | [diff] [blame] | 38 | <library name="equalizersw" path="libequalizersw.so"/> |
Shraddha Basantwani | ae7dde5 | 2022-12-18 15:01:14 +0530 | [diff] [blame] | 39 | <library name="haptic_generator" path="libhapticgeneratoraidl.so"/> |
Shraddha Basantwani | 22834ea | 2022-12-08 16:09:05 +0530 | [diff] [blame] | 40 | <library name="loudness_enhancer" path="libloudnessenhanceraidl.so"/> |
Shunkai Yao | bd862b8 | 2022-12-20 00:11:41 +0000 | [diff] [blame] | 41 | <library name="nssw" path="libnssw.so"/> |
Shunkai Yao | 812d5b4 | 2022-11-16 18:08:50 +0000 | [diff] [blame] | 42 | <library name="env_reverbsw" path="libenvreverbsw.so"/> |
| 43 | <library name="preset_reverbsw" path="libpresetreverbsw.so"/> |
Shraddha Basantwani | b83ec07 | 2022-12-29 19:43:38 +0530 | [diff] [blame] | 44 | <library name="reverb" path="libreverbaidl.so"/> |
Shunkai Yao | 60b34b7 | 2022-11-10 17:16:50 +0000 | [diff] [blame] | 45 | <library name="virtualizersw" path="libvirtualizersw.so"/> |
Shunkai Yao | e39cd36 | 2022-12-22 00:23:34 +0000 | [diff] [blame] | 46 | <library name="visualizer" path="libvisualizeraidl.so"/> |
Shunkai Yao | 60b34b7 | 2022-11-10 17:16:50 +0000 | [diff] [blame] | 47 | <library name="volumesw" path="libvolumesw.so"/> |
| 48 | </libraries> |
| 49 | |
| 50 | <!-- list of effects to load. |
| 51 | Each "effect" element must contain a "name", "library" and a "uuid" attribute. |
| 52 | The value of the "library" attribute must correspond to the name of one library element in |
| 53 | the "libraries" element. |
| 54 | The "name" attribute used to specific effect type, and should be mapping to a key of |
| 55 | aidl::android::hardware::audio::effect::kUuidNameTypeMap. |
| 56 | The "uuid" attribute is the implementation specific UUID as specified by the effect vendor. |
| 57 | |
| 58 | Effect proxy can be supported with "effectProxy" element, each sub-element should contain |
| 59 | "library" and "uuid" attribute, all other attributes were ignored. Framework side use |
| 60 | result of IFactory.queryEffects() to decide which effect implementation should be part of |
| 61 | proxy and which not. |
| 62 | |
| 63 | Only "name", "library", and "uuid" attributes in "effects" element are meaningful and |
| 64 | parsed out by EffectConfig class, all other attributes are ignored. |
| 65 | Only "name" and "uuid" attributes in "effectProxy" element are meaningful and parsed out |
| 66 | by EffectConfig class, all other attributes are ignored. |
| 67 | --> |
| 68 | |
| 69 | <effects> |
Shunkai Yao | bd862b8 | 2022-12-20 00:11:41 +0000 | [diff] [blame] | 70 | <effect name="acoustic_echo_canceler" library="aecsw" uuid="bb392ec0-8d4d-11e0-a896-0002a5d5c51b"/> |
Shraddha Basantwani | cac2e68 | 2023-02-15 18:03:58 +0530 | [diff] [blame^] | 71 | <effect name="automatic_gain_control_v1" library="agc1sw" uuid="aa8130e0-66fc-11e0-bad0-0002a5d5c51b"/> |
Shraddha Basantwani | 84ea32e | 2023-02-01 16:22:37 +0530 | [diff] [blame] | 72 | <effect name="automatic_gain_control_v2" library="agc2sw" uuid="89f38e65-d4d2-4d64-ad0e-2b3e799ea886"/> |
Shraddha Basantwani | 3a2fb03 | 2022-11-22 11:04:35 +0530 | [diff] [blame] | 73 | <effectProxy name="bassboost" uuid="14804144-a5ee-4d24-aa88-0002a5d5c51b"> |
| 74 | <libsw library="bassboostsw" uuid="fa8181f2-588b-11ed-9b6a-0242ac120002"/> |
| 75 | <libsw library="bundle" uuid="8631f300-72e2-11df-b57e-0002a5d5c51b"/> |
| 76 | </effectProxy> |
Shraddha Basantwani | 4ff8698 | 2022-12-13 16:31:49 +0530 | [diff] [blame] | 77 | <effect name="downmix" library="downmix" uuid="93f04452-e4fe-41cc-91f9-e475b6d1d69f"/> |
Ram Mohan | e4064ce | 2022-12-20 18:05:14 +0530 | [diff] [blame] | 78 | <effect name="dynamics_processing" library="dynamics_processing" uuid="e0e6539b-1781-7261-676f-6d7573696340"/> |
Shraddha Basantwani | ae7dde5 | 2022-12-18 15:01:14 +0530 | [diff] [blame] | 79 | <effect name="haptic_generator" library="haptic_generator" uuid="97c4acd1-8b82-4f2f-832e-c2fe5d7a9931"/> |
Shraddha Basantwani | 22834ea | 2022-12-08 16:09:05 +0530 | [diff] [blame] | 80 | <effect name="loudness_enhancer" library="loudness_enhancer" uuid="fa415329-2034-4bea-b5dc-5b381c8d1e2c"/> |
Shunkai Yao | 812d5b4 | 2022-11-16 18:08:50 +0000 | [diff] [blame] | 81 | <effect name="env_reverb" library="env_reverbsw" uuid="fa819886-588b-11ed-9b6a-0242ac120002"/> |
Shunkai Yao | bd862b8 | 2022-12-20 00:11:41 +0000 | [diff] [blame] | 82 | <effect name="noise_suppression" library="nssw" uuid="c06c8400-8e06-11e0-9cb6-0002a5d5c51b"/> |
Shunkai Yao | 812d5b4 | 2022-11-16 18:08:50 +0000 | [diff] [blame] | 83 | <effect name="preset_reverb" library="preset_reverbsw" uuid="fa8199c6-588b-11ed-9b6a-0242ac120002"/> |
Shraddha Basantwani | b83ec07 | 2022-12-29 19:43:38 +0530 | [diff] [blame] | 84 | <effect name="reverb_env_aux" library="reverb" uuid="4a387fc0-8ab3-11df-8bad-0002a5d5c51b"/> |
| 85 | <effect name="reverb_env_ins" library="reverb" uuid="c7a511a0-a3bb-11df-860e-0002a5d5c51b"/> |
| 86 | <effect name="reverb_pre_aux" library="reverb" uuid="f29a1400-a3bb-11df-8ddc-0002a5d5c51b"/> |
| 87 | <effect name="reverb_pre_ins" library="reverb" uuid="172cdf00-a3bc-11df-a72f-0002a5d5c51b"/> |
Sham Rathod | 5fd232f | 2022-12-08 13:56:38 +0530 | [diff] [blame] | 88 | <effectProxy name="virtualizer" uuid="d3467faa-acc7-4d34-acaf-0002a5d5c51b"> |
| 89 | <libsw library="virtualizersw" uuid="fa819d86-588b-11ed-9b6a-0242ac120002"/> |
| 90 | <libsw library="bundle" uuid="1d4033c0-8557-11df-9f2d-0002a5d5c51b"/> |
| 91 | </effectProxy> |
Shunkai Yao | e39cd36 | 2022-12-22 00:23:34 +0000 | [diff] [blame] | 92 | <effect name="visualizer" library="visualizer" uuid="d069d9e0-8329-11df-9168-0002a5d5c51b"/> |
Sham Rathod | 51d16c6 | 2022-12-19 17:21:59 +0530 | [diff] [blame] | 93 | <effect name="volume" library="bundle" uuid="119341a0-8469-11df-81f9-0002a5d5c51b"/> |
Shunkai Yao | 812d5b4 | 2022-11-16 18:08:50 +0000 | [diff] [blame] | 94 | <effectProxy name="equalizer" uuid="c8e70ecd-48ca-456e-8a4f-0002a5d5c51b"> |
Shunkai Yao | 60b34b7 | 2022-11-10 17:16:50 +0000 | [diff] [blame] | 95 | <libsw library="equalizersw" uuid="0bed4300-847d-11df-bb17-0002a5d5c51b"/> |
| 96 | <libsw library="bundle" uuid="ce772f20-847d-11df-bb17-0002a5d5c51b"/> |
| 97 | </effectProxy> |
| 98 | </effects> |
| 99 | |
| 100 | <!-- Audio pre processor configurations. |
| 101 | The pre processor configuration is described in a "preprocess" element and consists in a |
| 102 | list of elements each describing pre processor settings for a given use case or "stream". |
| 103 | Each stream element has a "type" attribute corresponding to the input source used. |
| 104 | Valid types are these defined in system/hardware/interfaces/media/aidl/android/media/audio/ |
| 105 | common/AudioSource.aidl. |
| 106 | Each "stream" element contains a list of "apply" elements indicating one effect to apply. |
| 107 | The effect to apply is designated by its name in the "effects" elements. |
| 108 | If there are more than one effect apply to one stream, the audio framework will apply them |
| 109 | in the same equence as they listed in "stream" element. |
| 110 | |
| 111 | <preprocess> |
| 112 | <stream type="voice_communication"> |
| 113 | <apply effect="aec"/> |
| 114 | <apply effect="ns"/> |
| 115 | </stream> |
| 116 | </preprocess> |
| 117 | --> |
| 118 | |
| 119 | <!-- Audio post processor configurations. |
| 120 | The post processor configuration is described in a "postprocess" element and consists in a |
| 121 | list of elements each describing post processor settings for a given use case or "stream". |
| 122 | Each stream element has a "type" attribute corresponding to the stream type used. |
| 123 | Valid types are these defined in system/hardware/interfaces/media/aidl/android/media/audio/ |
| 124 | common/AudioStreamType.aidl. |
| 125 | Each "stream" element contains a list of "apply" elements indicating one effect to apply. |
| 126 | The effect to apply is designated by its name in the "effects" elements. |
| 127 | If there are more than one effect apply to one stream, the audio framework will apply them |
| 128 | in the same equence as they listed in "stream" element. |
| 129 | |
| 130 | <postprocess> |
| 131 | <stream type="music"> |
| 132 | <apply effect="music_post_proc"/> |
| 133 | </stream> |
| 134 | <stream type="voice_call"> |
| 135 | <apply effect="voice_post_proc"/> |
| 136 | </stream> |
| 137 | <stream type="notification"> |
| 138 | <apply effect="notification_post_proc"/> |
| 139 | </stream> |
| 140 | </postprocess> |
| 141 | --> |
| 142 | |
| 143 | </audio_effects_conf> |