1 //<MStar Software> 2 //****************************************************************************** 3 // MStar Software 4 // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved. 5 // All software, firmware and related documentation herein ("MStar Software") are 6 // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by 7 // law, including, but not limited to, copyright law and international treaties. 8 // Any use, modification, reproduction, retransmission, or republication of all 9 // or part of MStar Software is expressly prohibited, unless prior written 10 // permission has been granted by MStar. 11 // 12 // By accessing, browsing and/or using MStar Software, you acknowledge that you 13 // have read, understood, and agree, to be bound by below terms ("Terms") and to 14 // comply with all applicable laws and regulations: 15 // 16 // 1. MStar shall retain any and all right, ownership and interest to MStar 17 // Software and any modification/derivatives thereof. 18 // No right, ownership, or interest to MStar Software and any 19 // modification/derivatives thereof is transferred to you under Terms. 20 // 21 // 2. You understand that MStar Software might include, incorporate or be 22 // supplied together with third party`s software and the use of MStar 23 // Software may require additional licenses from third parties. 24 // Therefore, you hereby agree it is your sole responsibility to separately 25 // obtain any and all third party right and license necessary for your use of 26 // such third party`s software. 27 // 28 // 3. MStar Software and any modification/derivatives thereof shall be deemed as 29 // MStar`s confidential information and you agree to keep MStar`s 30 // confidential information in strictest confidence and not disclose to any 31 // third party. 32 // 33 // 4. MStar Software is provided on an "AS IS" basis without warranties of any 34 // kind. Any warranties are hereby expressly disclaimed by MStar, including 35 // without limitation, any warranties of merchantability, non-infringement of 36 // intellectual property rights, fitness for a particular purpose, error free 37 // and in conformity with any international standard. You agree to waive any 38 // claim against MStar for any loss, damage, cost or expense that you may 39 // incur related to your use of MStar Software. 40 // In no event shall MStar be liable for any direct, indirect, incidental or 41 // consequential damages, including without limitation, lost of profit or 42 // revenues, lost or damage of data, and unauthorized system use. 43 // You agree that this Section 4 shall still apply without being affected 44 // even if MStar Software has been modified by MStar in accordance with your 45 // request or instruction for your use, except otherwise agreed by both 46 // parties in writing. 47 // 48 // 5. If requested, MStar may from time to time provide technical supports or 49 // services in relation with MStar Software to you for your use of 50 // MStar Software in conjunction with your or your customer`s product 51 // ("Services"). 52 // You understand and agree that, except otherwise agreed by both parties in 53 // writing, Services are provided on an "AS IS" basis and the warranty 54 // disclaimer set forth in Section 4 above shall apply. 55 // 56 // 6. Nothing contained herein shall be construed as by implication, estoppels 57 // or otherwise: 58 // (a) conferring any license or right to use MStar name, trademark, service 59 // mark, symbol or any other identification; 60 // (b) obligating MStar or any of its affiliates to furnish any person, 61 // including without limitation, you and your customers, any assistance 62 // of any kind whatsoever, or any information; or 63 // (c) conferring any license or right under any intellectual property right. 64 // 65 // 7. These terms shall be governed by and construed in accordance with the laws 66 // of Taiwan, R.O.C., excluding its conflict of law rules. 67 // Any and all dispute arising out hereof or related hereto shall be finally 68 // settled by arbitration referred to the Chinese Arbitration Association, 69 // Taipei in accordance with the ROC Arbitration Law and the Arbitration 70 // Rules of the Association by three (3) arbitrators appointed in accordance 71 // with the said Rules. 72 // The place of arbitration shall be in Taipei, Taiwan and the language shall 73 // be English. 74 // The arbitration award shall be final and binding to both parties. 75 // 76 //****************************************************************************** 77 //<MStar Software> 78 //////////////////////////////////////////////////////////////////////////////// 79 // 80 // Copyright (c) 2008-2009 MStar Semiconductor, Inc. 81 // All rights reserved. 82 // 83 // Unless otherwise stipulated in writing, any and all information contained 84 // herein regardless in any format shall remain the sole proprietary of 85 // MStar Semiconductor Inc. and be kept in strict confidence 86 // ("MStar Confidential Information") by the recipient. 87 // Any unauthorized act including without limitation unauthorized disclosure, 88 // copying, use, reproduction, sale, distribution, modification, disassembling, 89 // reverse bEngineering and compiling of the contents of MStar Confidential 90 // Information is unlawful and strictly prohibited. MStar hereby reserves the 91 // rights to any and all damages, losses, costs and expenses resulting therefrom. 92 // 93 //////////////////////////////////////////////////////////////////////////////// 94 95 #ifndef _HALADVSOUND_H_ 96 #define _HALADVSOUND_H_ 97 98 #include "MsTypes.h" 99 100 101 #ifdef __cplusplus 102 extern "C" 103 { 104 #endif 105 106 typedef enum 107 { 108 SRS_TBHDX_SPEAKERSIZE_40HZ,///0 109 SRS_TBHDX_SPEAKERSIZE_50HZ,///1 110 SRS_TBHDX_SPEAKERSIZE_60HZ,///2 111 SRS_TBHDX_SPEAKERSIZE_70HZ,///3 112 SRS_TBHDX_SPEAKERSIZE_80HZ,///4 113 SRS_TBHDX_SPEAKERSIZE_90HZ,///5 114 SRS_TBHDX_SPEAKERSIZE_100HZ,///6 115 SRS_TBHDX_SPEAKERSIZE_110HZ,///7 116 SRS_TBHDX_SPEAKERSIZE_120HZ,///8 117 SRS_TBHDX_SPEAKERSIZE_130HZ,///9 118 SRS_TBHDX_SPEAKERSIZE_140HZ,///10 119 SRS_TBHDX_SPEAKERSIZE_150HZ,///11 120 SRS_TBHDX_SPEAKERSIZE_160HZ,///12 121 SRS_TBHDX_SPEAKERSIZE_170HZ,///13 122 SRS_TBHDX_SPEAKERSIZE_180HZ,///14 123 SRS_TBHDX_SPEAKERSIZE_190HZ,///15 124 SRS_TBHDX_SPEAKERSIZE_200HZ,///16 125 SRS_TBHDX_SPEAKERSIZE_210HZ,///17 126 SRS_TBHDX_SPEAKERSIZE_220HZ,///18 127 SRS_TBHDX_SPEAKERSIZE_230HZ,///19 128 SRS_TBHDX_SPEAKERSIZE_240HZ,///20 129 SRS_TBHDX_SPEAKERSIZE_250HZ,///21 130 SRS_TBHDX_SPEAKERSIZE_300HZ,///22 131 SRS_TBHDX_SPEAKERSIZE_400HZ,///23 132 SRS_TBHDX_SPEAKERSIZE_500HZ,///24 133 SRS_TBHDX_SPEAKERSIZE_600HZ,///25 134 SRS_TBHDX_SPEAKERSIZE_CUSTOM, 135 SRS_TBHDX_SPEAKERSIZE_SIZES, 136 SRS_TBHDX_SPEAKERSIZE_UNUSED = 0x7FFFFFFF 137 } SRSTBHDXSpeakerSize; 138 #define AUDIO_USE_SOUND_EFFECT_PL2 0 //ID = 0 139 #define AUDIO_USE_SOUND_EFFECT_BBE 0 //ID = 1 140 #define AUDIO_USE_SOUND_EFFECT_SRS 0 //ID = 2 141 #define AUDIO_USE_SOUND_EFFECT_VDS 0 //ID = 3 142 #define AUDIO_USE_SOUND_EFFECT_VSPK 0 //ID = 4 143 #define AUDIO_USE_SOUND_EFFECT_SUPVOICE 0 //ID = 5 144 #define AUDIO_USE_SOUND_EFFECT_TSHD 0 //ID = 6 145 #define AUDIO_USE_SOUND_EFFECT_XEN 0 //ID = 7 146 #define AUDIO_USE_SOUND_EFFECT_TSHDVIQ 0 //ID = 8 147 #define AUDIO_USE_SOUND_EFFECT_ADV 0 //ID = 9 148 #define AUDIO_USE_SOUND_EFFECT_DBX 0 //ID = 10 149 #define AUDIO_USE_SOUND_EFFECT_THEATERSOUND 0 //ID = 11 150 #define AUDIO_USE_SOUND_EFFECT_PURESND 1 //ID = 12 151 152 //SRS APOLLO 153 typedef enum 154 { 155 HAL_APOLLO_EN, 156 HAL_TSHD_EN, 157 HAL_TRUBASS_FRONT_EN, 158 HAL_DEFINITION_FRONT_EN, 159 HAL_DIALOG_CLARITY_EN, 160 HAL_SURROUND_LEVEL_CTRL, 161 HAL_TSHD_INPUT_GAIN, 162 HAL_DEFINITION_FRONT_CTRL, 163 HAL_DIALOG_CLARITY_CTRL, 164 HAL_TRUBASS_FRONT_CTRL, 165 HAL_LOW_END_FRONT_SPEAKER_FREQ, 166 HAL_HL_EN, 167 HAL_HL_LIMIT_LEVEL, 168 HAL_HL_BOOST_GAIN, 169 HAL_APOLLO_HEADROOM_GAIN, 170 HAL_AEQ_PEQ_EN, 171 HAL_AEQ_HPF_EN, 172 HAL_AEQ_GEQ_EN, 173 HAL_VIQ_EN, 174 HAL_VIQ_MODE, 175 HAL_VIQ_VOL_REF_LEVEL, 176 HAL_VIQ_MAX_GAIN, 177 HAL_VIQ_NOISE_MNGR_THLD, 178 HAL_VIQ_CALIBRATE, 179 } HAL_ADVAUDIO_SRSAPOLLOTYPE; 180 181 //===================================================== 182 // Declare audio function here. 183 //===================================================== 184 void HAL_SOUND_AseSetBinAddress(MS_U8 u8Index, MS_U32 BinAddr); 185 void HAL_SOUND_VDS_Enable(MS_U8 u8enVDS); 186 void HAL_SOUND_VSPK_Enable(MS_U8 u8enVSPK); 187 void HAL_SOUND_SRS_SetTsxtPara(MS_U8 u8mode, MS_U8 u8value); 188 void HAL_SOUND_SRS_SetTshdPara(MS_U8 u8mode, MS_U8 u8value); 189 void HAL_SOUND_SRS_Enable(MS_U8 u8enSRS); 190 void HAL_SOUND_TSHD_Enable(MS_U8 u8enSRS); 191 void HAL_SOUND_VSPK_SetWMod(MS_U8 u8VSPK_WMode); 192 void HAL_SOUND_VSPK_SetSMod(MS_U8 u8VSPK_SMode); 193 void HAL_SOUND_BBE_SetBbeMode(MS_U8 u8EnBBE, MS_U8 u8BBEMode); 194 void HAL_SOUND_SetPara(MS_U8 u8Addr1, MS_U8 u8Addr2, MS_U8 u8Value1, MS_U8 u8Value2, MS_U8 u8Value3); 195 void HAL_SOUND_SRS_DC(MS_U8 u8SRSenDC); 196 void HAL_SOUND_SRS_TruBass(MS_U8 u8SRSenTruBass); 197 void HAL_SOUND_TSHD_TruBass(MS_U8 u8TSHDenTruBass); 198 void HAL_SOUND_TSHD_Definition(MS_U8 u8TSHDenDefinition); 199 void HAL_SOUND_TSHD_Clarity(MS_U8 u8TSHDenClarity); 200 void HAL_SOUND_TSHD_TruSurr(MS_U8 u8TSHDenTruSurr); 201 void HAL_SOUND_TSHD_Limiter(MS_U8 u8TSHDenLimiter); 202 void HAL_SOUND_TSHD_SRS3D(MS_U8 u8TSHDenSRS3D); 203 void HAL_SOUND_TruVolume_Enable(MS_U8 u8TSHDenTVol); 204 void HAL_SOUND_ADV_SetPara(MS_U8 u8mode, MS_U8 u8value); 205 void HAL_SOUND_ADSY_SetPara(MS_U8 u8mode, MS_U8 u8value); 206 void HAL_SOUND_SRS_APOLLO_SetPara(MS_U8 u8mode, MS_U32 u32param, MS_U16 u16value2); 207 void HAL_SOUND_DTSPRTV_SYM_Enable( MS_U8 enable); 208 void HAL_SOUND_DTSPRTV_SYM_Default(MS_U8 Value); 209 void HAL_SOUND_DTSPRTV_SYM_Mode(MS_U8 Value); 210 void HAL_SOUND_DTSPRTV_SYM_Level(MS_U8 Value); 211 void HAL_SOUND_DTSPRTV_EVO_Enable(MS_U8 Value); 212 void HAL_SOUND_DTSPRTV_EVO_MonoInput(MS_U8 Value); 213 void HAL_SOUND_DTSPRTV_EVO_WideningOn(MS_U8 Value); 214 void HAL_SOUND_DTSPRTV_EVO_PCELevel(MS_U8 Value); 215 void HAL_SOUND_DTSPRTV_EVO_VLFELevel(MS_U8 Value); 216 217 MS_BOOL HAL_ADVSOUND_ProcessEnable(AUDIO_DSP_CODE_TYPE type); 218 MS_BOOL HAL_ADVSOUND_SubProcessEnable(ADVFUNC proc, MS_BOOL enable); 219 MS_BOOL HAL_ADVSOUND_SetParam(ADVSND_PARAM param, MS_U32 u32param, MS_U16 u16value2); 220 void HAL_AUDIO_COPY_Parameter(ADVSND_PARAM type, void* Parameter_ptr, MS_U32 size); 221 MS_BOOL HAL_SOUND_DBX_Enable(MS_BOOL u8enDBX); 222 MS_BOOL HAL_SET_DBX_MODE(MS_U8 u8enMODE); 223 int HAL_Copy(MS_U32 *ptr_data, MS_U32 Address, MS_U32 Length); 224 void HAL_DBXTV_SetMode(EN_DBXTV_TotSonMode enTotSonMode, EN_DBXTV_TotVolMode enTotVolMode, EN_DBXTV_TotSurMode enTotSurMode,MS_U32 enable); 225 void HAL_SOUND_DBX_COPY_DM(MS_U32 *DM_ptr,MS_U32 size); 226 void HAL_SOUND_DBX_COPY_PARAMETERS_FROM_APP(ADVSND_PARAM type, MS_U32 *Parameter_ptr,MS_U32 size); 227 void Hal_DBXTV_SetVolPath(AUDIO_OUTPUT_TYPE path); 228 229 #define u32param_normalize(u32value, u32param, iwl, Q24H, Q24L) {\ 230 u32value = u32param/(1<<iwl);\ 231 if(u32value > 8388607)\ 232 {\ 233 u32value = 8388607;\ 234 }\ 235 Q24H=(unsigned short )((u32value>>16) & 0xFFFF);\ 236 Q24L=(unsigned short )(u32value & 0xFFFF);\ 237 } 238 239 #ifdef __cplusplus 240 } 241 #endif 242 #endif //_DRVADVSOUND_H_ 243