auddrv.c
上传用户:caisangzi8
上传日期:2013-10-25
资源大小:15756k
文件大小:35k
- /***********************************************************************
- * 2004.10 System Dept.VI Oliver Chen
- *
- * This file is all about audio related driver interface.
- * Please control the audio h/w, DSP, board, and pin config
- * through these APIs.
- ***********************************************************************/
- #include "auddrv.h"
- #include "gpio.h"
- #include "kinf.h"
- #include "ninf.h"
- #include "file_if.h" //for Wave format related APIs
- #include "setup_def.h"
- extern UINT8 setup_sel[MAX_SETUP_PAGE + MAX_CUSTM_SETUP_PAGE][MAX_PAGE_ITEM];
- extern const UINT8 setup_item[MAX_SETUP_PAGE + MAX_CUSTM_SETUP_PAGE][MAX_PAGE_ITEM][MAX_ITEM_SEL];
- #include "setup_page.h"
- extern UINT8 power_on_mute;
- #ifdef SPHE1000 //bktesng, 2004/12/09, To get audio info for Linux AP.
- #include "driver/message.h"
- extern share_info_t *pDVB;
- #endif
- extern void delay_srv_10ms(int tms);
- extern BYTE wait_dsp_port0_5(int port0,int port5,int val,UINT32 risc_waiting_dsp_tm);
- extern int ReadFromI2c(int,int,BYTE *,int);
- #ifdef SUPPORT_MP4
- extern BYTE GetCurrentFileType();
- int mp4_aud_channel_flg=0;
- int mp4_aud_channel=0;
- #endif
- #ifdef SUPPORT_MIDI
- extern UINT8 gIsMidiSelMenu;
- #ifdef SUPPORT_MIDIDISK_TITLE
- extern BYTE bIsPlayMidiTitle;
- #endif
- #endif
- INT8 mic_volume=8;
- /***********************************************************************
- * Code Session
- ***********************************************************************/
- // FUNCTION DESCRIPTION : wait until turn to STOP(ready) status
- //
- void AUDIF_Wait_DSPReady(int dspChanged)
- {
- //delay_srv_10ms(2);//2004/3/8 11:40PM,terry
- wait_dsp_port0_5(0,1,0,200000);//terry,2003/8/8 03:46AM
-
- //If AC3, we need to set some configure(subwoofer, speaker gain, speaker delay)
- if(coding_mode_now==AUDIF_CODING_MODE_AC3) {
- setup_SetAC3Config();
- }
-
- if(dspChanged) {
- //set common audio configure when DSP audio change
- if((cd_type_loaded==CDDA)&&(coding_mode_now==AUDIF_CODING_MODE_DTSCD)){ //Jeff 20020719
- delay_srv_10ms(15);
- }
- #ifdef SUPPORT_DSPMUTE
- regs0->dsp24_port[14] = 0x0; // for dsp mute benson 2004/7/12 01:13