// //****************************************************************************** // MStar Software // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved. // All software, firmware and related documentation herein ("MStar Software") are // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by // law, including, but not limited to, copyright law and international treaties. // Any use, modification, reproduction, retransmission, or republication of all // or part of MStar Software is expressly prohibited, unless prior written // permission has been granted by MStar. // // By accessing, browsing and/or using MStar Software, you acknowledge that you // have read, understood, and agree, to be bound by below terms ("Terms") and to // comply with all applicable laws and regulations: // // 1. MStar shall retain any and all right, ownership and interest to MStar // Software and any modification/derivatives thereof. // No right, ownership, or interest to MStar Software and any // modification/derivatives thereof is transferred to you under Terms. // // 2. You understand that MStar Software might include, incorporate or be // supplied together with third party`s software and the use of MStar // Software may require additional licenses from third parties. // Therefore, you hereby agree it is your sole responsibility to separately // obtain any and all third party right and license necessary for your use of // such third party`s software. // // 3. MStar Software and any modification/derivatives thereof shall be deemed as // MStar`s confidential information and you agree to keep MStar`s // confidential information in strictest confidence and not disclose to any // third party. // // 4. MStar Software is provided on an "AS IS" basis without warranties of any // kind. Any warranties are hereby expressly disclaimed by MStar, including // without limitation, any warranties of merchantability, non-infringement of // intellectual property rights, fitness for a particular purpose, error free // and in conformity with any international standard. You agree to waive any // claim against MStar for any loss, damage, cost or expense that you may // incur related to your use of MStar Software. // In no event shall MStar be liable for any direct, indirect, incidental or // consequential damages, including without limitation, lost of profit or // revenues, lost or damage of data, and unauthorized system use. // You agree that this Section 4 shall still apply without being affected // even if MStar Software has been modified by MStar in accordance with your // request or instruction for your use, except otherwise agreed by both // parties in writing. // // 5. If requested, MStar may from time to time provide technical supports or // services in relation with MStar Software to you for your use of // MStar Software in conjunction with your or your customer`s product // ("Services"). // You understand and agree that, except otherwise agreed by both parties in // writing, Services are provided on an "AS IS" basis and the warranty // disclaimer set forth in Section 4 above shall apply. // // 6. Nothing contained herein shall be construed as by implication, estoppels // or otherwise: // (a) conferring any license or right to use MStar name, trademark, service // mark, symbol or any other identification; // (b) obligating MStar or any of its affiliates to furnish any person, // including without limitation, you and your customers, any assistance // of any kind whatsoever, or any information; or // (c) conferring any license or right under any intellectual property right. // // 7. These terms shall be governed by and construed in accordance with the laws // of Taiwan, R.O.C., excluding its conflict of law rules. // Any and all dispute arising out hereof or related hereto shall be finally // settled by arbitration referred to the Chinese Arbitration Association, // Taipei in accordance with the ROC Arbitration Law and the Arbitration // Rules of the Association by three (3) arbitrators appointed in accordance // with the said Rules. // The place of arbitration shall be in Taipei, Taiwan and the language shall // be English. // The arbitration award shall be final and binding to both parties. // //****************************************************************************** // //////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2008-2009 MStar Semiconductor, Inc. // All rights reserved. // // Unless otherwise stipulated in writing, any and all information contained // herein regardless in any format shall remain the sole proprietary of // MStar Semiconductor Inc. and be kept in strict confidence // ("MStar Confidential Information") by the recipient. // Any unauthorized act including without limitation unauthorized disclosure, // copying, use, reproduction, sale, distribution, modification, disassembling, // reverse engineering and compiling of the contents of MStar Confidential // Information is unlawful and strictly prohibited. MStar hereby reserves the // rights to any and all damages, losses, costs and expenses resulting therefrom. // //////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// /// /// @file apiAUDIO.h /// @brief AUDIO API /// @author MStar Semiconductor Inc. /////////////////////////////////////////////////////////////////////////////////////////////////// /*! \defgroup Audio Audio interface \brief Audio Module is used for: - 1. Audio Input source handling - support input source as VGA, ATV, CVBS, YPbPr, SCART, HDMI, DTV, MM ... - 2. Audio Output source handling - support stereo audio analog output ,SPDIF digital output, I2S, HDMI 1.4 ARC output - 3. Basic Sound Effect support - support Volume Control , Bass, Treble, GEQ, PEQ, Surround, AVC ... - 4. Digital audio format decoding - support MPEG-1, MPEG-2(Layer I/II), MP3, AC-3,E-AC-3, WMA, HE-AAC, DTS, FLAC, XPCM - 5. Advanced Sound Effect support - support SRS-TSHD , SRS-TSXT, DBX.... - All audio related features , architecture and bolck diagram are collected in MStar Audio Application Note(Chip dependent). *! \defgroup Audio_System System * \ingroup Audio *! \defgroup Audio_Decoder Decoder * \ingroup Audio *! \defgroup Audio_ATV_SPDIF_HDMI ATV SPDIF HDMI * \ingroup Audio *! \defgroup Audio_BASIC_SOUNDEFFECT Basic Sound Effect * \ingroup Audio *! \defgroup Audio_ADVANCED_SOUNDEFFECT Advanced Sound Effect * \ingroup Audio *! \defgroup Audio_ToBeMerged To Be Merged * \ingroup Audio *! \defgroup Audio_ToBeModified To Be Modified * \ingroup Audio *! \defgroup Audio_ToBeMoved To Be Moved * \ingroup Audio *! \defgroup Audio_ToBeRemove To Be Removed * \ingroup Audio */ #ifndef _API_AUDIO_H_ #define _API_AUDIO_H_ #include "MsCommon.h" #include "drvAUDIO_if.h" #ifdef __cplusplus extern "C" { #endif //------------------------------------------------------------------------------------------------- // Macro and Define //------------------------------------------------------------------------------------------------- //----------------------------------------------------------- #define MSAPI_AUD_SPDIF_PCM 0 #define MSAPI_AUD_SPDIF_OFF 1 #define MSAPI_AUD_SPDIF_NONPCM 2 #define MSAPI_AUD_DTV_IN 0 #define MSAPI_AUD_ATV_IN 1 #define MSAPI_AUD_HDMI_IN 2 #define MSAPI_AUD_ADC_IN 3 #define MSAPI_AUD_CardRD_IN 4 #define MSAPI_AUD_MM_IN 5 #define MSAPI_AUD_AVsync 0 #define MSAPI_AUD_FreeRun 1 /// A2/FM/_SOUND_MOD Report info #define _STATUS_MOD_MONO_EXIST 0x01 #define _STATUS_MOD_STEREO_EXIST 0x02 #define _STATUS_MOD_DUAL_EXIST 0x04 #define _STATUS_MOD_A2_PILOT_EXIST 0x08 #define _STATUS_MOD_A2_PRIMARY_EXIST 0x10 #define _STATUS_MOD_A2_SECONDARY_EXIST 0x20 #define _STATUS_MOD_A2_DK2_EXIST 0x40 #define _STATUS_MOD_A2_DK3_EXIST 0x80 /// NICAM_SOUND_MOD Report info #define _MASK_NICAM_STATUS_INFO 0x0F #define _NICAM_SOUND_MODE_LOCK_STATE 0x05 #define _MASK_NICAM_SOUND_MODE_INFO 0xF0 #define _NICAM_SOUND_MOD_MONO_NOT_EXIST 0x00 #define _NICAM_SOUND_MOD_NICAM_MONO 0x10 #define _NICAM_SOUND_MOD_NICAM_STEREO 0x20 #define _NICAM_SOUND_MOD_NICAM_DUAL 0x30 #define _NICAM_SOUND_MOD_MONO_EXIST 0x80 #define _NICAM_SOUND_MOD_MONO_n_NICAM_MONO 0x90 #define _NICAM_SOUND_MOD_MONO_n_NICAM_STEREO 0xA0 #define _NICAM_SOUND_MOD_MONO_n_NICAM_DUAL 0xB0 /******************************** * SIF Standard ********************************/ #define _STD_SEL_INVALID 0x00 #define _STD_SEL_M_BTSC 0x01 #define _STD_SEL_M_EIAJ 0x02 #define _STD_SEL_M_A2 0x03 #define _STD_SEL_BG_A2 0x04 #define _STD_SEL_DK1_A2 0x05 #define _STD_SEL_DK2_A2 0x06 #define _STD_SEL_DK3_A2 0x07 #define _STD_SEL_BG_NICAM 0x08 #define _STD_SEL_DK_NICAM 0x09 #define _STD_SEL_I_NICAM 0x0A #define _STD_SEL_L_NICAM 0x0B #define _STD_SEL_AUTO 0xE0 //------------------------------------------------------------------------------------------------- // Type and Structure //------------------------------------------------------------------------------------------------- ///< Decoder command type typedef enum { MSAPI_AUD_DVB_DECCMD_STOP = 0x0, ///< 1st DSP stop MSAPI_AUD_DVB_DECCMD_PLAY, ///< 1st DSP play MSAPI_AUD_DVB_DECCMD_RESYNC, MSAPI_AUD_DVB_DECCMD_FREE_RUN, MSAPI_AUD_DVB_DECCMD_AVSYNC, MSAPI_AUD_DVB_DECCMD_PLAYFILE, ///< 1st DSP play file MSAPI_AUD_DVB_DECCMD_PAUSE, ///< 1st DSP pause MSAPI_AUD_DVB_DECCMD_PLAYFILETSP, ///< 1st DSP play TS file MSAPI_AUD_DVB_DECCMD_STARTBROWSE, MSAPI_AUD_DVB_DECCMD_PLAYFRAME, ///<1st DSP play MM (for uniplayer/Mstreamer) MSAPI_AUD_DVB_DECCMD_PLAYFRAME_STAGE, ////<1st DSP play MM (for stagecraft) MSAPI_AUD_DVB_DECCMD_PLAYFRAME_GS, ///<1st DSP play MM (for uniplayer/Gstreamer ES copy) MSAPI_AUD_DVB_DECCMD_PLAYMM_FILE2, MSAPI_AUD_DVB_DECCMD_PLAY_AD, MSAPI_AUD_DVB_DECCMD_STOP_AD, MSAPI_AUD_DVB_DECCMD_SKIP, // SE DSP MSAPI_AUD_DVB2_DECCMD_STOP=0x10, ///< 2nd DSP stop MSAPI_AUD_DVB2_DECCMD_PLAY, ///< 2nd DSP play MSAPI_AUD_DVB2_DECCMD_RESYNC, MSAPI_AUD_DVB2_DECCMD_FREE_RUN, MSAPI_AUD_DVB2_DECCMD_AVSYNC, MSAPI_AUD_DVB2_DECCMD_PLAYFILE, ///< 2nd DSP play file MSAPI_AUD_DVB2_DECCMD_PAUSE, ///< 2nd DSP pause MSAPI_AUD_DVB2_DECCMD_PLAYFILETSP, ///< 2nd DSP play TS file } En_DVB_decCmdType; ///< Encoder Command typedef enum { MSAPI_AUD_DVB_ENCCMD_STOP = 0x0, ///< stop encode MSAPI_AUD_DVB_ENCCMD_START ///< start encode }En_DVB_EncCmdType; ///< ATV SIF Command typedef enum { MSAPI_AUD_SIF_CMD_SET_STOP = 0x00, MSAPI_AUD_SIF_CMD_SET_PLAY = 0x01, MSAPI_AUD_SIF_CMD_ENABLE_HIDEV = 0x02, MSAPI_AUD_SIF_CMD_SET_HIDEV_FILTER_BW_LEVEL = 0x03, MSAPI_AUD_SIF_CMD_RESET_FC_TRACKING = 0x04, MSAPI_AUD_SIF_CMD_ENABLE_FC_TRACKING = 0x05, MSAPI_AUD_SIF_CMD_SET_ADC_FROM_VIF_PATH = 0x06, MSAPI_AUD_SIF_CMD_ENABLE_AUTO_MUTE = 0x07, MSAPI_AUD_SIF_CMD_ENABLE_BEEPER_FUNCTION = 0x08, MSAPI_AUD_SIF_CMD_SET_BEEPER_TONE = 0x09, MSAPI_AUD_SIF_CMD_ENABLE_AGC = 0x0A, MSAPI_AUD_SIF_CMD_RESET_AGC = 0x0B, MSAPI_AUD_SIF_STANDARD_RESET = 0x0C, MSAPI_AUD_SIF_CMD_DETECT_MAIN_STD_ONLY = 0x0D, MSAPI_AUD_SIF_CMD_ENABLE_AUTO_SOUNDMODE = 0x0E, MSAPI_AUD_SIF_CMD_FMTX_SET_PREEMP = 0x0F, MSAPI_AUD_SIF_CMD_SET_ENC_CMD = 0x10, MSAPI_AUD_SIF_CMD_SET_ENC_Input_attenuation= 0x11, MSAPI_AUD_SIF_CMD_SET_ENC_Output_scaling= 0x12, MSAPI_AUD_SIF_CMD_SET_BTSC_Enc_M_Gain=0x13, MSAPI_AUD_SIF_CMD_SET_BTSC_Enc_D_Gain= 0x14, MSAPI_AUD_SIF_CMD_SET_BTSC_Enc_SAP_Gain= 0x15, MSAPI_AUD_SIF_CMD2_ADC_VIA_VIF_PIN = 0x01 } En_AUD_SIF_CmdType; typedef enum { MSAPI_AUD_SIF_42M, MSAPI_AUD_SIF_43M, MSAPI_AUD_SIF_44M, } En_AUD_VIF_Type; enum { MSAPI_AUD_SIF_HIDEV_FILTER_BW_DEFAULT = 0x00, // equal middle filter bandwidth MSAPI_AUD_SIF_HIDEV_FILTER_BW_L1 = 0x10, // narrowest filter bandwidth MSAPI_AUD_SIF_HIDEV_FILTER_BW_L2 = 0x20, // middle filter bandwidth MSAPI_AUD_SIF_HIDEV_FILTER_BW_L3 = 0x30 // widest filter bandwidth }; ///< Decoder Number typedef enum { DVB_Audio_Decoder1, ///