1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _AUDIO_EFFECTS_H 20 #define _AUDIO_EFFECTS_H 21 #define CONFIG_CACHE 0 22 #define CONFIG_SET 1 23 #define CONFIG_GET 2 24 #define VIRTUALIZER_MODULE 0x00001000 25 #define VIRTUALIZER_ENABLE 0x00001001 26 #define VIRTUALIZER_STRENGTH 0x00001002 27 #define VIRTUALIZER_OUT_TYPE 0x00001003 28 #define VIRTUALIZER_GAIN_ADJUST 0x00001004 29 #define VIRTUALIZER_ENABLE_PARAM_LEN 1 30 #define VIRTUALIZER_STRENGTH_PARAM_LEN 1 31 #define VIRTUALIZER_OUT_TYPE_PARAM_LEN 1 32 #define VIRTUALIZER_GAIN_ADJUST_PARAM_LEN 1 33 #define REVERB_MODULE 0x00002000 34 #define REVERB_ENABLE 0x00002001 35 #define REVERB_MODE 0x00002002 36 #define REVERB_PRESET 0x00002003 37 #define REVERB_WET_MIX 0x00002004 38 #define REVERB_GAIN_ADJUST 0x00002005 39 #define REVERB_ROOM_LEVEL 0x00002006 40 #define REVERB_ROOM_HF_LEVEL 0x00002007 41 #define REVERB_DECAY_TIME 0x00002008 42 #define REVERB_DECAY_HF_RATIO 0x00002009 43 #define REVERB_REFLECTIONS_LEVEL 0x0000200a 44 #define REVERB_REFLECTIONS_DELAY 0x0000200b 45 #define REVERB_LEVEL 0x0000200c 46 #define REVERB_DELAY 0x0000200d 47 #define REVERB_DIFFUSION 0x0000200e 48 #define REVERB_DENSITY 0x0000200f 49 #define REVERB_ENABLE_PARAM_LEN 1 50 #define REVERB_MODE_PARAM_LEN 1 51 #define REVERB_PRESET_PARAM_LEN 1 52 #define REVERB_WET_MIX_PARAM_LEN 1 53 #define REVERB_GAIN_ADJUST_PARAM_LEN 1 54 #define REVERB_ROOM_LEVEL_PARAM_LEN 1 55 #define REVERB_ROOM_HF_LEVEL_PARAM_LEN 1 56 #define REVERB_DECAY_TIME_PARAM_LEN 1 57 #define REVERB_DECAY_HF_RATIO_PARAM_LEN 1 58 #define REVERB_REFLECTIONS_LEVEL_PARAM_LEN 1 59 #define REVERB_REFLECTIONS_DELAY_PARAM_LEN 1 60 #define REVERB_LEVEL_PARAM_LEN 1 61 #define REVERB_DELAY_PARAM_LEN 1 62 #define REVERB_DIFFUSION_PARAM_LEN 1 63 #define REVERB_DENSITY_PARAM_LEN 1 64 #define BASS_BOOST_MODULE 0x00003000 65 #define BASS_BOOST_ENABLE 0x00003001 66 #define BASS_BOOST_MODE 0x00003002 67 #define BASS_BOOST_STRENGTH 0x00003003 68 #define BASS_BOOST_ENABLE_PARAM_LEN 1 69 #define BASS_BOOST_MODE_PARAM_LEN 1 70 #define BASS_BOOST_STRENGTH_PARAM_LEN 1 71 #define EQ_MODULE 0x00004000 72 #define EQ_ENABLE 0x00004001 73 #define EQ_CONFIG 0x00004002 74 #define EQ_NUM_BANDS 0x00004003 75 #define EQ_BAND_LEVELS 0x00004004 76 #define EQ_BAND_LEVEL_RANGE 0x00004005 77 #define EQ_BAND_FREQS 0x00004006 78 #define EQ_SINGLE_BAND_FREQ_RANGE 0x00004007 79 #define EQ_SINGLE_BAND_FREQ 0x00004008 80 #define EQ_BAND_INDEX 0x00004009 81 #define EQ_PRESET_ID 0x0000400a 82 #define EQ_NUM_PRESETS 0x0000400b 83 #define EQ_PRESET_NAME 0x0000400c 84 #define EQ_ENABLE_PARAM_LEN 1 85 #define EQ_CONFIG_PARAM_LEN 3 86 #define EQ_CONFIG_PER_BAND_PARAM_LEN 5 87 #define EQ_NUM_BANDS_PARAM_LEN 1 88 #define EQ_BAND_LEVELS_PARAM_LEN 13 89 #define EQ_BAND_LEVEL_RANGE_PARAM_LEN 2 90 #define EQ_BAND_FREQS_PARAM_LEN 13 91 #define EQ_SINGLE_BAND_FREQ_RANGE_PARAM_LEN 2 92 #define EQ_SINGLE_BAND_FREQ_PARAM_LEN 1 93 #define EQ_BAND_INDEX_PARAM_LEN 1 94 #define EQ_PRESET_ID_PARAM_LEN 1 95 #define EQ_NUM_PRESETS_PARAM_LEN 1 96 #define EQ_PRESET_NAME_PARAM_LEN 32 97 #define EQ_TYPE_NONE 0 98 #define EQ_BASS_BOOST 1 99 #define EQ_BASS_CUT 2 100 #define EQ_TREBLE_BOOST 3 101 #define EQ_TREBLE_CUT 4 102 #define EQ_BAND_BOOST 5 103 #define EQ_BAND_CUT 6 104 #define SOFT_VOLUME_MODULE 0x00006000 105 #define SOFT_VOLUME_ENABLE 0x00006001 106 #define SOFT_VOLUME_GAIN_2CH 0x00006002 107 #define SOFT_VOLUME_GAIN_MASTER 0x00006003 108 #define SOFT_VOLUME_ENABLE_PARAM_LEN 1 109 #define SOFT_VOLUME_GAIN_2CH_PARAM_LEN 2 110 #define SOFT_VOLUME_GAIN_MASTER_PARAM_LEN 1 111 #define SOFT_VOLUME2_MODULE 0x00007000 112 #define SOFT_VOLUME2_ENABLE 0x00007001 113 #define SOFT_VOLUME2_GAIN_2CH 0x00007002 114 #define SOFT_VOLUME2_GAIN_MASTER 0x00007003 115 #define SOFT_VOLUME2_ENABLE_PARAM_LEN SOFT_VOLUME_ENABLE_PARAM_LEN 116 #define SOFT_VOLUME2_GAIN_2CH_PARAM_LEN SOFT_VOLUME_GAIN_2CH_PARAM_LEN 117 #define SOFT_VOLUME2_GAIN_MASTER_PARAM_LEN SOFT_VOLUME_GAIN_MASTER_PARAM_LEN 118 #define PBE_CONF_MODULE_ID 0x00010C2A 119 #define PBE_CONF_PARAM_ID 0x00010C49 120 #define PBE_MODULE 0x00008000 121 #define PBE_ENABLE 0x00008001 122 #define PBE_CONFIG 0x00008002 123 #define PBE_ENABLE_PARAM_LEN 1 124 #define PBE_CONFIG_PARAM_LEN 28 125 #define COMMAND_PAYLOAD_LEN 3 126 #define COMMAND_PAYLOAD_SZ (COMMAND_PAYLOAD_LEN * sizeof(uint32_t)) 127 #define COMMAND_IID_PAYLOAD_LEN 4 128 #define COMMAND_IID_PAYLOAD_SZ (COMMAND_IID_PAYLOAD_LEN * sizeof(uint32_t)) 129 #define MAX_INBAND_PARAM_SZ 4096 130 #define Q27_UNITY (1 << 27) 131 #define Q8_UNITY (1 << 8) 132 #define CUSTOM_OPENSL_PRESET 18 133 #define VIRTUALIZER_ENABLE_PARAM_SZ (VIRTUALIZER_ENABLE_PARAM_LEN * sizeof(uint32_t)) 134 #define VIRTUALIZER_STRENGTH_PARAM_SZ (VIRTUALIZER_STRENGTH_PARAM_LEN * sizeof(uint32_t)) 135 #define VIRTUALIZER_OUT_TYPE_PARAM_SZ (VIRTUALIZER_OUT_TYPE_PARAM_LEN * sizeof(uint32_t)) 136 #define VIRTUALIZER_GAIN_ADJUST_PARAM_SZ (VIRTUALIZER_GAIN_ADJUST_PARAM_LEN * sizeof(uint32_t)) 137 struct virtualizer_params { 138 uint32_t device; 139 uint32_t enable_flag; 140 uint32_t strength; 141 uint32_t out_type; 142 int32_t gain_adjust; 143 }; 144 #define NUM_OSL_REVERB_PRESETS_SUPPORTED 6 145 #define REVERB_ENABLE_PARAM_SZ (REVERB_ENABLE_PARAM_LEN * sizeof(uint32_t)) 146 #define REVERB_MODE_PARAM_SZ (REVERB_MODE_PARAM_LEN * sizeof(uint32_t)) 147 #define REVERB_PRESET_PARAM_SZ (REVERB_PRESET_PARAM_LEN * sizeof(uint32_t)) 148 #define REVERB_WET_MIX_PARAM_SZ (REVERB_WET_MIX_PARAM_LEN * sizeof(uint32_t)) 149 #define REVERB_GAIN_ADJUST_PARAM_SZ (REVERB_GAIN_ADJUST_PARAM_LEN * sizeof(uint32_t)) 150 #define REVERB_ROOM_LEVEL_PARAM_SZ (REVERB_ROOM_LEVEL_PARAM_LEN * sizeof(uint32_t)) 151 #define REVERB_ROOM_HF_LEVEL_PARAM_SZ (REVERB_ROOM_HF_LEVEL_PARAM_LEN * sizeof(uint32_t)) 152 #define REVERB_DECAY_TIME_PARAM_SZ (REVERB_DECAY_TIME_PARAM_LEN * sizeof(uint32_t)) 153 #define REVERB_DECAY_HF_RATIO_PARAM_SZ (REVERB_DECAY_HF_RATIO_PARAM_LEN * sizeof(uint32_t)) 154 #define REVERB_REFLECTIONS_LEVEL_PARAM_SZ (REVERB_REFLECTIONS_LEVEL_PARAM_LEN * sizeof(uint32_t)) 155 #define REVERB_REFLECTIONS_DELAY_PARAM_SZ (REVERB_REFLECTIONS_DELAY_PARAM_LEN * sizeof(uint32_t)) 156 #define REVERB_LEVEL_PARAM_SZ (REVERB_LEVEL_PARAM_LEN * sizeof(uint32_t)) 157 #define REVERB_DELAY_PARAM_SZ (REVERB_DELAY_PARAM_LEN * sizeof(uint32_t)) 158 #define REVERB_DIFFUSION_PARAM_SZ (REVERB_DIFFUSION_PARAM_LEN * sizeof(uint32_t)) 159 #define REVERB_DENSITY_PARAM_SZ (REVERB_DENSITY_PARAM_LEN * sizeof(uint32_t)) 160 struct reverb_params { 161 uint32_t device; 162 uint32_t enable_flag; 163 uint32_t mode; 164 uint32_t preset; 165 uint32_t wet_mix; 166 int32_t gain_adjust; 167 int32_t room_level; 168 int32_t room_hf_level; 169 uint32_t decay_time; 170 uint32_t decay_hf_ratio; 171 int32_t reflections_level; 172 uint32_t reflections_delay; 173 int32_t level; 174 uint32_t delay; 175 uint32_t diffusion; 176 uint32_t density; 177 }; 178 #define BASS_BOOST_ENABLE_PARAM_SZ (BASS_BOOST_ENABLE_PARAM_LEN * sizeof(uint32_t)) 179 #define BASS_BOOST_MODE_PARAM_SZ (BASS_BOOST_MODE_PARAM_LEN * sizeof(uint32_t)) 180 #define BASS_BOOST_STRENGTH_PARAM_SZ (BASS_BOOST_STRENGTH_PARAM_LEN * sizeof(uint32_t)) 181 struct bass_boost_params { 182 uint32_t device; 183 uint32_t enable_flag; 184 uint32_t mode; 185 uint32_t strength; 186 }; 187 #define MAX_EQ_BANDS 12 188 #define MAX_OSL_EQ_BANDS 5 189 #define EQ_ENABLE_PARAM_SZ (EQ_ENABLE_PARAM_LEN * sizeof(uint32_t)) 190 #define EQ_CONFIG_PARAM_SZ (EQ_CONFIG_PARAM_LEN * sizeof(uint32_t)) 191 #define EQ_CONFIG_PER_BAND_PARAM_SZ (EQ_CONFIG_PER_BAND_PARAM_LEN * sizeof(uint32_t)) 192 #define EQ_CONFIG_PARAM_MAX_LEN (EQ_CONFIG_PARAM_LEN + MAX_EQ_BANDS * EQ_CONFIG_PER_BAND_PARAM_LEN) 193 #define EQ_CONFIG_PARAM_MAX_SZ (EQ_CONFIG_PARAM_MAX_LEN * sizeof(uint32_t)) 194 #define EQ_NUM_BANDS_PARAM_SZ (EQ_NUM_BANDS_PARAM_LEN * sizeof(uint32_t)) 195 #define EQ_BAND_LEVELS_PARAM_SZ (EQ_BAND_LEVELS_PARAM_LEN * sizeof(uint32_t)) 196 #define EQ_BAND_LEVEL_RANGE_PARAM_SZ (EQ_BAND_LEVEL_RANGE_PARAM_LEN * sizeof(uint32_t)) 197 #define EQ_BAND_FREQS_PARAM_SZ (EQ_BAND_FREQS_PARAM_LEN * sizeof(uint32_t)) 198 #define EQ_SINGLE_BAND_FREQ_RANGE_PARAM_SZ (EQ_SINGLE_BAND_FREQ_RANGE_PARAM_LEN * sizeof(uint32_t)) 199 #define EQ_SINGLE_BAND_FREQ_PARAM_SZ (EQ_SINGLE_BAND_FREQ_PARAM_LEN * sizeof(uint32_t)) 200 #define EQ_BAND_INDEX_PARAM_SZ (EQ_BAND_INDEX_PARAM_LEN * sizeof(uint32_t)) 201 #define EQ_PRESET_ID_PARAM_SZ (EQ_PRESET_ID_PARAM_LEN * sizeof(uint32_t)) 202 #define EQ_NUM_PRESETS_PARAM_SZ (EQ_NUM_PRESETS_PARAM_LEN * sizeof(uint8_t)) 203 struct eq_config_t { 204 int32_t eq_pregain; 205 int32_t preset_id; 206 uint32_t num_bands; 207 }; 208 struct eq_per_band_config_t { 209 int32_t band_idx; 210 uint32_t filter_type; 211 uint32_t freq_millihertz; 212 int32_t gain_millibels; 213 uint32_t quality_factor; 214 }; 215 struct eq_per_band_freq_range_t { 216 uint32_t band_index; 217 uint32_t min_freq_millihertz; 218 uint32_t max_freq_millihertz; 219 }; 220 struct eq_params { 221 uint32_t device; 222 uint32_t enable_flag; 223 struct eq_config_t config; 224 struct eq_per_band_config_t per_band_cfg[MAX_EQ_BANDS]; 225 struct eq_per_band_freq_range_t per_band_freq_range[MAX_EQ_BANDS]; 226 uint32_t band_index; 227 uint32_t freq_millihertz; 228 }; 229 #define PBE_ENABLE_PARAM_SZ (PBE_ENABLE_PARAM_LEN * sizeof(uint32_t)) 230 #define PBE_CONFIG_PARAM_SZ (PBE_CONFIG_PARAM_LEN * sizeof(uint16_t)) 231 struct pbe_config_t { 232 int16_t real_bass_mix; 233 int16_t bass_color_control; 234 uint16_t main_chain_delay; 235 uint16_t xover_filter_order; 236 uint16_t bandpass_filter_order; 237 int16_t drc_delay; 238 uint16_t rms_tav; 239 int16_t exp_threshold; 240 uint16_t exp_slope; 241 int16_t comp_threshold; 242 uint16_t comp_slope; 243 uint16_t makeup_gain; 244 uint32_t comp_attack; 245 uint32_t comp_release; 246 uint32_t exp_attack; 247 uint32_t exp_release; 248 int16_t limiter_bass_threshold; 249 int16_t limiter_high_threshold; 250 int16_t limiter_bass_makeup_gain; 251 int16_t limiter_high_makeup_gain; 252 int16_t limiter_bass_gc; 253 int16_t limiter_high_gc; 254 int16_t limiter_delay; 255 uint16_t reserved; 256 int32_t p1LowPassCoeffs[5 * 2]; 257 int32_t p1HighPassCoeffs[5 * 2]; 258 int32_t p1BandPassCoeffs[5 * 3]; 259 int32_t p1BassShelfCoeffs[5]; 260 int32_t p1TrebleShelfCoeffs[5]; 261 } __attribute__((packed)); 262 struct pbe_params { 263 uint32_t device; 264 uint32_t enable_flag; 265 uint32_t cfg_len; 266 struct pbe_config_t config; 267 }; 268 #define SOFT_VOLUME_ENABLE_PARAM_SZ (SOFT_VOLUME_ENABLE_PARAM_LEN * sizeof(uint32_t)) 269 #define SOFT_VOLUME_GAIN_MASTER_PARAM_SZ (SOFT_VOLUME_GAIN_MASTER_PARAM_LEN * sizeof(uint32_t)) 270 #define SOFT_VOLUME_GAIN_2CH_PARAM_SZ (SOFT_VOLUME_GAIN_2CH_PARAM_LEN * sizeof(uint16_t)) 271 struct soft_volume_params { 272 uint32_t device; 273 uint32_t enable_flag; 274 uint32_t master_gain; 275 uint32_t left_gain; 276 uint32_t right_gain; 277 }; 278 struct msm_nt_eff_all_config { 279 struct bass_boost_params bass_boost; 280 struct pbe_params pbe; 281 struct virtualizer_params virtualizer; 282 struct reverb_params reverb; 283 struct eq_params equalizer; 284 struct soft_volume_params saplus_vol; 285 struct soft_volume_params topo_switch_vol; 286 }; 287 #endif 288