#ifndef _DRV_AUDIO_CMDQ_H #define _DRV_AUDIO_CMDQ_H #include "drv_types.h" //#define SISCMDQ_INFO_ADDR (0xba00d800) #define AUDIOCMDQ_INFO_ADDR 0xa0000200 //size : 32x64 = 2048 , cmdq buffer 0xa0000200 ~ 0xa0000a00 #define AUDIOCMDQ_NUMBER (63) #define AUDIOCMDQ_STATUS_ADDR (AUDIOCMDQ_INFO_ADDR + 0x04) #define AUDIOCMDQ_RP_ADDR (AUDIOCMDQ_INFO_ADDR + 0x8) #define AUDIOCMDQ_WP_ADDR (AUDIOCMDQ_INFO_ADDR + 0xc) /* TODO: For decode only path only, SHOULE BE MODIFIED. */ //#define AUDIO_ROM_LAST_DEC_ADDR_REG (AUDIOCMDQ_INFO_ADDR + 0x10) #define AUDIOCMDQ_BYPASS_ADDR (AUDIOCMDQ_INFO_ADDR + 0x14) /////////////////////////////////////////////////////////////////////////////////////////////// // // CMDQ VARIABLE DEFINITION // /////////////////////////////////////////////////////////////////////////////////////////////// //#define AUDIO_CURR_CPU2_USED_BUFFNO_ADDR (0x9a018100) #define AUDIO_CID 0x03 #define AUDIO_FLAG_DECODING 0x01 #define AUDIO_FLAG_BYPASS 0x02 #define AUDIO_FLAG_PCM_OUT 0x03 #define AUDIO_FLAG_REPACKAGE 0x04 #define AUDIO_FLAG_INFO 0x05 #define AUDIO_FLAG_MEDIA_PCM_OUT 0x06 #define AUDIO_FLAG_SET_PTS_OFFSET 0x10 #define AUDIO_FLAG_FREE_RUN_STOP_ENABLE 0x20 #define AUDIO_FLAG_MUTE_ENABLE 0x30 #define AUDIO_FLAG_MUTE_DISABLE 0x40 #define AUDIO_FLAG_RESET_ALL 0x50 #define AUDIO_FLAG_RESET_BYPASS 0x51 //hauchuen@20100630 add for bypass cmdq cmd when reset audio eng #define AUDIO_FLAG_RESET_AUDIOROM_ONLY 0x52 //HC add , only reset audiorom status. #define AUDIO_FLAG_TSXT_SETTING 0x60 // joujean add for SRS 20080221 #define AUDIO_FLAG_TRUEVOL_SETTING 0x61 //20090410 Kai for SRS TrueVolume #define AUDIO_FLAG_TSHD_SETTING 0x62 #define AUDIO_FLAG_DBXAUDIO_SETTING 0x63 #define AUDIO_FLAG_TITOI_SETTING 0x64 //#define AUDIO_FLAG_SIS_AUDIOEFFECT 0x66 // joujean add for Audio Effect 20080618 #define AUDIO_FLAG_AUDIOEFFECT_SETTING 0x67 #define AUDIO_FLAG_MAXIMUS_SURROUND 0x68 //20170113 BJT add for maximus surround #define AUDIO_FLAG_EQ_SETTING 0x70 // joujean add for EQ 20080221 #define AUDIO_FLAG_PEQ_SETTING 0x71 // hauchuen@20100205 #define AUDIO_FLAG_SHELVING_SETTING 0x72 // john@20130423 #define AUDIO_FLAG_CUT_OFF 0x73 #define AUDIO_FLAG_FADE_CTL 0x74 //AUDIO FADE IN OUT CONTROL #define AUDIO_FLAG_HPLP_SETTING 0x75 //AUDIO HIGH/LOW PASS FILTER #define AUDIO_FLAG_AGC_SETTING 0x80 // joujean add for AGC 20080320 #define AUDIO_FLAG_DOLBY_DIGITAL_SETTINGS 0x90 #define AUDIO_FLAG_WMA_SETTINGS 0x91 //Kai 20091223 #define AUDIO_FLAG_ENCODING 0xa0 //steve add for encoding only path 20110423 #define AUDIO_FLAG_DSP 0xb0 #define AUDIO_FLAG_TXDESP 0xb1 #define AUDIO_FLAG_CHECKTOKEN 0xc0 #define AUDIO_FLAG_CANCEL 0xff #define AUDIO_DATA_TYPE_PCM 0x00 #define AUDIO_DATA_TYPE_MPEG 0x01 #define AUDIO_DATA_TYPE_AC3 0x02 #define AUDIO_DATA_TYPE_DTS 0x03 #define AUDIO_DATA_TYPE_AAC 0x04 #define AUDIO_DATA_TYPE_MP3 0x05 #define AUDIO_DATA_TYPE_REAL 0x06 #define AUDIO_DATA_TYPE_EAC3 0x07 #define AUDIO_DATA_TYPE_WMA 0x08 //Kai 20091223 #define AUDIO_DATA_TYPE_COOK 0x09 #define AUDIO_DATA_TYPE_AMRNB 0x0a #define AUDIO_DATA_TYPE_AMRWB 0x0b #define AUDIO_DATA_TYPE_VORBIS 0x0c #define AUDIO_DATA_TYPE_SILK 0x0d #define AUDIO_DATA_TYPE_ISAC 0x0e #define AUDIO_DATA_TYPE_DRA 0x0f #define AUDIO_DATA_TYPE_FLAC 0x10 #define AUDIO_DATA_TYPE_UNKNOW 0xff #define AUDIO_RX_TYPE_TS 0x00 #define AUDIO_RX_TYPE_HDMI 0x01 #define AUDIO_RX_TYPE_RF 0x02 #define AUDIO_RX_TYPE_LINE 0x03 #define AUDIO_RX_TYPE_USB 0x04 #define AUDIO_RX_TYPE_MP AUDIO_RX_TYPE_USB #define AUDIO_RX_TYPE_ALSA 0x05 // Super@20101026 #define AUDIO_TX_TYPE_NO_OUTPUT 0x00 #define AUDIO_TX_TYPE_ONLY_I2S 0x01 #define AUDIO_TX_TYPE_ONLY_SPDIF 0x02 #define AUDIO_TX_TYPE_I2S_AND_SPDIF_NONLINEAR 0x03 #define AUDIO_TX_TYPE_I2S_AND_SPDIF_LINEAR 0x04 #define AUDIO_TX_TYPE_I2S_AND_SPDIF AUDIO_TX_TYPE_I2S_AND_SPDIF_NONLINEAR// reserved for backward compatible #define AUDIO_TX_TYPE_AD 0x05 #define BYPASS_MESSAGE 0xBABEBED /* * RETURN VALUE OF CMDQ * DEFAULT STORE IN 0xBA00D804 */ typedef enum { /* * NEGATIVE VALUE MEANS THE CODEC FATAL ERROR. */ E_CMDQ_ERROR_BEGINNING = -32768, E_CMDQ_ERROR_GENERAL_ERROR, E_CMDQ_CODEC_INIT_ERROR, E_CMDQ_CODEC_READ_HEADER_ERROR, E_CMDQ_CODEC_PROCESS_ERROR, /* NORMAL RETUN */ E_CMDQ_OK = 0, /* * 0 ~ 32767: RESERVED FOR CODEC ERROR RETURN * MUST TO CHECK EACH CODEC ERROR DEFINITION */ /* * 32768 ~ MAX: FLOW CONTROL */ E_CMDQ_FLOW_CONTROL_INDEX = 32768, E_CMDQ_DOLBY_DDP_NO_DATA = 32768, E_CMDQ_DOLBY_DDP_NO_MATCH_STREAM_ID_TYPE, E_CMDQ_DOLBY_DDP_NO_ENOUGH_PCM_DATA, E_CMDQ_CODEC_INIT_AND_SKIP_1ST_FRAME, E_CMDQ_CODEC_HDMI_SKIP_1ST_FRAME, }E_CMDQ_STATUS; /*~RETURN VALUE OF CMDQ*/ enum { SFREQ_24000, SFREQ_48000, SFREQ_96000, SFREQ_192000, SFREQ_22050, SFREQ_44100, SFREQ_88200, SFREQ_176400, SFREQ_32000, SFREQ_8000, SFREQ_11025, SFREQ_12000, SFREQ_16000, }; enum { SAMPLENUM_1024, SAMPLENUM_2048, }; enum { CH_CNT_2, CH_CNT_6, CH_CNT_8, CH_CNT_RSV, }; enum { I2S_2ch, I2S0_BYPASS, I2S1_BYPASS, I2S_Multi_ch, //I2S Muti output, non bypass feature }; enum { No_CanalPlus, CanalPlus_from_SD3, //FullScart from SD3 CanalPlus_from_SD2, //FullScart from SD2 (swap SD2 and SD3) }; // Dolby Digital dual-mono modes enum _dualmonomode { MIPS_SAI_DDCD_DM_MODE_ST, // stereo MIPS_SAI_DDCD_DM_MODE_LM, // left mono MIPS_SAI_DDCD_DM_MODE_RM, // right mono MIPS_SAI_DDCD_DM_MODE_MM, // mixed mono MIPS_SAI_DDCD_NUM_DM_MODES }; enum{ SUCCESS = 0, EEMPTY, EFULL, EFAIL }; enum{ CID_RS232 = 1, CID_Controller, CID_AUDIO, CID_DEMUX, CID_VIDEO, CID_DMA, CID_I2C, CID_GPIO, CID_EXDEV, CID_VBI, CID_TELTEXT, CID_TIMER }; typedef struct __AUDIOCMDQ_DATA { UINT8 data[32]; }AUDIOCMDQ_DATA; #define AUDIOCMDQ_DATA_LENGTH (sizeof(AUDIOCMDQ_DATA)) /////////////////////////////////////////////////////////////////////////////////////////////// // // CMDQ DATA STRUCTURE DEFINITION // /////////////////////////////////////////////////////////////////////////////////////////////// #pragma pack(push,1) typedef volatile struct __AUDIOCMDQ_INFO { /* DW 00 */ UINT32 cmdq_base; /* DW 01 */ UINT32 codec_status; #define CODECST_OK (0) #define CODECST_FIAL (1) #define CODECST_NODATA (2) #define CODECST_PROCESSING (3) /* DW 02 */ UINT32 rp; /* DW 03 */ UINT32 wp; /* DW 04 */ union{ UINT32 reserved04; UINT32 CMDQ_CUR_DATAPTR; //update current handle audio data pointer(decode and pcm path ) }; /* DW 05 */ union{ UINT32 reserved05; struct{ UINT32 CMDQ_BYPASS_FLAG:8; UINT32 audiorom_debug_log:1; UINT32 audiorom_debug_write:1; UINT32 reserved02_00:22; }; }; /* DW 06 */ union{ UINT32 reserved06; struct { UINT32 sfreq : 4; // 0~12: 24/48/96/192/22.05/44.1/88.2/176.4/32 K/8k/11.025k/12k/16k UINT32 samplenum : 2; //0:1024 1:2048 2~reserved UINT32 reserved7_b6 : 1; UINT32 vaild_status : 1; //0: status didn't update yet, 1:status is valid for driver reference. UINT32 reserved7_b8_b31 : 24; }; }; /* DW 07 */ UINT32 audiocmdq2_baseaddr; /* The following cmdqs */ AUDIOCMDQ_DATA cmdq[0]; }AUDIOCMDQ_INFO,*AUDIOCMDQ_INFO_PTR; typedef volatile struct __AUDIOCMDQ2_INFO { /* DW 00 */ UINT32 reserved_dw00; /* DW 01 */ UINT32 num; /* DW 02 */ UINT32 rp; /* DW 03 */ UINT32 wp; /* DW 04 */ UINT32 reserved_dw04; /* DW 05 */ UINT32 reserved_dw05; /* DW 06 */ UINT32 reserved_dw06; /* DW 07 */ UINT32 reserved_dw07; /* The following cmdqs */ AUDIOCMDQ_DATA cmdq[0]; }AUDIOCMDQ2_INFO,*AUDIOCMDQ2_INFO_PTR; typedef struct _AUDIO_CMDQ { // 1st UINT32 UINT8 CID; UINT8 flag; struct { UINT8 pause : 1; UINT8 discontinue : 1; UINT8 sfreq : 4; // 0~12: 24/48/96/192/22.05/44.1/88.2/176.4/32 K/8k/11.025k/12k/16k UINT8 chcnt : 2; //0/1/2/rsv: sp,2ch/5.1ch/7.1ch/rsv }; UINT8 FrameNo; // 2nd UINT32 UINT8 inDataType; // 0->PCM 1->mpeg 2->AC3 UINT8 outDataType; // 0->PCM 1->mpeg 2->AC3 struct { UINT8 RxType : 4; // 0->TS 1->HDMI //ac3 library configuration UINT8 stereomode : 2; // stereo downmix mode. 0: auto. 1: Lt/Rt. 2: Lo/Ro. UINT8 outputselect : 2; // output select mode. 0: output L,R. 1: output Ls,Rs. 2: output C,Lfe. }; struct { UINT8 TxType : 4; // 1->I2S 2->SPIF 3->Both UINT8 compmode : 2; // compression mode. 0: custom0. 1: custom1. 2: line out mode. 3: RF mode //ac3 library configuration UINT8 dualmonomode : 2; // dual mono mode. 0: streo. 1: left mono. 2: right mono. 3: mixed mono. }; // 3th UINT32 UINT32 DataPtr; // 4th UINT32 union { UINT32 DataSize; // linear : real playing size UINT32 nonlinear_sample_no; // non-linear : sample number. ex. AC3-> 1536, MPEG->1152, etc... }; // 5th UINT32 union { UINT32 PTS; //PTS value 0th ~ 31th bit UINT32 ulTargetAddr; //file mode output target address UINT32 dspbuf_base; //mp used struct { UINT32 PTS_offset :24; UINT32 NLdelayCnt : 8; }; }; // 6th UINT32 union { UINT32 reserved6_b0_b31 : 32; UINT32 dspdesp_idx; //mp used struct { UINT32 PTS_High : 1; //PTS value 32th bit UINT32 copy_protection : 1; //record HDMI CP bit setting UINT32 dolby_loudness_gain_idx: 3; // 0: 0db, 1: -1db, 3= -3db(EU) ,4 = -4db (ATSC) UINT32 reserved6_b5_b7: 3; UINT32 spdif_channel_status_category_code : 8; UINT32 nonlinear_frame_length : 16; //non-linear frame length without SPDIF header and alignment }; }; // 7th UINT32 union { UINT32 ZeroStuffLen; //16 UINT8 unit, length starting from 0, means "length + 1" UINT32 NLsize; //16 UINT8 unit, size starting from 1, mean "length" }; // 8th UINT32 union { /* Audio Description Used */ UINT32 AD_info; struct { UINT32 ucFade : 8; UINT32 ucPan : 8; //UINT32 usAD_Vol : 16; UINT32 usAD_Vol : 8; UINT32 usAD_reserved: 8; }; /*~Audio Description Used */ struct { union { UINT8 spkplace; /* HDMI SPEAKER PLACEMENT */ struct { UINT8 L_invalid : 1; //O UINT8 R_invalid : 1; //P UINT8 Lfe_invalid : 1; //Q UINT8 C_invalid : 1; //R UINT8 Ls_invalid : 1; //S UINT8 Rs_invalid : 1; //T UINT8 SL_invalid : 1; //U UINT8 SR_invalid : 1; //V }; }; UINT8 sp_non_linear_type : 5; /* SPDIF CHANNEL STATUS */ // 1 for AC3 // 4 MPEG1L1 // 5 MPEG1L2,3 or MPEG2 without extension // 6 MPEG2 with extension // 8 MPEG2 L1 low freq // 9 MPEG2 L1 low freq // 10 MPEG2 L1 low UINT8 reserved8_b13_b15 : 3; UINT8 sample_bit : 4; /* HDMI PCM out use*/ UINT8 BuffNo : 4; /* not use now */ union { struct { UINT8 reserved8_24_b27 : 4; UINT8 silk_fmt : 3; /* 0 :SILK_NB_V3 ,1: SILK_MB_V3, 2 SILK_WB_V3, 3 SILK_SW_V3 */ UINT8 reserved8_b31: 1; }; struct { UINT8 FileMode : 1; // file decode enable UINT8 outputmode : 3; /* AC3 library CONFIG */ // 0: 3/2 (L,C,R,l,r). 1: 1/0(C). 2: 2/0(L,R). 3: 3/0(L,C,R). // 4: 2/1 (L,R,l). 5: 3/1(L,C,R,l). 6: 2/2 (L,R,l,r). 7: 3/2 (L,C,R,l,r) //AAC FORMAT SELECT FLAG UINT8 aac_fmt : 2; #define AAC_LATM 0 #define AAC_ADTS 1 #define AAC_ADIF 2 #define AAC_RAW 3 //put AudioSpecificConfig data in cmdbuffer, first UINT8 is length. UINT8 ffmpeg_mode : 1; UINT8 aac_codec: 1; // 1: AAC MAIN 0: IIS AAC //UINT8 asynchronous : 1; //it only used on TXtype=AUDIO_TX_TYPE_NO_OUTPUT }; }; }; }; }AUDIO_CMDQ, *pAUDIO_CMDQ; //Kai 20091223 typedef struct _AUDIO_WMA_SETTINGS_CMDQ { UINT8 CID; UINT8 flag; UINT8 bitspersample; struct { UINT8 channels : 4; UINT8 codec_id : 2; UINT8 tvnoise : 1; UINT8 reserved1 : 1; }; UINT32 samplerate; UINT32 bitrate; UINT32 blockalign; UINT32 datalen; UINT8 data[6]; unsigned short wEncodeOptions; UINT32 dwChannelMask; }AUDIO_WMA_SETTINGS_CMDQ, *pAUDIO_WMA_SETTINGS_CMDQ; //True Volume typedef struct _SRS_AUDIO_TRUEVOL_CMDQ { UINT8 CID; UINT8 flag; struct { UINT8 tv : 1; // TrueVolume enable/bypass UINT8 tvleftenable :1; //TrueVolume left channel enable/disable flag UINT8 tvrightenable :1; //TrueVolume right channel enable/disable flag UINT8 tvnoise : 1; // TrueVolume noise enable/disable flag UINT8 SRSTVEnable : 1; UINT8 reserved1 : 3; }; struct { UINT8 tvmode : 1; // TrueVolume mode, 0~1 UINT8 tvspksize: 3; // TrueVolume speaker size, 0~5 20Hz~410Hz UINT8 reserved2: 4; // TruBass speaker size, 0~7 40Hz~400Hz }; UINT32 inputgain; //input gain, 0~0x7fffffff UINT32 outputgain; //output gain, 0~0x7fffffff UINT32 bypassgain; //bypass gain, 0~0x7fffffff UINT32 referencelevel; //reference gain, 0~0x7fffffff UINT32 maxgain; UINT32 noisethreshold; UINT32 reserved7; }SRS_TRUEVOL_CMDQ, *pSRS_TRUEVOL_CMDQ; //SRS TruSurround HD typedef struct _SRS_TSHD_CMDQ { //1st UINT32 UINT8 CID; UINT8 flag; struct { UINT8 Enable : 1; // SRS TruSurroundHD Enable UINT8 Surround_En : 1; //Surround Enable UINT8 DialogClarity_En : 1; // Focus enable/disable flag (Dialog Clarity) UINT8 TruBassFront_En : 1; // TruBass enable/disable flag UINT8 DefinitionFront_En : 1; UINT8 TruBass_spksize : 3; //// TruBass speaker size, 0~7 40Hz~400Hz }; struct { UINT8 Inputmode : 4; // TruSurround mode, 0~11 UINT8 Outputmode: 3; UINT8 reserved2: 1; }; //2nd UINT32 UINT32 InputGain; UINT32 OutputGain; UINT32 BypassGain; UINT32 SurroundLevel; UINT32 DialogClarityLevel; UINT32 TruBassFrontLevel; UINT32 DefinitionFrontLevel; }SRS_TSHD_CMDQ, *pSRS_TSHD_CMDQ; typedef struct _AUDIO_AGC_CMDQ { // 1st UINT32 UINT8 CID; UINT8 flag; UINT8 Enable; /* True = Process, False = Bypass */ UINT8 limiter_level; //unit -1dB, 0: 0: 0.dB(default), 1: -1dB, 2: -2dB.... Max: 30 : -30dB // 2nd UINT32 UINT8 pullup_gain; //unit: 0.1dB, 0: 0.dB(default), 1: 0.1 dB... max:180(18 dB) UINT8 at_re_rate; //attack/release rate , 0: 1/4 , 1: 1/8, 2: 1/16, 3: 1/32, 4: 1/64 , 5: 1/128 6: 1/256 , 7: 1/512 , 8: 1/1024 9: 1/2048, 10: 1/4096 UINT8 at_speed; //Control attack speed, 0: default(slowest) ~ 7: fastest (30x default) UINT8 active_time; //unit 10ms, 0: 10ms, 1: 20ms .... 15: 160ms // 3rd UINT32 struct { UINT32 pullup_active_level : 8;//unit -1dB, 0: 0: 0.dB(default), 1: -1dB, 2: -2dB.... Max: 30 : -30dB UINT32 free_run_count: 8; //free run count when agc reset, attacke and release rate will be 1:1 UINT32 pl_rate : 8; //0: 1/8, 1:1/16 2: 1/32 3: 1/64, 4 :1/128 5: 1/256 UINT32 detect_mode : 8; //0: peak mode , 1: rms mode }; // 4th UINT32 UINT32 reserved4; // 5th UINT32 UINT32 reserved5; // 6th UINT32 UINT32 reserved6; // 7th UINT32 UINT32 reserved7; // 8th UINT32 UINT32 reserved8; }AUDIO_AGC_CMDQ, *pAUDIO_AGC_CMDQ; typedef struct _AE_CMDQ { // 1st UINT32 UINT8 CID; UINT8 flag; struct { UINT8 enable: 1; UINT8 surround_en:1; UINT8 voice_en: 1; UINT8 bass_en: 1; UINT8 sf_exp: 1; UINT8 Reserved0: 3; }; UINT8 Sur_mode; //surround mode // 2nd UINT32 UINT8 Sur_Lv; // surround level UINT8 Voice_Lv; //voice level UINT8 Bass_Lv; // bass level UINT8 Bass_Freq; // bass freq // 3rd UINT32 struct { UINT32 inputgain :8; UINT32 directgain :8; //only use for S+ Surround UINT32 reverbgain :8; //only use for S+ Surround UINT32 ambiancegain :8; //only use for S+ Surround }; UINT32 reserved4; UINT32 reserved5; UINT32 reserved6; UINT32 reserved7; UINT32 reserved8; }AE_CMDQ, *pAE_CMDQ; typedef struct _MS_AE_CMDQ { // 1st UINT32 UINT8 CID; UINT8 flag; struct { UINT8 MS_enable: 1; UINT8 MS_surround_en:1; UINT8 MS_bass_en: 1; UINT8 MS_voice_en: 1; UINT8 MS_definition_en: 1; UINT8 MS_sf_exp: 1; UINT8 Reserved0: 2; }; UINT8 Sur_mode; //reserved // 2nd UINT32 UINT8 MS_AE_surround_gain ; //surround gain UINT8 MS_Sur_Lv; // surround level delay UINT8 MS_AE_Bass_Freq; // bass freq 0:100 1:200 2:400 UINT8 MS_AE_bassfix_gain; // , default 8 // 3rd UINT32 struct { UINT32 MS_AE_Voice_Lv :8; //voice level ,dialog clarity //0~+10dB (2500Hz EQ) UINT32 MS_AE_Definition_gain :8; // high pass definition 0~+10dB (5000Hz EQ) UINT32 MS_AE_Sur_Delay :8; //for ae_EX UINT32 MS_Headroom :8; //for ae_EX }; UINT32 reserved4; UINT32 reserved5; UINT32 reserved6; UINT32 reserved7; UINT32 reserved8; }MS_AE_CMDQ, *pMS_AE_CMDQ; typedef struct _CUT_OFF_CMDQ { // 1st UINT32 UINT8 CID; UINT8 flag; UINT8 enable; UINT8 freq_index; UINT32 reserved2; UINT32 reserved3; UINT32 reserved4; UINT32 reserved5; UINT32 reserved6; UINT32 reserved7; UINT32 reserved8; }CUT_OFF_CMDQ,*pCUT_OFF_CMDQ; // WARNING! // Now, only use the compmode parameter. // In the future, must replace the dolby ditital settings with // DOLBY_DIGITAL_SETTINGS_CMDQ without using AUDIO_CMDQ typedef struct _DOLBY_DIGITAL_SETTINGS_CMDQ { // 1st UINT32 struct { UINT32 CID : 8; UINT32 flag : 8; UINT32 reconfig : 1; UINT32 reserved1_b17_b23 : 7; UINT32 logo_enable : 1; UINT32 spdif_ac3_enable : 1; UINT32 enable_mixdata_file_out : 1; UINT32 reserved1_b26_b31 : 5; }; // 2nd UINT32 struct { UINT32 outnchans : 3; UINT32 outlfe : 1; UINT32 compmode : 2; UINT32 quitonerr :1; UINT32 reserved2_b7 : 1; UINT32 stereomode : 4; UINT32 dualmode : 4; UINT32 outchanconfig : 4; UINT32 reserved2_b20_b23 : 4; UINT32 upsample : 2; UINT32 kmode : 2; UINT32 enable_pcm_file_out : 1; UINT32 enable_dd_file_out : 1; UINT32 output_channel_select : 2; // 0: L, R. 1: Ls, Rs. 2: C, LFE. }; // 3rd UINT32 UINT32 dynscalehigh; // 4th UINT32 UINT32 dynscalelow; // 5th UINT32 UINT32 pcmscale; // 6th UINT32 // 7th UINT32 UINT8 chanrouting[6]; UINT8 reserved7[2]; // 8th UINT32 UINT32 reserved8; }DOLBY_DIGITAL_SETTINGS_CMDQ, *pDOLBY_DIGITAL_SETTINGS_CMDQ; //hauchuen@20091029 use to send information to audiorom. typedef struct _AUDIO_INFO_CMDQ { // 1st UINT32 UINT8 CID; UINT8 flag; UINT8 I2SPASS; // 0: Normal, 1: I2S0BYPASS, 2:I2S1BYPASS, 3.I2S_Nopass UINT8 CanalPlus; //0: No canalplus, 1:Outpu from SD3, 2, output from SD2(swap SD2&SD3) // 2nd UINT32 UINT32 audio_feature; //support AC3, Real, MP3, SRS TSXT, SRS TV....etc. // 3rd UINT32 struct { UINT32 ALSA_PCM_TYPE : 2; //0: 16bit , 1:24bit (size = 32) , 2,3 : reserved UINT32 dolby_5_8_frm_bypass : 1; //0: check 5/8 frame error , 1:bypass check UINT32 reserved3_b2_b31 : 29; }; // 4th UINT32 UINT32 reserved4; // 5th UINT32 UINT32 reserved5; // 6th UINT32 UINT32 reserved6; // 7th UINT32 UINT32 reserved7; // 8th UINT32 UINT32 reserved8; }AUDIO_INFO_CMDQ, *pAUDIO_INFO_CMDQ; // john@20110630 add for PEQ setting typedef struct _AUDIO_PEQ_SET_CMDQ { // 1st UINT32 UINT8 CID; UINT8 flag; struct { UINT8 reserved1_1: 6; UINT8 type: 1; // set EQ or PEQ, 0=PEQ, 1=PEQ UINT8 enable: 1; // enable or disable peq }; UINT8 reserved1_2; // 2nd UINT32 UINT32 table_addr; // eq/peq table address // 3rd UINT32 UINT32 reserved3; // 4th UINT32 UINT32 reserved4; // 5th UINT32 UINT32 reserved5; // 6th UINT32 UINT32 reserved6; // 7th UINT32 UINT32 reserved7; // 8th UINT32 UINT32 reserved8; }AUDIO_PEQ_SET_CMDQ, *pAUDIO_PEQ_SET_CMDQ; // ~john typedef struct _AUDIO_TITOI_SET_CMDQ { // 1st UINT32 UINT8 CID; UINT8 flag; struct { UINT8 reserved1_1: 7; UINT8 enable: 1; }; UINT8 reserved1_2; // 2nd UINT32 UINT32 table_addr; // eq/peq table address // 3rd UINT32 UINT32 reserved3; // 4th UINT32 UINT32 reserved4; // 5th UINT32 UINT32 reserved5; // 6th UINT32 UINT32 reserved6; // 7th UINT32 UINT32 reserved7; // 8th UINT32 UINT32 reserved8; }AUDIO_TITOI_SET_CMDQ, *pAUDIO_TITOI_SET_CMDQ; // john@20130423 add for shelving setting typedef struct _AUDIO_SHELVING_CMDQ { // 1st dword UINT8 CID; UINT8 flag; struct { UINT8 enable: 1; UINT8 treble_en: 1; UINT8 bass_en: 1; UINT8 reserved1_1: 5; }; UINT8 reserved1_2; // 2nd dword INT8 treble; INT8 bass; UINT8 reserved2_1; UINT8 reserved2_2; // 3rd dword UINT32 samplerate;// not used // 4th dword UINT32 frequency_bass; // 5th dword UINT32 Q_bass;// not used // 6th dword UINT32 frequency_treble; // 7th dword UINT32 Q_treble;// not used // 8th dword UINT32 reserved8; }AUDIO_SHELVING_CMDQ, *pAUDIO_SHELVING_CMDQ; typedef struct _AUDIO_HPLP_CMDQ { // 1st dword UINT8 CID; UINT8 flag; struct { UINT8 enable: 1; UINT8 hp_en: 1; UINT8 lp_en: 1; UINT8 reserved1_1: 5; }; UINT8 reserved1_2; // 2nd dword INT32 reserved2; // 3rd dword INT32 samplerate; // 4th dword INT32 frequency_hp; // 5th dword INT32 Q_hp;//not used // 6th dword INT32 frequency_lp; // 7th dword INT32 Q_lp;//not used // 8th dword UINT32 reserved8; }AUDIO_HPLP_CMDQ, *pAUDIO_HPLP_CMDQ; enum { DBXCMD_TYPE_SET_MODE, //DBX CHANGE MODE DBXCMD_TYPE_INT_TABLE, //DBX TABLE INIT DBXCMD_TYPE_SET_PARAM, //SET DBX PARAMETER }; typedef struct _DBXAUDIO_SET_CMDQ { // 1st dword UINT8 CID; UINT8 flag; UINT8 dbx_enable; // enable or disable dbx function UINT8 type; //o: set mode, 1: table init , 2:set parameter // 2nd dword struct { UINT32 totvol_mode:8; UINT32 totsur_mode:8; UINT32 totson_mode:8; UINT32 reserved2:8; }; // 3rd dword UINT32 enable_flag; //sub_function enable flag. 0x1f = all enable // 4th dword UINT32 dbx_table_addr; //table address for audiorom update parameter // 5th dword UINT32 ParamCoeff; // 6th dword UINT32 ParamCoeffOffset; // 7th dword UINT32 ParamCoeffValue; // 8th dword UINT32 reserved8; }DBXAUDIO_SET_CMDQ, *pDBXAUDIO_SET_CMDQ; /* AUDIO FADE IN OUT CONTROL */ typedef struct _AUDIO_FADE_CMDQ { // 1st dword UINT8 CID; UINT8 flag; UINT8 Enable; /* True = Process, False = Bypass */ UINT8 mode; //0: linear , 1: (Reserved) // 2nd dword UINT8 type; //0: Fade in , 1: (Reserved) UINT8 fade_speed; //0: 1db/ms. 1: db/2ms, 2: db/4ms 3, db/8ms (linear mode) UINT8 fade_level; //fade level : 0:-60db, 1: -40db 2: -20db UINT8 reserved2_4; // 3rd dword UINT32 reserved3; // 4th dword UINT32 reserved4; // 5th dword UINT32 reserved5; // 6th dword UINT32 reserved6; // 7th dword UINT32 reserved7; // 8th dword UINT32 reserved8; }AUDIO_FADE_CMDQ, *pAUDIO_FADE_CMDQ; #pragma pack(pop) static inline INT32 READ_CMDQ_STATUS(void) { return *(int*)AUDIOCMDQ_STATUS_ADDR; } static inline void WRITE_CMDQ_STATUS(E_CMDQ_STATUS e_cmdq_status) { (*(int*)AUDIOCMDQ_STATUS_ADDR)=e_cmdq_status; }; static inline UINT32* Get_CmdQ_RP(void) { return (UINT32*)AUDIOCMDQ_RP_ADDR; } static inline UINT32* Get_CmdQ_WP(void) { return (UINT32*)AUDIOCMDQ_WP_ADDR; } /*~ RETURN VALUE OF CMDQ */ INT32 DRV_Audio_intcmdqfire(void *data); INT32 DRV_Audio_intcmdqfire2(void *data); #endif