void AUDDRV_Enable_Input ( AUDDRV_InOut_Enum_t input_path, AUDDRV_MIC_Enum_t mic_selection, AUDIO_SAMPLING_RATE_t sample_rate ) { #if defined(FUSE_APPS_PROCESSOR) currInputSamplingRate = sample_rate; AUDDRV_EnableHWInput ( input_path, mic_selection, sample_rate, AUDDRV_REASON_HW_CTRL ); switch(input_path) { case AUDDRV_VOICE_INPUT: Log_DebugPrintf(LOGID_AUDIO, "\n\r\t* AUDDRV_Enable_Input mic_selection %d *\n\r", mic_selection ); if(inVoiceCall != TRUE) { //if inVoiceCall== TRUE, assume the telphony_init() function sends ENABLE and CONNECT_UL if (sample_rate == AUDIO_SAMPLING_RATE_8000) { currInputSamplingRate = AUDIO_SAMPLING_RATE_8000; audio_control_dsp(DSPCMD_TYPE_AUDIO_CONNECT_UL, 1, 0, 0, 0, 0); audio_control_dsp(DSPCMD_TYPE_AUDIO_ENABLE, 1, 0, 0, 0, 0 ); } else { currInputSamplingRate = AUDIO_SAMPLING_RATE_16000; audio_control_dsp(DSPCMD_TYPE_AUDIO_CONNECT_UL, 1, 1, 0, 0, 0); audio_control_dsp(DSPCMD_TYPE_AUDIO_ENABLE, 1, 1, 0, 0, 0 ); } } voiceInPathEnabled = TRUE; currVoiceMic = mic_selection; if (currVoiceMic == AUDDRV_MIC_PCM_IF) AUDDRV_SetPCMOnOff( 1 ); else { if (currVoiceSpkr != AUDDRV_SPKR_PCM_IF) //need to check spkr too. AUDDRV_SetPCMOnOff( 0 ); } break; default: break; } #endif //#if defined(FUSE_APPS_PROCESSOR) }
// ========================================================================== // // Function Name: csl_audvoc_capture_start // // Description: Start the data transfer of the audio path capture // // ========================================================================= Result_t csl_audio_capture_start( UInt32 streamID ) { CSL_AUDVOC_Drv_t *audDrv = NULL; Log_DebugPrintf(LOGID_SOC_AUDIO, "csl_audvoc_capture_start:: DMA streamID = %d\n", streamID); audDrv = GetDriverByType (streamID); if (audDrv == NULL) return RESULT_ERROR; if(OSDAL_DMA_Start_Transfer(audDrv->dmaCH) != OSDAL_ERR_OK) { Log_DebugPrintf(LOGID_SOC_AUDIO, "csl_audvoc_capture_start::Error, Start transfer failed.\n"); } if (streamID == CSL_AUDVOC_STREAM_BTW) { Log_DebugPrintf(LOGID_AUDIO, "csl_audio_capture_start BT wb tap \n"); AUDDRV_Enable_MixerTap ( AUDDRV_MIXERTap_WB_INPUT, AUDDRV_SPKR_NONE, ////this param bears no meaning in this context. AUDDRV_SPKR_NONE, ////this param bears no meaning in this context. AUDIO_SAMPLING_RATE_UNDEFINED, //this param bears no meaning in this context AUDDRV_REASON_DATA_DRIVER ); } else { AUDDRV_EnableHWInput ( AUDDRV_AUDIO_INPUT, AUDDRV_MIC_NONE, //this param bears no meaning in this context. AUDIO_SAMPLING_RATE_UNDEFINED, //this param bears no meaning in this context. AUDDRV_REASON_DATA_DRIVER ); } return RESULT_OK; }