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> |
| 31 | <library name="bassboostsw" path="libbassboostsw.so"/> |
| 32 | <library name="bundle" path="libbundleaidl.so"/> |
| 33 | <library name="dynamics_processingsw" path="libdynamicsprocessingsw.so"/> |
| 34 | <library name="equalizersw" path="libequalizersw.so"/> |
| 35 | <library name="haptic_generatorsw" path="libhapticgeneratorsw.so"/> |
| 36 | <library name="loudness_enhancersw" path="libloudnessenhancersw.so"/> |
Shunkai Yao | 812d5b4 | 2022-11-16 18:08:50 +0000 | [diff] [blame^] | 37 | <library name="env_reverbsw" path="libenvreverbsw.so"/> |
| 38 | <library name="preset_reverbsw" path="libpresetreverbsw.so"/> |
Shunkai Yao | 60b34b7 | 2022-11-10 17:16:50 +0000 | [diff] [blame] | 39 | <library name="virtualizersw" path="libvirtualizersw.so"/> |
| 40 | <library name="visualizersw" path="libvisualizersw.so"/> |
| 41 | <library name="volumesw" path="libvolumesw.so"/> |
| 42 | </libraries> |
| 43 | |
| 44 | <!-- list of effects to load. |
| 45 | Each "effect" element must contain a "name", "library" and a "uuid" attribute. |
| 46 | The value of the "library" attribute must correspond to the name of one library element in |
| 47 | the "libraries" element. |
| 48 | The "name" attribute used to specific effect type, and should be mapping to a key of |
| 49 | aidl::android::hardware::audio::effect::kUuidNameTypeMap. |
| 50 | The "uuid" attribute is the implementation specific UUID as specified by the effect vendor. |
| 51 | |
| 52 | Effect proxy can be supported with "effectProxy" element, each sub-element should contain |
| 53 | "library" and "uuid" attribute, all other attributes were ignored. Framework side use |
| 54 | result of IFactory.queryEffects() to decide which effect implementation should be part of |
| 55 | proxy and which not. |
| 56 | |
| 57 | Only "name", "library", and "uuid" attributes in "effects" element are meaningful and |
| 58 | parsed out by EffectConfig class, all other attributes are ignored. |
| 59 | Only "name" and "uuid" attributes in "effectProxy" element are meaningful and parsed out |
| 60 | by EffectConfig class, all other attributes are ignored. |
| 61 | --> |
| 62 | |
| 63 | <effects> |
| 64 | <effect name="bassboost" library="bassboostsw" uuid="fa8181f2-588b-11ed-9b6a-0242ac120002"/> |
| 65 | <effect name="dynamics_processing" library="dynamics_processingsw" uuid="fa818d78-588b-11ed-9b6a-0242ac120002"/> |
| 66 | <effect name="haptic_generator" library="haptic_generatorsw" uuid="fa819110-588b-11ed-9b6a-0242ac120002"/> |
| 67 | <effect name="loudness_enhancer" library="loudness_enhancersw" uuid="fa819610-588b-11ed-9b6a-0242ac120002"/> |
Shunkai Yao | 812d5b4 | 2022-11-16 18:08:50 +0000 | [diff] [blame^] | 68 | <effect name="env_reverb" library="env_reverbsw" uuid="fa819886-588b-11ed-9b6a-0242ac120002"/> |
| 69 | <effect name="preset_reverb" library="preset_reverbsw" uuid="fa8199c6-588b-11ed-9b6a-0242ac120002"/> |
Shunkai Yao | 60b34b7 | 2022-11-10 17:16:50 +0000 | [diff] [blame] | 70 | <effect name="virtualizer" library="virtualizersw" uuid="fa819d86-588b-11ed-9b6a-0242ac120002"/> |
| 71 | <effect name="visualizer" library="visualizersw" uuid="fa81a0f6-588b-11ed-9b6a-0242ac120002"/> |
| 72 | <effect name="volume" library="volumesw" uuid="fa81a718-588b-11ed-9b6a-0242ac120002"/> |
Shunkai Yao | 812d5b4 | 2022-11-16 18:08:50 +0000 | [diff] [blame^] | 73 | <effectProxy name="equalizer" uuid="c8e70ecd-48ca-456e-8a4f-0002a5d5c51b"> |
Shunkai Yao | 60b34b7 | 2022-11-10 17:16:50 +0000 | [diff] [blame] | 74 | <libsw library="equalizersw" uuid="0bed4300-847d-11df-bb17-0002a5d5c51b"/> |
| 75 | <libsw library="bundle" uuid="ce772f20-847d-11df-bb17-0002a5d5c51b"/> |
| 76 | </effectProxy> |
| 77 | </effects> |
| 78 | |
| 79 | <!-- Audio pre processor configurations. |
| 80 | The pre processor configuration is described in a "preprocess" element and consists in a |
| 81 | list of elements each describing pre processor settings for a given use case or "stream". |
| 82 | Each stream element has a "type" attribute corresponding to the input source used. |
| 83 | Valid types are these defined in system/hardware/interfaces/media/aidl/android/media/audio/ |
| 84 | common/AudioSource.aidl. |
| 85 | Each "stream" element contains a list of "apply" elements indicating one effect to apply. |
| 86 | The effect to apply is designated by its name in the "effects" elements. |
| 87 | If there are more than one effect apply to one stream, the audio framework will apply them |
| 88 | in the same equence as they listed in "stream" element. |
| 89 | |
| 90 | <preprocess> |
| 91 | <stream type="voice_communication"> |
| 92 | <apply effect="aec"/> |
| 93 | <apply effect="ns"/> |
| 94 | </stream> |
| 95 | </preprocess> |
| 96 | --> |
| 97 | |
| 98 | <!-- Audio post processor configurations. |
| 99 | The post processor configuration is described in a "postprocess" element and consists in a |
| 100 | list of elements each describing post processor settings for a given use case or "stream". |
| 101 | Each stream element has a "type" attribute corresponding to the stream type used. |
| 102 | Valid types are these defined in system/hardware/interfaces/media/aidl/android/media/audio/ |
| 103 | common/AudioStreamType.aidl. |
| 104 | Each "stream" element contains a list of "apply" elements indicating one effect to apply. |
| 105 | The effect to apply is designated by its name in the "effects" elements. |
| 106 | If there are more than one effect apply to one stream, the audio framework will apply them |
| 107 | in the same equence as they listed in "stream" element. |
| 108 | |
| 109 | <postprocess> |
| 110 | <stream type="music"> |
| 111 | <apply effect="music_post_proc"/> |
| 112 | </stream> |
| 113 | <stream type="voice_call"> |
| 114 | <apply effect="voice_post_proc"/> |
| 115 | </stream> |
| 116 | <stream type="notification"> |
| 117 | <apply effect="notification_post_proc"/> |
| 118 | </stream> |
| 119 | </postprocess> |
| 120 | --> |
| 121 | |
| 122 | </audio_effects_conf> |