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