⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 am_app_logic_processor_mask.cc

📁 Motorola synergy audio component
💻 CC
📖 第 1 页 / 共 5 页
字号:
    }#endif    /****************************************************************************/    /*                             STANDARD DEVICES                             */    /****************************************************************************/        else    {        chosen_device = choose_device(feature_state, info_ptr);        set_audio_path(info_ptr, chosen_device);    }    /* Don't want to do Noise Suppression if seem element SEEM_AUD_DSP_ALGRTHMS      * has NS bit turned off     */     if ( am_en_ns == FALSE )     {         clear_bit( info_ptr->instruction_mask, AM_I_MASK_NOISE_SUPPRESS );     }    /* Don't want to do Echo control if seem element SEEM_AUD_DSP_ALGRTHMS has EC      * bit turned off     */     if ( am_en_ec == FALSE )     {         clear_bit( info_ptr->instruction_mask, AM_I_MASK_ECHO_CONTROL );     }  #if (MAKE_TTY == TRUE)    //  The TTY sine waves must not be processed in any way    //  or else there will be transmission/reception errors!    //  Do this ONLY if we are in a active call with TTY enabled     if (    ( am_event_tty_mode != AM_HW_TTY_MODE_DISABLED )         && ( in_call           == TRUE                    )         && (   ( chosen_device == DL_ACC_DM_DIG_TTY       )             || ( chosen_device == DL_ACC_DM_HEADSET       )#if (STEREO_HEADSET_SUPPORTED == TRUE)             || ( chosen_device == DL_ACC_DM_STEREO_HEADSET) #endif              || ( chosen_device == DL_ACC_DM_EMU_HEADSET   ) ) )    {        info_ptr->echo_mode = ECHO_MODE_HANDSET;        clear_bit( info_ptr->instruction_mask, AM_I_MASK_MIC_FILTER );        clear_bit( info_ptr->instruction_mask, AM_I_MASK_SPKR_FILTER );        clear_bit( info_ptr->instruction_mask, AM_I_MASK_ECHO_CONTROL  );        clear_bit( info_ptr->instruction_mask, AM_I_MASK_NOISE_SUPPRESS  );        clear_bit( info_ptr->instruction_mask, AM_I_MASK_ZIHF_VOICE_COMPAND );        clear_bit( info_ptr->instruction_mask, AM_I_MASK_PLOVER_VOICE_COMPAND  );        clear_bit( info_ptr->instruction_mask, AM_I_MASK_ZIHF_HIFI_COMPAND );        clear_bit( info_ptr->instruction_mask, AM_I_MASK_PLOVER_HIFI_COMPAND  );        clear_bit( info_ptr->instruction_mask, AM_I_MASK_HEADSET_VOICE_COMPAND    );        clear_bit( info_ptr->instruction_mask, AM_I_MASK_AUDIO_HANDSET_FILTERING     );        clear_bit( info_ptr->instruction_mask, AM_I_MASK_CLIP_ON_SPEAKER_PHONE_COMPAND  );        clear_bit( info_ptr->instruction_mask, AM_I_MASK_INT_SPEAKER_PHONE_VOICE_COMPAND   );    }  #endif    /* This has to be called right before ORing mic gain and speaker gain */#if ( MAKE_TELEMATICS == TRUE)    map_audio_device_ids(info_ptr, &mic_routing, &spkr_routing);#endif    /*******************************************************************************/    /*                           DEVICE INDEPENDENT                                */    /*******************************************************************************/       // set TONE GENERATOR to UL SPEACH in the matrix as long as it is locked here for TDMA#if (AUDIO_TDMA == TRUE)    if (ul_dtmf_lock == TRUE)    {        set_matrix( info_ptr, TONE_GENERATOR, UPLINK_SPEECH, MATRIX_ANALOG_DTMF_UL );        set_matrix( info_ptr, CODEC_MIC,      UPLINK_SPEECH, DISCONNECT_DSP_AUDIO );    }#endif#if (MAKE_FTR_MFT_SUPPORT == FALSE)    if ( isVibAlert(info_ptr->vib_type ) && !(isMediaTone(tone.fields.id)) )    {        set_bit( info_ptr->instruction_mask, AM_I_MASK_SEL_VIBRATOR );    }#else    if (!is_MFT_Available)    {        if ( isVibAlert(info_ptr->vib_type ) )        {            set_bit( info_ptr->instruction_mask, AM_I_MASK_SEL_VIBRATOR );        }    }#endif        /*  Screen out phones not supporting HAPI CE bus accy signals. */#if ((MAKE_NEPTUNE_CHIPSET == TRUE && MAKE_HDW_BB_IC != MAKE_HDW_NEPTUNE_LT) \ ||  (MAKE_NEPTUNE_CHIPSET == FALSE))    /*  HAPI_get_power_ic_type() is only defined for C650, an LTS product. */#if (MAKE_HDW_BB_IC == MAKE_HDW_NEPTUNE_LTS)    /*  The call below will find out if we have seaweed or pcap. */    if ( HAPI_get_power_ic_type() == HAPI_POWER_IC_TYPE_PCAP ||         HAPI_get_power_ic_type() == HAPI_POWER_IC_TYPE_AUL )#endif    {        if ( ( chosen_device    != DL_ACC_DM_CE_BUS_SPEAKER_PHONE ) &&#if (MAKE_HDW_EMU_BUS == TRUE)                 ( chosen_device    != DL_ACC_DM_FAST_CHRGR_SIHF ) &&             ( chosen_device    != DL_ACC_DM_MID_CHRGR_SIHF ) &&#endif             ( is_ce_bus_unmute == TRUE                           ) )        {            // MUTE CE BUS            hPortConfigure(HAPI_FM_ACC_MUTE_EN);            AM_HW_Primitive_Builder::aud_hPortWrite( HAPI_FM_ACC_MUTE_EN,                                                     HAPI_SIGNAL_ENABLE,                                                     AM_HW_FM_ACC_MUTE_EN );             is_ce_bus_unmute = FALSE;        }    }#endif#if ( MAKE_TELEMATICS == TRUE)    /* Create audio start/stop message for PSE ent. mute */    if ( ( ( info_ptr->path_type != old_path_type)    ||     ( mic_routing         != old_mic_routing)    ||     ( spkr_routing        != old_spkr_routing))    &&     ( info_ptr->path_type != AM_AUDIO_PATH_ID_INVALID_TONE)    &&     ( info_ptr->path_type != AM_AUDIO_PATH_ID_UNUSED_TONE) )    {        msgptr = (AUD_AUDIO_START_STOP_IND_T *)            suCreateMessage((UINT32)sizeof(AUD_AUDIO_START_STOP_IND_T),               (UINT32)AUD_AUDIO_START_STOP_IND, SU_INVALID_HANDLE,                                                               NULL);        msgptr->audio_type   = info_ptr->path_type;        msgptr->mic_routing  = mic_routing;        msgptr->spkr_routing = spkr_routing;        suSendMessage(msgptr,            (SU_PORT_HANDLE)suFindName(DL_PORT_NAME_AUDIO_SP, 10000, &err), NULL);    }            old_path_type    = info_ptr->path_type;    old_mic_routing  = mic_routing;    old_spkr_routing = spkr_routing;#endif}/* DESCRIPTION:       Set up the hardware path based on the path we are trying to route to   INPUTS:       info_ptr - where to store the information       device - the device to route to   OUTPUTS:       None   IMPORTANT NOTES:       None     */voidAM_App_Logic_Processor :: set_audio_path( AM_AUDIO_INFO *info_ptr, UINT8 device){    BOOL in_call = relay_layer.is_incall();    UINT8  volume;    DL_AUDIO_ALERT_TYPE audio_profile;    volume = initialize_path(info_ptr, device);    //  We check this in execute before powering up the audio block    //  in PCAP with activate_power set to TRUE.    //  We sometimes have temporarily stuck non-audible va/vr tones    //  on our queue, which inhibit us from going into low power.    //  So we want to set this here, and clear the active audio    //  bit below for the few non-audible cases.    set_bit(info_ptr->instruction_mask, AM_I_MASK_ACTIVE_AUDIO);#if (MAKE_HDW_OKI == TRUE)    am_oki_volume = volume;#endif    /* The vibrate should be hardcoded to a particular volume and should not follow the     * volume setting of the ring styles. Also, this will be flexed hence forth reusing     * a flex ID which was never used since its creation.      * DL_DB_FEATURE_ID_MFT_VIBRATION_FREQUENCY will be used to store the MFT vib volume.     */    if (info_ptr->path_type == AM_AUDIO_PATH_ID_MULTIMEDIA_MFT_VIB)    {        volume = AM_App_Feature_Server :: read_value(DL_DB_FEATURE_ID_MFT_VIBRATION_FREQUENCY);    }    /* LIBdd27164: : Need to enable NS, EC and AVC/ANM only if SEEM element bit for it is     * enabled. This is for the hardware team to be able to enable these algorithms     * without needing s/w change.     */    enable_disable_dsp_alg();    switch ( info_ptr->path_type )    {        case AM_AUDIO_PATH_ID_ALERT_LITE:        case AM_AUDIO_PATH_ID_MULTIMEDIA_ALERT:             /*  Set up the audio path. */             set_alert_path(info_ptr, volume, device);            break;        case AM_AUDIO_PATH_ID_UI_LITE:        case AM_AUDIO_PATH_ID_KEY_LITE:            if (( device == DL_ACC_DM_HANDSET )                && (( info_ptr->tone_insertion_method) & (AM_ANALOG_DTMF_TX_MASK)))                {                    // disable tone-upspeech to prevent speech overide by tone in call                    set_matrix( info_ptr, TONE_GENERATOR, UPLINK_SPEECH, DISCONNECT_DSP_CTG_GAIN );                }            /*still falling though intentionally*/        case AM_AUDIO_PATH_ID_NETWORK_LITE:            set_tone_path(info_ptr, volume, device);            /* If we are in a call and are playing in call beeps like call waiting beeps, if               the device is a  handset or a headset, we want to keep the voice audio paths               connected. For any other device, we want to make sure that the uplink is               muted so that the other end does not hear any clicks.              */            if (in_call)            {                /* Before calling set_voice_path(), set the volume back to the                  * voice volume. This will prevent the sidetone gains from getting                 * resent while In call tones play which is causing clicks on uplink                 */                /* Create temporary info_ptr to pass to volume step.  This was needed                 * because of an interface change to get_volume_step().  get_volume_step()                 * now takes an info_ptr instead of a path_type.                 */                AM_AUDIO_INFO temp_info;                temp_info.path_type = AM_AUDIO_PATH_ID_VOICE;                temp_info.tone.type = info_ptr->tone.type;                volume = relay_layer.get_volume_step( &temp_info );                set_voice_path(info_ptr, volume, device);            }            break ;        case AM_AUDIO_PATH_ID_VOICE:        case AM_AUDIO_PATH_ID_VT_VOICE:            //  If the flip is closed, mute the voice path to eliminate feedback            //  on phones where the mic and speaker come very close to each other.            if ( ( device == DL_ACC_DM_HANDSET )            &&   ( DL_AccGetHookswitchStatus(DL_ACC_DM_FLIP) == FALSE)             &&   ( info_ptr->tone.fields.id == DL_AUDIO_TONE_TYPE_VOICE ) )            {                          #if (MAKE_FTR_UMA == TRUE)                //  Find out if this is a GSM or UMA (Bluephone) call.                UINT8 curr_call_technology = UAC_GetAccessTechnology();                if ( curr_call_technology == ACCESS_TECHNOLOGY_UMA )                {                    //  In a Bluephone call, the voice is processed as multimedia AMR.                    set_matrix( info_ptr, VA_PLAYBACK,     CODEC_SPEAKER,  MUTE_DSP_AUDIO );                    set_matrix( info_ptr, CODEC_MIC,       VA_REC,         MUTE_DSP_AUDIO );                }                else              #endif                {                    set_matrix( info_ptr, DOWNLINK_SPEECH, CODEC_SPEAKER,  MUTE_DSP_AUDIO );                    set_matrix( info_ptr, CODEC_MIC,       UPLINK_SPEECH,  MUTE_DSP_AUDIO );                }            }            else            {                set_voice_path(info_ptr, volume, device);            }            break ;#if ( (MAKE_FTR_VR == TRUE) || (MAKE_FTR_VA == TRUE) )        case AM_AUDIO_PATH_ID_VA_IO:            set_va_rec_path(info_ptr, volume, device);            if (in_call)            {                /* Need to mute DL voice when doing VA Record in-call, and TX Mute is true. */                /* This is because the audio from the speaker can bleed into the mic and we */                /* specifically don't want to record the downlink when muted. */                BOOL temp_rx_mute = rx_mute_status();                set_rx_mute(tx_mute_status());                if (!tx_mute_status())                {                    set_va_in_call_path(info_ptr, volume, device);                }                set_voice_path(info_ptr, volume, device);                set_rx_mute(temp_rx_mute);            }            break;                   case AM_AUDIO_PATH_ID_VA_VR_IO:            set_va_rec_path(info_ptr, volume, device);            /*falling through intentionally*/        case AM_AUDIO_PATH_ID_VR_IO:#endif        case AM_AUDIO_PATH_ID_FUNLIGHTS:            set_vr_path(info_ptr, volume, device);            break;#if ( (MAKE_FTR_VR == TRUE) || (MAKE_FTR_VA == TRUE) )        case AM_AUDIO_PATH_ID_VA_VR_OUTPUT:            if (in_call)            {                set_voice_path(info_ptr, volume, device);            }            set_va_play_path(info_ptr, volume, device);            break;        case AM_AUDIO_PATH_ID_VA_VR_NON_AUDIO:            if (in_call)            {                /* Before calling set_voice_path(), set the volume back to the                  * voice volume. This will prevent the sidetone gains from getting                 * resent while In call tones play which is causing clicks on uplink                 */                /* Create temporary info_ptr to pass to volume step.  This was needed                 * because of an interface change to get_volume_step().  get_volume_step()                 * now takes an info_ptr instead of a path_type.                 */                AM_AUDIO_INFO temp_info;		UINT8 temp_volume;                temp_info.path_type = AM_AUDIO_PATH_ID_VOICE;                temp_info.tone.type = info_ptr->tone.type;                temp

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -