]>
Commit | Line | Data |
---|---|---|
e79753ed PM |
1 | #ifndef QDSP5AUDPPCMDI_H |
2 | #define QDSP5AUDPPCMDI_H | |
3 | ||
4 | /*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* | |
5 | ||
6 | A U D I O P O S T P R O C E S S I N G I N T E R N A L C O M M A N D S | |
7 | ||
8 | GENERAL DESCRIPTION | |
9 | This file contains defintions of format blocks of commands | |
10 | that are accepted by AUDPP Task | |
11 | ||
12 | REFERENCES | |
13 | None | |
14 | ||
15 | EXTERNALIZED FUNCTIONS | |
16 | None | |
17 | ||
18 | Copyright(c) 1992 - 2008 by QUALCOMM, Incorporated. | |
19 | ||
20 | This software is licensed under the terms of the GNU General Public | |
21 | License version 2, as published by the Free Software Foundation, and | |
22 | may be copied, distributed, and modified under those terms. | |
23 | ||
24 | This program is distributed in the hope that it will be useful, | |
25 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
26 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
27 | GNU General Public License for more details. | |
28 | ||
29 | *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ | |
30 | /*=========================================================================== | |
31 | ||
32 | EDIT HISTORY FOR FILE | |
33 | ||
34 | This section contains comments describing changes made to this file. | |
35 | Notice that changes are listed in reverse chronological order. | |
36 | ||
37 | $Header: //source/qcom/qct/multimedia2/Audio/drivers/QDSP5Driver/QDSP5Interface/main/latest/qdsp5audppcmdi.h#2 $ | |
38 | ||
39 | ===========================================================================*/ | |
40 | ||
41 | /* | |
42 | * ARM to AUDPPTASK Commands | |
43 | * | |
44 | * ARM uses three command queues to communicate with AUDPPTASK | |
45 | * 1)uPAudPPCmd1Queue : Used for more frequent and shorter length commands | |
46 | * Location : MEMA | |
47 | * Buffer Size : 6 words | |
48 | * No of buffers in a queue : 20 for gaming audio and 5 for other images | |
49 | * 2)uPAudPPCmd2Queue : Used for commands which are not much lengthier | |
50 | * Location : MEMA | |
51 | * Buffer Size : 23 | |
52 | * No of buffers in a queue : 2 | |
53 | * 3)uPAudOOCmd3Queue : Used for lengthier and more frequent commands | |
54 | * Location : MEMA | |
55 | * Buffer Size : 145 | |
56 | * No of buffers in a queue : 3 | |
57 | */ | |
58 | ||
59 | /* | |
60 | * Commands Related to uPAudPPCmd1Queue | |
61 | */ | |
62 | ||
63 | /* | |
64 | * Command Structure to enable or disable the active decoders | |
65 | */ | |
66 | ||
67 | #define AUDPP_CMD_CFG_DEC_TYPE 0x0001 | |
68 | #define AUDPP_CMD_CFG_DEC_TYPE_LEN sizeof(audpp_cmd_cfg_dec_type) | |
69 | ||
70 | /* Enable the decoder */ | |
71 | #define AUDPP_CMD_DEC_TYPE_M 0x000F | |
72 | ||
73 | #define AUDPP_CMD_ENA_DEC_V 0x4000 | |
74 | #define AUDPP_CMD_DIS_DEC_V 0x0000 | |
75 | #define AUDPP_CMD_DEC_STATE_M 0x4000 | |
76 | ||
77 | #define AUDPP_CMD_UPDATDE_CFG_DEC 0x8000 | |
78 | #define AUDPP_CMD_DONT_UPDATE_CFG_DEC 0x0000 | |
79 | ||
80 | ||
81 | /* Type specification of cmd_cfg_dec */ | |
82 | ||
83 | typedef struct { | |
84 | unsigned short cmd_id; | |
85 | unsigned short dec0_cfg; | |
86 | unsigned short dec1_cfg; | |
87 | unsigned short dec2_cfg; | |
88 | unsigned short dec3_cfg; | |
89 | unsigned short dec4_cfg; | |
90 | } __attribute__((packed)) audpp_cmd_cfg_dec_type; | |
91 | ||
92 | /* | |
93 | * Command Structure to Pause , Resume and flushes the selected audio decoders | |
94 | */ | |
95 | ||
96 | #define AUDPP_CMD_DEC_CTRL 0x0002 | |
97 | #define AUDPP_CMD_DEC_CTRL_LEN sizeof(audpp_cmd_dec_ctrl) | |
98 | ||
99 | /* Decoder control commands for pause, resume and flush */ | |
100 | #define AUDPP_CMD_FLUSH_V 0x2000 | |
101 | ||
102 | #define AUDPP_CMD_PAUSE_V 0x4000 | |
103 | #define AUDPP_CMD_RESUME_V 0x0000 | |
104 | ||
105 | #define AUDPP_CMD_UPDATE_V 0x8000 | |
106 | #define AUDPP_CMD_IGNORE_V 0x0000 | |
107 | ||
108 | ||
109 | /* Type Spec for decoder control command*/ | |
110 | ||
111 | typedef struct { | |
112 | unsigned short cmd_id; | |
113 | unsigned short dec0_ctrl; | |
114 | unsigned short dec1_ctrl; | |
115 | unsigned short dec2_ctrl; | |
116 | unsigned short dec3_ctrl; | |
117 | unsigned short dec4_ctrl; | |
118 | } __attribute__((packed)) audpp_cmd_dec_ctrl; | |
119 | ||
120 | /* | |
121 | * Command Structure to Configure the AVSync FeedBack Mechanism | |
122 | */ | |
123 | ||
124 | #define AUDPP_CMD_AVSYNC 0x0003 | |
125 | #define AUDPP_CMD_AVSYNC_LEN sizeof(audpp_cmd_avsync) | |
126 | ||
127 | typedef struct { | |
128 | unsigned short cmd_id; | |
129 | unsigned short object_number; | |
130 | unsigned short interrupt_interval_lsw; | |
131 | unsigned short interrupt_interval_msw; | |
132 | } __attribute__((packed)) audpp_cmd_avsync; | |
133 | ||
134 | /* | |
135 | * Command Structure to enable or disable(sleep) the AUDPPTASK | |
136 | */ | |
137 | ||
138 | #define AUDPP_CMD_CFG 0x0004 | |
139 | #define AUDPP_CMD_CFG_LEN sizeof(audpp_cmd_cfg) | |
140 | ||
141 | #define AUDPP_CMD_CFG_SLEEP 0x0000 | |
142 | #define AUDPP_CMD_CFG_ENABLE 0xFFFF | |
143 | ||
144 | typedef struct { | |
145 | unsigned short cmd_id; | |
146 | unsigned short cfg; | |
147 | } __attribute__((packed)) audpp_cmd_cfg; | |
148 | ||
149 | /* | |
150 | * Command Structure to Inject or drop the specified no of samples | |
151 | */ | |
152 | ||
153 | #define AUDPP_CMD_ADJUST_SAMP 0x0005 | |
154 | #define AUDPP_CMD_ADJUST_SAMP_LEN sizeof(audpp_cmd_adjust_samp) | |
155 | ||
156 | #define AUDPP_CMD_SAMP_DROP -1 | |
157 | #define AUDPP_CMD_SAMP_INSERT 0x0001 | |
158 | ||
159 | #define AUDPP_CMD_NUM_SAMPLES 0x0001 | |
160 | ||
161 | typedef struct { | |
162 | unsigned short cmd_id; | |
163 | unsigned short object_no; | |
164 | signed short sample_insert_or_drop; | |
165 | unsigned short num_samples; | |
166 | } __attribute__((packed)) audpp_cmd_adjust_samp; | |
167 | ||
168 | /* | |
169 | * Command Structure to Configure AVSync Feedback Mechanism | |
170 | */ | |
171 | ||
172 | #define AUDPP_CMD_AVSYNC_CMD_2 0x0006 | |
173 | #define AUDPP_CMD_AVSYNC_CMD_2_LEN sizeof(audpp_cmd_avsync_cmd_2) | |
174 | ||
175 | typedef struct { | |
176 | unsigned short cmd_id; | |
177 | unsigned short object_number; | |
178 | unsigned short interrupt_interval_lsw; | |
179 | unsigned short interrupt_interval_msw; | |
180 | unsigned short sample_counter_dlsw; | |
181 | unsigned short sample_counter_dmsw; | |
182 | unsigned short sample_counter_msw; | |
183 | unsigned short byte_counter_dlsw; | |
184 | unsigned short byte_counter_dmsw; | |
185 | unsigned short byte_counter_msw; | |
186 | } __attribute__((packed)) audpp_cmd_avsync_cmd_2; | |
187 | ||
188 | /* | |
189 | * Command Structure to Configure AVSync Feedback Mechanism | |
190 | */ | |
191 | ||
192 | #define AUDPP_CMD_AVSYNC_CMD_3 0x0007 | |
193 | #define AUDPP_CMD_AVSYNC_CMD_3_LEN sizeof(audpp_cmd_avsync_cmd_3) | |
194 | ||
195 | typedef struct { | |
196 | unsigned short cmd_id; | |
197 | unsigned short object_number; | |
198 | unsigned short interrupt_interval_lsw; | |
199 | unsigned short interrupt_interval_msw; | |
200 | unsigned short sample_counter_dlsw; | |
201 | unsigned short sample_counter_dmsw; | |
202 | unsigned short sample_counter_msw; | |
203 | unsigned short byte_counter_dlsw; | |
204 | unsigned short byte_counter_dmsw; | |
205 | unsigned short byte_counter_msw; | |
206 | } __attribute__((packed)) audpp_cmd_avsync_cmd_3; | |
207 | ||
208 | #define AUDPP_CMD_ROUTING_MODE 0x0008 | |
209 | #define AUDPP_CMD_ROUTING_MODE_LEN \ | |
210 | sizeof(struct audpp_cmd_routing_mode) | |
211 | ||
212 | struct audpp_cmd_routing_mode { | |
213 | unsigned short cmd_id; | |
214 | unsigned short object_number; | |
215 | unsigned short routing_mode; | |
216 | } __attribute__((packed)); | |
217 | ||
218 | /* | |
219 | * Commands Related to uPAudPPCmd2Queue | |
220 | */ | |
221 | ||
222 | /* | |
223 | * Command Structure to configure Per decoder Parameters (Common) | |
224 | */ | |
225 | ||
226 | #define AUDPP_CMD_CFG_ADEC_PARAMS 0x0000 | |
227 | #define AUDPP_CMD_CFG_ADEC_PARAMS_COMMON_LEN \ | |
228 | sizeof(audpp_cmd_cfg_adec_params_common) | |
229 | ||
230 | #define AUDPP_CMD_STATUS_MSG_FLAG_ENA_FCM 0x4000 | |
231 | #define AUDPP_CMD_STATUS_MSG_FLAG_DIS_FCM 0x0000 | |
232 | ||
233 | #define AUDPP_CMD_STATUS_MSG_FLAG_ENA_DCM 0x8000 | |
234 | #define AUDPP_CMD_STATUS_MSG_FLAG_DIS_DCM 0x0000 | |
235 | ||
236 | /* Sampling frequency*/ | |
237 | #define AUDPP_CMD_SAMP_RATE_96000 0x0000 | |
238 | #define AUDPP_CMD_SAMP_RATE_88200 0x0001 | |
239 | #define AUDPP_CMD_SAMP_RATE_64000 0x0002 | |
240 | #define AUDPP_CMD_SAMP_RATE_48000 0x0003 | |
241 | #define AUDPP_CMD_SAMP_RATE_44100 0x0004 | |
242 | #define AUDPP_CMD_SAMP_RATE_32000 0x0005 | |
243 | #define AUDPP_CMD_SAMP_RATE_24000 0x0006 | |
244 | #define AUDPP_CMD_SAMP_RATE_22050 0x0007 | |
245 | #define AUDPP_CMD_SAMP_RATE_16000 0x0008 | |
246 | #define AUDPP_CMD_SAMP_RATE_12000 0x0009 | |
247 | #define AUDPP_CMD_SAMP_RATE_11025 0x000A | |
248 | #define AUDPP_CMD_SAMP_RATE_8000 0x000B | |
249 | ||
250 | ||
251 | /* | |
252 | * Type specification of cmd_adec_cfg sent to all decoder | |
253 | */ | |
254 | ||
255 | typedef struct { | |
256 | unsigned short cmd_id; | |
257 | unsigned short length; | |
258 | unsigned short dec_id; | |
259 | unsigned short status_msg_flag; | |
260 | unsigned short decoder_frame_counter_msg_period; | |
261 | unsigned short input_sampling_frequency; | |
262 | } __attribute__((packed)) audpp_cmd_cfg_adec_params_common; | |
263 | ||
264 | /* | |
265 | * Command Structure to configure Per decoder Parameters (Wav) | |
266 | */ | |
267 | ||
268 | #define AUDPP_CMD_CFG_ADEC_PARAMS_WAV_LEN \ | |
269 | sizeof(audpp_cmd_cfg_adec_params_wav) | |
270 | ||
271 | ||
272 | #define AUDPP_CMD_WAV_STEREO_CFG_MONO 0x0001 | |
273 | #define AUDPP_CMD_WAV_STEREO_CFG_STEREO 0x0002 | |
274 | ||
275 | #define AUDPP_CMD_WAV_PCM_WIDTH_8 0x0000 | |
276 | #define AUDPP_CMD_WAV_PCM_WIDTH_16 0x0001 | |
277 | #define AUDPP_CMD_WAV_PCM_WIDTH_32 0x0002 | |
278 | ||
279 | typedef struct { | |
280 | audpp_cmd_cfg_adec_params_common common; | |
281 | unsigned short stereo_cfg; | |
282 | unsigned short pcm_width; | |
283 | unsigned short sign; | |
284 | } __attribute__((packed)) audpp_cmd_cfg_adec_params_wav; | |
285 | ||
286 | /* | |
287 | * Command Structure to configure Per decoder Parameters (ADPCM) | |
288 | */ | |
289 | ||
290 | #define AUDPP_CMD_CFG_ADEC_PARAMS_ADPCM_LEN \ | |
291 | sizeof(audpp_cmd_cfg_adec_params_adpcm) | |
292 | ||
293 | ||
294 | #define AUDPP_CMD_ADPCM_STEREO_CFG_MONO 0x0001 | |
295 | #define AUDPP_CMD_ADPCM_STEREO_CFG_STEREO 0x0002 | |
296 | ||
297 | typedef struct { | |
298 | audpp_cmd_cfg_adec_params_common common; | |
299 | unsigned short stereo_cfg; | |
300 | unsigned short block_size; | |
301 | } __attribute__((packed)) audpp_cmd_cfg_adec_params_adpcm; | |
302 | ||
303 | /* | |
304 | * Command Structure to configure Per decoder Parameters (MP3) | |
305 | */ | |
306 | ||
307 | #define AUDPP_CMD_CFG_ADEC_PARAMS_MP3_LEN \ | |
308 | sizeof(audpp_cmd_cfg_adec_params_mp3) | |
309 | ||
310 | typedef struct { | |
311 | audpp_cmd_cfg_adec_params_common common; | |
312 | } __attribute__((packed)) audpp_cmd_cfg_adec_params_mp3; | |
313 | ||
314 | ||
315 | /* | |
316 | * Command Structure to configure Per decoder Parameters (AAC) | |
317 | */ | |
318 | ||
319 | #define AUDPP_CMD_CFG_ADEC_PARAMS_AAC_LEN \ | |
320 | sizeof(audpp_cmd_cfg_adec_params_aac) | |
321 | ||
322 | ||
323 | #define AUDPP_CMD_AAC_FORMAT_ADTS -1 | |
324 | #define AUDPP_CMD_AAC_FORMAT_RAW 0x0000 | |
325 | #define AUDPP_CMD_AAC_FORMAT_PSUEDO_RAW 0x0001 | |
326 | #define AUDPP_CMD_AAC_FORMAT_LOAS 0x0002 | |
327 | ||
328 | #define AUDPP_CMD_AAC_AUDIO_OBJECT_LC 0x0002 | |
329 | #define AUDPP_CMD_AAC_AUDIO_OBJECT_LTP 0x0004 | |
330 | #define AUDPP_CMD_AAC_AUDIO_OBJECT_ERLC 0x0011 | |
331 | ||
332 | #define AUDPP_CMD_AAC_SBR_ON_FLAG_ON 0x0001 | |
333 | #define AUDPP_CMD_AAC_SBR_ON_FLAG_OFF 0x0000 | |
334 | ||
335 | #define AUDPP_CMD_AAC_SBR_PS_ON_FLAG_ON 0x0001 | |
336 | #define AUDPP_CMD_AAC_SBR_PS_ON_FLAG_OFF 0x0000 | |
337 | ||
338 | typedef struct { | |
339 | audpp_cmd_cfg_adec_params_common common; | |
340 | signed short format; | |
341 | unsigned short audio_object; | |
342 | unsigned short ep_config; | |
343 | unsigned short aac_section_data_resilience_flag; | |
344 | unsigned short aac_scalefactor_data_resilience_flag; | |
345 | unsigned short aac_spectral_data_resilience_flag; | |
346 | unsigned short sbr_on_flag; | |
347 | unsigned short sbr_ps_on_flag; | |
348 | unsigned short dual_mono_mode; | |
349 | unsigned short channel_configuration; | |
350 | } __attribute__((packed)) audpp_cmd_cfg_adec_params_aac; | |
351 | ||
352 | /* | |
353 | * Command Structure to configure Per decoder Parameters (V13K) | |
354 | */ | |
355 | ||
356 | #define AUDPP_CMD_CFG_ADEC_PARAMS_V13K_LEN \ | |
357 | sizeof(struct audpp_cmd_cfg_adec_params_v13k) | |
358 | ||
359 | ||
360 | #define AUDPP_CMD_STEREO_CFG_MONO 0x0001 | |
361 | #define AUDPP_CMD_STEREO_CFG_STEREO 0x0002 | |
362 | ||
363 | struct audpp_cmd_cfg_adec_params_v13k { | |
364 | audpp_cmd_cfg_adec_params_common common; | |
365 | unsigned short stereo_cfg; | |
366 | } __attribute__((packed)); | |
367 | ||
368 | #define AUDPP_CMD_CFG_ADEC_PARAMS_EVRC_LEN \ | |
369 | sizeof(struct audpp_cmd_cfg_adec_params_evrc) | |
370 | ||
371 | struct audpp_cmd_cfg_adec_params_evrc { | |
372 | audpp_cmd_cfg_adec_params_common common; | |
373 | unsigned short stereo_cfg; | |
374 | } __attribute__ ((packed)); | |
375 | ||
376 | /* | |
377 | * Command Structure to configure the HOST PCM interface | |
378 | */ | |
379 | ||
380 | #define AUDPP_CMD_PCM_INTF 0x0001 | |
381 | #define AUDPP_CMD_PCM_INTF_2 0x0002 | |
382 | #define AUDPP_CMD_PCM_INTF_LEN sizeof(audpp_cmd_pcm_intf) | |
383 | ||
384 | #define AUDPP_CMD_PCM_INTF_MONO_V 0x0001 | |
385 | #define AUDPP_CMD_PCM_INTF_STEREO_V 0x0002 | |
386 | ||
387 | /* These two values differentiate the two types of commands that could be issued | |
388 | * Interface configuration command and Buffer update command */ | |
389 | ||
390 | #define AUDPP_CMD_PCM_INTF_CONFIG_CMD_V 0x0000 | |
391 | #define AUDPP_CMD_PCM_INTF_BUFFER_CMD_V -1 | |
392 | ||
393 | #define AUDPP_CMD_PCM_INTF_RX_ENA_M 0x000F | |
394 | #define AUDPP_CMD_PCM_INTF_RX_ENA_ARMTODSP_V 0x0008 | |
395 | #define AUDPP_CMD_PCM_INTF_RX_ENA_DSPTOARM_V 0x0004 | |
396 | ||
397 | /* These flags control the enabling and disabling of the interface together | |
398 | * with host interface bit mask. */ | |
399 | ||
400 | #define AUDPP_CMD_PCM_INTF_ENA_V -1 | |
401 | #define AUDPP_CMD_PCM_INTF_DIS_V 0x0000 | |
402 | ||
403 | ||
404 | #define AUDPP_CMD_PCM_INTF_FULL_DUPLEX 0x0 | |
405 | #define AUDPP_CMD_PCM_INTF_HALF_DUPLEX_TODSP 0x1 | |
406 | ||
407 | ||
408 | #define AUDPP_CMD_PCM_INTF_OBJECT_NUM 0x5 | |
409 | #define AUDPP_CMD_PCM_INTF_COMMON_OBJECT_NUM 0x6 | |
410 | ||
411 | ||
412 | typedef struct { | |
413 | unsigned short cmd_id; | |
414 | unsigned short object_num; | |
415 | signed short config; | |
416 | unsigned short intf_type; | |
417 | ||
418 | /* DSP -> ARM Configuration */ | |
419 | unsigned short read_buf1LSW; | |
420 | unsigned short read_buf1MSW; | |
421 | unsigned short read_buf1_len; | |
422 | ||
423 | unsigned short read_buf2LSW; | |
424 | unsigned short read_buf2MSW; | |
425 | unsigned short read_buf2_len; | |
426 | /* 0:HOST_PCM_INTF disable | |
427 | ** 0xFFFF: HOST_PCM_INTF enable | |
428 | */ | |
429 | signed short dsp_to_arm_flag; | |
430 | unsigned short partition_number; | |
431 | ||
432 | /* ARM -> DSP Configuration */ | |
433 | unsigned short write_buf1LSW; | |
434 | unsigned short write_buf1MSW; | |
435 | unsigned short write_buf1_len; | |
436 | ||
437 | unsigned short write_buf2LSW; | |
438 | unsigned short write_buf2MSW; | |
439 | unsigned short write_buf2_len; | |
440 | ||
441 | /* 0:HOST_PCM_INTF disable | |
442 | ** 0xFFFF: HOST_PCM_INTF enable | |
443 | */ | |
444 | signed short arm_to_rx_flag; | |
445 | unsigned short weight_decoder_to_rx; | |
446 | unsigned short weight_arm_to_rx; | |
447 | ||
448 | unsigned short partition_number_arm_to_dsp; | |
449 | unsigned short sample_rate; | |
450 | unsigned short channel_mode; | |
451 | } __attribute__((packed)) audpp_cmd_pcm_intf; | |
452 | ||
453 | /* | |
454 | ** BUFFER UPDATE COMMAND | |
455 | */ | |
456 | #define AUDPP_CMD_PCM_INTF_SEND_BUF_PARAMS_LEN \ | |
457 | sizeof(audpp_cmd_pcm_intf_send_buffer) | |
458 | ||
459 | typedef struct { | |
460 | unsigned short cmd_id; | |
461 | unsigned short host_pcm_object; | |
462 | /* set config = 0xFFFF for configuration*/ | |
463 | signed short config; | |
464 | unsigned short intf_type; | |
465 | unsigned short dsp_to_arm_buf_id; | |
466 | unsigned short arm_to_dsp_buf_id; | |
467 | unsigned short arm_to_dsp_buf_len; | |
468 | } __attribute__((packed)) audpp_cmd_pcm_intf_send_buffer; | |
469 | ||
470 | ||
471 | /* | |
472 | * Commands Related to uPAudPPCmd3Queue | |
473 | */ | |
474 | ||
475 | /* | |
476 | * Command Structure to configure post processing params (Commmon) | |
477 | */ | |
478 | ||
479 | #define AUDPP_CMD_CFG_OBJECT_PARAMS 0x0000 | |
480 | #define AUDPP_CMD_CFG_OBJECT_PARAMS_COMMON_LEN \ | |
481 | sizeof(audpp_cmd_cfg_object_params_common) | |
482 | ||
483 | #define AUDPP_CMD_OBJ0_UPDATE 0x8000 | |
484 | #define AUDPP_CMD_OBJ0_DONT_UPDATE 0x0000 | |
485 | ||
486 | #define AUDPP_CMD_OBJ1_UPDATE 0x8000 | |
487 | #define AUDPP_CMD_OBJ1_DONT_UPDATE 0x0000 | |
488 | ||
489 | #define AUDPP_CMD_OBJ2_UPDATE 0x8000 | |
490 | #define AUDPP_CMD_OBJ2_DONT_UPDATE 0x0000 | |
491 | ||
492 | #define AUDPP_CMD_OBJ3_UPDATE 0x8000 | |
493 | #define AUDPP_CMD_OBJ3_DONT_UPDATE 0x0000 | |
494 | ||
495 | #define AUDPP_CMD_OBJ4_UPDATE 0x8000 | |
496 | #define AUDPP_CMD_OBJ4_DONT_UPDATE 0x0000 | |
497 | ||
498 | #define AUDPP_CMD_HPCM_UPDATE 0x8000 | |
499 | #define AUDPP_CMD_HPCM_DONT_UPDATE 0x0000 | |
500 | ||
501 | #define AUDPP_CMD_COMMON_CFG_UPDATE 0x8000 | |
502 | #define AUDPP_CMD_COMMON_CFG_DONT_UPDATE 0x0000 | |
503 | ||
504 | typedef struct { | |
505 | unsigned short cmd_id; | |
506 | unsigned short obj0_cfg; | |
507 | unsigned short obj1_cfg; | |
508 | unsigned short obj2_cfg; | |
509 | unsigned short obj3_cfg; | |
510 | unsigned short obj4_cfg; | |
511 | unsigned short host_pcm_obj_cfg; | |
512 | unsigned short comman_cfg; | |
513 | unsigned short command_type; | |
514 | } __attribute__((packed)) audpp_cmd_cfg_object_params_common; | |
515 | ||
516 | /* | |
517 | * Command Structure to configure post processing params (Volume) | |
518 | */ | |
519 | ||
520 | #define AUDPP_CMD_CFG_OBJECT_PARAMS_VOLUME_LEN \ | |
521 | sizeof(audpp_cmd_cfg_object_params_volume) | |
522 | ||
523 | typedef struct { | |
524 | audpp_cmd_cfg_object_params_common common; | |
525 | unsigned short volume; | |
526 | unsigned short pan; | |
527 | } __attribute__((packed)) audpp_cmd_cfg_object_params_volume; | |
528 | ||
529 | /* | |
530 | * Command Structure to configure post processing params (PCM Filter) --DOUBT | |
531 | */ | |
532 | ||
533 | typedef struct { | |
534 | unsigned short numerator_b0_filter_lsw; | |
535 | unsigned short numerator_b0_filter_msw; | |
536 | unsigned short numerator_b1_filter_lsw; | |
537 | unsigned short numerator_b1_filter_msw; | |
538 | unsigned short numerator_b2_filter_lsw; | |
539 | unsigned short numerator_b2_filter_msw; | |
540 | } __attribute__((packed)) numerator; | |
541 | ||
542 | typedef struct { | |
543 | unsigned short denominator_a0_filter_lsw; | |
544 | unsigned short denominator_a0_filter_msw; | |
545 | unsigned short denominator_a1_filter_lsw; | |
546 | unsigned short denominator_a1_filter_msw; | |
547 | } __attribute__((packed)) denominator; | |
548 | ||
549 | typedef struct { | |
550 | unsigned short shift_factor_0; | |
551 | } __attribute__((packed)) shift_factor; | |
552 | ||
553 | typedef struct { | |
554 | unsigned short pan_filter_0; | |
555 | } __attribute__((packed)) pan; | |
556 | ||
557 | typedef struct { | |
558 | numerator numerator_filter; | |
559 | denominator denominator_filter; | |
560 | shift_factor shift_factor_filter; | |
561 | pan pan_filter; | |
562 | } __attribute__((packed)) filter_1; | |
563 | ||
564 | typedef struct { | |
565 | numerator numerator_filter[2]; | |
566 | denominator denominator_filter[2]; | |
567 | shift_factor shift_factor_filter[2]; | |
568 | pan pan_filter[2]; | |
569 | } __attribute__((packed)) filter_2; | |
570 | ||
571 | typedef struct { | |
572 | numerator numerator_filter[3]; | |
573 | denominator denominator_filter[3]; | |
574 | shift_factor shift_factor_filter[3]; | |
575 | pan pan_filter[3]; | |
576 | } __attribute__((packed)) filter_3; | |
577 | ||
578 | typedef struct { | |
579 | numerator numerator_filter[4]; | |
580 | denominator denominator_filter[4]; | |
581 | shift_factor shift_factor_filter[4]; | |
582 | pan pan_filter[4]; | |
583 | } __attribute__((packed)) filter_4; | |
584 | ||
585 | #define AUDPP_CMD_CFG_OBJECT_PARAMS_PCM_LEN \ | |
586 | sizeof(audpp_cmd_cfg_object_params_pcm) | |
587 | ||
588 | ||
589 | typedef struct { | |
590 | audpp_cmd_cfg_object_params_common common; | |
591 | unsigned short active_flag; | |
592 | unsigned short num_bands; | |
593 | union { | |
594 | filter_1 filter_1_params; | |
595 | filter_2 filter_2_params; | |
596 | filter_3 filter_3_params; | |
597 | filter_4 filter_4_params; | |
598 | } __attribute__((packed)) params_filter; | |
599 | } __attribute__((packed)) audpp_cmd_cfg_object_params_pcm; | |
600 | ||
601 | ||
602 | /* | |
603 | * Command Structure to configure post processing parameters (equalizer) | |
604 | */ | |
605 | ||
606 | #define AUDPP_CMD_CFG_OBJECT_PARAMS_EQALIZER_LEN \ | |
607 | sizeof(audpp_cmd_cfg_object_params_eqalizer) | |
608 | ||
609 | typedef struct { | |
610 | unsigned short numerator_coeff_0_lsw; | |
611 | unsigned short numerator_coeff_0_msw; | |
612 | unsigned short numerator_coeff_1_lsw; | |
613 | unsigned short numerator_coeff_1_msw; | |
614 | unsigned short numerator_coeff_2_lsw; | |
615 | unsigned short numerator_coeff_2_msw; | |
616 | } __attribute__((packed)) eq_numerator; | |
617 | ||
618 | typedef struct { | |
619 | unsigned short denominator_coeff_0_lsw; | |
620 | unsigned short denominator_coeff_0_msw; | |
621 | unsigned short denominator_coeff_1_lsw; | |
622 | unsigned short denominator_coeff_1_msw; | |
623 | } __attribute__((packed)) eq_denominator; | |
624 | ||
625 | typedef struct { | |
626 | unsigned short shift_factor; | |
627 | } __attribute__((packed)) eq_shiftfactor; | |
628 | ||
629 | typedef struct { | |
630 | eq_numerator numerator; | |
631 | eq_denominator denominator; | |
632 | eq_shiftfactor shiftfactor; | |
633 | } __attribute__((packed)) eq_coeff_1; | |
634 | ||
635 | typedef struct { | |
636 | eq_numerator numerator[2]; | |
637 | eq_denominator denominator[2]; | |
638 | eq_shiftfactor shiftfactor[2]; | |
639 | } __attribute__((packed)) eq_coeff_2; | |
640 | ||
641 | typedef struct { | |
642 | eq_numerator numerator[3]; | |
643 | eq_denominator denominator[3]; | |
644 | eq_shiftfactor shiftfactor[3]; | |
645 | } __attribute__((packed)) eq_coeff_3; | |
646 | ||
647 | typedef struct { | |
648 | eq_numerator numerator[4]; | |
649 | eq_denominator denominator[4]; | |
650 | eq_shiftfactor shiftfactor[4]; | |
651 | } __attribute__((packed)) eq_coeff_4; | |
652 | ||
653 | typedef struct { | |
654 | eq_numerator numerator[5]; | |
655 | eq_denominator denominator[5]; | |
656 | eq_shiftfactor shiftfactor[5]; | |
657 | } __attribute__((packed)) eq_coeff_5; | |
658 | ||
659 | typedef struct { | |
660 | eq_numerator numerator[6]; | |
661 | eq_denominator denominator[6]; | |
662 | eq_shiftfactor shiftfactor[6]; | |
663 | } __attribute__((packed)) eq_coeff_6; | |
664 | ||
665 | typedef struct { | |
666 | eq_numerator numerator[7]; | |
667 | eq_denominator denominator[7]; | |
668 | eq_shiftfactor shiftfactor[7]; | |
669 | } __attribute__((packed)) eq_coeff_7; | |
670 | ||
671 | typedef struct { | |
672 | eq_numerator numerator[8]; | |
673 | eq_denominator denominator[8]; | |
674 | eq_shiftfactor shiftfactor[8]; | |
675 | } __attribute__((packed)) eq_coeff_8; | |
676 | ||
677 | typedef struct { | |
678 | eq_numerator numerator[9]; | |
679 | eq_denominator denominator[9]; | |
680 | eq_shiftfactor shiftfactor[9]; | |
681 | } __attribute__((packed)) eq_coeff_9; | |
682 | ||
683 | typedef struct { | |
684 | eq_numerator numerator[10]; | |
685 | eq_denominator denominator[10]; | |
686 | eq_shiftfactor shiftfactor[10]; | |
687 | } __attribute__((packed)) eq_coeff_10; | |
688 | ||
689 | typedef struct { | |
690 | eq_numerator numerator[11]; | |
691 | eq_denominator denominator[11]; | |
692 | eq_shiftfactor shiftfactor[11]; | |
693 | } __attribute__((packed)) eq_coeff_11; | |
694 | ||
695 | typedef struct { | |
696 | eq_numerator numerator[12]; | |
697 | eq_denominator denominator[12]; | |
698 | eq_shiftfactor shiftfactor[12]; | |
699 | } __attribute__((packed)) eq_coeff_12; | |
700 | ||
701 | ||
702 | typedef struct { | |
703 | audpp_cmd_cfg_object_params_common common; | |
704 | unsigned short eq_flag; | |
705 | unsigned short num_bands; | |
706 | union { | |
707 | eq_coeff_1 eq_coeffs_1; | |
708 | eq_coeff_2 eq_coeffs_2; | |
709 | eq_coeff_3 eq_coeffs_3; | |
710 | eq_coeff_4 eq_coeffs_4; | |
711 | eq_coeff_5 eq_coeffs_5; | |
712 | eq_coeff_6 eq_coeffs_6; | |
713 | eq_coeff_7 eq_coeffs_7; | |
714 | eq_coeff_8 eq_coeffs_8; | |
715 | eq_coeff_9 eq_coeffs_9; | |
716 | eq_coeff_10 eq_coeffs_10; | |
717 | eq_coeff_11 eq_coeffs_11; | |
718 | eq_coeff_12 eq_coeffs_12; | |
719 | } __attribute__((packed)) eq_coeff; | |
720 | } __attribute__((packed)) audpp_cmd_cfg_object_params_eqalizer; | |
721 | ||
722 | ||
723 | /* | |
724 | * Command Structure to configure post processing parameters (ADRC) | |
725 | */ | |
726 | ||
727 | #define AUDPP_CMD_CFG_OBJECT_PARAMS_ADRC_LEN \ | |
728 | sizeof(audpp_cmd_cfg_object_params_adrc) | |
729 | ||
730 | ||
731 | #define AUDPP_CMD_ADRC_FLAG_DIS 0x0000 | |
732 | #define AUDPP_CMD_ADRC_FLAG_ENA -1 | |
733 | ||
734 | typedef struct { | |
735 | audpp_cmd_cfg_object_params_common common; | |
736 | signed short adrc_flag; | |
737 | unsigned short compression_th; | |
738 | unsigned short compression_slope; | |
739 | unsigned short rms_time; | |
740 | unsigned short attack_const_lsw; | |
741 | unsigned short attack_const_msw; | |
742 | unsigned short release_const_lsw; | |
743 | unsigned short release_const_msw; | |
744 | unsigned short adrc_system_delay; | |
745 | } __attribute__((packed)) audpp_cmd_cfg_object_params_adrc; | |
746 | ||
747 | /* | |
748 | * Command Structure to configure post processing parameters(Spectrum Analizer) | |
749 | */ | |
750 | ||
751 | #define AUDPP_CMD_CFG_OBJECT_PARAMS_SPECTRAM_LEN \ | |
752 | sizeof(audpp_cmd_cfg_object_params_spectram) | |
753 | ||
754 | ||
755 | typedef struct { | |
756 | audpp_cmd_cfg_object_params_common common; | |
757 | unsigned short sample_interval; | |
758 | unsigned short num_coeff; | |
759 | } __attribute__((packed)) audpp_cmd_cfg_object_params_spectram; | |
760 | ||
761 | /* | |
762 | * Command Structure to configure post processing parameters (QConcert) | |
763 | */ | |
764 | ||
765 | #define AUDPP_CMD_CFG_OBJECT_PARAMS_QCONCERT_LEN \ | |
766 | sizeof(audpp_cmd_cfg_object_params_qconcert) | |
767 | ||
768 | ||
769 | #define AUDPP_CMD_QCON_ENA_FLAG_ENA -1 | |
770 | #define AUDPP_CMD_QCON_ENA_FLAG_DIS 0x0000 | |
771 | ||
772 | #define AUDPP_CMD_QCON_OP_MODE_HEADPHONE -1 | |
773 | #define AUDPP_CMD_QCON_OP_MODE_SPEAKER_FRONT 0x0000 | |
774 | #define AUDPP_CMD_QCON_OP_MODE_SPEAKER_SIDE 0x0001 | |
775 | #define AUDPP_CMD_QCON_OP_MODE_SPEAKER_DESKTOP 0x0002 | |
776 | ||
777 | #define AUDPP_CMD_QCON_GAIN_UNIT 0x7FFF | |
778 | #define AUDPP_CMD_QCON_GAIN_SIX_DB 0x4027 | |
779 | ||
780 | ||
781 | #define AUDPP_CMD_QCON_EXPANSION_MAX 0x7FFF | |
782 | ||
783 | ||
784 | typedef struct { | |
785 | audpp_cmd_cfg_object_params_common common; | |
786 | signed short enable_flag; | |
787 | signed short output_mode; | |
788 | signed short gain; | |
789 | signed short expansion; | |
790 | signed short delay; | |
791 | unsigned short stages_per_mode; | |
792 | } __attribute__((packed)) audpp_cmd_cfg_object_params_qconcert; | |
793 | ||
794 | /* | |
795 | * Command Structure to configure post processing parameters (Side Chain) | |
796 | */ | |
797 | ||
798 | #define AUDPP_CMD_CFG_OBJECT_PARAMS_SIDECHAIN_LEN \ | |
799 | sizeof(audpp_cmd_cfg_object_params_sidechain) | |
800 | ||
801 | ||
802 | #define AUDPP_CMD_SIDECHAIN_ACTIVE_FLAG_DIS 0x0000 | |
803 | #define AUDPP_CMD_SIDECHAIN_ACTIVE_FLAG_ENA -1 | |
804 | ||
805 | typedef struct { | |
806 | audpp_cmd_cfg_object_params_common common; | |
807 | signed short active_flag; | |
808 | unsigned short num_bands; | |
809 | union { | |
810 | filter_1 filter_1_params; | |
811 | filter_2 filter_2_params; | |
812 | filter_3 filter_3_params; | |
813 | filter_4 filter_4_params; | |
814 | } __attribute__((packed)) params_filter; | |
815 | } __attribute__((packed)) audpp_cmd_cfg_object_params_sidechain; | |
816 | ||
817 | ||
818 | /* | |
819 | * Command Structure to configure post processing parameters (QAFX) | |
820 | */ | |
821 | ||
822 | #define AUDPP_CMD_CFG_OBJECT_PARAMS_QAFX_LEN \ | |
823 | sizeof(audpp_cmd_cfg_object_params_qafx) | |
824 | ||
825 | #define AUDPP_CMD_QAFX_ENA_DISA 0x0000 | |
826 | #define AUDPP_CMD_QAFX_ENA_ENA_CFG -1 | |
827 | #define AUDPP_CMD_QAFX_ENA_DIS_CFG 0x0001 | |
828 | ||
829 | #define AUDPP_CMD_QAFX_CMD_TYPE_ENV 0x0100 | |
830 | #define AUDPP_CMD_QAFX_CMD_TYPE_OBJ 0x0010 | |
831 | #define AUDPP_CMD_QAFX_CMD_TYPE_QUERY 0x1000 | |
832 | ||
833 | #define AUDPP_CMD_QAFX_CMDS_ENV_OP_MODE 0x0100 | |
834 | #define AUDPP_CMD_QAFX_CMDS_ENV_LIS_POS 0x0101 | |
835 | #define AUDPP_CMD_QAFX_CMDS_ENV_LIS_ORI 0x0102 | |
836 | #define AUDPP_CMD_QAFX_CMDS_ENV_LIS_VEL 0X0103 | |
837 | #define AUDPP_CMD_QAFX_CMDS_ENV_ENV_RES 0x0107 | |
838 | ||
839 | #define AUDPP_CMD_QAFX_CMDS_OBJ_SAMP_FREQ 0x0010 | |
840 | #define AUDPP_CMD_QAFX_CMDS_OBJ_VOL 0x0011 | |
841 | #define AUDPP_CMD_QAFX_CMDS_OBJ_DIST 0x0012 | |
842 | #define AUDPP_CMD_QAFX_CMDS_OBJ_POS 0x0013 | |
843 | #define AUDPP_CMD_QAFX_CMDS_OBJ_VEL 0x0014 | |
844 | ||
845 | ||
846 | typedef struct { | |
847 | audpp_cmd_cfg_object_params_common common; | |
848 | signed short enable; | |
849 | unsigned short command_type; | |
850 | unsigned short num_commands; | |
851 | unsigned short commands; | |
852 | } __attribute__((packed)) audpp_cmd_cfg_object_params_qafx; | |
853 | ||
854 | /* | |
855 | * Command Structure to enable , disable or configure the reverberation effect | |
856 | * (Common) | |
857 | */ | |
858 | ||
859 | #define AUDPP_CMD_REVERB_CONFIG 0x0001 | |
860 | #define AUDPP_CMD_REVERB_CONFIG_COMMON_LEN \ | |
861 | sizeof(audpp_cmd_reverb_config_common) | |
862 | ||
863 | #define AUDPP_CMD_ENA_ENA 0xFFFF | |
864 | #define AUDPP_CMD_ENA_DIS 0x0000 | |
865 | #define AUDPP_CMD_ENA_CFG 0x0001 | |
866 | ||
867 | #define AUDPP_CMD_CMD_TYPE_ENV 0x0104 | |
868 | #define AUDPP_CMD_CMD_TYPE_OBJ 0x0015 | |
869 | #define AUDPP_CMD_CMD_TYPE_QUERY 0x1000 | |
870 | ||
871 | ||
872 | typedef struct { | |
873 | unsigned short cmd_id; | |
874 | unsigned short enable; | |
875 | unsigned short cmd_type; | |
876 | } __attribute__((packed)) audpp_cmd_reverb_config_common; | |
877 | ||
878 | /* | |
879 | * Command Structure to enable , disable or configure the reverberation effect | |
880 | * (ENV-0x0104) | |
881 | */ | |
882 | ||
883 | #define AUDPP_CMD_REVERB_CONFIG_ENV_104_LEN \ | |
884 | sizeof(audpp_cmd_reverb_config_env_104) | |
885 | ||
886 | typedef struct { | |
887 | audpp_cmd_reverb_config_common common; | |
888 | unsigned short env_gain; | |
889 | unsigned short decay_msw; | |
890 | unsigned short decay_lsw; | |
891 | unsigned short decay_timeratio_msw; | |
892 | unsigned short decay_timeratio_lsw; | |
893 | unsigned short delay_time; | |
894 | unsigned short reverb_gain; | |
895 | unsigned short reverb_delay; | |
896 | } __attribute__((packed)) audpp_cmd_reverb_config_env_104; | |
897 | ||
898 | /* | |
899 | * Command Structure to enable , disable or configure the reverberation effect | |
900 | * (ENV-0x0015) | |
901 | */ | |
902 | ||
903 | #define AUDPP_CMD_REVERB_CONFIG_ENV_15_LEN \ | |
904 | sizeof(audpp_cmd_reverb_config_env_15) | |
905 | ||
906 | typedef struct { | |
907 | audpp_cmd_reverb_config_common common; | |
908 | unsigned short object_num; | |
909 | unsigned short absolute_gain; | |
910 | } __attribute__((packed)) audpp_cmd_reverb_config_env_15; | |
911 | ||
912 | ||
913 | #endif /* QDSP5AUDPPCMDI_H */ | |
914 |