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 engineering 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 /////////////////////////////////////////////////////////////////////////////////////////////////// 96 /// 97 /// @file apiAUDIO.h 98 /// @brief AUDIO API 99 /// @author MStar Semiconductor Inc. 100 /////////////////////////////////////////////////////////////////////////////////////////////////// 101 102 /*! \defgroup Audio Audio interface 103 104 \brief 105 Audio Module is used for: 106 107 - 1. Audio Input source handling 108 - support input source as VGA, ATV, CVBS, YPbPr, SCART, HDMI, DTV, MM ... 109 110 - 2. Audio Output source handling 111 - support stereo audio analog output ,SPDIF digital output, I2S, HDMI 1.4 ARC output 112 113 - 3. Basic Sound Effect support 114 - support Volume Control , Bass, Treble, GEQ, PEQ, Surround, AVC ... 115 116 - 4. Digital audio format decoding 117 - support MPEG-1, MPEG-2(Layer I/II), MP3, AC-3,E-AC-3, WMA, HE-AAC, DTS, FLAC, XPCM 118 119 - 5. Advanced Sound Effect support 120 - support SRS-TSHD , SRS-TSXT, DBX.... 121 122 - All audio related features , architecture and bolck diagram are collected in 123 MStar Audio Application Note(Chip dependent). 124 125 *! \defgroup Audio_System System 126 * \ingroup Audio 127 128 *! \defgroup Audio_Decoder Decoder 129 * \ingroup Audio 130 131 *! \defgroup Audio_ATV_SPDIF_HDMI ATV SPDIF HDMI 132 * \ingroup Audio 133 134 *! \defgroup Audio_BASIC_SOUNDEFFECT Basic Sound Effect 135 * \ingroup Audio 136 137 *! \defgroup Audio_ADVANCED_SOUNDEFFECT Advanced Sound Effect 138 * \ingroup Audio 139 140 *! \defgroup Audio_ToBeMerged To Be Merged 141 * \ingroup Audio 142 143 *! \defgroup Audio_ToBeModified To Be Modified 144 * \ingroup Audio 145 146 *! \defgroup Audio_ToBeMoved To Be Moved 147 * \ingroup Audio 148 149 *! \defgroup Audio_ToBeRemove To Be Removed 150 * \ingroup Audio 151 */ 152 153 #ifndef _API_AUDIO_H_ 154 #define _API_AUDIO_H_ 155 156 #include "MsCommon.h" 157 #include "drvAUDIO_if.h" 158 #include "UFO.h" 159 160 161 #ifdef __cplusplus 162 extern "C" 163 { 164 #endif 165 //------------------------------------------------------------------------------------------------- 166 // Macro and Define 167 //------------------------------------------------------------------------------------------------- 168 //----------------------------------------------------------- 169 #define MSAPI_AUD_SPDIF_PCM 0 170 #define MSAPI_AUD_SPDIF_OFF 1 171 #define MSAPI_AUD_SPDIF_NONPCM 2 172 173 #define MSAPI_AUD_DTV_IN 0 174 #define MSAPI_AUD_ATV_IN 1 175 #define MSAPI_AUD_HDMI_IN 2 176 #define MSAPI_AUD_ADC_IN 3 177 #define MSAPI_AUD_CardRD_IN 4 178 #define MSAPI_AUD_MM_IN 5 179 180 #define MSAPI_AUD_AVsync 0 181 #define MSAPI_AUD_FreeRun 1 182 183 /// A2/FM/_SOUND_MOD Report info 184 #define _STATUS_MOD_MONO_EXIST 0x01 185 #define _STATUS_MOD_STEREO_EXIST 0x02 186 #define _STATUS_MOD_DUAL_EXIST 0x04 187 #define _STATUS_MOD_A2_PILOT_EXIST 0x08 188 #define _STATUS_MOD_A2_PRIMARY_EXIST 0x10 189 #define _STATUS_MOD_A2_SECONDARY_EXIST 0x20 190 #define _STATUS_MOD_A2_DK2_EXIST 0x40 191 #define _STATUS_MOD_A2_DK3_EXIST 0x80 192 193 /// NICAM_SOUND_MOD Report info 194 #define _MASK_NICAM_STATUS_INFO 0x0F 195 #define _NICAM_SOUND_MODE_LOCK_STATE 0x05 196 #define _MASK_NICAM_SOUND_MODE_INFO 0xF0 197 #define _NICAM_SOUND_MOD_MONO_NOT_EXIST 0x00 198 #define _NICAM_SOUND_MOD_NICAM_MONO 0x10 199 #define _NICAM_SOUND_MOD_NICAM_STEREO 0x20 200 #define _NICAM_SOUND_MOD_NICAM_DUAL 0x30 201 #define _NICAM_SOUND_MOD_MONO_EXIST 0x80 202 #define _NICAM_SOUND_MOD_MONO_n_NICAM_MONO 0x90 203 #define _NICAM_SOUND_MOD_MONO_n_NICAM_STEREO 0xA0 204 #define _NICAM_SOUND_MOD_MONO_n_NICAM_DUAL 0xB0 205 206 /******************************** 207 * SIF Standard 208 ********************************/ 209 #define _STD_SEL_INVALID 0x00 210 #define _STD_SEL_M_BTSC 0x01 211 #define _STD_SEL_M_EIAJ 0x02 212 #define _STD_SEL_M_A2 0x03 213 #define _STD_SEL_BG_A2 0x04 214 #define _STD_SEL_DK1_A2 0x05 215 #define _STD_SEL_DK2_A2 0x06 216 #define _STD_SEL_DK3_A2 0x07 217 #define _STD_SEL_BG_NICAM 0x08 218 #define _STD_SEL_DK_NICAM 0x09 219 #define _STD_SEL_I_NICAM 0x0A 220 #define _STD_SEL_L_NICAM 0x0B 221 #define _STD_SEL_AUTO 0xE0 222 223 //------------------------------------------------------------------------------------------------- 224 // Type and Structure 225 //------------------------------------------------------------------------------------------------- 226 ///< Decoder command type 227 typedef enum 228 { 229 MSAPI_AUD_DVB_DECCMD_STOP = 0x0, ///< 1st DSP stop 230 MSAPI_AUD_DVB_DECCMD_PLAY, ///< 1st DSP play 231 MSAPI_AUD_DVB_DECCMD_RESYNC, 232 MSAPI_AUD_DVB_DECCMD_FREE_RUN, 233 MSAPI_AUD_DVB_DECCMD_AVSYNC, 234 MSAPI_AUD_DVB_DECCMD_PLAYFILE, ///< 1st DSP play file 235 MSAPI_AUD_DVB_DECCMD_PAUSE, ///< 1st DSP pause 236 MSAPI_AUD_DVB_DECCMD_PLAYFILETSP, ///< 1st DSP play TS file 237 MSAPI_AUD_DVB_DECCMD_STARTBROWSE, 238 MSAPI_AUD_DVB_DECCMD_PLAYFRAME, ///<1st DSP play MM (for uniplayer/Mstreamer) 239 MSAPI_AUD_DVB_DECCMD_PLAYFRAME_STAGE, ////<1st DSP play MM (for stagecraft) 240 MSAPI_AUD_DVB_DECCMD_PLAYFRAME_GS, ///<1st DSP play MM (for uniplayer/Gstreamer ES copy) 241 MSAPI_AUD_DVB_DECCMD_PLAYMM_FILE2, 242 MSAPI_AUD_DVB_DECCMD_PLAY_AD, 243 MSAPI_AUD_DVB_DECCMD_STOP_AD, 244 MSAPI_AUD_DVB_DECCMD_SKIP, 245 // SE DSP 246 MSAPI_AUD_DVB2_DECCMD_STOP=0x10, ///< 2nd DSP stop 247 MSAPI_AUD_DVB2_DECCMD_PLAY, ///< 2nd DSP play 248 MSAPI_AUD_DVB2_DECCMD_RESYNC, 249 MSAPI_AUD_DVB2_DECCMD_FREE_RUN, 250 MSAPI_AUD_DVB2_DECCMD_AVSYNC, 251 MSAPI_AUD_DVB2_DECCMD_PLAYFILE, ///< 2nd DSP play file 252 MSAPI_AUD_DVB2_DECCMD_PAUSE, ///< 2nd DSP pause 253 MSAPI_AUD_DVB2_DECCMD_PLAYFILETSP, ///< 2nd DSP play TS file 254 255 } En_DVB_decCmdType; 256 257 ///< Encoder Command 258 typedef enum 259 { 260 MSAPI_AUD_DVB_ENCCMD_STOP = 0x0, ///< stop encode 261 MSAPI_AUD_DVB_ENCCMD_START ///< start encode 262 }En_DVB_EncCmdType; 263 264 ///< ATV SIF Command 265 typedef enum 266 { 267 MSAPI_AUD_SIF_CMD_SET_STOP = 0x00, 268 MSAPI_AUD_SIF_CMD_SET_PLAY = 0x01, 269 MSAPI_AUD_SIF_CMD_ENABLE_HIDEV = 0x02, 270 MSAPI_AUD_SIF_CMD_SET_HIDEV_FILTER_BW_LEVEL = 0x03, 271 MSAPI_AUD_SIF_CMD_RESET_FC_TRACKING = 0x04, 272 MSAPI_AUD_SIF_CMD_ENABLE_FC_TRACKING = 0x05, 273 MSAPI_AUD_SIF_CMD_SET_ADC_FROM_VIF_PATH = 0x06, 274 MSAPI_AUD_SIF_CMD_ENABLE_AUTO_MUTE = 0x07, 275 MSAPI_AUD_SIF_CMD_ENABLE_BEEPER_FUNCTION = 0x08, 276 MSAPI_AUD_SIF_CMD_SET_BEEPER_TONE = 0x09, 277 MSAPI_AUD_SIF_CMD_ENABLE_AGC = 0x0A, 278 MSAPI_AUD_SIF_CMD_RESET_AGC = 0x0B, 279 MSAPI_AUD_SIF_STANDARD_RESET = 0x0C, 280 MSAPI_AUD_SIF_CMD_DETECT_MAIN_STD_ONLY = 0x0D, 281 MSAPI_AUD_SIF_CMD_ENABLE_AUTO_SOUNDMODE = 0x0E, 282 MSAPI_AUD_SIF_CMD_FMTX_SET_PREEMP = 0x0F, 283 MSAPI_AUD_SIF_CMD_SET_ENC_CMD = 0x10, 284 MSAPI_AUD_SIF_CMD_SET_ENC_Input_attenuation= 0x11, 285 MSAPI_AUD_SIF_CMD_SET_ENC_Output_scaling= 0x12, 286 MSAPI_AUD_SIF_CMD_SET_BTSC_Enc_M_Gain=0x13, 287 MSAPI_AUD_SIF_CMD_SET_BTSC_Enc_D_Gain= 0x14, 288 MSAPI_AUD_SIF_CMD_SET_BTSC_Enc_SAP_Gain= 0x15, 289 MSAPI_AUD_SIF_CMD_SET_FM_CH2_FILTER_BW_LEVEL=0x16, 290 MSAPI_AUD_SIF_CMD2_ADC_VIA_VIF_PIN = 0x01 291 } En_AUD_SIF_CmdType; 292 293 typedef enum 294 { 295 MSAPI_AUD_SIF_42M, 296 MSAPI_AUD_SIF_43M, 297 MSAPI_AUD_SIF_44M, 298 } En_AUD_VIF_Type; 299 300 enum 301 { 302 MSAPI_AUD_SIF_HIDEV_FILTER_BW_DEFAULT = 0x00, // equal middle filter bandwidth 303 MSAPI_AUD_SIF_HIDEV_FILTER_BW_L1 = 0x10, // narrowest filter bandwidth 304 MSAPI_AUD_SIF_HIDEV_FILTER_BW_L2 = 0x20, // middle filter bandwidth 305 MSAPI_AUD_SIF_HIDEV_FILTER_BW_L3 = 0x30 // widest filter bandwidth 306 }; 307 308 ///< Decoder Number 309 typedef enum 310 { 311 DVB_Audio_Decoder1, ///<Audio decoder1 312 DVB_Audio_Decoder2 ///<Audio decoder2 313 } En_DVB_AudioDecoder; 314 315 #if defined(UFO_PUBLIC_HEADER_500) || defined(UFO_PUBLIC_HEADER_700) 316 317 ///< Advance sound effect type 318 typedef char* En_DVB_advsndType; 319 #define MSAPI_AUD_ADVSND_NONE ((En_DVB_advsndType)"ADVSND_NONE") 320 #define MSAPI_AUD_ADVSND_PL2 ((En_DVB_advsndType)"ADVSND_PL2") 321 #define MSAPI_AUD_ADVSND_BBE ((En_DVB_advsndType)"ADVSND_BBE") 322 #define MSAPI_AUD_ADVSND_SRS ((En_DVB_advsndType)"ADVSND_SRS") 323 #define MSAPI_AUD_ADVSND_VDS ((En_DVB_advsndType)"ADVSND_VDS") 324 #define MSAPI_AUD_ADVSND_VSPK ((En_DVB_advsndType)"ADVSND_VSPK") 325 #define MSAPI_AUD_ADVSND_SUPV ((En_DVB_advsndType)"ADVSND_SUPV") 326 #define MSAPI_AUD_ADVSND_TSHD ((En_DVB_advsndType)"ADVSND_TSHD") 327 #define MSAPI_AUD_ADVSND_DTS_ULTRATV ((En_DVB_advsndType)"ADVSND_DTS_ULTRATV") 328 #define MSAPI_AUD_ADVSND_TSHDVIQ ((En_DVB_advsndType)"ADVSND_TSHDVIQ") 329 #define MSAPI_AUD_ADVSND_AUDYSSEY ((En_DVB_advsndType)"ADVSND_AUDYSSEY") 330 #define MSAPI_AUD_ADVSND_DBX ((En_DVB_advsndType)"ADVSND_DBX") 331 #define MSAPI_AUD_ADVSND_SSHD_TSHD ((En_DVB_advsndType)"ADVSND_SSHD_TSHD") 332 #define MSAPI_AUD_ADVSND_PURESND ((En_DVB_advsndType)"ADVSND_PURESND") 333 #define MSAPI_AUD_ADVSND_BONGIOVI_DPS ((En_DVB_advsndType)"ADVSND_BONGIOVI_DPS") 334 #define MSAPI_AUD_ADVSND_DOLBY_DAP ((En_DVB_advsndType)"ADVSND_DOLBY_DAP") 335 336 #else 337 338 ///< Advance sound effect type 339 typedef enum 340 { 341 MSAPI_AUD_ADVSND_PL2, ///<ID = 0 342 MSAPI_AUD_ADVSND_BBE, ///<ID = 1 343 MSAPI_AUD_ADVSND_SRS, ///<ID = 2 344 MSAPI_AUD_ADVSND_VDS, ///<ID = 3 345 MSAPI_AUD_ADVSND_VSPK, ///<ID = 4 346 MSAPI_AUD_ADVSND_SUPV, ///<ID = 5 347 MSAPI_AUD_ADVSND_TSHD, ///<ID = 6 348 MSAPI_AUD_ADVSND_DTS_ULTRATV, ///<ID = 7 349 MSAPI_AUD_ADVSND_TSHDVIQ, ///<ID = 8 350 MSAPI_AUD_ADVSND_AUDYSSEY, ///<ID = 9 351 MSAPI_AUD_ADVSND_DBX, ///<ID = 10 352 MSAPI_AUD_ADVSND_SSHD_TSHD, ///<ID = 55 353 MSAPI_AUD_ADVSND_PURESND, ///<ID = 66 354 MSAPI_AUD_ADVSND_BONGIOVI_DPS, ///<ID = 93 355 MSAPI_AUD_ADVSND_CV3, 356 } En_DVB_advsndType; 357 358 #endif 359 360 ///< Select audio output mode type 361 typedef enum 362 { 363 MSAPI_AUD_DVB_SOUNDMODE_STEREO, 364 MSAPI_AUD_DVB_SOUNDMODE_LEFT, 365 MSAPI_AUD_DVB_SOUNDMODE_RIGHT, 366 MSAPI_AUD_DVB_SOUNDMODE_NONE, 367 } En_DVB_soundModeType; 368 369 ///< Melody play command type 370 typedef enum 371 { 372 MSAPI_AUD_MELODY_START, 373 MSAPI_AUD_MELODY_STOP, 374 MSAPI_AUD_MELODY_RESUME, 375 MSAPI_AUD_MELODY_CHK_STATUS 376 }En_DVB_melodyPlayCmdType; 377 378 typedef struct 379 { 380 MS_U32 u32BufStartAddr; 381 MS_U32 u32BufEndAddr; 382 MS_U32 u32BufWrPtr; 383 MS_U32 u32BufTotalSize; 384 MS_U32 u32BufferedPCMSize; 385 }audioBufMonitor; 386 387 typedef struct 388 { 389 audioBufMonitor _stBufInfo; 390 MS_U32 u32ReqAddr; 391 MS_U32 u32ReqSize; 392 #if defined(UFO_PUBLIC_HEADER_300) || defined(UFO_PUBLIC_HEADER_212) 393 MS_U32 u32RetAddr1; 394 #else 395 MS_PHY phyRetAddr1; 396 #endif 397 MS_U32 u32RetSize1; 398 #if defined(UFO_PUBLIC_HEADER_300) || defined(UFO_PUBLIC_HEADER_212) 399 MS_U32 u32RetAddr2; 400 #else 401 MS_PHY phyRetAddr2; 402 #endif 403 MS_U32 u32RetSize2; 404 MS_U8 u8RingStatus; 405 }audioRingTask; 406 407 408 ///< Melody play status 409 typedef enum 410 { 411 MSAPI_AUD_MELODY_NEED_MORE_DATA, 412 MSAPI_AUD_MELODY_PLAY_INIT, 413 MSAPI_AUD_MELODY_PLAY_ING, 414 MSAPI_AUD_MELODY_PLAY_DONE, 415 MSAPI_AUD_MELODY_PLAY_STOP 416 }En_DVB_melodyPlayStatus; 417 418 ///< Select AD output type 419 enum 420 { 421 AD_OUT_SPEAKER, ///< AD out in speaker only 422 AD_OUT_HP, ///< AD out in HP only 423 AD_OUT_BOTH, ///< AD out both in speaker & HP 424 AD_OUT_NONE ///< no AD out 425 }; 426 427 ///< Audio System Type 428 typedef enum 429 { 430 E_AUDIO_SYSTEM_BTSC, 431 E_AUDIO_SYSTEM_A2, 432 E_AUDIO_SYSTEM_EIAJ 433 }AUDIO_SYSTEM_TYPE; 434 435 ///< Audio SIF Standard Type 436 typedef enum 437 { 438 E_AUDIOSTANDARD_BG = 0x00, ///< Audio standard BG 439 E_AUDIOSTANDARD_BG_A2 = 0x01, ///< Audio standard BG A2 440 E_AUDIOSTANDARD_BG_NICAM = 0x02, ///< Audio standard BG NICAM 441 E_AUDIOSTANDARD_I = 0x03, ///< Audio standard I 442 E_AUDIOSTANDARD_DK = 0x04, ///< Audio standard DK 443 E_AUDIOSTANDARD_DK1_A2 = 0x05, ///< Audio standard DK1 A2 444 E_AUDIOSTANDARD_DK2_A2 = 0x06, ///< Audio standard DK2 A2 445 E_AUDIOSTANDARD_DK3_A2 = 0x07, ///< Audio standard DK3 A2 446 E_AUDIOSTANDARD_DK_NICAM = 0x08, ///< Audio standard DK NICAM 447 E_AUDIOSTANDARD_L = 0x09, ///< Audio standard L 448 E_AUDIOSTANDARD_M = 0x0A, ///< Audio standard M 449 E_AUDIOSTANDARD_M_BTSC = 0x0B, ///< Audio standard M BTSC 450 E_AUDIOSTANDARD_M_A2 = 0x0C, ///< Audio standard M A2 451 E_AUDIOSTANDARD_M_EIA_J = 0x0D, ///< Audio standard M EIA J 452 E_AUDIOSTANDARD_NOTSTANDARD = 0x0F ///< Not Audio standard 453 } AUDIOSTANDARD_TYPE; 454 455 ///< Audio Stream type 456 typedef enum 457 { 458 E_AUDIOSTREAM_INVALID = 0x00, 459 E_AUDIOSTREAM_MPEG = 0x01, 460 E_AUDIOSTREAM_AC3 = 0x02, 461 E_AUDIOSTREAM_MPEG_AD = 0x03, 462 E_AUDIOSTREAM_MPEG4 = 0x04, 463 E_AUDIOSTREAM_AAC = 0x05, 464 E_AUDIOSTREAM_AC3P = 0x06, 465 E_AUDIOSTREAM_AC3_AD = 0x07, 466 E_AUDIOSTREAM_AC3P_AD = 0x08, 467 E_AUDIOSTREAM_AACP_AD = 0x09, 468 E_AUDIOSTREAM_DRA = 0x0A 469 } AUDIOSTREAM_TYPE; 470 471 ///< Audio mode type 472 typedef enum 473 { 474 E_AUDIOMODE_INVALID = 0x00, ///< Audio Mode Invalid 475 E_AUDIOMODE_MONO = 0x01, ///< Audio Mode MONO 476 E_AUDIOMODE_FORCED_MONO = 0x02, ///< Audio Mode Forced MONO 477 E_AUDIOMODE_G_STEREO = 0x03, ///< Audio Mode G Stereo 478 E_AUDIOMODE_K_STEREO = 0x04, ///< Audio Mode K Stereo 479 E_AUDIOMODE_MONO_SAP = 0x05, ///< Audio Mode MONO SAP 480 E_AUDIOMODE_STEREO_SAP = 0x06, ///< Audio Mode Stereo SAP 481 E_AUDIOMODE_DUAL_A = 0x07, ///< Audio Mode Dual A 482 E_AUDIOMODE_DUAL_B = 0x08, ///< Audio Mode Dual B 483 E_AUDIOMODE_DUAL_AB = 0x09, ///< Audio Mode Dual AB 484 E_AUDIOMODE_NICAM_MONO = 0x0A, ///< Audio Mode NICAM MONO 485 E_AUDIOMODE_NICAM_STEREO = 0x0B, ///< Audio Mode NICAM Stereo 486 E_AUDIOMODE_NICAM_DUAL_A = 0x0C, ///< Audio Mode NICAM DUAL A 487 E_AUDIOMODE_NICAM_DUAL_B = 0x0D, ///< Audio Mode NICAM DUAL B 488 E_AUDIOMODE_NICAM_DUAL_AB = 0x0E, ///< Audio Mode NICAM DUAL AB 489 E_AUDIOMODE_HIDEV_MONO = 0x0F, ///< Audio Mode HIDEV MONO 490 E_AUDIOMODE_LEFT_LEFT = 0x10, ///< Audio Mode Left left 491 E_AUDIOMODE_RIGHT_RIGHT = 0x11, ///< Audio Mode right right 492 E_AUDIOMODE_LEFT_RIGHT = 0x12 ///< Audio Mode left right 493 } AUDIOMODE_TYPE; 494 495 ///< sif carrier status define 496 typedef enum 497 { // Never change the value of enumeration. Because each bit has weight. 498 E_STATE_AUDIO_NO_CARRIER = 0x00, ///< No carrier detect 499 E_STATE_AUDIO_PRIMARY_CARRIER = 0x01, ///< Carrier 1 exist 500 E_STATE_AUDIO_SECONDARY_CARRIER = 0x02, ///< Carrier 2 exist 501 E_STATE_AUDIO_NICAM = 0x04, ///< Nicam lock state 502 E_STATE_AUDIO_STEREO = 0x08, ///< A2 Stereo exist 503 E_STATE_AUDIO_BILINGUAL = 0x10, ///< A2 Dual exist 504 E_STATE_AUDIO_PILOT = 0x20, ///< A2 Pilot exist 505 E_STATE_AUDIO_DK2 = 0x40, ///< Sound standard is DK2 506 E_STATE_AUDIO_DK3 = 0x80 ///< Sound standard is DK3 507 } AUDIOSTATUS; 508 509 ///< EQ band define 510 typedef enum 511 { 512 E_EQUALIZER_BAND_1 = 0x00, ///< EQ Band1 513 E_EQUALIZER_BAND_2 = 0x01, ///< EQ Band2 514 E_EQUALIZER_BAND_3 = 0x02, ///< EQ Band3 515 E_EQUALIZER_BAND_4 = 0x03, ///< EQ Band4 516 E_EQUALIZER_BAND_5 = 0x04, ///< EQ Band5 517 E_EQUALIZER_BAND_6 = 0x05, ///< EQ Band6 518 E_EQUALIZER_BAND_7 = 0x06 ///< EQ Band7 519 } EQUALIZER_BAND; 520 521 ///< Audio command type 522 typedef enum 523 { 524 E_AUDIO_COM_PLAY, 525 E_AUDIO_COM_STOP, 526 E_AUDIO_COM_RESYNC, 527 E_AUDIO_COM_FREE_RUN, 528 E_AUDIO_COM_LOCK_AVSYNC, 529 E_AUDIO_COM_FILE_PLAY, // start playing file based audio in MHEG5 530 E_AUDIO_COM_FILE_PAUSE, // pause playing file based audio in MHEG5 531 E_AUDIO_DVB2_COM_PLAY, 532 E_AUDIO_DVB2_COM_STOP, 533 E_AUDIO_DVB2_COM_RESYNC, 534 E_AUDIO_DVB2_COM_FREE_RUN, 535 E_AUDIO_DVB2_COM_LOCK_AVSYNC, 536 E_AUDIO_DVB2_COM_FILE_PLAY, // start playing file based audio in MHEG5 537 E_AUDIO_DVB2_COM_FILE_PAUSE // pause playing file based audio in MHEG5 538 } DTV_AUDIO_COMMAND; 539 540 enum 541 { 542 MSAPI_AUD_MODE_STEREO, ///< 0:STEREO 543 MSAPI_AUD_MODE_LL, ///< 1: LL 544 MSAPI_AUD_MODE_RR, ///< 2: RR 545 MSAPI_AUD_MODE_MUTE ///< 3:MUTE 546 }; 547 548 /// TSXT mode 549 enum 550 { 551 MSAPI_TSXT_OFF = 0, 552 MSAPI_TSXT_STEREO, 553 MSAPI_TSXT_3D_MONO, 554 MSAPI_TSXT_MAX, 555 MSAPI_TSXT_INVALID = -1 556 }; 557 558 typedef enum 559 { 560 E_TSXT_MOD_STEREO, ///< 0:STEREO 561 E_TSXT_MOD_3D_MONO, ///< 0:MONO 562 E_TSXT_MOD_MAX ///< 0:PASSIVE MATRIX 563 } TSXT_MODETYPE; 564 565 ///< TSXT parameter 566 typedef enum 567 { 568 E_TSXT_PARA_TS_GAIN, 569 E_TSXT_PARA_DC_GAIN, 570 E_TSXT_PARA_TB_GAIN, 571 E_TSXT_PARA_SPK, 572 E_TSXT_PARA_INPUT_MOD, 573 E_TSXT_PARA_OUTPUT_GAIN 574 } TSXT_PARATYPE; 575 576 ///< Audio DSP system type 577 typedef enum 578 { 579 E_AUDIO_DSP_MPEG, ///< AUDIO DSP = MPEG 580 E_AUDIO_DSP_AC3, ///< AUDIO DSP = AC3 581 E_AUDIO_DSP_AC3_AD, ///< AUDIO DSP = AC3 AD 582 E_AUDIO_DSP_SIF, ///< AUDIO DSP = SIF 583 E_AUDIO_DSP_AACP, ///< AUDIO DSP = HE-AAC 584 E_AUDIO_DSP_MPEG_AD, ///< AUDIO DSP = MPEG AD 585 E_AUDIO_DSP_AC3P, ///< AUDIO DSP = AC3+ 586 E_AUDIO_DSP_AC3P_AD, ///< AUDIO DSP = AC3P AD 587 E_AUDIO_DSP_AACP_AD, ///< AUDIO DSP = HE-AAC AD 588 E_AUDIO_DSP_DTS, ///< AUDIO DSP = DTS 589 E_AUDIO_DSP_MS10_DDT, ///< AUDIO DSP = MS10 DDT 590 E_AUDIO_DSP_MS10_DDC, ///< AUDIO DSP = MS10 DDC 591 E_AUDIO_DSP_FLAC, ///< AUDIO DSP = FLAC 592 E_AUDIO_DSP_FM_RADIO, ///< AUDIO DSP = FM RADIO 593 E_AUDIO_DSP_KTV, 594 E_AUDIO_DSP_RESERVE3, 595 E_AUDIO_DSP_RESERVE2, 596 E_AUDIO_DSP_RESERVE1, 597 E_AUDIO_DSP_MAX, 598 E_AUDIO_DSP_INVALID=0xFF ///< AUDIO DSP = Invalid 599 } AUDIO_DSP_SYSTEM; 600 601 ///<Audio source switch group 602 typedef enum 603 { 604 E_AUDIO_GROUP_MAIN, ///< Main speaker, HP, Line-out , S/PDIF PCM mode 605 E_AUDIO_GROUP_SCART, ///< SCART 606 E_AUDIO_GROUP_SPDIF, ///< SPDIF non-pcm 607 E_AUDIO_GROUP_SUB, ///< SUB source for PIP application 608 E_AUDIO_GROUP_INVALID 609 } AUDIO_SWITCH_GROUP; 610 611 #define TBL_INDEX MS_U8 612 #define TBL_LENGTH MS_U8 613 614 #define FM_RADIO_TBL_LENGTH 6 ///< FM Radio Threshold table length 615 #define BTSC_TBL_LENGTH 10 ///< BTSC Threshold table length 616 #define A2_M_TBL_LENGTH 10 ///< A2_M Threshold table length 617 #define A2_BG_TBL_LENGTH 10 ///< A2_BG Threshold table length 618 #define A2_DK_TBL_LENGTH 10 ///< A2_DK Threshold table length 619 #define FM_I_TBL_LENGTH 4 ///< FM_I Threshold table length 620 #define AM_TBL_LENGTH 2 ///< AM Threshold table length 621 #define NICAM_BG_TBL_LENGTH 2 ///< NICAM_BG Threshold table length 622 #define NICAM_I_TBL_LENGTH 2 ///< NICAM_I Threshold table length 623 #define HIDEV_M_TBL_LENGTH 4 ///< HIDEV_M Threshold table length 624 #define HIDEV_BG_TBL_LENGTH 4 ///< HIDEV_BG Threshold table length 625 #define HIDEV_DK_TBL_LENGTH 4 ///< HIDEV_DK Threshold table length 626 #define HIDEV_I_TBL_LENGTH 4 ///< HIDEV_I Threshold table length 627 628 #define FM_RADIO_TBL_INDEX 0 629 #define BTSC_TBL_INDEX 0 630 #define A2_M_TBL_INDEX 0 631 #define A2_BG_TBL_INDEX A2_M_TBL_INDEX + A2_M_TBL_LENGTH 632 #define A2_DK_TBL_INDEX A2_BG_TBL_INDEX + A2_BG_TBL_LENGTH 633 #define FM_I_TBL_INDEX A2_DK_TBL_INDEX + A2_DK_TBL_LENGTH 634 #define AM_TBL_INDEX FM_I_TBL_INDEX + FM_I_TBL_LENGTH 635 #define NICAM_BG_TBL_INDEX AM_TBL_INDEX + AM_TBL_LENGTH 636 #define NICAM_I_TBL_INDEX NICAM_BG_TBL_INDEX + NICAM_BG_TBL_LENGTH 637 #define HIDEV_M_TBL_INDEX NICAM_I_TBL_INDEX + NICAM_I_TBL_LENGTH 638 #define HIDEV_BG_TBL_INDEX HIDEV_M_TBL_INDEX + HIDEV_M_TBL_LENGTH 639 #define HIDEV_DK_TBL_INDEX HIDEV_BG_TBL_INDEX + HIDEV_BG_TBL_LENGTH 640 #define HIDEV_I_TBL_INDEX HIDEV_DK_TBL_INDEX + HIDEV_DK_TBL_LENGTH 641 642 //------------------------------------------------------------------------------------------------- 643 // Function and Variable 644 //------------------------------------------------------------------------------------------------- 645 646 //============================================================ 647 // AUDIO_SYSTEM RELATIONAL API FUNCTION 648 //============================================================ 649 650 //////////////////////////////////////////////////////////////////////////////// 651 /// @ingroup Audio_System 652 /// @brief \b Function \b Name: MApi_AUDIO_SetPowerOn() 653 /// @brief \b Function \b Description: This routine is used to execute DSP power on/down setting. 654 /// @param bFlag \b : TRUE --power on; 655 /// FALSE--power off 656 //////////////////////////////////////////////////////////////////////////////// 657 void MApi_AUDIO_SetPowerOn(MS_BOOL bFlag); 658 659 //////////////////////////////////////////////////////////////////////////////// 660 /// @ingroup Audio_System 661 /// @brief \b Function \b Name: MApi_AUD_Initialize() 662 /// @brief \b Function \b Description: Audio initialize function incluing DSP power on and load code. 663 //////////////////////////////////////////////////////////////////////////////// 664 void MApi_AUDIO_Initialize(void); 665 666 //////////////////////////////////////////////////////////////////////////////// 667 /// @ingroup Audio_System 668 /// @brief \b Function \b Name: MApi_AUDIO_SetSystemInfo() 669 /// @brief \b Function \b Description: Function for Driver layer to get the system compile option 670 /// (TV system , Audio system ....) 671 /// @param pau_info \b : Audio output path information structure pointer 672 /// Please refer AUDIO_INIT_INFO in header file 673 //////////////////////////////////////////////////////////////////////////////// 674 void MApi_AUDIO_SetSystemInfo(AUDIO_INIT_INFO *pau_info); 675 676 //////////////////////////////////////////////////////////////////////////////// 677 /// @ingroup Audio_System 678 /// @brief \b Function \b Name: MApi_Audio_Monitor() 679 /// @brief \b Function \b Description: This function is used to monitor DSP while-loop and ISR running counter. 680 /// If these counters stop longer than a certain period of time in any abnormal condition, DSP reboot will be launched to alive DSP process again. 681 //////////////////////////////////////////////////////////////////////////////// 682 void MApi_Audio_Monitor(void); 683 684 //////////////////////////////////////////////////////////////////////////////// 685 /// @ingroup Audio_System 686 /// @brief \b Function \b Name: MApi_AUDIO_SetOutConnectivity() 687 /// @brief \b Function \b Description: Set the TV output connectivity information from APP layer 688 /// to audio driver . Then audio driver will set the audio output 689 /// port with these information automatically. 690 /////////////////////////////////////////////////////////////////////////////// 691 void MApi_AUDIO_SetOutConnectivity(void); 692 693 //////////////////////////////////////////////////////////////////////////////// 694 /// @ingroup Audio_System 695 /// @brief \b Function \b Name: MApi_AUDIO_SetPathInfo() 696 /// @brief \b Function \b Description: Get audio output path information from APP 697 /// @param path_info \b : path information structure pointer 698 /// for Speaker , Head phone , Monitor out , Scart out and SPDIF out 699 //////////////////////////////////////////////////////////////////////////////// 700 void MApi_AUDIO_SetPathInfo(AUDIO_PATH_INFO *path_info); 701 702 //////////////////////////////////////////////////////////////////////////////// 703 /// @ingroup Audio_System 704 /// @brief \b Function \b Name: MApi_AUDIO_GetPathInfo() 705 /// @brief \b Function \b Description: Get audio output path information from APP 706 /// @param path_info \b : path information structure pointer 707 /// for Speaker , Head phone , Monitor out , Scart out and SPDIF out 708 //////////////////////////////////////////////////////////////////////////////// 709 void MApi_AUDIO_GetPathInfo(AUDIO_PATH_INFO *path_info); 710 711 //////////////////////////////////////////////////////////////////////////////// 712 /// @ingroup Audio_System 713 /// @brief \b Function \b Name: MApi_AUDIO_SetOutputInfo() 714 /// @brief \b Function \b Description: Get audio output information from APP 715 /// @param pout_info \b : Audio output path information structure pointer. 716 /// Please refer AUDIO_OUT_INFO in header file 717 //////////////////////////////////////////////////////////////////////////////// 718 void MApi_AUDIO_SetOutputInfo(AUDIO_OUT_INFO *pout_info); 719 720 //////////////////////////////////////////////////////////////////////////////// 721 /// @ingroup Audio_System 722 /// @brief \b Function \b Name: MApi_AUDIO_SetSourceInfo() 723 /// @brief \b Function \b Description: For driver layer to get audio source information from APP 724 /// @param eSourceType \b : information structure pointer ==>AUDIO_SOURCE_INFO_TYPE 725 /// - E_AUDIO_INFO_DTV_IN, 726 /// - E_AUDIO_INFO_ATV_IN, 727 /// - E_AUDIO_INFO_HDMI_IN, 728 /// - E_AUDIO_INFO_ADC_IN, 729 /// - E_AUDIO_INFO_MM_IN, 730 /// - E_AUDIO_INFO_SPDIF_IN, 731 /// - E_AUDIO_INFO_KTV_IN, 732 //////////////////////////////////////////////////////////////////////////////// 733 void MApi_AUDIO_SetSourceInfo(AUDIO_SOURCE_INFO_TYPE eSourceType); 734 735 //////////////////////////////////////////////////////////////////////////////// 736 /// @ingroup Audio_System 737 /// @brief \b Function \b Name: MApi_AUDIO_InputSwitch() 738 /// @brief \b Function \b Description: Set audio Input connectivity (for S7 serious only) 739 /// @param enSource \b : Please refer AUDIO_INPUT_TYPE enum in header file 740 ///@param enGroup \b : Please refer AUDIO_SWITCH_GROUP enum in header file 741 /////////////////////////////////////////////////////////////////////////////// 742 void MApi_AUDIO_InputSwitch(AUDIO_INPUT_TYPE enSource, AUDIO_SWITCH_GROUP enGroup); 743 744 //////////////////////////////////////////////////////////////////////////////// 745 /// @ingroup Audio_ToBeRemove 746 /// @brief \b Function \b Name: MApi_AUDIO_SetDataCaptureSource() 747 /// @brief \b Function \b Description: Select source for data capture 748 /// @param <IN> \b AUDIO_DEVICE_TYPE : select 1st or 2nd data capture 749 /// @param <IN> \b AUDIO_CAPTURE_SOURCE_TYPE : Data Source 750 /// @param <OUT> \b MS_BOOL : return TRUE if success, else return FALSE 751 /// @param <RET> \b NONE : 752 /// @param <GLOBAL> \b NONE : 753 //////////////////////////////////////////////////////////////////////////////// 754 MS_BOOL MApi_AUDIO_SetDataCaptureSource(AUDIO_DEVICE_TYPE eID, AUDIO_CAPTURE_SOURCE_TYPE eSource); 755 756 //////////////////////////////////////////////////////////////////////////////// 757 /// @ingroup Audio_System 758 /// @brief \b Function \b Name: MApi_AUDIO_SetOutputSourceInfo() 759 /// @brief \b Function \b Description: Set audio output source information 760 /// @param path_info \b : output port source information structure pointer 761 /// for Speaker , Head phone , Monitor out , Scart out and SPDIF out 762 //////////////////////////////////////////////////////////////////////////////// 763 void MApi_AUDIO_SetOutputSourceInfo(OUTPUT_SOURCE_INFO *pSourceInfo); 764 765 //////////////////////////////////////////////////////////////////////////////// 766 /// @ingroup Audio_System 767 /// @brief \b Function \b Name: MApi_AUDIO_GetOutputSourceInfo() 768 /// @brief \b Function \b Description: Get audio output path information from APP 769 /// @param pSourceInfo \b : output port source information structure pointer 770 /// for Speaker , Head phone , Monitor out , Scart out and SPDIF out 771 //////////////////////////////////////////////////////////////////////////////// 772 void MApi_AUDIO_GetOutputSourceInfo(OUTPUT_SOURCE_INFO *pSourceInfo); 773 774 //////////////////////////////////////////////////////////////////////////////// 775 /// @ingroup Audio_ToBeRemove 776 /// @brief \b Function \b Name: MApi_AUDIO_ReadMailBox() 777 /// @brief \b Function \b Description: This routine is used to read the DSP mail box value 778 /// @param bDspType \b : Select audio DEC/SE DSP 779 /// @param u8ParamNum \b : Mail box address 780 /// @return MS_U16 \b : Mail Box value 781 //////////////////////////////////////////////////////////////////////////////// 782 MS_U16 MApi_AUDIO_ReadMailBox(MS_BOOL bDspType, MS_U8 u8ParamNum); 783 784 //////////////////////////////////////////////////////////////////////////////// 785 /// @ingroup Audio_ToBeRemove 786 /// @brief \b Function \b Name: MDrv_AUDIO_WriteDecMailBox() 787 /// @brief \b Function \b Description: This routine is used to write DSP mail box 788 /// @param bDspType \b : Select audio DEC/SE DSP 789 /// @param u8ParamNum \b : Mail box address 790 /// @param u16Data \b : value 791 //////////////////////////////////////////////////////////////////////////////// 792 void MApi_AUDIO_WriteMailBox(MS_BOOL bDspType, MS_U8 u8ParamNum, MS_U16 u16Data); 793 794 //////////////////////////////////////////////////////////////////////////////// 795 /// @ingroup Audio_ToBeRemove 796 /// @brief \b Function \b Name: MApi_AUDIO_FwTriggerDSP() 797 /// @brief \b Function \b Description: This routine send a PIO interrupt to DSP with a command . 798 /// @param u16Cmd \b : 0xF0-- for MHEG5 file protocol 799 //////////////////////////////////////////////////////////////////////////////// 800 void MApi_AUDIO_FwTriggerDSP(MS_U16 u16Cmd); 801 802 //////////////////////////////////////////////////////////////////////////////// 803 /// @ingroup Audio_System 804 /// @brief \b Function \b Name: MApi_AUDIO_SetFwStatus() 805 /// @brief \b Function \b Description: FW set DSP load/reload code from DDR or Flash 806 /// @param bBootOnDDR \b : 807 /// - TRUE==> Boot from DDR; 808 /// - FALSE==> Boot from Flash 809 //////////////////////////////////////////////////////////////////////////////// 810 void MApi_AUDIO_SetFwStatus(MS_BOOL en); 811 812 //////////////////////////////////////////////////////////////////////////////// 813 /// @ingroup Audio_System 814 /// @brief \b Function \b Name: MApi_AUDIO_ExitAudioSystem() 815 /// @brief \b Function \b Description: This routine is used to exit audio system 816 /// by performing DSP power down setting. 817 //////////////////////////////////////////////////////////////////////////////// 818 void MApi_AUDIO_ExitAudioSystem(void); 819 820 //////////////////////////////////////////////////////////////////////////////// 821 /// @ingroup Audio_System 822 /// @brief \b Function \b Name: MApi_AUDIO_RebootDsp(void) 823 /// @brief \b Function \b Description: This routine reboot DSP. 824 /// @param bDspType \b : 0- DEC DSP; 1- SNDEff DSP 825 //////////////////////////////////////////////////////////////////////////////// 826 void MApi_AUDIO_RebootDsp(MS_BOOL bDspType); 827 828 //////////////////////////////////////////////////////////////////////////////// 829 /// @ingroup Audio_System 830 /// @brief \b Function \b Name: MApi_AUDIO_SendIntrupt() 831 /// @brief \b Function \b Description: This routine send a PIO8 interrupt to DSP. 832 /// @param bDspType \b : 0- DEC DSP; 1- SNDEff DSP 833 /// @param u8Cmd \b : 0xE0, for MHEG5 file protocol 834 //////////////////////////////////////////////////////////////////////////////// 835 void MApi_AUDIO_SendIntrupt(MS_BOOL bDspType,MS_U8 u8Cmd); 836 837 //////////////////////////////////////////////////////////////////////////////// 838 /// @ingroup Audio_System 839 /// @brief \b Function \b Name: MApi_AUDIO_I2S_SetMode() 840 /// @brief \b Function \b Description: This routine is used to Set the I2S output mode. 841 /// @param u8Mode \b : I2S mode select 842 /// - AUDIO_I2S_MCLK ==>Set I2S MCLK 843 /// - AUDIO_I2S_WORD_WIDTH, ==>Set I2S Word-width 844 /// - AUDIO_I2S_SOURCE_CH, ==>Set I2S channel Source 845 /// - AUDIO_I2S_FORMAT ==>Set I2S format 846 /// @param u8Val \b : I2S mode value 847 /// - I2S_MCLK_64FS=0x04, ==> MCLK=64 Fs ; 848 /// - I2S_MCLK_128FS=0x05, ==> MCLK=128 Fs ; 849 /// - I2S_MCLK_256FS=0x06, ==> MCLK=256 Fs ; default setting 850 /// - I2S_MCLK_384FS=0x07, ==> MCLK=384 Fs ; 851 /// - I2S_WORD_WIDTH_16BIT=0x4, ==>Word width=16bit; 852 /// - I2S_WORD_WIDTH_24BIT=0x5, ==>Word width=24bit; 853 /// - I2S_WORD_WIDTH_32BIT=0x6, ==>Word width=32bit; default setting 854 /// - I2S_FORMAT_STANDARD=0, ==>I2S in Standard format 855 /// - I2S_FORMAT_LEFT_JUSTIFIED=1 ==> I2S in Left-justify format 856 /////////////////////////////////////////////////////////////////////////////// 857 void MApi_AUDIO_I2S_SetMode(AUDIO_I2S_MODE_TYPE u8Mode, AUDIO_I2S_MODE_VALUE u8Val); 858 859 //////////////////////////////////////////////////////////////////////////////// 860 /// @ingroup Audio_System 861 /// @brief \b Function \b Name: MApi_AUDIO_WritePreInitTable() 862 /// @brief \b Function \b Description: This routine is to set power on DAC sequence before setting init table. 863 //////////////////////////////////////////////////////////////////////////////// 864 void MApi_AUDIO_WritePreInitTable(void); //Refine power on sequence for earphone & DAC pop noise issue 865 866 //////////////////////////////////////////////////////////////////////////////// 867 /// @ingroup Audio_ToBeRemove 868 /// @brief \b Function \b Name: MApi_AUDIO_EnaEarphone_LowPower_Stage() 869 /// @brief \b Function \b Description: This routine is used to enable earphone low power stage. 870 //////////////////////////////////////////////////////////////////////////////// 871 void MApi_AUDIO_EnaEarphone_LowPower_Stage(void); //Refine power on sequence for earphone & DAC pop noise issue 872 873 //////////////////////////////////////////////////////////////////////////////// 874 /// @ingroup Audio_ToBeRemove 875 /// @brief \b Function \b Name: MApi_AUDIO_EnaEarphone_HighDriving_Stage() 876 /// @brief \b Function \b Description: This routine is used to enable earphone high driving stage. 877 //////////////////////////////////////////////////////////////////////////////// 878 void MApi_AUDIO_EnaEarphone_HighDriving_Stage(void);//Refine power on sequence for earphone & DAC pop noise issue 879 880 //////////////////////////////////////////////////////////////////////////////// 881 /// @brief \b Function \b Name: MApi_AUDIO_SetDspBaseAddr() 882 /// @brief \b Function \b Description: This function is used to set bin file base address in flash for Audio module. 883 /// @param u8Index \b : 884 /// @param u32Bin_Base_Address \b : 885 /// @param u32Mad_Base_Buffer_Adr \b : 886 //////////////////////////////////////////////////////////////////////////////// 887 void MApi_AUDIO_SetDspBaseAddr(MS_U8 u8Index, MS_U32 u32Bin_Base_Address, MS_U32 u32Mad_Base_Buffer_Adr); 888 889 //////////////////////////////////////////////////////////////////////////////// 890 /// @brief \b Function \b Name: MApi_AUDIO_GetDspMadBaseAddr() 891 /// @brief \b Function \b Description: This function is used to get the MAD base address. 892 /// @param u8Index \b : 893 /// @return MS_U32 \b : 894 //////////////////////////////////////////////////////////////////////////////// 895 MS_U32 MApi_AUDIO_GetDspMadBaseAddr(MS_U8 u8Index); 896 897 //============================================================= 898 // AUDIO_SOUND RELATIONAL API FUNCTION 899 //============================================================= 900 901 //////////////////////////////////////////////////////////////////////////////// 902 /// @ingroup Audio_BASIC_SOUNDEFFECT 903 /// @brief \b Function \b Name: MApi_SND_ProcessEnable() 904 /// @brief \b Function \b Description: This routine is used for adjust Common Sound parameters 905 //////////////////////////////////////////////////////////////////////////////// 906 MS_BOOL MApi_SND_ProcessEnable(Sound_ENABLE_Type Type, MS_BOOL enable); 907 908 //////////////////////////////////////////////////////////////////////////////// 909 /// @ingroup Audio_ToBeRemove 910 /// @brief \b Function \b Name: MApi_SND_SetParam1() 911 /// @brief \b Function \b Description: This routine is used for adjust Common Sound parameters 912 /// @return MS_BOOL \b : True / False 913 //////////////////////////////////////////////////////////////////////////////// 914 MS_BOOL MApi_SND_SetParam1( Sound_SET_PARAM_Type Type, MS_U16 param1, MS_U16 param2); 915 916 //////////////////////////////////////////////////////////////////////////////// 917 /// @ingroup Audio_ToBeRemove 918 /// @brief \b Function \b Name: HAL_AUDIO_SOUND_SetParam() 919 /// @brief \b Function \b Description: This routine is used for adjust Common Sound parameters 920 /// @return MS_BOOL \b : True / False 921 //////////////////////////////////////////////////////////////////////////////// 922 MS_U16 MApi_SND_GetParam1( Sound_GET_PARAM_Type Type, MS_U16 param1); 923 924 //****************************************************************************** 925 /// @ingroup Audio_BASIC_SOUNDEFFECT 926 /// @brief \b Function \b Name: MApi_AUDIO_SOUND_SetParam() 927 /// @brief \b Function \b Description: This routine is used for adjust Common Sound parameters 928 /// @return MS_BOOL \b : True / False 929 //****************************************************************************** 930 MS_BOOL MApi_AUDIO_SOUND_SetParam( Sound_SET_Type Type, MS_U32 *p_param ); 931 932 //////////////////////////////////////////////////////////////////////////////// 933 /// @ingroup Audio_BASIC_SOUNDEFFECT 934 /// @brief \b Function \b Name: MDrv_SOUND_AbsoluteVolume() 935 /// @brief \b Function \b Description: This routine is used to set the absolute u8Volume of audio u8Path. 936 /// @param u8Path \b : for audio u8Path0 ~ u8Path6 937 /// @param u8Vol1 \b : MSB 7-bit register value of 10-bit u8Volume 938 /// range from 0x00 to 0x7E , gain: +12db to -114db (-1 db per step) 939 /// @param u8Vol2 \b : LSB 3-bit register value of 10-bit u8Volume 940 /// range from 0x00 to 0x07 , gain: -0db to -0.875db (-0.125 db per step) 941 //////////////////////////////////////////////////////////////////////////////// 942 void MApi_AUDIO_SetAbsoluteVolume( MS_U8 u8Path, MS_U8 u8Vol1, MS_U8 u8Vol2 ); 943 944 //////////////////////////////////////////////////////////////////////////////// 945 /// @ingroup Audio_BASIC_SOUNDEFFECT 946 /// @brief \b Function \b Name: MApi_AUDIO_SetPreScale() 947 /// @brief \b Function \b Description: This routine is used to set the prescale of audio u8Path. 948 /// @param u8Path \b : for audio u8Path0 ~ u8Path5 949 /// @param u8PreScale \b : range from 0x01 to 0xFF , gain: -13.75db to +18db (0.125 db per step) 950 /// - 0x00: disable pre-scale 951 /// - 0x6F: gain = 0db 952 /// - 0xFF: gain = +18db 953 //////////////////////////////////////////////////////////////////////////////// 954 void MApi_AUDIO_SetPreScale ( MS_U8 u8Path, MS_U8 u8PreScale ); 955 956 //////////////////////////////////////////////////////////////////////////////// 957 /// @ingroup Audio_BASIC_SOUNDEFFECT 958 /// @brief \b Function \b Name: MApi_AUDIO_SetMute() 959 /// @brief \b Function \b Description: This routine is used to set audio path S/W mute. 960 /// @param u8Path \b : for audio path0 ~ path6 961 /// @param EnMute \b : TRUE --Mute; 962 /// FALSE--Unmute 963 //////////////////////////////////////////////////////////////////////////////// 964 void MApi_AUDIO_SetMute( MS_U8 u8Path, MS_BOOL EnMute); 965 966 //////////////////////////////////////////////////////////////////////////////// 967 /// @ingroup Audio_BASIC_SOUNDEFFECT 968 /// @brief \b Function \b Name: MApi_AUDIO_SourceConnect() 969 /// @brief \b Function \b Description: This routine is used to set audio mute by processor 970 /// @param u8Path \b : eProcessor: Set Main/Sub processor, 971 /// @param EnMute \b : TRUE --Mute; 972 /// FALSE--Unmute 973 //////////////////////////////////////////////////////////////////////////////// 974 void MApi_AUDIO_SourceConnect(AUDIO_OUTPORT_SOURCE_TYPE eConnectSourceType, MS_BOOL bIsConnect ); 975 976 //////////////////////////////////////////////////////////////////////////////// 977 /// @ingroup Audio_BASIC_SOUNDEFFECT 978 /// @brief \b Function \b Name: MApi_AUDIO_SetBalance() 979 /// @brief \b Function \b Description: This routine is used to set balance value 980 /// @param u8Balance \b : balance (0~100) 981 /// - 0 : R channel is muted ... 982 /// - 50 : L & R channel output the same level... 983 /// - 100 : L channel is muted . 984 //////////////////////////////////////////////////////////////////////////////// 985 void MApi_AUDIO_SetBalance ( MS_U8 u8Balance ); 986 987 //////////////////////////////////////////////////////////////////////////////// 988 /// @ingroup Audio_BASIC_SOUNDEFFECT 989 /// @brief \b Function \b Name: MApi_AUDIO_EnableEQ() 990 /// @brief \b Function \b Description: This routine is used to enable EQ function. 991 /// @param EnEQ \b : TRUE --Enable EQ; 992 /// FALSE--Disable EQ 993 //////////////////////////////////////////////////////////////////////////////// 994 void MApi_AUDIO_EnableEQ ( MS_BOOL EnEQ ); 995 996 //////////////////////////////////////////////////////////////////////////////// 997 /// @ingroup Audio_BASIC_SOUNDEFFECT 998 /// @brief \b Function \b Name: MApi_AUDIO_EnableTone() 999 /// @brief \b Function \b Description: This routine is used to enable Bass/Treble function. 1000 /// @param EnTone \b : TRUE --Enable Bass/Treble; 1001 /// FALSE--Disable Bass/Treble 1002 //////////////////////////////////////////////////////////////////////////////// 1003 void MApi_AUDIO_EnableTone ( MS_BOOL EnTone ); 1004 1005 //////////////////////////////////////////////////////////////////////////////// 1006 /// @ingroup Audio_BASIC_SOUNDEFFECT 1007 /// @brief \b Function \b Name: MApi_AUDIO_EnableAutoVolume() 1008 /// @brief \b Function \b Description: This routine is used to enable auto volume(AVC) function. 1009 /// @param EnAVC \b : TRUE --Enable AVC; 1010 /// FALSE--Disable AVC 1011 //////////////////////////////////////////////////////////////////////////////// 1012 void MApi_AUDIO_EnableAutoVolume ( MS_BOOL EnAVL ); 1013 1014 //////////////////////////////////////////////////////////////////////////////// 1015 /// @ingroup Audio_BASIC_SOUNDEFFECT 1016 /// @brief \b Function \b Name: MApi_AUDIO_EnableSurround() 1017 /// @brief \b Function \b Description: This routine is used to enable surround function. 1018 /// @param EnSurround \b : TRUE --Enable Surround; 1019 /// FALSE--Disable Surround 1020 //////////////////////////////////////////////////////////////////////////////// 1021 void MApi_AUDIO_EnableSurround ( MS_BOOL EnSurround ); 1022 1023 //////////////////////////////////////////////////////////////////////////////// 1024 /// @ingroup Audio_BASIC_SOUNDEFFECT 1025 /// @brief \b Function \b Name: MApi_AUDIO_EnableBalance() 1026 /// @brief \b Function \b Description: This routine is used to enable Balance function. 1027 /// @param EnBalance \b : Balance Enable bits 1028 //////////////////////////////////////////////////////////////////////////////// 1029 void MApi_AUDIO_EnableBalance( MS_U8 EnBalance ); 1030 1031 //////////////////////////////////////////////////////////////////////////////// 1032 /// @ingroup Audio_BASIC_SOUNDEFFECT 1033 /// @brief \b Function \b Name: MApi_AUDIO_SetDynamicBass() 1034 /// @brief \b Function \b Description: This routine is used to set DynamicBass level. 1035 /// @param u8Bass \b : 1036 //////////////////////////////////////////////////////////////////////////////// 1037 void MApi_AUDIO_SetDynamicBass( MS_U8 u8DynamicBass ); 1038 1039 //////////////////////////////////////////////////////////////////////////////// 1040 /// @ingroup Audio_BASIC_SOUNDEFFECT 1041 /// @brief \b Function \b Name: MApi_AUDIO_SetBass() 1042 /// @brief \b Function \b Description: This routine is used to set Bass level. 1043 /// @param u8Bass \b :Bass Level (0~100) 1044 /// - CHIP_FAMILY_U3 & S4LE==>mapping to -16 ~ +15 dB Gain 1045 /// - CHIP_FAMILY_S7 ==>mapping to -12 ~ +12 dB Gain 1046 /// - CHIP_FAMILY_S7J ==> mapping to -16 ~ +15 dB Gain 1047 //////////////////////////////////////////////////////////////////////////////// 1048 void MApi_AUDIO_SetBass( MS_U8 u8Bass ); 1049 1050 //////////////////////////////////////////////////////////////////////////////// 1051 /// @ingroup Audio_BASIC_SOUNDEFFECT 1052 /// @brief \b Function \b Name: MApi_AUDIO_AbsoluteBass() 1053 /// @brief \b Function \b Description: This routine is used to set abs. Bass value. 1054 /// @param u8Bass \b : register value 1055 /// - CHIP_FAMILY_U3 & S4LE ==>mapping to -16 ~ +15 dB Gain 1056 /// - CHIP_FAMILY_S7 ==>mapping to -12 ~ +12 dB Gain 1057 /// - CHIP_FAMILY_S7J ==> mapping to -16 ~ +15 dB Gain 1058 //////////////////////////////////////////////////////////////////////////////// 1059 void MApi_AUDIO_AbsoluteBass( MS_U8 u8Bass ); 1060 1061 //////////////////////////////////////////////////////////////////////////////// 1062 /// @ingroup Audio_BASIC_SOUNDEFFECT 1063 /// @brief \b Function \b Name: MApi_AUDIO_SetTreble() 1064 /// @brief \b Function \b Description: This routine is used to set Treble level. 1065 /// @param u8Treble \b :Treble Level (0~100) 1066 /// - CHIP_FAMILY_U3 & S4LE ==>mapping to -16 ~ +15 dB Gain 1067 /// - CHIP_FAMILY_S7 ==>mapping to -12 ~ +12 dB Gain 1068 //////////////////////////////////////////////////////////////////////////////// 1069 void MApi_AUDIO_SetTreble( MS_U8 u8Treble ); 1070 1071 //////////////////////////////////////////////////////////////////////////////// 1072 /// @ingroup Audio_BASIC_SOUNDEFFECT 1073 /// @brief \b Function \b Name: MApi_AUDIO_AbsoluteTreble() 1074 /// @brief \b Function \b Description: This routine is used to set abs. Treble value. 1075 /// @param u8Treble \b : register value 1076 /// - CHIP_FAMILY_U3 & S4LE ==> mapping to -16 ~ +15 dB Gain 1077 /// - CHIP_FAMILY_S7 ==> mapping to -12 ~ +12 dB Gain 1078 /// - CHIP_FAMILY_S7J ==> mapping to -16 ~ +15 dB Gain 1079 //////////////////////////////////////////////////////////////////////////////// 1080 void MApi_AUDIO_AbsoluteTreble( MS_U8 u8Treble ); 1081 1082 //////////////////////////////////////////////////////////////////////////////// 1083 /// @ingroup Audio_BASIC_SOUNDEFFECT 1084 /// @brief \b Function \b Name: MApi_AUDIO_SetEq() 1085 /// @brief \b Function \b Description: This routine is used to set the the 5-band EQ level . 1086 /// @param u8band \b : EQ band 0~4 1087 /// @param u8level \b : Absolute EQ register value ; 1088 /// - 0011-0000: +12.00db. (Max) 1089 /// - 0000-0001: +0.25db. 1090 /// - 0000-0000: +0.00db. 1091 /// - 1111-1111: -0.25db. 1092 /// - 1101-0000: -12.00db. (Min) 1093 //////////////////////////////////////////////////////////////////////////////// 1094 void MApi_AUDIO_SetEq(MS_U8 u8band, MS_U8 u8level); 1095 1096 //////////////////////////////////////////////////////////////////////////////// 1097 /// @ingroup Audio_BASIC_SOUNDEFFECT 1098 /// @brief \b Function \b Name: MApi_AUDIO_SetEq_7band() 1099 /// @brief \b Function \b Description: This routine is used to set the the 7-band EQ level . 1100 /// @param u8band \b : EQ band 0~6 1101 /// @param u8level \b : Absolute EQ register value ; 1102 /// 0011-0000: +12.00db. (Max) 1103 /// 0000-0001: +0.25db. 1104 /// 0000-0000: +0.00db. 1105 /// 1111-1111: -0.25db. 1106 /// 1101-0000: -12.00db. (Min) 1107 //////////////////////////////////////////////////////////////////////////////// 1108 void MApi_AUDIO_SetEq_7band(MS_U8 u8band, MS_U8 u8level); 1109 1110 //////////////////////////////////////////////////////////////////////////////// 1111 /// @ingroup Audio_BASIC_SOUNDEFFECT 1112 /// @brief \b Function \b Name: MApi_AUDIO_SetAvcThreshold() 1113 /// @brief \b Function \b Description: This routine is used to set the AVC threshold level. 1114 /// @param Level \b : AVC threshold level 1115 /// - 0x00-- 0 dBFS 1116 /// - 0x01-- -0.5 dBFS 1117 /// - 0x20-- -16 dBFS 1118 /// - 0x50-- -40 dBFS 1119 //////////////////////////////////////////////////////////////////////////////// 1120 void MApi_AUDIO_SetAvcThreshold(MS_U8 Level); 1121 1122 //////////////////////////////////////////////////////////////////////////////// 1123 /// @ingroup Audio_BASIC_SOUNDEFFECT 1124 /// @brief \b Function \b Name: MApi_AUDIO_SetAvcMode() 1125 /// @brief \b Function \b Description: This routine is used to set the AVC mode. 1126 /// @param <IN> \b u8AvcMode : AVC u8Mode 1127 /// - 0: L mode 1128 /// - 1: S mode 1129 /// - 2: M mode 1130 /// @image html L_mode.JPG "L mode" 1131 /// @image html S_mode.JPG "S mode" 1132 /// @image html M_mode.JPG "M mode" 1133 /// @param <OUT> \b NONE : 1134 /// @param <RET> \b NONE : 1135 /// @param <GLOBAL> \b NONE : 1136 //////////////////////////////////////////////////////////////////////////////// 1137 void MApi_AUDIO_SetAvcMode( MS_U8 AvcMode ); 1138 1139 //////////////////////////////////////////////////////////////////////////////// 1140 /// @ingroup Audio_BASIC_SOUNDEFFECT 1141 /// @brief \b Function \b Name: MApi_AUDIO_SetAvcAT() 1142 /// @brief \b Function \b Description: This routine is used to set the AVC attack time . 1143 /// @param AvcAT \b : AVC attack time 1144 /// - AvcAT = 0 --> 20 ms 1145 /// - AvcAT = 1 --> 100 ms 1146 /// - AvcAT = 2 --> 200 ms 1147 /// - AvcAT = 3 --> 1 sec 1148 //////////////////////////////////////////////////////////////////////////////// 1149 void MApi_AUDIO_SetAvcAT( MS_U8 AvcAT ); 1150 1151 //////////////////////////////////////////////////////////////////////////////// 1152 /// @ingroup Audio_BASIC_SOUNDEFFECT 1153 /// @brief \b Function \b Name: MApi_AUDIO_SetAvcRT() 1154 /// @brief \b Function \b Description: This routine is used to set the AVC release time . 1155 /// @param AvcRT \b : AVC release time 1156 /// - AvcRT = 0 --> 1 sec 1157 /// - AvcRT = 1 --> 2 sec 1158 /// - AvcRT = 2 --> 100 ms 1159 /// - AvcRT = 3 --> 200 ms 1160 //////////////////////////////////////////////////////////////////////////////// 1161 void MApi_AUDIO_SetAvcRT( MS_U8 AvcRT ); 1162 1163 //////////////////////////////////////////////////////////////////////////////// 1164 /// @ingroup Audio_BASIC_SOUNDEFFECT 1165 /// @brief \b Function \b Name: MApi_AUDIO_SetBufferProcess() 1166 /// @brief \b Function \b Description: sets the value of audio delay time (ms).. 1167 /// @param DelayTime \b : 0x00~0xFA(0~250), each step=1 ms , 0~250 ms 1168 //////////////////////////////////////////////////////////////////////////////// 1169 void MApi_AUDIO_SetBufferProcess(MS_U8 DelayTime); 1170 1171 //////////////////////////////////////////////////////////////////////////////// 1172 /// @ingroup Audio_BASIC_SOUNDEFFECT 1173 /// @brief \b Function \b Name: MApi_AUDIO_SetSurroundXA() 1174 /// @brief \b Function \b Description: This routine is used to set the Surround xA echo Gain. 1175 /// @param <IN> \b mode : A Gain : register SURROUND[3:2] 1176 /// - 0 : x0.1 1177 /// - 1 : x0.15 1178 /// - 2 : x0.2 1179 /// - 3 : x0.25 1180 /// @param <OUT> \b NONE : 1181 /// @param <RET> \b NONE : 1182 /// @param <GLOBAL> \b NONE 1183 //////////////////////////////////////////////////////////////////////////////// 1184 void MApi_AUDIO_SetSurroundXA( MS_U8 mode ); 1185 1186 //////////////////////////////////////////////////////////////////////////////// 1187 /// @ingroup Audio_BASIC_SOUNDEFFECT 1188 /// @brief \b Function \b Name: MApi_AUDIO_SetSurroundXB() 1189 /// @brief \b Function \b Description: This routine is used to set the Surround xB echo Gain. 1190 /// @param <IN> \b mode : B Gain : register SURROUND[5:4] 1191 /// - 0 : x0.25 1192 /// - 1 : x0.3 1193 /// - 2 : x0.35 1194 /// - 3 : x0.45 1195 /// @param <OUT> \b NONE : 1196 /// @param <RET> \b NONE : 1197 /// @param <GLOBAL> \b NONE 1198 //////////////////////////////////////////////////////////////////////////////// 1199 void MApi_AUDIO_SetSurroundXB( MS_U8 mode ); 1200 1201 //////////////////////////////////////////////////////////////////////////////// 1202 /// @ingroup Audio_BASIC_SOUNDEFFECT 1203 /// @brief \b Function \b Name: MApi_AUDIO_SetSurroundXK() 1204 /// @brief \b Function \b Description: This routine is used to set the Surround xK feedback Gain. 1205 /// @param <IN> \b mode : K Gain : register SURROUND[10:8] 1206 /// - 0 : x0.1 1207 /// - 1 : x0.2 1208 /// - 2 : x0.3 1209 /// - 3 : x0.4 1210 /// - 4 : x0.5 1211 /// - 5 : x0.6 1212 /// - 6 : x0.7 1213 /// - 7 : x0.8 1214 /// @param <OUT> \b NONE : 1215 /// @param <RET> \b NONE : 1216 /// @param <GLOBAL> \b NONE 1217 //////////////////////////////////////////////////////////////////////////////// 1218 void MApi_AUDIO_SetSurroundXK( MS_U8 mode ); 1219 1220 //////////////////////////////////////////////////////////////////////////////// 1221 /// @ingroup Audio_BASIC_SOUNDEFFECT 1222 /// @brief \b Function \b Name: MApi_AUDIO_SetSurroundLPFGain() 1223 /// @brief \b Function \b Description: This routine is used to set the Surround LPF Gain. 1224 /// @image html surround.JPG "Surround block diagram" 1225 /// @param <IN> \b mode : LPF Gain : register SURROUND[7:6] 1226 /// - 0 : 0 dB 1227 /// - 1 : 2 dB 1228 /// - 2 : 4 dB 1229 /// - 3 : un-support 1230 /// @param <OUT> \b NONE : 1231 /// @param <RET> \b NONE : 1232 /// @param <GLOBAL> \b NONE 1233 //////////////////////////////////////////////////////////////////////////////// 1234 void MApi_AUDIO_SetSurroundLPFGain( MS_U8 mode ); 1235 1236 ///////////////////////////////////////////////////////////////////////////////// 1237 /// @ingroup Audio_ToBeRemove 1238 /// @brief \b Function \b Name: MApi_AUDIO_ConvertVolumeUnit() 1239 /// @brief \b Function \b Description: Convert UI Volume to Absolute Volume. 1240 /// valid value of UiVolume is between 0 and 100 1241 /// @param UiVolume \b : UI Volume 0 -> 62, 50 -> 12, 100 -> 7 1242 /// @param MS_U8 \b : register value 1243 //////////////////////////////////////////////////////////////////////////////// 1244 MS_U8 MApi_AUDIO_ConvertVolumeUnit(MS_U8 UiVolume); 1245 1246 // void MApi_AUDIO_SetMaxClipping( MS_U8 MaxClippingValue, MS_U16 Volume ); 1247 1248 //////////////////////////////////////////////////////////////////////////////// 1249 /// @ingroup Audio_BASIC_SOUNDEFFECT 1250 /// @brief \b Function \b Name: MApi_AUDIO_SetPEQCoef() 1251 /// @brief \b Function \b Description: This routine is used to set PEQ Coefficient. 1252 /// @param <IN> \b peq_coef 1253 /// @param <OUT> \b NONE : 1254 /// @param <RET> \b NONE : 1255 /// @param <GLOBAL> \b NONE 1256 //////////////////////////////////////////////////////////////////////////////// 1257 void MApi_AUDIO_SetPEQCoef(AUDIO_PEQ_COEF *peq_coef); 1258 1259 //////////////////////////////////////////////////////////////////////////////// 1260 /// @ingroup Audio_BASIC_SOUNDEFFECT 1261 /// @brief \b Function \b Name: MApi_AUDIO_EnablePEQ() 1262 /// @brief \b Function \b Description: This routine is used to eable PEQ. 1263 /// @param <IN> \b Enpeq 1264 /// @param <OUT> \b NONE : 1265 /// @param <RET> \b NONE : 1266 /// @param <GLOBAL> \b NONE 1267 //////////////////////////////////////////////////////////////////////////////// 1268 void MApi_AUDIO_EnablePEQ(MS_BOOL Enpeq); 1269 1270 //////////////////////////////////////////////////////////////////////////////// 1271 /// @ingroup Audio_BASIC_SOUNDEFFECT 1272 /// @brief \b Function \b Name: MApi_AUDIO_EnableDcRemove() 1273 /// @brief \b Function \b Description: This routine is used to eable PEQ. 1274 /// @param <IN> \b EnDcRemove 1275 /// @param <OUT> \b True / False 1276 /// @param <RET> \b NONE : 1277 /// @param <GLOBAL> \b NONE 1278 //////////////////////////////////////////////////////////////////////////////// 1279 MS_BOOL MApi_AUDIO_EnableDcRemove(MS_BOOL EnDcRemove); 1280 1281 //============================================================ 1282 // AUDIO_DTV RELATIONAL API FUNCTION 1283 //============================================================ 1284 1285 //////////////////////////////////////////////////////////////////////////////// 1286 /// @ingroup Audio_System 1287 /// @brief \b Function \b Name: MApi_AUDIO_ReleaseDecodeSystem() 1288 /// @brief \b Function \b Description: This function will release/close decode system 1289 /// @param DecId \b : Decoder ID to be released 1290 /// @return\b MS_BOOL \b : set decoder system process status FALSE-> fail TRUE-> Success 1291 //////////////////////////////////////////////////////////////////////////////// 1292 MS_BOOL MApi_AUDIO_ReleaseDecodeSystem(AUDIO_DEC_ID DecId); 1293 1294 //////////////////////////////////////////////////////////////////////////////// 1295 /// @ingroup Audio_System 1296 /// @brief \b Function \b Name: MApi_AUDIO_SetDecodeSystem() 1297 /// @brief \b Function \b Description: This function will set DecId decoder as structure p_AudioDecStatus 1298 /// @param\b DecId \b : Decoder ID to be controled 1299 /// @param\b p_AudioDecStatus \b : decoder status structure pointer 1300 /// @return\b MS_BOOL \b : set decoder system process status FALSE-> fail TRUE-> Success 1301 //////////////////////////////////////////////////////////////////////////////// 1302 MS_BOOL MApi_AUDIO_SetDecodeSystem(AUDIO_DEC_ID DecId, AudioDecStatus_t * p_AudioDecStatus); 1303 1304 //////////////////////////////////////////////////////////////////////////////// 1305 /// @ingroup Audio_System 1306 /// @brief \b Function \b Name: MApi_AUDIO_GetDecodeSystem() 1307 /// @brief \b Function \b Description: This function will get DecId decoder status 1308 /// @param DecId \b : Decoder ID to get status 1309 /// @param p_AudioDecStatus \b : return status to p_AudioDecStatus pointer 1310 /// @return\b MS_BOOL \b : set decoder system process status FALSE-> fail TRUE-> Success 1311 //////////////////////////////////////////////////////////////////////////////// 1312 MS_BOOL MApi_AUDIO_GetDecodeSystem(AUDIO_DEC_ID DecId, AudioDecStatus_t * p_AudioDecStatus); 1313 1314 //////////////////////////////////////////////////////////////////////////////// 1315 /// @ingroup Audio_System 1316 /// @brief \b Function \b Name: MApi_AUDIO_SetDecodeCmd() 1317 /// @brief \b Function \b Description: This function will send decode command to DecId decoder 1318 /// @param DecId \b : Decoder ID to be controled 1319 /// @param enDecComamnd \b : decoder command 1320 /// @return\b MS_BOOL \b : set decoder system process status FALSE-> fail TRUE-> Success 1321 //////////////////////////////////////////////////////////////////////////////// 1322 MS_BOOL MApi_AUDIO_SetDecodeCmd(AUDIO_DEC_ID DecId, En_DVB_decCmdType enDecComamnd); 1323 1324 //////////////////////////////////////////////////////////////////////////////// 1325 /// @ingroup Audio_System 1326 /// @brief \b Function \b Name: MApi_AUDIO_OpenDecodeSystem() 1327 /// @brief \b Function \b Description: This function will open decode system according audio dec status 1328 /// @param p_AudioDecStatus \b : decoder status stucture 1329 /// @return\b AUDIO_DEC_ID \b : return available decoder ID 1330 //////////////////////////////////////////////////////////////////////////////// 1331 AUDIO_DEC_ID MApi_AUDIO_OpenDecodeSystem(AudioDecStatus_t * p_AudioDecStatus); 1332 1333 //////////////////////////////////////////////////////////////////////////////// 1334 /// @ingroup Audio_ToBeRemove 1335 /// @brief \b Function \b Name: MApi_AUDIO_SetSystem() 1336 /// @brief \b Function \b Description: This function will load 1337 /// different audio decoder to audio system. 1338 /// 1339 /// In Mstar audio system, we can support 1 or 2 decoders. 1340 /// One is for main DTV audio or Multimedia audio player. 1341 /// Another is for second audio decode (ex: used for Audio Description purpose) 1342 /// 1343 /// @param enDecSystem \b : (En_DVB_decSystemType) decoder type 1344 /// - parameter type "MSAPI_AUD_DVB_XXXX" is decoder type for main audio decoder 1345 /// - parameter type "MSAPI_AUD_DVB2_XXXX" is decoder type for second audio decoder 1346 //////////////////////////////////////////////////////////////////////////////// 1347 MS_BOOL MApi_AUDIO_SetSystem(En_DVB_decSystemType enDecSystem); 1348 1349 //////////////////////////////////////////////////////////////////////////////// 1350 /// @ingroup Audio_System 1351 /// @brief \b Function \b Name: MApi_AUDIO_GetDecSysSupportStatus() 1352 /// @brief \b Function \b Description: This function will report Audio Decoder support feature status when giving DecSystem type 1353 /// @param <IN> \b enDecSystem : Decoder type 1354 /// @param <RET> \b BOOL : True or False 1355 //////////////////////////////////////////////////////////////////////////////// 1356 MS_BOOL MApi_AUDIO_GetDecSysSupportStatus(En_DVB_decSystemType enDecSystem); 1357 1358 //////////////////////////////////////////////////////////////////////////////// 1359 /// @ingroup Audio_ToBeRemove 1360 /// @brief \b Function \b Name: MApi_AUDIO_SetH264StreamID_Mod() 1361 /// @brief \b Function \b Description: This routine is used to AC3 Stream ID mod. 1362 /// @param stream_id_mod \b : DTV stream ID 1363 /// - stream_id_mod = 0, video MPEG mode; 1364 /// - stream_id_mod = 1, video H264 mode 1365 //////////////////////////////////////////////////////////////////////////////// 1366 void MApi_AUDIO_SetH264StreamID_Mod(MS_U8 stream_id_mod); 1367 1368 //////////////////////////////////////////////////////////////////////////////// 1369 /// @ingroup Audio_System 1370 /// @brief \b Function \b Name: MApi_AUDIO_IsMadLock() 1371 /// @brief \b Function \b Description: This function show DTV Audio stream lock status 1372 /// @return MS_BOOL \b : 1 : lock ; 0 : unlock 1373 //////////////////////////////////////////////////////////////////////////////// 1374 MS_BOOL MApi_AUDIO_IsMadLock(void); 1375 1376 //////////////////////////////////////////////////////////////////////////////// 1377 /// @ingroup Audio_ToBeRemove 1378 /// @brief \b Function \b Name: MApi_AUDIO_GetDecStatus() 1379 /// @brief \b Function \b Description: This routine is used to get the decoder's status (paly or stop) 1380 /// @return En_DVB_decCmdType \b : Decoder status (paly or stop) 1381 //////////////////////////////////////////////////////////////////////////////// 1382 En_DVB_decCmdType MApi_AUDIO_GetDecStatus ( void ); 1383 1384 /////////////////////////////////////////////////////////////////////////////////////// 1385 /// @ingroup Audio_System 1386 /// @brief \b Function \b Name: MApi_AUDIO_GetCommand() 1387 /// @brief \b Function \b Description: This routine is to get the DVB1 decode command. 1388 /// @return AU_DVB_DECCMD \b : 1389 /// - AU_DVB_DECCMD_STOP, //0 1390 /// - AU_DVB_DECCMD_PLAY, //1 1391 /// - AU_DVB_DECCMD_PLAYFILETSP, //2 1392 /// - AU_DVB_DECCMD_RESYNC, 1393 /// ....etc 1394 /////////////////////////////////////////////////////////////////////////////////////// 1395 AU_DVB_DECCMD MApi_AUDIO_GetCommand(En_DVB_AudioDecoder AdoDecoderNo); 1396 1397 //////////////////////////////////////////////////////////////////////////////// 1398 /// @ingroup Audio_System 1399 /// @brief \b Function \b Name: MApi_AUDIO_SetCommand() 1400 /// @brief \b Function \b Description: Set decoder Command for Digital Audio module 1401 /// @param enDecComamnd \b : deccoder command for DVB Audio 1402 //////////////////////////////////////////////////////////////////////////////// 1403 void MApi_AUDIO_SetCommand(En_DVB_decCmdType enDecComamnd); 1404 1405 //////////////////////////////////////////////////////////////////////////////// 1406 /// @ingroup Audio_System 1407 /// @brief \b Function \b Name: MApi_AUDIO_GetMAD_LOCK() 1408 /// @brief \b Function \b Description: This routine is used to report decoder lock information. 1409 /// @retun MS_U8 \b the decoder status 1410 /////////////////////////////////////////////////////////////////////////////// 1411 MS_BOOL MApi_AUDIO_GetMAD_LOCK(void); 1412 1413 //////////////////////////////////////////////////////////////////////////////// 1414 /// @ingroup Audio_System 1415 /// @brief \b Function \b Name: MApi_AUDIO_SetADOutputMode() 1416 /// @brief \b Function \b Description: Set AD output mode 1417 /// @param out_mode \b : out_mode: 1418 /// - AD_OUT_SPEAKER 1419 /// - AD_OUT_HP 1420 /// - AD_OUT_BOTH 1421 //////////////////////////////////////////////////////////////////////////////// 1422 void MApi_AUDIO_SetADOutputMode (MS_U8 out_mode); 1423 1424 //////////////////////////////////////////////////////////////////////////////// 1425 /// @ingroup Audio_System 1426 /// @brief \b Function \b Name: MApi_AUDIO_SetADAbsoluteVolume() 1427 /// @brief \b Function \b Description: This routine is used to set the absolute u8Volume of AD. 1428 /// @param AbsVolume \b : MSB 7-bit register value of 10-bit u8Volume 1429 /// range from 0x00 to 0x7E , gain: +12db to -114db (-1 db per step) 1430 //////////////////////////////////////////////////////////////////////////////// 1431 void MApi_AUDIO_SetADAbsoluteVolume (MS_U8 AbsVolume); 1432 1433 //////////////////////////////////////////////////////////////////////////////// 1434 /// @ingroup Audio_System 1435 /// @brief \b Function \b Name: MApi_AUDIO_ADSetMute() 1436 /// @brief \b Function \b Description: This routine is used to set AD mute. 1437 /// @param EnMute \b : TRUE --Mute AD; 1438 /// FALSE--Unmute AD 1439 //////////////////////////////////////////////////////////////////////////////// 1440 void MApi_AUDIO_ADSetMute(MS_BOOL EnMute); 1441 1442 //============================================================ 1443 // AUDIO_PVR RELATED FUNCTIONS 1444 //============================================================ 1445 1446 //////////////////////////////////////////////////////////////////////////////// 1447 /// @ingroup Audio_ToBeRemove 1448 /// @brief \b Function \b Name: MDrv_AUDIO_SetEncodeInit() 1449 /// @brief \b Function \b Description: This function is used to set Encod init 1450 /// @param BitRate \b : Encode Output Bitrate 1451 /// - AU_DVB_ENCBR_192K, // 0 1452 /// - AU_DVB_ENCBR_384K, // 1 1453 /// - AU_DVB_ENCBR_128K, // 2 1454 /// - AU_DVB_ENCBR_64K // 3 1455 /// @param EncFrameNum \b : Frame number per interrupt 1456 //////////////////////////////////////////////////////////////////////////////// 1457 void MApi_AUDIO_SetEncInit(AU_DVB_ENCBR BitRate, MS_U8 u8EncFrameNum); 1458 1459 //////////////////////////////////////////////////////////////////////////////// 1460 /// @ingroup Audio_ToBeRemove 1461 /// @brief \b Function \b Name: MApi_AUDIO_SetEncCommand() 1462 /// @brief \b Function \b Description: Set Encoder Command for Digital Audio module 1463 /// @param enEnccComamnd \b : Encoder command for DVB Audio 1464 /// - AU_DVB_ENCCMD_STOP, //0 1465 /// - AU_DVB_ENCCMD_START // 1 1466 //////////////////////////////////////////////////////////////////////////////// 1467 void MApi_AUDIO_SetEncCommand(AU_DVB_ENCCMD enEncComamnd); 1468 1469 //////////////////////////////////////////////////////////////////////////////// 1470 /// @ingroup Audio_ToBeRemove 1471 /// @brief \b Function \b Name: MDrv_AUDIO_GetEncodeFrameInfo() 1472 /// @brief \b Function \b Description: This function is used to get the Encoded frame info 1473 /// @param input \b EncFrameInfo: structure to store encoded frame info 1474 //////////////////////////////////////////////////////////////////////////////// 1475 void MApi_AUDIO_GetEncodeFrameInfo(AU_DVB_ENC_FRAME_INFO *EncFrameInfo); 1476 1477 //////////////////////////////////////////////////////////////////////////////// 1478 /// @ingroup Audio_ToBeRemove 1479 /// @brief \b Function \b Name: MApi_AUDIO_GetEncodeDoneFlag() 1480 /// @brief \b Function \b Description: This function is used to get check encode done flag 1481 /// @param input \b None 1482 /// @param output \b BOOL TRUE/FALSE 1483 //////////////////////////////////////////////////////////////////////////////// 1484 MS_BOOL MApi_AUDIO_GetEncodeDoneFlag(void); 1485 1486 //============================================================ 1487 // AUDIO_ATV RELATIONAL API FUNCTION 1488 //============================================================ 1489 1490 //////////////////////////////////////////////////////////////////////////////// 1491 /// @ingroup Audio_ATV_SPDIF_HDMI 1492 /// @brief \b Function \b Name: MApi_AUDIO_SIF_SetStandard() 1493 /// @brief \b Function \b Description: Set SIF standard 1494 /// @param system_type \b : standard type 1495 //////////////////////////////////////////////////////////////////////////////// 1496 void MApi_AUDIO_SIF_SetStandard(AUDIOSTANDARD_TYPE standard_type); 1497 1498 //////////////////////////////////////////////////////////////////////////////// 1499 /// @ingroup Audio_ATV_SPDIF_HDMI 1500 /// @brief \b Function \b Name: MApi_AUDIO_SIF_GetSoundMode() 1501 /// @brief \b Function \b Description: Get SIF BTSC sound mode type 1502 /// @return MS_U8 \b : Sound mode type 1503 /// - MS_U8 = 0x0 : Mute 1504 /// - bit 0 : Mono 1505 /// - bit 1 : Stereo 1506 /// - bit 2 : SAP 1507 //////////////////////////////////////////////////////////////////////////////// 1508 MS_U8 MApi_AUDIO_SIF_GetSoundMode(void); 1509 1510 //////////////////////////////////////////////////////////////////////////////// 1511 /// @ingroup Audio_ATV_SPDIF_HDMI 1512 /// @brief \b Function \b Name: MApi_AUDIO_SIF_SetSoundMode() 1513 /// @brief \b Function \b Description: Set sound mode for ATV source. 1514 /// @param u8SifSoundMode \b : sound mode type 1515 /// - AU_MODE_MONO 1516 /// - AU_MODE_STEREO 1517 /// - AU_MODE_SAP 1518 /// - AU_MODE_LANG_A 1519 /// - AU_MODE_LANG_B 1520 /// - AU_MODE_NICAM_MONO, ...etc 1521 /// @return MS_BOOL \b : success / fail 1522 //////////////////////////////////////////////////////////////////////////////// 1523 MS_BOOL MApi_AUDIO_SIF_SetSoundMode(MS_U8 u8SifSoundMode); 1524 1525 //////////////////////////////////////////////////////////////////////////////// 1526 /// @ingroup Audio_ATV_SPDIF_HDMI 1527 /// @brief \b Function \b Name: MApi_AUDIO_SIF_GetAudioStatus() 1528 /// @brief \b Function \b Description: Get the current audio status. 1529 /// It can be used for getting available sound modes and real-time audio standard monitor. 1530 /// @param eAudioStatus \b : audio status pointer 1531 /// @return MS_BOOL \b : TRUE/FALSE 1532 //////////////////////////////////////////////////////////////////////////////// 1533 MS_BOOL MApi_AUDIO_SIF_GetAudioStatus(AUDIOSTATUS * eAudioStatus); 1534 1535 //////////////////////////////////////////////////////////////////////////////// 1536 /// @ingroup Audio_ATV_SPDIF_HDMI 1537 /// @brief \b Function \b Name: MApi_AUDIO_SIF_StartAutoStandardDetection() 1538 /// @brief \b Function \b Description: To start automatic detection about input audio standard 1539 //////////////////////////////////////////////////////////////////////////////// 1540 void MApi_AUDIO_SIF_StartAutoStandardDetection(void); 1541 1542 //////////////////////////////////////////////////////////////////////////////// 1543 /// @ingroup Audio_ATV_SPDIF_HDMI 1544 /// @brief \b Function \b Name: MApi_AUDIO_SIF_GetResultOfAutoStandardDetection() 1545 /// @brief \b Function \b Description: To get result of audio standard after automatic detection called by MDrv_ASP_StartAutoStandardDetection. 1546 /// @return AUDIOSTANDARD_TYPE \b : 1547 //////////////////////////////////////////////////////////////////////////////// 1548 AUDIOSTANDARD_TYPE MApi_AUDIO_SIF_GetResultOfAutoStandardDetection(void); 1549 1550 //////////////////////////////////////////////////////////////////////////////// 1551 /// @ingroup Audio_ATV_SPDIF_HDMI 1552 /// @brief \b Function \b Name: MApi_AUDIO_SIF_ConvertToBasicAudioStandard() 1553 /// @brief \b Function \b Description: Convert the audio standard to the basic standard 1554 /// @param eStandard \b : Please refer AUDIOSTANDARD_TYPE enum in header file 1555 /// @return AUDIOSTANDARD_TYPE \b : basic standard 1556 /// - E_AUDIOSTANDARD_BG 1557 /// - E_AUDIOSTANDARD_I 1558 /// - E_AUDIOSTANDARD_DK 1559 /// - E_AUDIOSTANDARD_L 1560 /// - E_AUDIOSTANDARD_M 1561 /// - E_AUDIOSTANDARD_NOTSTANDARD 1562 //////////////////////////////////////////////////////////////////////////////// 1563 AUDIOSTANDARD_TYPE MApi_AUDIO_SIF_ConvertToBasicAudioStandard(AUDIOSTANDARD_TYPE eStandard); 1564 1565 //////////////////////////////////////////////////////////////////////////////// 1566 /// @ingroup Audio_ATV_SPDIF_HDMI 1567 /// @brief \b Function \b Name: MApi_AUDIO_SIF_SetThreshold() 1568 /// @brief \b Function \b Description: This routine is used to set SIF threshold 1569 /// @param ThrTbl \b : SIF thresholds Table 1570 //////////////////////////////////////////////////////////////////////////////// 1571 #if defined(UFO_PUBLIC_HEADER_212) 1572 void MApi_AUDIO_SIF_SetThreshold(THR_TBL_TYPE code *ThrTbl); 1573 #else 1574 void MApi_AUDIO_SIF_SetThreshold(THR_TBL_TYPE *ThrTbl); 1575 #endif 1576 //////////////////////////////////////////////////////////////////////////////// 1577 /// @ingroup Audio_ATV_SPDIF_HDMI 1578 /// @brief \b Function \b Name: MApi_AUDIO_SIF_SetPrescale() 1579 /// @brief \b Function \b Description: SIF output level = (original level add db_value gain) 1580 //////////////////////////////////////////////////////////////////////////////// 1581 #if defined(UFO_PUBLIC_HEADER_300) || defined(UFO_PUBLIC_HEADER_212) 1582 void MApi_AUDIO_SIF_SetPrescale(MS_U8, int); 1583 #else 1584 void MApi_AUDIO_SIF_SetPrescale(MS_U8, MS_S32); 1585 #endif 1586 1587 //////////////////////////////////////////////////////////////////////////////// 1588 /// @ingroup Audio_ATV_SPDIF_HDMI 1589 /// @brief \b Function \b Name: MApi_AUDIO_SIF_IsPALType() 1590 /// @brief \b Function \b Description: Check the DSP type is pal_type or not 1591 /// @return MS_BOOL \b : TRUE/FALSE 1592 //////////////////////////////////////////////////////////////////////////////// 1593 MS_BOOL MApi_AUDIO_SIF_IsPALType(AUDIO_SIF_PAL_TYPE pal_type); 1594 1595 //////////////////////////////////////////////////////////////////////////////// 1596 /// @ingroup Audio_ATV_SPDIF_HDMI 1597 /// @brief \b Function \b Name: MApi_AUDIO_SIF_SetPALType() 1598 /// @brief \b Function \b Description: Set DSP type to pal_type 1599 //////////////////////////////////////////////////////////////////////////////// 1600 void MApi_AUDIO_SIF_SetPALType(AUDIO_SIF_PAL_TYPE pal_type); 1601 1602 //////////////////////////////////////////////////////////////////////////////// 1603 /// @ingroup Audio_ATV_SPDIF_HDMI 1604 /// @brief \b Function \b Name: MApi_AUDIO_SIF_SetCommand() 1605 /// @brief \b Function \b Description: Set decoder Command for ATV module 1606 /// @param enDecComamnd \b : deccoder command for ATV AUDIO 1607 //////////////////////////////////////////////////////////////////////////////// 1608 void MApi_AUDIO_SIF_SendCmd(En_AUD_SIF_CmdType enAudSifCommand, MS_U8 comm_arg1, MS_U8 comm_arg2); 1609 1610 //////////////////////////////////////////////////////////////////////////////// 1611 /// @ingroup Audio_ATV_SPDIF_HDMI 1612 /// @brief \b Function \b Name: MApi_AUDIO_SIF_Shift() 1613 /// @brief \b Function \b Description: This function is used to provide a API for application to choose what kind of VIF mdoe. 1614 /// 1615 //////////////////////////////////////////////////////////////////////////////// 1616 void MApi_AUDIO_SIF_Shift(En_AUD_VIF_Type type); 1617 1618 //////////////////////////////////////////////////////////////////////////////// 1619 /// @brief \b Function \b Name: MApi_AUDIO_TriggerSifPLL() 1620 /// @brief \b Function \b Description: This function is used to initialize SIF analog part . 1621 //////////////////////////////////////////////////////////////////////////////// 1622 void MApi_AUDIO_TriggerSifPLL(void); 1623 1624 //============================================================ 1625 // AUDIO_FM_RADIO RELATIONAL API FUNCTION 1626 //============================================================ 1627 1628 //////////////////////////////////////////////////////////////////////////////// 1629 /// @ingroup Audio_ATV_SPDIF_HDMI 1630 /// @brief \b Function \b Name: MApi_AUDIO_FM_RADIO_GetSoundMode() 1631 /// @brief \b Function \b Description: Getting FM Radio Sound Mode 1632 /// @param <IN> \b NONE : 1633 /// @param <OUT> \b MS_U8 : return E_AUDIOMODE_MONO, E_AUDIOMODE_K_STEREO or E_AUDIOMODE_INVALID 1634 //////////////////////////////////////////////////////////////////////////////// 1635 MS_U8 MApi_AUDIO_FM_RADIO_GetSoundMode(void); 1636 1637 //////////////////////////////////////////////////////////////////////////////// 1638 /// @ingroup Audio_ATV_SPDIF_HDMI 1639 /// @brief \b Function \b Name: MApi_AUDIO_FM_RADIO_SetSoundMode() 1640 /// @brief \b Function \b Description: Setting FM Radio Sound Mode 1641 /// @param <IN> \b MS_U8 : u8FMRadioSoundMode 1642 /// @param <OUT> \b NONE : 1643 //////////////////////////////////////////////////////////////////////////////// 1644 void MApi_AUDIO_FM_RADIO_SetSoundMode(MS_U8 u8FMRadioSoundMode); 1645 1646 //////////////////////////////////////////////////////////////////////////////// 1647 /// @ingroup Audio_ATV_SPDIF_HDMI 1648 /// @brief \b Function \b Name: MApi_AUDIO_FM_RADIO_DeEmphassisOption() 1649 /// @brief \b Function \b Description: FM Radio De-emphassis Option 1650 /// @param <IN> \b MS_BOOL : Is_Europe 1651 /// @param <OUT> \b NONE : 1652 //////////////////////////////////////////////////////////////////////////////// 1653 void MApi_AUDIO_FM_RADIO_DeEmphassisOption(MS_BOOL Is_Europe); 1654 1655 //////////////////////////////////////////////////////////////////////////////// 1656 /// @ingroup Audio_ATV_SPDIF_HDMI 1657 /// @brief \b Function \b Name: MApi_AUDIO_FM_RADIO_GET_DC_AMP() 1658 /// @brief \b Function \b Description: FM Radio get DC amp 1659 /// @param <IN> \b NONE 1660 /// @param <OUT> \b MS_S8 DC amp 1661 //////////////////////////////////////////////////////////////////////////////// 1662 MS_S8 MApi_AUDIO_FM_RADIO_GET_DC_AMP(void); 1663 1664 //////////////////////////////////////////////////////////////////////////////// 1665 /// @ingroup Audio_ATV_SPDIF_HDMI 1666 /// @brief \b Function \b Name: MApi_AUDIO_FM_RADIO_GET_NSR() 1667 /// @brief \b Function \b Description: FM Radio get NSR 1668 /// @param <IN> \b NONE 1669 /// @param <OUT> \b MS_U8 NSR 1670 //////////////////////////////////////////////////////////////////////////////// 1671 MS_U8 MApi_AUDIO_FM_RADIO_GET_NSR(void); 1672 1673 //////////////////////////////////////////////////////////////////////////////// 1674 /// @ingroup Audio_ATV_SPDIF_HDMI 1675 /// @brief \b Function \b Name: MApi_AUDIO_FM_RADIO_RESET() 1676 /// @brief \b Function \b Description: FM Radio reset 1677 /// @param <IN> \b NONE 1678 /// @param <OUT> \b NONE 1679 //////////////////////////////////////////////////////////////////////////////// 1680 void MApi_AUDIO_FM_RADIO_RESET(void); 1681 1682 //============================================================= 1683 // AUDIO_SPDIF RELATIONAL API FUNCTION 1684 //============================================================= 1685 1686 //////////////////////////////////////////////////////////////////////////////// 1687 /// @ingroup Audio_ATV_SPDIF_HDMI 1688 /// @brief \b Function \b Name: MApi_AUDIO_SPDIF_HWEN() 1689 /// @brief \b Function \b Description: This routine is used to enable S/PDIF output (Hardware) 1690 /// @param spdif_en \b : 0--Disable S/PDIF out; 1691 /// 1--Enable S/PDIF out 1692 //////////////////////////////////////////////////////////////////////////////// 1693 void MApi_AUDIO_SPDIF_HWEN(MS_BOOL spdif_hwen); 1694 1695 //////////////////////////////////////////////////////////////////////////////// 1696 /// @ingroup Audio_ATV_SPDIF_HDMI 1697 /// @brief \b Function \b Name: MApi_AUDIO_SPDIF_SetMute() 1698 /// @brief \b Function \b Description: This routine is used to enable S/PDIF output (Hardware) 1699 /// @param mute_en \b : 0--Disable mute; 1700 /// 1--Enable mute 1701 //////////////////////////////////////////////////////////////////////////////// 1702 void MApi_AUDIO_SPDIF_SetMute(MS_BOOL mute_en); 1703 1704 //////////////////////////////////////////////////////////////////////////////// 1705 /// @ingroup Audio_ATV_SPDIF_HDMI 1706 /// @brief \b Function \b Name: MApi_AUDIO_SPDIF_SetMode() 1707 /// @brief \b Function \b Description: This routine is used to set S/PDIF mode. 1708 /// @param spdif_mode \b : PCM or Non-PCM mode 1709 /// - spdif_mode = 0x0 : SPDIF enable, PCM mode 1710 /// - spdif_mode = 0x1 : SPDIF off 1711 /// - spdif_mode = 0x2 : SPDIF enable, nonPCM mode 1712 //////////////////////////////////////////////////////////////////////////////// 1713 void MApi_AUDIO_SPDIF_SetMode(MS_U8 spdif_mode); 1714 1715 //////////////////////////////////////////////////////////////////////////////// 1716 /// @ingroup Audio_ATV_SPDIF_HDMI 1717 /// @brief \b Function \b Name: MApi_AUDIO_SPDIF_GetMode() 1718 /// @brief \b Function \b Description: This routine is used to get S/PDIF mode. 1719 /// @return MS_U8 \b : register SPDIF_CTRL value 1720 /// - 0x0 : SPDIF enable, PCM mode 1721 /// - 0x1 : SPDIF OFF 1722 /// - 0x2 : SPDIF enable, non-PCM mode 1723 //////////////////////////////////////////////////////////////////////////////// 1724 MS_U8 MApi_AUDIO_SPDIF_GetMode(void); 1725 1726 //////////////////////////////////////////////////////////////////////////////// 1727 /// @ingroup Audio_ATV_SPDIF_HDMI 1728 /// @brief \b Function \b Name: MApi_AUDIO_SPDIF_SetSCMS() 1729 /// @brief \b Function \b Description: This routine is used to set SPDIF SCMS. 1730 /// @param C_bit_en \b : copy right control bit 1731 /// @param L_bit_en \b : generation bit 1732 //////////////////////////////////////////////////////////////////////////////// 1733 void MApi_AUDIO_SPDIF_SetSCMS(MS_U8 C_bit_en, MS_U8 L_bit_en); 1734 1735 //////////////////////////////////////////////////////////////////////////////// 1736 /// @ingroup Audio_ATV_SPDIF_HDMI 1737 /// @brief \b Function \b Name: MApi_AUDIO_SPDIF_GetSCMS() 1738 /// @brief \b Function \b Description: This routine is used to get SPDIF SCMS. 1739 /// @return MS_U8 \b : SCMS[0] = C bit status, SCMS[1] = L bit status 1740 //////////////////////////////////////////////////////////////////////////////// 1741 MS_U8 MApi_AUDIO_SPDIF_GetSCMS(void); 1742 void MApi_AUDIO_SPDIF_SetOutputType(AUDIO_SPDIF_OUTPUT_TYPE eType); // New API for S/PDIF output auto/PCM mode switching 1743 1744 //////////////////////////////////////////////////////////////////////////////// 1745 /// @ingroup Audio_ATV_SPDIF_HDMI 1746 /// @brief \b Function \b Name: MApi_Audio_SPDIF_Monitor() 1747 /// @brief \b Function \b Description: 1748 /// @param pau_info \b : AUDIO INIT STRUCTURE 1749 //////////////////////////////////////////////////////////////////////////////// 1750 void MApi_Audio_SPDIF_Monitor(void); 1751 void MApi_Audio_Monitor_SPDIF_NONPCM_SmpRate(void); 1752 1753 //////////////////////////////////////////////////////////////////////////////// 1754 /// @ingroup Audio_ATV_SPDIF_HDMI 1755 /// @brief \b Function \b Name: MApi_AUDIO_SPDIF_ChannelStatus_CTRL() 1756 /// @brief \b Function \b Description: 1757 /// @param pau_info \b : AUDIO INIT STRUCTURE 1758 //////////////////////////////////////////////////////////////////////////////// 1759 MS_BOOL MApi_AUDIO_SPDIF_ChannelStatus_CTRL(AUDIO_SPDIF_CS_TYPE cs_mode, AUDIO_SPDIF_CS_TYPE_STATUS status); 1760 1761 //////////////////////////////////////////////////////////////////////////////// 1762 /// @ingroup Audio_ATV_SPDIF_HDMI 1763 /// @brief \b Function \b Name: HAL_AUDIO_Digital_Out_SetChannelStatus() 1764 /// @brief \b Function \b Description: This routine is used to set SPDIF/HDMI/ARC channel status. 1765 /// @param <IN> \b eType : 1766 /// @param <OUT> \b NONE : 1767 /// @param <RET> \b NONE : 1768 //////////////////////////////////////////////////////////////////////////////// 1769 MS_BOOL MApi_AUDIO_DigitalOut_SetChannelStatus(DIGITAL_OUTPUT_TYPE ePath, Digital_Out_Channel_Status_t *stChannelStatus); 1770 1771 1772 //////////////////////////////////////////////////////////////////////////////// 1773 /// @ingroup Audio_ATV_SPDIF_HDMI 1774 /// @brief \b Function \b Name: MApi_AUDIO_DigitalOut_SetDeviceCapability() 1775 /// @brief \b Function \b Description: This routine is used to set output device capability. 1776 /// @param <IN> \b eoutType: output type (ARC_OUTPUT or HDMI_OUTPUT) 1777 /// @param <IN> \b ecodecType: kind of codec 1778 /// @param <IN> \b *p_codecCapability: codec support capability structure 1779 /// @param <RET> \b bRet: return api setting success or fail 1780 //////////////////////////////////////////////////////////////////////////////// 1781 MS_BOOL MApi_AUDIO_DigitalOut_SetDeviceCapability(DIGITAL_OUTPUT_TYPE eoutType, AUDIO_FORMAT_CODE ecodecType, Digital_Out_Device_Capability_t *p_codecCapability); 1782 1783 //============================================================= 1784 // AUDIO_HDMI RELATIONAL API FUNCTION 1785 //============================================================= 1786 1787 //////////////////////////////////////////////////////////////////////////////// 1788 /// @ingroup Audio_ATV_SPDIF_HDMI 1789 /// @brief \b Function \b Name: MApi_AUDIO_HDMI_Tx_SetMute() 1790 /// @brief \b Function \b Description: This routine is used to enable HDMI Tx output (Software) 1791 /// @param mute_en \b : 0--Disable mute; 1792 /// 1--Enable mute 1793 //////////////////////////////////////////////////////////////////////////////// 1794 void MApi_AUDIO_HDMI_Tx_SetMute(MS_BOOL mute_en); 1795 1796 //////////////////////////////////////////////////////////////////////////////// 1797 /// @ingroup Audio_ATV_SPDIF_HDMI 1798 /// @brief \b Function \b Name: MApi_AUDIO_HDMI_Tx_GetStatus() 1799 /// @brief \b Function \b Description: This routine is used to get HDMI Tx status 1800 /// @param onOff \b : HDMI tx function is availible in this chip ? 1801 /// @param hdmi_SmpFreq \b : Audio current sample freq for tx 1802 /// @param outType \b : PCM mode or nonPCM mode 1803 //////////////////////////////////////////////////////////////////////////////// 1804 void MApi_AUDIO_HDMI_Tx_GetStatus(MS_BOOL *onOff, AUDIO_FS_TYPE *hdmi_SmpFreq, HDMI_TX_OUTPUT_TYPE *outType ); 1805 1806 //////////////////////////////////////////////////////////////////////////////// 1807 /// @ingroup Audio_ATV_SPDIF_HDMI 1808 /// @brief \b Function \b Name: MApi_AUDIO_HDMI_Monitor() 1809 /// @brief \b Function \b Description: This function report HDMI non-PCM or PCM format (register STATUS_INPUT) 1810 /// @return MS_U8 \b : 1811 /// - non-PCM --> register STATUS_INPUT[7:6]= 0x1; 1812 /// - PCM --> register STATUS_INPUT[7:6]= 0x0 1813 //////////////////////////////////////////////////////////////////////////////// 1814 MS_U8 MApi_AUDIO_HDMI_Monitor(void); 1815 1816 //////////////////////////////////////////////////////////////////////////////// 1817 /// @ingroup Audio_ATV_SPDIF_HDMI 1818 /// @brief \b Function \b Name: MApi_AUDIO_HDMI_GetNonpcmFlag() 1819 /// @brief \b Function \b Description: This function report HDMI non-PCM or PCM format (register STATUS_INPUT) 1820 /// @return MS_BOOL \b : 1821 /// - TRUE : non-PCM --> register STATUS_INPUT[7:6]= 0x1 ; 1822 /// - FALSE : PCM --> register STATUS_INPUT[7:6]= 0x0 1823 //////////////////////////////////////////////////////////////////////////////// 1824 MS_BOOL MApi_AUDIO_HDMI_GetNonpcmFlag(void); 1825 1826 //////////////////////////////////////////////////////////////////////////////// 1827 /// @ingroup Audio_ATV_SPDIF_HDMI 1828 /// @brief \b Function \b Name: MApi_AUDIO_HDMI_SetNonpcm() 1829 /// @brief \b Function \b Description: This function setting HDMI non-PCM or PCM relational register 1830 /// @param nonPCM_en \b : 1: nonPCM; 0: PCM 1831 //////////////////////////////////////////////////////////////////////////////// 1832 void MApi_AUDIO_HDMI_SetNonpcm(MS_U8 nonPCM_en); 1833 1834 //////////////////////////////////////////////////////////////////////////////// 1835 /// @ingroup Audio_ATV_SPDIF_HDMI 1836 /// @brief \b Function \b Name: MApi_AUDIO_HDMI_RX_SetNonpcm() 1837 /// @brief \b Function \b Description: This function setting HDMI non-PCM or PCM relational register 1838 /// @param nonPCM_en \b : 1: nonPCM; 0: PCM 1839 /// @return AUDIO_HDMI_RX_TYPE \b : Return HDMI RX Type 1840 //////////////////////////////////////////////////////////////////////////////// 1841 AUDIO_HDMI_RX_TYPE MApi_AUDIO_HDMI_RX_SetNonpcm(MS_U8 nonPCM_en); 1842 1843 //////////////////////////////////////////////////////////////////////////////// 1844 /// @ingroup Audio_ATV_SPDIF_HDMI 1845 /// @brief \b Function \b Name: MApi_AUDIO_HDMI_RX_SetNonpcm() 1846 /// @brief \b Function \b Description: This function setting HDMI non-PCM or PCM relational register 1847 /// @param nonPCM_en \b : 1: nonPCM; 0: PCM 1848 /// @return AUDIO_HDMI_RX_TYPE \b : Return HDMI RX Type 1849 //////////////////////////////////////////////////////////////////////////////// 1850 AUDIO_HDMI_RX_TYPE MApi_AUDIO_HDMI_RX_GetNonPCM(void); 1851 1852 //////////////////////////////////////////////////////////////////////////////// 1853 /// @ingroup Audio_ATV_SPDIF_HDMI 1854 /// @brief \b Function \b Name: MApi_AUDIO_DTV_HDMI_CFG() 1855 /// @brief \b Function \b Description: Set DVB/HDMI AC3 path configure 1856 /// @param ctrl \b : 0: DVB2_AD path; 1857 /// 1: HDMI path 1858 //////////////////////////////////////////////////////////////////////////////// 1859 void MApi_AUDIO_DTV_HDMI_CFG(MS_U8 ctrl); 1860 1861 //////////////////////////////////////////////////////////////////////////////// 1862 /// @ingroup Audio_ATV_SPDIF_HDMI 1863 /// @brief \b Function \b Name: MApi_AUDIO_HDMI_GetSynthFreq() 1864 /// @brief \b Function \b Description: Audio HDMI CTS-N synthesizer input signal detect. 1865 /// @return MS_U16 \b : return freq. If no signal, return 0 1866 //////////////////////////////////////////////////////////////////////////////// 1867 MS_U16 MApi_AUDIO_HDMI_GetSynthFreq(void); 1868 1869 //////////////////////////////////////////////////////////////////////////////// 1870 /// @ingroup Audio_ATV_SPDIF_HDMI 1871 /// @brief \b Function \b Name: MApi_AUDIO_HDMI_SetDownSample() 1872 /// @brief \b Function \b Description: set HDMI downsample rate 1873 /// @param ratio \b : donwsample ratio 1874 /// - 00: Normal (from 1x to 1x). 1875 /// - 01: Down sample from 2x to 1x. 1876 //////////////////////////////////////////////////////////////////////////////// 1877 void MApi_AUDIO_HDMI_SetDownSample(MS_U8 ratio); 1878 1879 //////////////////////////////////////////////////////////////////////////////// 1880 /// @ingroup Audio_ATV_SPDIF_HDMI 1881 /// @brief \b Function \b Name: MApi_AUDIO_HDMI_SetOutputType() 1882 /// @brief \b Function \b Description: To set HDMI output type independently 1883 //////////////////////////////////////////////////////////////////////////////// 1884 void MApi_AUDIO_HDMI_TX_SetMode(HDMI_TX_OUTPUT_TYPE outType); 1885 1886 //////////////////////////////////////////////////////////////////////////////// 1887 /// @ingroup Audio_System 1888 /// @brief \b Function \b Name: MApi_AUDIO_HDMI_RX_GetHdmiInAudioStatus() 1889 /// @brief \b Function \b Description: Return audio status. 1890 /// @return MS_U16 \b : return structure which include pcm, non pcm, sampling rate. 1891 //////////////////////////////////////////////////////////////////////////////// 1892 MS_BOOL MApi_AUDIO_HDMI_RX_GetHdmiInAudioStatus( ST_HDMI_AUDIO_STATUS *p_hdmiAudioSts); 1893 1894 //============================================================= 1895 // AUDIO_ADVANCE_SOUND RELATIONAL API FUNCTION 1896 //============================================================= 1897 1898 //////////////////////////////////////////////////////////////////////////////// 1899 /// @ingroup Audio_ADVANCED_SOUNDEFFECT 1900 /// @brief \b Function \b Name: MApi_AUDIO_ADVSOUND_ProcessEnable 1901 /// @brief \b Function \b Description: This routine is used to enable process of advanced sound effect. 1902 /// @param <IN> \b ADVSND_TYPE type 1903 /// @param <OUT> \b NONE : 1904 /// @param <RET> \b NONE : 1905 /// @param <GLOBAL> \b NONE 1906 //////////////////////////////////////////////////////////////////////////////// 1907 MS_BOOL MApi_AUDIO_ADVSOUND_ProcessEnable(ADVSND_TYPE type); 1908 1909 //////////////////////////////////////////////////////////////////////////////// 1910 /// @ingroup Audio_ADVANCED_SOUNDEFFECT 1911 /// @brief \b Function \b Name: MApi_AUDIO_ADVSOUND_SubProcessEnable(ADVFUNC proc, BOOL enable) 1912 /// @brief \b Function \b Description: This routine is used to enable subprocess of advanced sound effect. 1913 /// @param <IN> \b proc, enable 1914 /// @param <OUT> \b NONE : 1915 /// @param <RET> \b NONE : 1916 /// @param <GLOBAL> \b NONE 1917 //////////////////////////////////////////////////////////////////////////////// 1918 MS_BOOL MApi_AUDIO_ADVSOUND_SubProcessEnable(ADVFUNC proc, MS_BOOL enable); 1919 1920 //////////////////////////////////////////////////////////////////////////////// 1921 /// @ingroup Audio_ADVANCED_SOUNDEFFECT 1922 /// @brief \b Function \b Name: MApi_AUDIO_ADVSOUND_SetParam(ADVSND_PARAM param, U16 value1, U16 value2) 1923 /// @brief \b Function \b Description: This routine is used to set paramters advanced sound effect. 1924 /// @param <IN> \b param, value1, value2 1925 /// @param <OUT> \b NONE : 1926 /// @param <RET> \b NONE : 1927 /// @param <GLOBAL> \b NONE 1928 //////////////////////////////////////////////////////////////////////////////// 1929 MS_BOOL MApi_AUDIO_ADVSOUND_SetParam(ADVSND_PARAM param, MS_U16 u16value1, MS_U16 u16value2); 1930 1931 //////////////////////////////////////////////////////////////////////////////// 1932 /// @ingroup Audio_ToBeRemove 1933 /// @brief \b Function \b Name: MApi_AUDIO_ADVSOUND_SetParam(ADVSND_PARAM param, U32 value1, U16 value2) 1934 /// @brief \b Function \b Description: This routine is used to set paramters advanced sound effect. 1935 /// @param <IN> \b param, u32value1, u16value2 1936 /// \b Parameter u32value1: range 0~0x7FFFFF 1937 /// \b Parameter u16value2: 0/1, 1938 /// - 0 : if u32value1 is u16, none fix point 24 bit parameter 1939 /// - 1 : if u32value1 is u32, fix point 24 bit parameter 1940 /// @param <OUT> \b NONE : 1941 /// @return <OUT> \b FALSE : Setting Fail 1942 /// \b TRUE : Setting OK 1943 /// @param <GLOBAL> \b NONE 1944 //////////////////////////////////////////////////////////////////////////////// 1945 MS_BOOL MApi_AUDIO_ADVSND_SetParam(ADVSND_PARAM param, MS_U32 u32value1, MS_U16 u16value2); 1946 1947 //////////////////////////////////////////////////////////////////////////////// 1948 /// @ingroup Audio_ADVANCED_SOUNDEFFECT 1949 /// @brief \b Function \b Name: MApi_AUDIO_ADVSOUND_GetInfo() 1950 /// @brief \b Function \b Description: This routine is used for Get ADV Sound info 1951 /// @return MS_BOOL \b : True / False 1952 //////////////////////////////////////////////////////////////////////////////// 1953 MS_U32 MApi_AUDIO_ADVSOUND_GetInfo( AdvSound_GET_Type Type); 1954 1955 //////////////////////////////////////////////////////////////////////////////// 1956 /// @ingroup Audio_ToBeRemove 1957 /// @brief \b Function \b Name: MApi_DBXTV_SetMode(DBXTV_TotSonMode TotSonMode, DBXTV_TotVolMode TotVolMode, DBXTV_TotSurMode TotSurMode) 1958 /// @brief \b Function \b Description: This routine is used to set dbx TV mode 1959 /// @param <IN> \b param, TotSonMode, TotVolMode, TotSurMode 1960 /// @param <OUT> \b NONE : 1961 /// @param <RET> \b NONE : 1962 /// @param <GLOBAL> \b NONE 1963 //////////////////////////////////////////////////////////////////////////////// 1964 void MApi_DBXTV_SetMode(EN_DBXTV_TotSonMode totsonmode, EN_DBXTV_TotVolMode totvolmode, EN_DBXTV_TotSurMode totsurmode,MS_U32 enable); 1965 1966 //////////////////////////////////////////////////////////////////////////////// 1967 /// @ingroup Audio_BASIC_SOUNDEFFECT 1968 /// @brief \b Function \b Name: MApi_AUDIO_SeInit() 1969 /// @brief \b Function \b Description: This routine is the initialization for Audio sound effect module. 1970 //////////////////////////////////////////////////////////////////////////////// 1971 void MApi_AUDIO_SeInit(void); 1972 1973 //////////////////////////////////////////////////////////////////////////////// 1974 /// @ingroup Audio_ToBeMerged 1975 /// @brief \b Function \b Name: MApi_AUDIO_SetAdvSndSys() 1976 /// @brief \b Function \b Description: Check Advance sound mod and reload code 1977 /// @param u8AdvSurrMod \b : Audio Advance Sound system mod 1978 //////////////////////////////////////////////////////////////////////////////// 1979 #if defined(UFO_PUBLIC_HEADER_500) || defined(UFO_PUBLIC_HEADER_700) 1980 void MApi_AUDIO_SetAdvSndSys(En_DVB_advsndType u8AdvSurrMod); 1981 #else 1982 void MApi_AUDIO_SetAdvSndSys(MS_U8 u8AdvSurrMod); 1983 #endif 1984 1985 //////////////////////////////////////////////////////////////////////////////// 1986 /// @ingroup Audio_ToBeMerged 1987 /// @brief \b Function \b Name: MApi_AUDIO_VDS() 1988 /// @brief \b Function \b Description: Dolby Virtual Surround 1989 /// @param u8enVDS \b : 1: enable; 0: disable 1990 //////////////////////////////////////////////////////////////////////////////// 1991 void MApi_AUDIO_SetVDS(MS_U8 u8enVDS); 1992 1993 //////////////////////////////////////////////////////////////////////////////// 1994 /// @ingroup Audio_ToBeMerged 1995 /// @brief \b Function \b Name: MApi_AUDIO_SetVSPK() 1996 /// @brief \b Function \b Description: Dolby Virtual Speaker 1997 /// @param u8enVSPK \b : 1: enable; 0: disable 1998 //////////////////////////////////////////////////////////////////////////////// 1999 void MApi_AUDIO_SetVSPK(MS_U8 u8enVSPK); 2000 2001 //////////////////////////////////////////////////////////////////////////////// 2002 /// @ingroup Audio_ToBeMerged 2003 /// @brief \b Function \b Name: MApi_AUDIO_SetSRS() 2004 /// @brief \b Function \b Description: SRS TruSurr 2005 /// @param u8enSRS \b : 1: enable; 0: disable 2006 //////////////////////////////////////////////////////////////////////////////// 2007 void MApi_AUDIO_SetSRS(MS_U8 u8enSRS); 2008 2009 //////////////////////////////////////////////////////////////////////////////// 2010 /// @ingroup Audio_ToBeMerged 2011 /// @brief \b Function \b Name: MApi_AUDIO_SetBBE() 2012 /// @brief \b Function \b Description: BBE Surround 2013 /// @param u8enBBE \b : 1: enable; 0: disable 2014 /// @param u8BBEMode \b : 2015 //////////////////////////////////////////////////////////////////////////////// 2016 void MApi_AUDIO_SetBBE(MS_U8 u8enBBE,MS_U8 u8BBEMode); 2017 2018 //////////////////////////////////////////////////////////////////////////////// 2019 /// @ingroup Audio_ToBeMerged 2020 /// @brief \b Function \b Name: MApi_AUDIO_VSPK_WMod() 2021 /// @brief \b Function \b Description: Dolby Virtual Speaker Wide Mod 2022 /// @param u8VSPK_WMode \b : 0: reference mod; 1: wide mod 2023 //////////////////////////////////////////////////////////////////////////////// 2024 void MApi_AUDIO_VSPK_WMod(MS_U8 u8VSPK_WMode); 2025 2026 //////////////////////////////////////////////////////////////////////////////// 2027 /// @ingroup Audio_ToBeMerged 2028 /// @brief \b Function \b Name: MApi_AUDIO_VSPK_SMod() 2029 /// @brief \b Function \b Description: Dolby Virtual Speaker Surround Mod 2030 /// @param u8VSPK_SMode \b : 0: movie mod; 1: music mod 2031 //////////////////////////////////////////////////////////////////////////////// 2032 void MApi_AUDIO_VSPK_SMod(MS_U8 u8VSPK_SMode); 2033 2034 //////////////////////////////////////////////////////////////////////////////// 2035 /// @ingroup Audio_ToBeMerged 2036 /// @brief \b Function \b Name: MApi_AUDIO_SRS_DC() 2037 /// @brief \b Function \b Description: SRS Dialog Clarity 2038 /// @param u8SRSenDC \b : 1: enable; 0: disable 2039 //////////////////////////////////////////////////////////////////////////////// 2040 void MApi_AUDIO_SRS_DC(MS_U8 u8SRSenDC); 2041 2042 //////////////////////////////////////////////////////////////////////////////// 2043 /// @ingroup Audio_ToBeMerged 2044 /// @brief \b Function \b Name: MApi_AUDIO_SRS_TruBass() 2045 /// @brief \b Function \b Description: SRS TruBass 2046 /// @param u8SRSenTruBass \b : 1: enable; 0: disable 2047 //////////////////////////////////////////////////////////////////////////////// 2048 void MApi_AUDIO_SRS_TruBass(MS_U8 u8SRSenTruBass); 2049 2050 //////////////////////////////////////////////////////////////////////////////// 2051 /// @ingroup Audio_ToBeMerged 2052 /// @brief \b Function \b Name: MApi_SOUND_SRS_SetTsxtPara() 2053 /// @brief \b Function \b Description: This function is used to set paramters of SRS-TSXT 2054 /// @param u8mode \b : parameter mode 2055 /// @param u8value \b : parameter value 2056 //////////////////////////////////////////////////////////////////////////////// 2057 void MApi_AUDIO_SRS_SetTsxtPara(MS_U8 u8mode, MS_U8 u8value); 2058 2059 //////////////////////////////////////////////////////////////////////////////// 2060 /// @ingroup Audio_ToBeMerged 2061 /// @brief \b Function \b Name: MApi_AUDIO_SetSRSTSHD() 2062 /// @brief \b Function \b Description: SRS TruSurround HD 2063 /// @param u8enSRS \b : 1: enable; 0: disable 2064 //////////////////////////////////////////////////////////////////////////////// 2065 void MApi_AUDIO_SetSRSTSHD(MS_U8 u8enTSHD); 2066 2067 //////////////////////////////////////////////////////////////////////////////// 2068 /// @ingroup Audio_ToBeRemove 2069 /// @brief \b Function \b Name: Mapi_SOUND_TSHD_TruBass() 2070 /// @brief \b Function \b Description: TSHD TruBass 2071 /// @param u8SRSenTruBass \b : 1: enable; 0: disable 2072 //////////////////////////////////////////////////////////////////////////////// 2073 void Mapi_SOUND_TSHD_TruBass(MS_U8 u8TSHDenTruBass); 2074 2075 //////////////////////////////////////////////////////////////////////////////// 2076 /// @ingroup Audio_ToBeMerged 2077 /// @brief \b Function \b Name: MApi_AUDIO_TSHD_Definition() 2078 /// @brief \b Function \b Description: This function is used to enable/disable SRS-HD Definition 2079 /// @param u8TSHDenDefinition \b : 1: enable, 0: disable 2080 //////////////////////////////////////////////////////////////////////////////// 2081 void MApi_AUDIO_TSHD_Definition(MS_U8 u8TSHDenDefinition); 2082 2083 //////////////////////////////////////////////////////////////////////////////// 2084 /// @ingroup Audio_ToBeRemove 2085 /// @brief \b Function \b Name: Mapi_SOUND_TSHD_Definition() 2086 /// @brief \b Function \b Description: This function is used to enable/disable SRS-HD Definition 2087 /// @param u8TSHDenDefinition \b : 1: enable, 0: disable 2088 //////////////////////////////////////////////////////////////////////////////// 2089 void Mapi_SOUND_TSHD_Definition(MS_U8 u8TSHDenDefinition); 2090 2091 //////////////////////////////////////////////////////////////////////////////// 2092 /// @ingroup Audio_ToBeMerged 2093 /// @brief \b Function \b Name: MApi_SOUND_SRS_SetTshdPara() 2094 /// @brief \b Function \b Description: This function is used to set paramters of SRS-TSHD 2095 /// @param u8mode \b : parameter mode 2096 /// @param u8value \b : parameter value 2097 //////////////////////////////////////////////////////////////////////////////// 2098 void MApi_AUDIO_SRS_SetTshdPara(MS_U8 u8mode, MS_U8 u8value); 2099 2100 //////////////////////////////////////////////////////////////////////////////// 2101 /// @ingroup Audio_BASIC_SOUNDEFFECT 2102 /// @brief \b Function \b Name: MApi_AUDIO_COPY_Parameter() 2103 /// @brief \b Function \b Description: Copy parameter from APP level 2104 /// @param u8enVSPK \b : 2105 //////////////////////////////////////////////////////////////////////////////// 2106 void MApi_AUDIO_COPY_Parameter(ADVSND_PARAM type, void* Parameter_ptr,MS_U32 size); 2107 2108 //============================================================= 2109 // AUDIO_KTV RELATIONAL API FUNCTION 2110 //============================================================= 2111 2112 //////////////////////////////////////////////////////////////////////////////// 2113 /// @ingroup Audio_BASIC_SOUNDEFFECT 2114 /// @brief \b Function \b Name: MApi_AUDIO_SetKTVInfo() 2115 /// @brief \b Function \b Description: Set KTV parameter 2116 /// @param modelType \b : KTV model type 2117 /// @param infoType \b : KTV infomation type 2118 /// @param param1 \b : 2119 /// @param param2 \b : 2120 //////////////////////////////////////////////////////////////////////////////// 2121 MS_BOOL MApi_AUDIO_SetKTVInfo (AUDIO_KTV_MODEL modelType, AUDIO_KTV_PARAMTYPE paramType, MS_U32 param1, MS_U32 param2); 2122 2123 //////////////////////////////////////////////////////////////////////////////// 2124 /// @ingroup Audio_BASIC_SOUNDEFFECT 2125 /// @brief \b Function \b Name: MApi_AUDIO_GetKTVInfo() 2126 /// @brief \b Function \b Description: Get KTV parameter 2127 /// @param modelType \b : KTV model type 2128 /// @param infoType \b : KTV infomation type 2129 /// @return MS_U32 \b : return KTV value 2130 //////////////////////////////////////////////////////////////////////////////// 2131 MS_U32 MApi_AUDIO_GetKTVInfo (AUDIO_KTV_MODEL modelType, AUDIO_KTV_INFOTYPE infoType); 2132 2133 //////////////////////////////////////////////////////////////////////////////// 2134 /// @ingroup Audio_BASIC_SOUNDEFFECT 2135 /// @brief \b Function \b Name: MApi_AUDIO_SetMixModeVolume() 2136 /// @brief \b Function \b Description: This routine is used to set the absolute u8Volume of mix mode. 2137 /// @param eSourceType \b : for audio source 2138 /// @param VolType \b : for audio vol type 2139 /// @param u8Vol1 \b : MSB 7-bit register value of 10-bit u8Volume 2140 /// range from 0x00 to 0x7E , gain: +12db to -114db (-1 db per step) 2141 /// @param u8Vol2 \b : LSB 3-bit register value of 10-bit u8Volume 2142 /// range from 0x00 to 0x07 , gain: -0db to -0.875db (-0.125 db per step) 2143 //////////////////////////////////////////////////////////////////////////////// 2144 void MApi_AUDIO_SetMixModeVolume(AUDIO_SOURCE_INFO_TYPE eSourceType, AUDIO_MIX_VOL_TYPE VolType, MS_U8 u8Vol1, MS_U8 u8Vol2); 2145 2146 //////////////////////////////////////////////////////////////////////////////// 2147 /// @ingroup Audio_BASIC_SOUNDEFFECT 2148 /// @brief \b Function \b Name: MApi_AUDIO_SetMixModeMute() 2149 /// @brief \b Function \b Description: This routine is used to set audio mix mode mute 2150 /// @param eSourceType \b : for audio source 2151 /// @param VolType \b : for audio vol type 2152 /// @param EnMute \b : TRUE --Mute; 2153 /// FALSE--Unmute 2154 //////////////////////////////////////////////////////////////////////////////// 2155 void MApi_AUDIO_SetMixModeMute(AUDIO_SOURCE_INFO_TYPE eSourceType, AUDIO_MIX_VOL_TYPE VolType, MS_BOOL EnMute); 2156 2157 //////////////////////////////////////////////////////////////////////////////// 2158 /// @ingroup Audio_ToBeRemove 2159 /// @brief \b Function \b Name: MApi_AUDIO_PlayMenuSound() 2160 /// @brief \b Function \b Description: This routine is used to Play Menu Sound. 2161 //////////////////////////////////////////////////////////////////////////////// 2162 void MApi_AUDIO_PlayMenuSound(void); 2163 2164 //============================================================= 2165 // AUDIO_OTHERS FUNCTION 2166 //============================================================= 2167 //Cathy0511 void MApi_AUDIO_SetAudioSource(AUDIOSOURCE_TYPE eSource); 2168 //Certification 2169 2170 //////////////////////////////////////////////////////////////////////////////// 2171 /// @ingroup Audio_ToBeRemove 2172 /// @brief \b Function \b Name: MApi_AUDIO_SetCertMode() 2173 /// @brief \b Function \b Description: 2174 /// @param CertType \b : 2175 /// @param enable \b : 2176 /// 2177 //////////////////////////////////////////////////////////////////////////////// 2178 MS_BOOL MApi_AUDIO_SetCertMode( Audio_CertMode CertType,Audio_CertEnable enable); 2179 2180 //============================================================= 2181 // AUDIO_MM RELATIONAL API FUNCTION 2182 //============================================================= 2183 // Each Decoder functions 2184 // Set Info 2185 2186 //****************************************************************************** 2187 /// @ingroup Audio_Decoder 2188 /// @brief \b Function \b Name: MApi_AUDIO_SetCommAudioInfo() 2189 /// @brief \b Function \b Description: This routine is used for adjust Common Audio decoder parameters 2190 /// @return MS_BOOL \b : True / False 2191 //****************************************************************************** 2192 MS_BOOL MApi_AUDIO_SetCommAudioInfo( Audio_COMM_infoType infoType, MS_VIRT param1, MS_VIRT param2 ); 2193 //****************************************************************************** 2194 /// @ingroup Audio_ToBeRemove 2195 /// @brief \b Function \b Name: MApi_AUDIO_SetMpegInfo() 2196 /// @brief \b Function \b Description: This routine is used for adjust MPEG Audio decoder parameters 2197 /// @return MS_BOOL \b : True / False 2198 //****************************************************************************** 2199 MS_BOOL MApi_AUDIO_SetMpegInfo( Audio_MPEG_infoType infoType, MS_VIRT param1, MS_VIRT param2 ); 2200 //****************************************************************************** 2201 /// @ingroup Audio_ToBeRemove 2202 /// @brief \b Function \b Name: MApi_AUDIO_SetAC3Info() 2203 /// @brief \b Function \b Description: This routine is used for adjust AC3 Audio decoder parameters 2204 /// @return MS_BOOL \b : True / False 2205 //****************************************************************************** 2206 MS_BOOL MApi_AUDIO_SetAC3Info( Audio_AC3_infoType infoType, MS_VIRT param1, MS_VIRT param2 ); 2207 2208 //****************************************************************************** 2209 /// @ingroup Audio_ToBeRemove 2210 /// @brief \b Function \b Name: MApi_AUDIO_SetAC3PInfo() 2211 /// @brief \b Function \b Description: This routine is used for adjust AC3+ Audio decoder parameters 2212 /// @return MS_BOOL \b : True / False 2213 //****************************************************************************** 2214 MS_BOOL MApi_AUDIO_SetAC3PInfo( Audio_AC3P_infoType infoType, MS_VIRT param1, MS_VIRT param2 ); 2215 //****************************************************************************** 2216 /// @ingroup Audio_ToBeRemove 2217 /// @brief \b Function \b Name: MApi_AUDIO_SetAACInfo() 2218 /// @brief \b Function \b Description: This routine is used for adjust AAC Audio decoder parameters 2219 /// @return MS_BOOL \b : True / False 2220 //****************************************************************************** 2221 MS_BOOL MApi_AUDIO_SetAACInfo( Audio_AAC_infoType infoType, MS_VIRT param1, MS_VIRT param2 ); 2222 //****************************************************************************** 2223 /// @ingroup Audio_ToBeRemove 2224 /// @brief \b Function \b Name: MApi_AUDIO_SetWmaInfo() 2225 /// @brief \b Function \b Description: This routine is used for adjust WMA Audio decoder parameters 2226 /// @return MS_BOOL \b : True / False 2227 //****************************************************************************** 2228 MS_BOOL MApi_AUDIO_SetWmaInfo( Audio_WMA_infoType infoType, MS_VIRT param1, MS_VIRT param2 ); 2229 //****************************************************************************** 2230 /// @ingroup Audio_ToBeRemove 2231 /// @brief \b Function \b Name: MApi_AUDIO_SetDTSCommonCtrl() 2232 /// @brief \b Function \b Description: This routine is used for adjust DTS Audio decoder control 2233 /// @return MS_BOOL \b : True / False 2234 //****************************************************************************** 2235 MS_BOOL MApi_AUDIO_SetDTSCommonCtrl( Audio_DTS_infoType infoType, Audio_DTS_CtrlType ctrl_type ); 2236 2237 //****************************************************************************** 2238 /// @ingroup Audio_Decoder 2239 /// @brief \b Function \b Name: MApi_AUDIO_GetCommAudioInfo() 2240 /// @brief \b Function \b Description: This routine will return the 64bit Common info according to info type 2241 /// @return long long \b : 64bit info 2242 //****************************************************************************** 2243 #if defined(UFO_PUBLIC_HEADER_300) || defined(UFO_PUBLIC_HEADER_212) 2244 long long MApi_AUDIO_GetCommAudioInfo( Audio_COMM_infoType infoType ); 2245 #else 2246 MS_U64 MApi_AUDIO_GetCommAudioInfo( Audio_COMM_infoType infoType ); 2247 #endif 2248 2249 //****************************************************************************** 2250 /// @ingroup Audio_ToBeRemove 2251 /// @brief \b Function \b Name: MApi_AUDIO_GetMpegInfo() 2252 /// @brief \b Function \b Description: This routine will return the 32bit mpeg info according to info type 2253 /// @return MS_U32 \b : 32bit info 2254 //****************************************************************************** 2255 MS_U32 MApi_AUDIO_GetMpegInfo( Audio_MPEG_infoType infoType ); 2256 2257 //****************************************************************************** 2258 /// @ingroup Audio_ToBeRemove 2259 /// @brief \b Function \b Name: MApi_AUDIO_GetAC3Info() 2260 /// @brief \b Function \b Description: This routine will return the 32bit ac3 info according to info type 2261 /// @return MS_U32 \b : 32bit info 2262 //****************************************************************************** 2263 MS_U32 MApi_AUDIO_GetAC3Info( Audio_AC3_infoType infoType ); 2264 2265 //****************************************************************************** 2266 /// @ingroup Audio_ToBeRemove 2267 /// @brief \b Function \b Name: MApi_AUDIO_GetAC3PInfo() 2268 /// @brief \b Function \b Description: This routine will return the 32bit ac3+ info according to info type 2269 /// @return MS_U32 \b : 32bit info 2270 //****************************************************************************** 2271 MS_U32 MApi_AUDIO_GetAC3PInfo( Audio_AC3P_infoType infoType ); 2272 2273 //****************************************************************************** 2274 /// @ingroup Audio_ToBeRemove 2275 /// @brief \b Function \b Name: MApi_AUDIO_GetAACInfo() 2276 /// @brief \b Function \b Description: This routine will return the 32bit AAC info according to info type 2277 /// @return MS_U32 \b : 32bit info 2278 //****************************************************************************** 2279 MS_U32 MApi_AUDIO_GetAACInfo( Audio_AAC_infoType infoType ); 2280 2281 //****************************************************************************** 2282 /// @ingroup Audio_ToBeRemove 2283 /// @brief \b Function \b Name: MApi_AUDIO_GetWmaInfo() 2284 /// @brief \b Function \b Description: This routine will return the 32bit wma info according to info type 2285 /// @return MS_U32 \b : 32bit info 2286 //****************************************************************************** 2287 MS_U32 MApi_AUDIO_GetWmaInfo( Audio_WMA_infoType infoType ); 2288 2289 //****************************************************************************** 2290 /// @ingroup Audio_ToBeRemove 2291 /// @brief \b Function \b Name: MApi_AUDIO_GetDTSInfo() 2292 /// @brief \b Function \b Description: This routine will return the 32bit DTS info according to info type 2293 /// @return MS_U32 \b : 32bit info 2294 //****************************************************************************** 2295 MS_U32 MApi_AUDIO_GetDTSInfo( Audio_DTS_infoType infoType ); 2296 2297 //////////////////////////////////////////////////////////////////////////////// 2298 /// @ingroup Audio_ToBeRemove 2299 /// @brief \b Function \b Name: MApi_AUDIO_XPCM_Param() 2300 /// @brief \b Function \b Description: This routine configures necessary parameters when playing XPCM data 2301 /// @param audioType \b : 1--lpcm; 2302 /// 2--MS-ADPCM; 2303 /// 17--IMA-ADPCM 2304 /// @param channels \b : 0-- mono; 2305 /// 1-- stereo 2306 /// @param sampleRate \b : 8, 11.025, 16, 22.05, 44.1 and 48 (KHz) 2307 /// @param bitsPerSample \b : 8--8 bits; 2308 /// 16--16 bits 2309 /// @param blockSize \b : block size 2310 /// @param samplePerBlock \b : samples per block 2311 /// @return MS_U8 \b : TRUE--parameters are correct; 2312 /// FALSE--parameters are incorrect 2313 //////////////////////////////////////////////////////////////////////////////// 2314 #if defined(UFO_PUBLIC_HEADER_212) ||defined(UFO_PUBLIC_HEADER_500_3) 2315 MS_U8 MApi_AUDIO_XPCM_Param(XPCM_TYPE audioType, MS_U8 channels, MS_U32 sampleRate, 2316 MS_U8 bitsPerSample, MS_U16 blockSize, MS_U16 samplePerBlock); 2317 #else 2318 MS_U8 MApi_AUDIO_XPCM_Param(XPCM_TYPE audioType, MS_U8 channels, MS_U16 sampleRate, 2319 MS_U8 bitsPerSample, MS_U16 blockSize, MS_U16 samplePerBlock); 2320 #endif 2321 2322 //////////////////////////////////////////////////////////////////////////////// 2323 /// @ingroup Audio_ToBeRemove 2324 /// @brief \b Function \b Name: MApi_AUDIO_XPCM2_Param() 2325 /// @brief \b Function \b Description: This routine configures necessary parameters when playing XPCM data 2326 /// @param audioType \b : 1--lpcm; 2327 /// 2--MS-ADPCM; 2328 /// 17--IMA-ADPCM 2329 /// @param channels \b : 0-- mono; 2330 /// 1-- stereo 2331 /// @param sampleRate \b : 8, 11.025, 16, 22.05, 44.1 and 48 (KHz) 2332 /// @param bitsPerSample \b : 8--8 bits; 2333 /// 16--16 bits 2334 /// @param blockSize \b : block size 2335 /// @param samplePerBlock \b : samples per block 2336 /// @return MS_U8 \b : TRUE--parameters are correct; 2337 /// FALSE--parameters are incorrect 2338 //////////////////////////////////////////////////////////////////////////////// 2339 #if defined(UFO_PUBLIC_HEADER_212) ||defined(UFO_PUBLIC_HEADER_500_3) 2340 void MApi_AUDIO_XPCM2_Param(XPCM_TYPE audioType, MS_U8 channels, MS_U32 sampleRate, 2341 MS_U8 bitsPerSample, MS_U16 blockSize, MS_U16 samplePerBlock); 2342 2343 #else 2344 void MApi_AUDIO_XPCM2_Param(XPCM_TYPE audioType, MS_U8 channels, MS_U16 sampleRate, 2345 MS_U8 bitsPerSample, MS_U16 blockSize, MS_U16 samplePerBlock); 2346 #endif 2347 2348 //////////////////////////////////////////////////////////////////////////////// 2349 /// @ingroup Audio_ToBeRemove 2350 /// @brief \b Function \b Name: MApi_AUDIO_XPCM2_CheckIntStatus() 2351 /// @brief \b Function \b Description: This routine is used to Read DSP internal sram value for int status by IDMA 2352 /// @param <OUT> \b NONE : 2353 /// @param <RET> \b MS_U16 : sram value for interrupt status 2354 /// @param <GLOBAL> \b NONE : 2355 //////////////////////////////////////////////////////////////////////////////// 2356 MS_U16 MApi_AUDIO_XPCM2_CheckIntStatus(void); 2357 2358 //////////////////////////////////////////////////////////////////////////////// 2359 /// @ingroup Audio_ToBeRemove 2360 /// @brief \b Function \b Name: MApi_AUDIO_RA8_Param() 2361 /// @brief \b Function \b Description: This routine configures necessary parameters when playing RA8 LBR data 2362 /// @param mNumCodecs \b : 1--stereo or mono 2363 /// 2~5-- multi channels 2364 /// @param mSamples \b : output samples--256, 512, 1024 2365 /// @param mSampleRate \b : 8, 11.025, 16, 22.05, 44.1 (KHz) 2366 /// @param Channels \b : 1-- mono 2367 /// 2-- stereo 2368 /// @param cplStart \b : 0 ~ 51 2369 /// @param Regions \b : 0 ~ 31 2370 /// @param cplQbits \b : 0, 2, 3, 4, 5, 6 2371 /// @param FrameSize \b : bitstream size of every NumCodes (bytes) 2372 /// Range--0 ~ 65535 2373 /// @return MS_U8 \b : TRUE--parameters are correct; 2374 /// FALSE--parameters are incorrect 2375 //////////////////////////////////////////////////////////////////////////////// 2376 MS_U8 MApi_AUDIO_RA8_Param(MS_U16 mNumCodecs, MS_U16 mSamples, MS_U16 mSampleRate, 2377 MS_U16* Channels, MS_U16* Regions, MS_U16* cplStart, MS_U16* cplQbits, 2378 MS_U16* FrameSize); 2379 2380 En_DVB_melodyPlayStatus MApi_AUDIO_PlayMelody(En_DVB_melodyPlayCmdType eMelodyCmd, MS_VIRT* u32FileAddr,MS_U32 u32FileSize, MS_U32 u32DspReqAddr); 2381 //////////////////////////////////////////////////////////////////////////////// 2382 /// @ingroup Audio_ToBeRemove 2383 /// @brief \b Function \b Name: MApi_AUDIO_Init() 2384 /// @brief \b Function \b Description: MM Music mode Initial Audio decoder 2385 /// @param <IN> \b enDecSystem: Audio decoder type 2386 /// @param <OUT> \b NONE : 2387 /// @param <GLOBAL> \b NONE : 2388 //////////////////////////////////////////////////////////////////////////////// 2389 void MApi_AUDIO_Init(En_DVB_decSystemType enDecSystem); 2390 2391 //////////////////////////////////////////////////////////////////////////////// 2392 /// @ingroup Audio_ToBeRemove 2393 /// @brief \b Function \b Name: MApi_AUDIO_StartDecode() 2394 /// @brief \b Function \b Description: start play MM file 2395 /// @param <IN> \b NONE : 2396 /// @param <OUT> \b NONE : 2397 /// @param <GLOBAL> \b NONE : 2398 //////////////////////////////////////////////////////////////////////////////// 2399 void MApi_AUDIO_StartDecode(void); 2400 2401 //////////////////////////////////////////////////////////////////////////////// 2402 /// @ingroup Audio_ToBeRemove 2403 /// @brief \b Function \b Name: MApi_AUDIO_StartBrowse() 2404 /// @brief \b Function \b Description: start browse file 2405 /// @param <IN> \b NONE : 2406 /// @param <OUT> \b NONE : 2407 /// @param <GLOBAL> \b NONE : 2408 //////////////////////////////////////////////////////////////////////////////// 2409 void MApi_AUDIO_StartBrowse(void); 2410 2411 //////////////////////////////////////////////////////////////////////////////// 2412 /// @ingroup Audio_ToBeRemove 2413 /// @brief \b Function \b Name: MApi_AUDIO_StopDecode() 2414 /// @brief \b Function \b Description: Stop decoder 2415 /// @param <IN> \b NONE : 2416 /// @param <OUT> \b NONE : 2417 /// @param <GLOBAL> \b NONE : 2418 //////////////////////////////////////////////////////////////////////////////// 2419 void MApi_AUDIO_StopDecode(void); 2420 2421 //////////////////////////////////////////////////////////////////////////////// 2422 /// @ingroup Audio_ToBeRemove 2423 /// @brief \b Function \b Name: MApi_AUDIO_PauseDecode() 2424 /// @brief \b Function \b Description: pause decoder 2425 /// @param <IN> \b NONE : 2426 /// @param <OUT> \b NONE : 2427 /// @param <GLOBAL> \b NONE : 2428 //////////////////////////////////////////////////////////////////////////////// 2429 void MApi_AUDIO_PauseDecode(void); 2430 2431 //////////////////////////////////////////////////////////////////////////////// 2432 /// @ingroup Audio_ToBeRemove 2433 /// @brief \b Function \b Name: MApi_AUDIO_CheckPlayDone() 2434 /// @brief \b Function \b Description: Check file play done. If file play done, will return TRUE 2435 /// @param <IN> \b NONE : 2436 /// @param <OUT> \b MS_U8 : TRUE or FALSE 2437 /// @param <GLOBAL> \b NONE : 2438 //////////////////////////////////////////////////////////////////////////////// 2439 MS_U8 MApi_AUDIO_CheckPlayDone(void); 2440 2441 //////////////////////////////////////////////////////////////////////////////// 2442 /// @ingroup Audio_ToBeRemove 2443 /// @brief \b Function \b Name: MApi_AUDIO_GetResidualBufferSize() 2444 /// @brief \b Function \b Description: Get ES buffer level. 2445 /// @param <IN> \b NONE : 2446 /// @param <OUT> \b MS_U16 : ES buffer level 2447 /// @param <GLOBAL> \b NONE : 2448 //////////////////////////////////////////////////////////////////////////////// 2449 MS_U16 MApi_AUDIO_GetResidualBufferSize(void); 2450 2451 //////////////////////////////////////////////////////////////////////////////// 2452 /// @ingroup Audio_ToBeRemove 2453 /// @brief \b Function \b Name: MApi_AUDIO_GetPCMBufferSize() 2454 /// @brief \b Function \b Description: Get MP3 PCM buffer level. 2455 /// @param <IN> \b u16BitRate : Bit Rate 2456 /// @param <OUT> \b MS_U16 : MP3 PCM buffer level 2457 /// @param <GLOBAL> \b NONE : 2458 //////////////////////////////////////////////////////////////////////////////// 2459 MS_U16 MApi_AUDIO_GetPCMBufferSize(MS_U16 u16BitRate); 2460 2461 //////////////////////////////////////////////////////////////////////////////// 2462 /// @ingroup Audio_ToBeRemove 2463 /// @brief \b Function \b Name: MApi_AUDIO_GetPCMBufferSize2() 2464 /// @brief \b Function \b Description: Get PCM buffer level. 2465 /// @param <IN> \b u16BitRate : Bit Rate; 2466 /// @param <IN> \b u16SampleRate : Sample Rate 2467 /// @param <OUT> \b MS_U16 : PCM buffer level 2468 /// @param <GLOBAL> \b NONE : 2469 //////////////////////////////////////////////////////////////////////////////// 2470 MS_U16 MApi_AUDIO_GetPCMBufferSize2(MS_U16 u16BitRate,MS_U16 u16SampleRate); 2471 2472 //////////////////////////////////////////////////////////////////////////////// 2473 /// @ingroup Audio_ToBeRemove 2474 /// @brief \b Function \b Name: MApi_AUDIO_GetCurrentFrameNumber() 2475 /// @brief \b Function \b Description: Get MP3 Current Frame Number 2476 /// @param <IN> \b NONE : 2477 /// @param <OUT> \b MS_U32 : Current Frame Number 2478 /// @param <GLOBAL> \b NONE : 2479 //////////////////////////////////////////////////////////////////////////////// 2480 MS_U32 MApi_AUDIO_GetCurrentFrameNumber(void); 2481 2482 //////////////////////////////////////////////////////////////////////////////// 2483 /// @ingroup Audio_ToBeMerged 2484 /// @brief \b Function \b Name: MApi_AUDIO_GetSampleRate() 2485 /// @brief \b Function \b Description: Get Sample Rate 2486 /// @param <IN> \b NONE : 2487 /// @param <OUT> \b MS_U16 : Sample Rate 2488 /// @param <GLOBAL> \b NONE : 2489 //////////////////////////////////////////////////////////////////////////////// 2490 MS_U16 MApi_AUDIO_GetSampleRate(void); 2491 2492 //////////////////////////////////////////////////////////////////////////////// 2493 /// @ingroup Audio_ToBeMerged 2494 /// @brief \b Function \b Name: MApi_AUDIO_GetBitRate() 2495 /// @brief \b Function \b Description: Get Bit Rate 2496 /// @param <IN> \b NONE : 2497 /// @param <OUT> \b MS_U32 : Bit Rate 2498 /// @param <GLOBAL> \b NONE : 2499 //////////////////////////////////////////////////////////////////////////////// 2500 MS_U32 MApi_AUDIO_GetBitRate(void); 2501 2502 //////////////////////////////////////////////////////////////////////////////// 2503 /// @ingroup Audio_ToBeRemove 2504 /// @brief \b Function \b Name: MApi_AUDIO_GetLayer() 2505 /// @brief \b Function \b Description: Get MP3 Layer 2506 /// @param <IN> \b NONE : 2507 /// @param <OUT> \b Audio_MP3_LAYER : MPEG Layer 2508 /// @param <GLOBAL> \b NONE : 2509 //////////////////////////////////////////////////////////////////////////////// 2510 Audio_MP3_LAYER MApi_AUDIO_GetLayer(void); 2511 //////////////////////////////////////////////////////////////////////////////// 2512 /// @ingroup Audio_Decoder 2513 /// @brief \b Function \b Name: MApi_AUDIO_CheckInputRequest() 2514 /// @brief \b Function \b Description: If MCU receive DSP interrupt, this function will return TRUE and report requested ES data buffer address and size 2515 /// @param <IN> \b pU32WrtAddr : 2516 /// @param <IN> \b pU32WrtBytes : 2517 /// @param <OUT> \b MS_U8 : TRUE or FALSE 2518 /// @param <GLOBAL> \b NONE : 2519 //////////////////////////////////////////////////////////////////////////////// 2520 #if defined(UFO_PUBLIC_HEADER_300) || defined(UFO_PUBLIC_HEADER_212) 2521 MS_U8 MApi_AUDIO_CheckInputRequest(MS_U32 *pU32WrtAddr, MS_U32 *pU32WrtBytes); 2522 #else 2523 MS_U8 MApi_AUDIO_CheckInputRequest(MS_PHY *pPHYWrtAddr, MS_U32 *pU32WrtBytes); 2524 #endif 2525 2526 //////////////////////////////////////////////////////////////////////////////// 2527 /// @ingroup Audio_Decoder 2528 /// @brief \b Function \b Name: MApi_AUDIO_SetInput() 2529 /// @brief \b Function \b Description: This function will inform DSP that MCU already write data to ES buffer by interrupt. 2530 /// @param <IN> \b NONE : 2531 /// @param <OUT> \b NONE : 2532 /// @param <GLOBAL> \b NONE : 2533 //////////////////////////////////////////////////////////////////////////////// 2534 void MApi_AUDIO_SetInput(void); 2535 2536 //////////////////////////////////////////////////////////////////////////////// 2537 /// @ingroup Audio_ToBeRemove 2538 /// @brief \b Function \b Name: MApi_AUDIO_SetSampleRateIndex() 2539 /// @brief \b Function \b Description: Set AAC sample rate index. 2540 /// @param <IN> \b u16Index : 2541 /// @param <OUT> \b NONE : 2542 /// @param <GLOBAL> \b NONE : 2543 //////////////////////////////////////////////////////////////////////////////// 2544 void MApi_AUDIO_SetSampleRateIndex(MS_U16 u16Index); 2545 2546 //////////////////////////////////////////////////////////////////////////////// 2547 /// @ingroup Audio_ToBeRemove 2548 /// @brief \b Function \b Name: MApi_AUDIO_SetXPCMParam() 2549 /// @brief \b Function \b Description: Set XPCM paramaters 2550 /// @param <IN> \b audioType : 2551 /// @param <IN> \b channels : 2552 /// @param <IN> \b sampleRate : 2553 /// @param <IN> \b bitsPerSample : 2554 /// @param <IN> \b samplePerBlock : 2555 /// @param <OUT> \b NONE : 2556 /// @param <GLOBAL> \b NONE : 2557 //////////////////////////////////////////////////////////////////////////////// 2558 #if defined(UFO_PUBLIC_HEADER_212) 2559 void MApi_AUDIO_SetXPCMParam(XPCM_TYPE audioType, MS_U8 channels, MS_U32 sampleRate, MS_U8 bitsPerSample, MS_U16 blockSize, MS_U16 samplePerBlock); 2560 #else 2561 void MApi_AUDIO_SetXPCMParam(XPCM_TYPE audioType, MS_U8 channels, MS_U16 sampleRate, MS_U8 bitsPerSample, MS_U16 blockSize, MS_U16 samplePerBlock); 2562 #endif 2563 2564 //////////////////////////////////////////////////////////////////////////////// 2565 /// @ingroup Audio_ToBeRemove 2566 /// @brief \b Function \b Name: MApi_AUDIO_FileEndNotification() 2567 /// @brief \b Function \b Description: This function will inform DSP that file end 2568 /// @param <IN> \b NONE : 2569 /// @param <OUT> \b NONE : 2570 /// @param <GLOBAL> \b NONE : 2571 //////////////////////////////////////////////////////////////////////////////// 2572 void MApi_AUDIO_FileEndNotification(void); 2573 2574 //////////////////////////////////////////////////////////////////////////////// 2575 /// @ingroup Audio_ToBeRemove 2576 /// @brief \b Function \b Name: MApi_AUDIO_FileEndDataHandle() 2577 /// @brief \b Function \b Description: Info DSP that the last ES data left size. 2578 /// @param <IN> \b u32DataLeft : 2579 /// @param <OUT> \b NONE : 2580 /// @param <GLOBAL> \b NONE : 2581 //////////////////////////////////////////////////////////////////////////////// 2582 void MApi_AUDIO_FileEndDataHandle(MS_U32 u32DataLeft); 2583 2584 //////////////////////////////////////////////////////////////////////////////// 2585 /// @ingroup Audio_ToBeRemove 2586 /// @brief \b Function \b Name: MApi_AUDIO_GetPlayTick() 2587 /// @brief \b Function \b Description: Get Play Time stamp 2588 /// @param <IN> \b NONE : 2589 /// @param <OUT> \b NONE : 2590 /// @param <GLOBAL> \b NONE : 2591 //////////////////////////////////////////////////////////////////////////////// 2592 MS_U32 MApi_AUDIO_GetPlayTick(void); 2593 2594 //////////////////////////////////////////////////////////////////////////////// 2595 /// @ingroup Audio_ToBeMerged 2596 /// @brief \b Function \b Name: MApi_AUDIO_GetEsMEMCnt() 2597 /// @brief \b Function \b Description: Get ES Bufffer size 2598 /// @param <IN> \b NONE : 2599 /// @param <OUT> \b MS_U16 : ES Bufffer size 2600 /// @param <GLOBAL> \b NONE : 2601 //////////////////////////////////////////////////////////////////////////////// 2602 MS_U16 MApi_AUDIO_GetEsMEMCnt(void); 2603 2604 //////////////////////////////////////////////////////////////////////////////// 2605 /// @ingroup Audio_ToBeMerged 2606 /// @brief \b Function \b Name: MApi_AUDIO_SetASFParm() 2607 /// @brief \b Function \b Description: Set WMA ASF Paramaters 2608 /// @param <IN> \b parm_type : 2609 /// @param <IN> \b value : 2610 /// @param <OUT> \b NONE : 2611 /// @param <GLOBAL> \b NONE : 2612 //////////////////////////////////////////////////////////////////////////////// 2613 void MApi_AUDIO_SetASFParm(WMA_ASF_PARMTYPE parm_type, MS_U32 value); 2614 2615 //////////////////////////////////////////////////////////////////////////////// 2616 /// @ingroup Audio_ToBeRemove 2617 /// @brief \b Function \b Name: MApi_AUDIO_MM_SetInput() 2618 /// @brief \b Function \b Description: MCU send interrupt to decoder1/2 in MM mode 2619 /// @param <IN> \b AUDDecoderNo : DVB_Audio_Decoder1 / DVB_Audio_Decoder2 2620 /// @param <IN> \b u8IntTag : Interrupt tag, increase by every time 2621 /// @param <OUT> \b NONE : 2622 /// @param <GLOBAL> \b NONE : 2623 //////////////////////////////////////////////////////////////////////////////// 2624 void MApi_AUDIO_MM_SetInput (En_DVB_AudioDecoder AUDDecoderNo, MS_U8 u8IntTag); 2625 2626 //////////////////////////////////////////////////////////////////////////////// 2627 /// @ingroup Audio_ToBeRemove 2628 /// @brief \b Function \b Name: MApi_AUDIO_MM_CheckPlayDone() 2629 /// @brief \b Function \b Description: MCU check audio play end in MM mode 2630 /// @param <IN> \b AUDDecoderNo : DVB_Audio_Decoder1 / DVB_Audio_Decoder2 2631 /// @param <OUT> \b MS_U16 : Value of residual PCM level for file end stop 2632 /// @param <GLOBAL> \b NONE : 2633 //////////////////////////////////////////////////////////////////////////////// 2634 MS_U32 MApi_AUDIO_MM_CheckPlayDone (En_DVB_AudioDecoder AUDDecoderNo); 2635 //////////////////////////////////////////////////////////////////////////////// 2636 /// @ingroup Audio_ToBeRemove 2637 /// @brief \b Function \b Name: MApi_AUDIO_MM_CheckInputRequest() 2638 /// @brief \b Function \b Description : Decoder request input addr & size in MM mode 2639 /// @param <IN> \b AUDDecoderNo : DVB_Audio_Decoder1 / DVB_Audio_Decoder2 2640 /// @param <IN> \b pU32WrtAddr : Request input address in ES1 buffer 2641 /// @param <IN> \b pU32WrtBytes : Request input size 2642 /// @param <OUT> \b MS_U8 : return TRUE if ok, else return FALSE 2643 /// @param <GLOBAL> \b NONE : 2644 //////////////////////////////////////////////////////////////////////////////// 2645 #if defined(UFO_PUBLIC_HEADER_300) || defined(UFO_PUBLIC_HEADER_212) 2646 MS_U8 MApi_AUDIO_MM_CheckInputRequest(En_DVB_AudioDecoder AUDDecoderNo, MS_U32 *pU32WrtAddr, MS_U32 *pU32WrtBytes); 2647 #else 2648 MS_U8 MApi_AUDIO_MM_CheckInputRequest(En_DVB_AudioDecoder AUDDecoderNo, MS_PHY *pPHYWrtAddr, MS_U32 *pU32WrtBytes); 2649 #endif 2650 2651 //////////////////////////////////////////////////////////////////////////////// 2652 /// @ingroup Audio_ToBeRemove 2653 /// @brief \b Function \b Name: MApi_AUDIO_DmaReader_Init() 2654 /// @brief \b Function \b Description: 2655 /// @param <IN> \b eType : sampleRate 2656 /// @param <OUT> \b NONE : 2657 /// @param <RET> \b NONE : 2658 //////////////////////////////////////////////////////////////////////////////// 2659 void MApi_AUDIO_DmaReader_Init(SAMPLE_RATE sampleRate); 2660 2661 //////////////////////////////////////////////////////////////////////////////// 2662 /// @ingroup Audio_ToBeRemove 2663 /// @brief \b Function \b Name: MApi_AUDIO_DmaReader_AllInput_Init() 2664 /// @brief \b Function \b Description: Used DMA reader in all audio source application 2665 /// \b (ex: Key sound) (CHIP_T8/T12) (48KHz only) 2666 /// @param <IN> \b eType : sampleRate 2667 /// @param <OUT> \b NONE : 2668 /// @param <RET> \b NONE : 2669 //////////////////////////////////////////////////////////////////////////////// 2670 void MApi_AUDIO_DmaReader_AllInput_Init(void); 2671 2672 //////////////////////////////////////////////////////////////////////////////// 2673 /// @ingroup Audio_ToBeRemove 2674 /// @brief \b Function \b Name: MApi_AUDIO_DmaReader_WritePCM() 2675 /// @brief \b Function \b Description: This routine is used to write PCM data into DMA reader Buffer 2676 /// @param <IN> \b eType : buffer size (must be multiple of 8 Byte) 2677 /// @param <OUT> \b MS_BOOL : TRUE or FALSE 2678 /// @param <RET> \b NONE : 2679 //////////////////////////////////////////////////////////////////////////////// 2680 MS_BOOL MApi_AUDIO_DmaReader_WritePCM(void* buffer, MS_U32 bytes); 2681 2682 //////////////////////////////////////////////////////////////////////////////// 2683 /// @ingroup Audio_ToBeRemove 2684 /// @brief \b Function \b Name: MApi_AUDIO_DmaWriter_Init() 2685 /// @brief \b Function \b Description: 2686 /// @param <IN> \b NONE : 2687 /// @param <OUT> \b NONE : 2688 /// @param <RET> \b NONE : 2689 //////////////////////////////////////////////////////////////////////////////// 2690 void MApi_AUDIO_DmaWriter_Init(void); 2691 2692 //////////////////////////////////////////////////////////////////////////////// 2693 /// @ingroup Audio_ToBeRemove 2694 /// @brief \b Function \b Name: MApi_AUDIO_USBPCM_Enable() @@Need_Modify 2695 /// @brief \b Function \b Description: Enable/ Disable the path of USB PCM 2696 /// @param <IN> \b bEnable : on: TRUE, off: FALSE 2697 /// @param <OUT> \b NONE : 2698 /// @param <RET> \b NONE : 2699 /// @param <GLOBAL> \b NONE : 2700 //////////////////////////////////////////////////////////////////////////////// 2701 void MApi_AUDIO_USBPCM_Enable(MS_BOOL bEnable); 2702 2703 //////////////////////////////////////////////////////////////////////////////// 2704 /// @ingroup Audio_ToBeRemove 2705 /// @brief \b Function \b Name: MApi_AUDIO_USBPCM_SetFlag() @@Need_Modify 2706 /// @brief \b Function \b Description: clear interrupt flag for USBPCM function 2707 /// \b (Encoder path) 2708 /// @param <IN> \b bEnable : set false to clean interrupt flag 2709 /// @param <OUT> \b NONE : 2710 /// @param <RET> \b NONE : 2711 /// @param <GLOBAL> \b NONE : 2712 //////////////////////////////////////////////////////////////////////////////// 2713 void MApi_AUDIO_USBPCM_SetFlag(MS_BOOL bEnable); 2714 2715 //////////////////////////////////////////////////////////////////////////////// 2716 /// @ingroup Audio_ToBeRemove 2717 /// @brief \b Function \b Name: MApi_AUDIO_USBPCM_GetFlag() @@Need_Modify 2718 /// @brief \b Function \b Description: Get interrupt flag for USBPCM function 2719 /// \b (Encoder path) 2720 /// @param <IN> \b NONE : 2721 /// @param <OUT> \b NONE : 2722 /// @param <RET> \b BOOL : interrupt flag 2723 /// @param <GLOBAL> \b NONE : 2724 //////////////////////////////////////////////////////////////////////////////// 2725 MS_BOOL MApi_AUDIO_USBPCM_GetFlag(void); 2726 2727 //////////////////////////////////////////////////////////////////////////////// 2728 /// @ingroup Audio_ToBeRemove 2729 /// @brief \b Function \b Name: MApi_AUDIO_USBPCM_GetMemInfo() @@Need_Modify 2730 /// @brief \b Function \b Description: Get memory address and size for USBPCM function 2731 /// \b (Encoder path) 2732 /// @param <IN> \b NONE : 2733 /// @param <OUT> \b MS_U32 : address, size 2734 /// @param <RET> \b NONE : 2735 /// @param <GLOBAL> \b NONE : 2736 //////////////////////////////////////////////////////////////////////////////// 2737 void MApi_AUDIO_USBPCM_GetMemInfo(AUDIO_UPLOAD_INFO *uploadInfo); 2738 2739 //////////////////////////////////////////////////////////////////////////////// 2740 /// @ingroup Audio_ToBeRemove 2741 /// @brief \b Function \b Name: MApi_AUDIO_PCMCapture_Init() 2742 /// @brief \b Function \b Description: Select source for pcm capture 2743 /// @param <IN> \b AUDIO_DEVICE_TYPE : select 1st or 2nd data capture 2744 /// @param <IN> \b AUDIO_CAPTURE_SOURCE_TYPE : Data Source 2745 /// @param <OUT> \b MS_BOOL : return TRUE if success, else return FALSE 2746 /// @param <RET> \b NONE : 2747 /// @param <GLOBAL> \b NONE : 2748 //////////////////////////////////////////////////////////////////////////////// 2749 MS_BOOL MApi_AUDIO_PCMCapture_Init(const AUDIO_DEVICE_TYPE eID, const AUDIO_CAPTURE_SOURCE_TYPE eSource); 2750 2751 //////////////////////////////////////////////////////////////////////////////// 2752 /// @ingroup Audio_ToBeRemove 2753 /// @brief \b Function \b Name: MApi_AUDIO_PCMCapture_Start() 2754 /// @brief \b Function \b Description: captrue pcm data to DDR 2755 /// @param <IN> \b AUDIO_DEVICE_TYPE : select 1st or 2nd data capture 2756 /// @param <OUT> \b MS_BOOL : return TRUE if success, else return FALSE 2757 /// @param <RET> \b NONE : 2758 /// @param <GLOBAL> \b NONE : 2759 //////////////////////////////////////////////////////////////////////////////// 2760 MS_BOOL MApi_AUDIO_PCMCapture_Start(const AUDIO_DEVICE_TYPE eID); 2761 2762 //////////////////////////////////////////////////////////////////////////////// 2763 /// @ingroup Audio_ToBeRemove 2764 /// @brief \b Function \b Name: MApi_AUDIO_PCMCapture_Stop() 2765 /// @brief \b Function \b Description: stop captrue pcm data from DDR 2766 /// @param <IN> \b AUDIO_DEVICE_TYPE : select 1st or 2nd data capture 2767 /// @param <OUT> \b MS_BOOL : return TRUE if success, else return FALSE 2768 /// @param <RET> \b NONE : 2769 /// @param <GLOBAL> \b NONE : 2770 //////////////////////////////////////////////////////////////////////////////// 2771 MS_BOOL MApi_AUDIO_PCMCapture_Stop(const AUDIO_DEVICE_TYPE eID); 2772 2773 //////////////////////////////////////////////////////////////////////////////// 2774 /// @ingroup Audio_ToBeRemove 2775 /// @brief \b Function \b Name: MApi_AUDIO_PCMCapture_Read() 2776 /// @brief \b Function \b Description: captrue pcm data from DDR to device 2777 /// @param <IN> \b AUDIO_DEVICE_TYPE : select 1st or 2nd data capture 2778 /// @param <IN> \b void* : destination buffer pointer 2779 /// @param <IN> \b MS_U32 : buffer size need transfered in byte 2780 /// @param <OUT> \b MS_BOOL : return TRUE if success, else return FALSE 2781 /// @param <RET> \b NONE : 2782 /// @param <GLOBAL> \b NONE : 2783 //////////////////////////////////////////////////////////////////////////////// 2784 MS_BOOL MApi_AUDIO_PCMCapture_Read(const AUDIO_DEVICE_TYPE eID, void* buffer, const MS_U32 bytes); 2785 2786 //////////////////////////////////////////////////////////////////////////////// 2787 /// @ingroup Audio_ToBeRemove 2788 /// @brief \b Function \b Name: MApi_AUDIO_VoIP_Config() 2789 /// @brief \b Function \b Description: This routine is used for VoIP applications 2790 /// @param <IN> \b AUDIO_VoIP_CONFIG_TYPE : configType 2791 /// @param <IN> \b MS_U32 : param1 2792 /// @param <IN> \b MS_U32 : param2 2793 /// @param <OUT> \b MS_BOOL : return TRUE if success, else return FALSE 2794 /// @param <RET> \b NONE : 2795 /// @param <GLOBAL> \b NONE : 2796 //////////////////////////////////////////////////////////////////////////////// 2797 MS_BOOL MApi_AUDIO_VoIP_Config(AUDIO_VoIP_CONFIG_TYPE configType, MS_U32 param1, MS_U32 param2); 2798 2799 //////////////////////////////////////////////////////////////////////////////// 2800 /// @ingroup Audio_ToBeRemove 2801 /// @brief \b Function \b Name: MApi_AUDIO_ALSA_Check() 2802 /// @brief \b Function \b Description: Check if ALSA Interface is supported 2803 /// @param <IN> \b bEnable : on: TRUE, off: FALSE 2804 /// @param <OUT> \b MS_BOOL : return TRUE if it's supported, else return FALSE 2805 /// @param <RET> \b NONE : 2806 /// @param <GLOBAL> \b NONE : 2807 //////////////////////////////////////////////////////////////////////////////// 2808 MS_BOOL MApi_AUDIO_ALSA_Check(void); 2809 2810 //////////////////////////////////////////////////////////////////////////////// 2811 /// @ingroup Audio_ToBeRemove 2812 /// @brief \b Function \b Name: MApi_AUDIO_ALSA_Enable() 2813 /// @brief \b Function \b Description: Enable/ Disable the path of ALSA 2814 /// @param <IN> \b bEnable : on: TRUE, off: FALSE 2815 /// @param <OUT> \b MS_BOOL : return TRUE if ok, else return FALSE 2816 /// @param <RET> \b NONE : 2817 /// @param <GLOBAL> \b NONE : 2818 //////////////////////////////////////////////////////////////////////////////// 2819 MS_BOOL MApi_AUDIO_ALSA_Enable(MS_BOOL bEnable); 2820 2821 //////////////////////////////////////////////////////////////////////////////// 2822 /// @ingroup Audio_ToBeRemove 2823 /// @brief \b Function \b Name: MApi_AUDIO_UNI_CheckDecodeDone() 2824 /// @brief \b Function \b Description : Decoder report pcm out addr & size in Uniplayer mode 2825 /// @param <IN> \b pU32WrtAddr : Request input address in ES1 buffer 2826 /// @param <IN> \b pU32WrtBytes : Request input size 2827 /// @param <OUT> \b MS_U8 : return TRUE if ok, else return FALSE 2828 /// @param <GLOBAL> \b NONE : 2829 //////////////////////////////////////////////////////////////////////////////// 2830 #if defined(UFO_PUBLIC_HEADER_300) || defined(UFO_PUBLIC_HEADER_212) 2831 MS_BOOL MApi_AUDIO_UNI_CheckDecodeDone(MS_U32 *pU32WrtAddr, MS_U32 *pU32WrtBytes); 2832 #else 2833 MS_BOOL MApi_AUDIO_UNI_CheckDecodeDone(MS_PHY *pPHYWrtAddr, MS_U32 *pU32WrtBytes); 2834 #endif 2835 2836 //////////////////////////////////////////////////////////////////////////////// 2837 /// @ingroup Audio_ToBeRemove 2838 /// @brief \b Function \b Name: MApi_AUDIO_UNI_SetOutput() 2839 /// @brief \b Function \b Description: MCU send interrupt to decoder1 in Uniplayer mode 2840 /// @param <IN> \b PCMOutCnt : Get output PCM count by MCU 2841 /// @param <OUT> \b NONE : 2842 /// @param <GLOBAL> \b NONE : 2843 //////////////////////////////////////////////////////////////////////////////// 2844 void MApi_AUDIO_UNI_SetOutput (MS_U32 PCMOutCnt); 2845 2846 //////////////////////////////////////////////////////////////////////////////// 2847 /// @ingroup Audio_ToBeRemove 2848 /// @brief \b Function \b Name: MApi_AUDIO_UNI_Set_PCMInputWriteAddr() 2849 /// @brief \b Function \b Description: MCU send DEC1-PCM3 wptr to decoder1 in Uniplayer mode 2850 /// @param <IN> \b PCMIn_Wptr : PCM3 write pointer to DSP 2851 /// @param <OUT> \b NONE : 2852 /// @param <GLOBAL> \b NONE : 2853 //////////////////////////////////////////////////////////////////////////////// 2854 void MApi_AUDIO_UNI_Set_PCMInputWriteAddr (MS_U32 PCMIn_Wptr); 2855 2856 //////////////////////////////////////////////////////////////////////////////// 2857 /// @ingroup Audio_ToBeRemove 2858 /// @brief \b Function \b Name: MApi_AUDIO_UNI_Get_OutPCMLevel() 2859 /// @brief \b Function \b Description: Decoder1 report DEC1-PCM3 buffer level in Uniplayer mode 2860 /// @param <OUT> \b MS_U32 : DEC1-PCM3 buffer level (byte unit) 2861 /// @param <GLOBAL> \b NONE : 2862 //////////////////////////////////////////////////////////////////////////////// 2863 MS_U32 MApi_AUDIO_UNI_Get_OutPCMLevel (void); 2864 2865 //////////////////////////////////////////////////////////////////////////////// 2866 /// @ingroup Audio_ToBeRemove 2867 /// @brief \b Function \b Name: MApi_AUDIO_RingTask() 2868 /// @brief \b Function \b Description : 2869 /// @param <IN> \b auRingTask : 2870 /// @param <GLOBAL> \b NONE : 2871 //////////////////////////////////////////////////////////////////////////////// 2872 void MApi_AUDIO_RingTask(audioRingTask* auRingTask) ; 2873 2874 //////////////////////////////////////////////////////////////////////////////// 2875 /// @ingroup Audio_ToBeRemove 2876 /// @brief \b Function \b Name: MApi_AUDIO_Ring_DataTransfer() 2877 /// @brief \b Function \b Description : 2878 /// @param <IN> \b auRingTask : 2879 /// @param <GLOBAL> \b NONE : 2880 //////////////////////////////////////////////////////////////////////////////// 2881 void MApi_AUDIO_Ring_DataTransfer(audioRingTask* auRingTask, audioRingTask* auRingTask_1); 2882 2883 //////////////////////////////////////////////////////////////////////////////// 2884 /// @ingroup Audio_ToBeRemove 2885 /// @brief \b Function \b Name: MApi_AUDIO_MM2_initAesInfo() 2886 /// @brief \b Function \b Description : Initialize AES info 2887 /// @param <IN> \b dec_id : Decoder ID 2888 /// @param <OUT> \b MS_BOOL : return TRUE if ok, else return FALSE 2889 /// @param <GLOBAL> \b NONE : 2890 //////////////////////////////////////////////////////////////////////////////// 2891 MS_BOOL MApi_AUDIO_MM2_initAesInfo( AUDIO_DEC_ID dec_id ); 2892 2893 //////////////////////////////////////////////////////////////////////////////// 2894 /// @ingroup Audio_ToBeRemove 2895 /// @brief \b Function \b Name: MApi_AUDIO_MM2_checkAesInfo() 2896 /// @brief \b Function \b Description : Get AES info from audio decoder 2897 /// @param <IN> \b dec_id : Decoder ID 2898 /// @param <IN> \b aes_info : AES info structure pointer 2899 /// @param <OUT> \b MS_BOOL : return TRUE if ok, else return FALSE 2900 /// @param <GLOBAL> \b NONE : 2901 //////////////////////////////////////////////////////////////////////////////// 2902 MS_BOOL MApi_AUDIO_MM2_checkAesInfo( AUDIO_DEC_ID dec_id, AES_INFO *aes_info ); 2903 2904 //////////////////////////////////////////////////////////////////////////////// 2905 /// @ingroup Audio_ToBeRemove 2906 /// @brief \b Function \b Name: MApi_AUDIO_MM2_inputAesFinished() 2907 /// @brief \b Function \b Description : Inform DSP how much ES data is sent 2908 /// @param <IN> \b dec_id : Decoder ID 2909 /// @param <IN> \b es_size : Size of ES data 2910 /// @param <IN> \b ptsExist : Whether ES data contains PTS or not 2911 /// @param <IN> \b pts : PTS 2912 /// @param <OUT> \b MS_BOOL : return TRUE if ok, else return FALSE 2913 /// @param <GLOBAL> \b NONE : 2914 //////////////////////////////////////////////////////////////////////////////// 2915 MS_BOOL MApi_AUDIO_MM2_inputAesFinished( AUDIO_DEC_ID dec_id, MS_U32 es_size, MS_BOOL ptsExist, MS_U64 pts ); 2916 2917 2918 //====== STAOS PIP START 2012/02/01 ======== 2919 2920 //////////////////////////////////////////////////////////////////////////////// 2921 /// @ingroup Audio_Decoder 2922 /// @brief \b Function \b Name: MApi_AUDIO_SetAudioParam2() 2923 //////////////////////////////////////////////////////////////////////////////// 2924 MS_BOOL MApi_AUDIO_SetAudioParam2( AUDIO_DEC_ID DecId, Audio_ParamType paramType, MS_VIRT Param ); 2925 //////////////////////////////////////////////////////////////////////////////// 2926 /// @ingroup Audio_Decoder 2927 /// @brief \b Function \b Name: MApi_AUDIO_GetAudioInfo2() 2928 //////////////////////////////////////////////////////////////////////////////// 2929 MS_BOOL MApi_AUDIO_GetAudioInfo2( AUDIO_DEC_ID DecId, Audio_InfoType infoType, void * pInfo ); 2930 2931 //====== STAOS PIP END 2012/02/01 ======== 2932 //////////////////////////////////////////////////////////////////////////////// 2933 /// @ingroup Audio_ToBeRemove 2934 /// @brief \b Function \b Name: MApi_AUDIO_GetDDRInfo() 2935 /// @brief \b Function \b Description: Return Audio DDR info 2936 /// @param <IN> \b AUDIO_DEC_ID : select audio processor 2937 /// @param <IN> \b EN_AUDIO_DDRINFO : DDR info 2938 /// @param <OUT> \b MS_U32 : return DDR info 2939 /// @param <RET> \b NONE : 2940 /// @param <GLOBAL> \b NONE : 2941 //////////////////////////////////////////////////////////////////////////////// 2942 MS_PHY MApi_AUDIO_GetDDRInfo(AUDIO_DEC_ID DecId, EN_AUDIO_DDRINFO DDRInfo); 2943 2944 MS_U32 MApi_AUDIO_GetCaps(AUDIO_DEC_ID DecId, MS_U32 *pCaps); 2945 2946 //////////////////////////////////////////////////////////////////////////////// 2947 /// @brief \b Function \b Name: MApi_AUDIO_PCM_Open() 2948 /// @brief \b Function \b Description : Open a PCM interface according to specific capabilities. 2949 /// @param <IN> \b void : Pointer to a block of memory with PCM information. 2950 /// @param <OUT> \b NONE : 2951 /// @param <RET> \b MS_S32 : On success a nonnegative value is returned, and this value is the chosen device-id. On error, a negative value is returned. 2952 /// @param <GLOBAL> \b NONE : 2953 //////////////////////////////////////////////////////////////////////////////// 2954 MS_S32 MApi_AUDIO_PCM_Open(void *pData); 2955 2956 //////////////////////////////////////////////////////////////////////////////// 2957 /// @brief \b Function \b Name: MApi_AUDIO_PCM_Close() 2958 /// @brief \b Function \b Description : Close an opened PCM interface. 2959 /// @param <IN> \b MS_S32 : The chosen device-id. 2960 /// @param <OUT> \b NONE : 2961 /// @param <RET> \b MS_S32 : On success zero is returned. On error, a negative value is returned. 2962 /// @param <GLOBAL> \b NONE : 2963 //////////////////////////////////////////////////////////////////////////////// 2964 MS_S32 MApi_AUDIO_PCM_Close(MS_S32 s32DeviceId); 2965 2966 //////////////////////////////////////////////////////////////////////////////// 2967 /// @brief \b Function \b Name: MApi_AUDIO_PCM_Start() 2968 /// @brief \b Function \b Description : Start an opened PCM interface. 2969 /// @param <IN> \b MS_S32 : The chosen device-id. 2970 /// @param <OUT> \b NONE : 2971 /// @param <RET> \b MS_S32 : On success zero is returned. On error, a negative value is returned. 2972 /// @param <GLOBAL> \b NONE : 2973 //////////////////////////////////////////////////////////////////////////////// 2974 MS_S32 MApi_AUDIO_PCM_Start(MS_S32 s32DeviceId); 2975 2976 //////////////////////////////////////////////////////////////////////////////// 2977 /// @brief \b Function \b Name: MApi_AUDIO_PCM_Stop() 2978 /// @brief \b Function \b Description : Stop a started PCM interface. 2979 /// @param <IN> \b MS_S32 : The chosen device-id. 2980 /// @param <OUT> \b NONE : 2981 /// @param <RET> \b MS_S32 : On success zero is returned. On error, a negative value is returned. 2982 /// @param <GLOBAL> \b NONE : 2983 //////////////////////////////////////////////////////////////////////////////// 2984 MS_S32 MApi_AUDIO_PCM_Stop(MS_S32 s32DeviceId); 2985 2986 //////////////////////////////////////////////////////////////////////////////// 2987 /// @brief \b Function \b Name: MApi_AUDIO_PCM_Set() 2988 /// @brief \b Function \b Description : Set configuration to an opened PCM interface. 2989 /// @param <IN> \b MS_S32 : The chosen device-id. 2990 /// @param <IN> \b MS_U32 : The command type. 2991 /// @param <IN> \b void : Pointer to a block of memory with specific configuration, and this memory is not allowed to be updated by this API. 2992 /// @param <OUT> \b NONE : 2993 /// @param <RET> \b MS_S32 : On success zero is returned. On error, a negative value is returned. 2994 /// @param <GLOBAL> \b NONE : 2995 //////////////////////////////////////////////////////////////////////////////// 2996 MS_S32 MApi_AUDIO_PCM_Set(MS_S32 s32DeviceId, MS_U32 u32Cmd, const void *pData); 2997 2998 //////////////////////////////////////////////////////////////////////////////// 2999 /// @brief \b Function \b Name: MApi_AUDIO_PCM_Get() 3000 /// @brief \b Function \b Description : Get configuration from an opened PCM interface. 3001 /// @param <IN> \b MS_S32 : The chosen device-id. 3002 /// @param <IN> \b MS_U32 : The command type. 3003 /// @param <IN> \b void : Pointer to a block of memory for receiving specific configuration. 3004 /// @param <OUT> \b NONE : 3005 /// @param <RET> \b MS_S32 : On success zero is returned. On error, a negative value is returned. 3006 /// @param <GLOBAL> \b NONE : 3007 //////////////////////////////////////////////////////////////////////////////// 3008 MS_S32 MApi_AUDIO_PCM_Get(MS_S32 s32DeviceId, MS_U32 u32Cmd, void *pData); 3009 3010 //////////////////////////////////////////////////////////////////////////////// 3011 /// @brief \b Function \b Name: MApi_AUDIO_PCM_Read() 3012 /// @brief \b Function \b Description : Read a specific amount of PCM data from a started PCM interface. 3013 /// @param <IN> \b MS_S32 : The chosen device-id. 3014 /// @param <IN> \b void : Pointer to a block of memory with PCM data. 3015 /// @param <IN> \b MS_U32 : The size of PCM data. 3016 /// @param <OUT> \b NONE : 3017 /// @param <RET> \b MS_U32 : The total number of PCM data successfully written is returned. 3018 /// @param <GLOBAL> \b NONE : 3019 //////////////////////////////////////////////////////////////////////////////// 3020 MS_U32 MApi_AUDIO_PCM_Read(MS_S32 s32DeviceId, void *pBuf, MS_U32 u32Size); 3021 3022 //////////////////////////////////////////////////////////////////////////////// 3023 /// @brief \b Function \b Name: MApi_AUDIO_PCM_Write() 3024 /// @brief \b Function \b Description : Write a specific amount of PCM data to a started PCM interface. 3025 /// @param <IN> \b MS_S32 : The chosen device-id. 3026 /// @param <IN> \b void : Pointer to a block of memory with PCM data, and this memory is not allowed to be updated by this API. 3027 /// @param <IN> \b MS_U32 : The size of PCM data. 3028 /// @param <OUT> \b NONE : 3029 /// @param <RET> \b MS_U32 : The total number of PCM data successfully written is returned. 3030 /// @param <GLOBAL> \b NONE : 3031 //////////////////////////////////////////////////////////////////////////////// 3032 MS_U32 MApi_AUDIO_PCM_Write(MS_S32 s32DeviceId, const void *pBuf, MS_U32 u32Size); 3033 3034 //////////////////////////////////////////////////////////////////////////////// 3035 /// @brief \b Function \b Name: MApi_AUDIO_PCM_Flush() 3036 /// @brief \b Function \b Description : Flush an opened PCM interface. 3037 /// @param <IN> \b MS_S32 : The chosen device-id. 3038 /// @param <OUT> \b NONE : 3039 /// @param <RET> \b MS_S32 : On success zero is returned. On error, a negative value is returned. 3040 /// @param <GLOBAL> \b NONE : 3041 //////////////////////////////////////////////////////////////////////////////// 3042 MS_S32 MApi_AUDIO_PCM_Flush(MS_S32 s32DeviceId); 3043 3044 #if defined(UFO_PUBLIC_HEADER_700) 3045 //////////////////////////////////////////////////////////////////////////////// 3046 /// @brief \b Function \b Name: MApi_AUDIO_ENCODER_Open() 3047 /// @brief \b Function \b Description : Open an encoder interface according to specific device name. 3048 /// @param <IN> \b char : Pointer to a string with name. 3049 /// @param <OUT> \b NONE : 3050 /// @param <RET> \b MS_S32 : On success a nonnegative value is returned, and this value is the chosen device-id. On error, a negative value is returned. 3051 /// @param <GLOBAL> \b NONE : 3052 /// 3053 /// Device Name : 3054 /// "MP3_ENCODER1" : 1st MP3 Encoder 3055 /// "MP3_ENCODER2" : 2nd MP3 Encoder 3056 //////////////////////////////////////////////////////////////////////////////// 3057 MS_S32 MApi_AUDIO_ENCODER_Open(const char *pName); 3058 3059 //////////////////////////////////////////////////////////////////////////////// 3060 /// @brief \b Function \b Name: MApi_AUDIO_ENCODER_Close() 3061 /// @brief \b Function \b Description : Close an opened encoder interface. 3062 /// @param <IN> \b MS_S32 : The chosen device-id. 3063 /// @param <OUT> \b NONE : 3064 /// @param <RET> \b MS_S32 : On success zero is returned. On error, a negative value is returned. 3065 /// @param <GLOBAL> \b NONE : 3066 //////////////////////////////////////////////////////////////////////////////// 3067 MS_S32 MApi_AUDIO_ENCODER_Close(MS_S32 s32DeviceId); 3068 3069 //////////////////////////////////////////////////////////////////////////////// 3070 /// @brief \b Function \b Name: MApi_AUDIO_ENCODER_Start() 3071 /// @brief \b Function \b Description : Start an opened encoder interface. 3072 /// @param <IN> \b MS_S32 : The chosen device-id. 3073 /// @param <OUT> \b NONE : 3074 /// @param <RET> \b MS_S32 : On success zero is returned. On error, a negative value is returned. 3075 /// @param <GLOBAL> \b NONE : 3076 //////////////////////////////////////////////////////////////////////////////// 3077 MS_S32 MApi_AUDIO_ENCODER_Start(MS_S32 s32DeviceId); 3078 3079 //////////////////////////////////////////////////////////////////////////////// 3080 /// @brief \b Function \b Name: MApi_AUDIO_ENCODER_Stop() 3081 /// @brief \b Function \b Description : Stop a started encoder interface. 3082 /// @param <IN> \b MS_S32 : The chosen device-id. 3083 /// @param <OUT> \b NONE : 3084 /// @param <RET> \b MS_S32 : On success zero is returned. On error, a negative value is returned. 3085 /// @param <GLOBAL> \b NONE : 3086 //////////////////////////////////////////////////////////////////////////////// 3087 MS_S32 MApi_AUDIO_ENCODER_Stop(MS_S32 s32DeviceId); 3088 3089 //////////////////////////////////////////////////////////////////////////////// 3090 /// @brief \b Function \b Name: MApi_AUDIO_ENCODER_Ioctl() 3091 /// @brief \b Function \b Description : Set/Get configuration to an opened encoder interface. 3092 /// @param <IN> \b MS_S32 : The chosen device-id. 3093 /// @param <IN> \b char : Pointer to a string with command name. 3094 /// @param <IN> \b void : Pointer to a block of memory with specific configuration to deliver, or to receive specific configuration. 3095 /// @param <OUT> \b NONE : 3096 /// @param <RET> \b MS_S32 : On success zero is returned. On error, a negative value is returned. 3097 /// @param <GLOBAL> \b NONE : 3098 /// 3099 /// Command String Name : 3100 /// "GetFrameSize" : Get the size of current encoded frame. 3101 /// "GetAvailableSize" : Get the size of total available encoded frames. 3102 /// "GetTimestampHigh32Bit" : Get high 32 bits of timestamp from current encoded frame. 3103 /// "GetTimestampLow32Bit" : Get low 32 bits of timestamp from current encoded frame. 3104 //////////////////////////////////////////////////////////////////////////////// 3105 MS_S32 MApi_AUDIO_ENCODER_Ioctl(MS_S32 s32DeviceId, const char *pCmd, void *pData); 3106 3107 //////////////////////////////////////////////////////////////////////////////// 3108 /// @brief \b Function \b Name: MApi_AUDIO_ENCODER_Read() 3109 /// @brief \b Function \b Description : Read a specific amount of encoded data from a started encoder interface. 3110 /// @param <IN> \b MS_S32 : The chosen device-id. 3111 /// @param <IN> \b void : Pointer to a block of memory with encoded data. 3112 /// @param <IN> \b MS_U32 : The size of encoded data. 3113 /// @param <OUT> \b NONE : 3114 /// @param <RET> \b MS_U32 : The total number of encoded data successfully written is returned. 3115 /// @param <GLOBAL> \b NONE : 3116 //////////////////////////////////////////////////////////////////////////////// 3117 MS_U32 MApi_AUDIO_ENCODER_Read(MS_S32 s32DeviceId, void *pBuf, MS_U32 u32Size); 3118 3119 //////////////////////////////////////////////////////////////////////////////// 3120 /// @brief \b Function \b Name: MApi_AUDIO_ENCODER_Flush() 3121 /// @brief \b Function \b Description : Flush an opened encoder interface. 3122 /// @param <IN> \b MS_S32 : The chosen device-id. 3123 /// @param <OUT> \b NONE : 3124 /// @param <RET> \b MS_S32 : On success zero is returned. On error, a negative value is returned. 3125 /// @param <GLOBAL> \b NONE : 3126 //////////////////////////////////////////////////////////////////////////////// 3127 MS_S32 MApi_AUDIO_ENCODER_Flush(MS_S32 s32DeviceId); 3128 #endif 3129 3130 #ifdef __cplusplus 3131 } 3132 #endif 3133 3134 #endif // _API_AUDIO_H_ 3135