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

📄 am_app_logic_processor_main.cc

📁 Motorola synergy audio component
💻 CC
📖 第 1 页 / 共 5 页
字号:
    dai_info.dai_mode              = mode;    dai_info.codec_type            = PHONE_CODEC;       clear_bit( dai_info.instruction_mask, AM_I_MASK_NOISE_SUPPRESS );    clear_bit( dai_info.instruction_mask, AM_I_MASK_ECHO_CONTROL );#if (AUDIO_RAINBOW == TRUE)    /* This needs to be set to 13M for GSM calls and 15M for WCMDA */    dai_info.clock_rate            = HAPI_CODEC_CLK_13M;#endif    set_bit( dai_info.instruction_mask, AM_I_MASK_MIC_FILTER );    set_bit( dai_info.instruction_mask, AM_I_MASK_SPKR_FILTER );    set_matrix( &dai_info, ALL_SOURCES, ALL_DESTINATIONS, (INT16) DISCONNECT_DSP_AUDIO );    if(volume == INVALID_VOLUME_STEP)    {        /* Create temporary info_ptr because of interface change that requires         * get_volume_step() to take an info_ptr.         */        AM_AUDIO_INFO temp_info;        temp_info.path_type = AM_AUDIO_PATH_ID_VOICE;        temp_info.tone.type = dai_info.tone.type;        volume = relay_layer.get_volume_step( &temp_info );    }        if ((mode == DL_AUDIO_TONE_TYPE_DAI_ANALOG_DOWNLINK)        ||(mode == DL_AUDIO_TONE_TYPE_DAI_ANALOG_UPLINK))    {               uplink_source   = CODEC_MIC;        uplink_dest     = SAP_TX_SLOT_1;        downlink_source = SAP_RX_SLOT_1;        downlink_dest   = CODEC_SPEAKER;        dai_info.dai_type = 0x0004;    }    else if ((mode == DL_AUDIO_TONE_TYPE_DAI_DIGITAL_UPLINK)             ||(mode == DL_AUDIO_TONE_TYPE_DAI_DIGITAL_DOWNLINK))    {        uplink_source   = SAP_RX_SLOT_1;        uplink_dest     = UPLINK_SPEECH;        downlink_source = DOWNLINK_SPEECH;        downlink_dest   = SAP_TX_SLOT_1;        if (mode == DL_AUDIO_TONE_TYPE_DAI_DIGITAL_UPLINK)        {            dai_info.dai_type = 0x0002;        }        else        {            dai_info.dai_type = 0x0001;        }    }    if ((device_array[ DL_ACC_DM_HEADSET ])         ||  (device_array[ DL_ACC_DM_EMU_HEADSET ])#if (STEREO_HEADSET_SUPPORTED == TRUE)        ||  (device_array[ DL_ACC_DM_STEREO_HEADSET])#endif        )    {        dai_info.speaker = HAPI_AUD_OUT_SEL_BOOM_HEADSET_SPEAKER;        dai_info.mic     = HAPI_AUD_IN_SEL_BOOM_HEADSET_MIC;        device           = DL_ACC_DM_HEADSET;        if (device_array[ DL_ACC_DM_EMU_HEADSET ])        {            device           = DL_ACC_DM_EMU_HEADSET;        }    }    else    {        dai_info.speaker = HAPI_AUD_OUT_SEL_HANDSET_SPEAKER;        dai_info.mic     = HAPI_AUD_IN_SEL_HANDSET_MIC;        device           =  DL_ACC_DM_HANDSET;        if ((mode == DL_AUDIO_TONE_TYPE_DAI_ANALOG_DOWNLINK) ||            (mode == DL_AUDIO_TONE_TYPE_DAI_ANALOG_UPLINK))        {            //  AUDIO SHAPING             set_bit( dai_info.instruction_mask, AM_I_MASK_AUDIO_HANDSET_FILTERING );        }    }    //  SET THE SPEAKER MATRIX GAINS.    gain_table_ptr = get_gain( device , DOWNLINK_SPEECH, CODEC_SPEAKER,                               AM_AUDIO_PATH_ID_VOICE , volume, TRUE );    dai_info.hardware_gain_speaker = gain_table_ptr->hardware_gain;    set_matrix( &dai_info, downlink_source, downlink_dest, gain_table_ptr->dsp_gain_1 );    //  SET THE MIC MATRIX GAINS.    gain_table_ptr = get_gain( device , CODEC_MIC, UPLINK_SPEECH,                                AM_AUDIO_PATH_ID_VOICE, volume, TRUE );    dai_info.hardware_gain_mic = gain_table_ptr->hardware_gain;    set_matrix( &dai_info, uplink_source, uplink_dest, gain_table_ptr->dsp_gain_1 );    //  Make sure that we don't go into low power in execute during DAI!    set_bit( dai_info.instruction_mask, AM_I_MASK_ACTIVE_AUDIO );    primitive_builder.execute(&dai_info);}#endif/* DESCRIPTION:   Assemble all information hardware layer needed to play the   tone on top of the queue      INPUTS:   None      OUTPUTS:   None      IMPORTANT NOTES:   None*/voidAM_App_Logic_Processor :: update_audio ( void ){    update_audio(0);}voidAM_App_Logic_Processor :: update_audio (UINT8 rerun){    SU_RET_STATUS err;    Tone_Item * front = eventqueuehandler.GetCurrent ();    TD_AUD_TONE_UNION_T       tone;    AM_AUDIO_PATH_TYPE   path_type;    AUD_DEVICE_AND_VOLUME_T am_device_and_volume = {0};    if(front != NULL)    {        path_type = front->Path;        tone = front->ToneEvent;    }#if (EARPHONE_RINGER_OPTION_DEFINED == TRUE)    /*only change option if ERO is available -- ero_state initialized properly otherwise*/    if (DL_DbGetFeatureAvailability(DL_DB_FEATURE_ID_EARPHONE_RINGER_OPTION_AVAILABLE))    {        DL_DbFeatureGetCurrentState (DL_DB_FEATURE_ID_EARPHONE_RINGER_OPTION,                                     &earphone_ringer_option_state);    }#endif     if((audio_dai_mode == DL_AUDIO_TONE_TYPE_DAI_ANALOG_UPLINK)       ||(audio_dai_mode == DL_AUDIO_TONE_TYPE_DAI_ANALOG_DOWNLINK)       ||(audio_dai_mode == DL_AUDIO_TONE_TYPE_DAI_DIGITAL_UPLINK)       ||(audio_dai_mode == DL_AUDIO_TONE_TYPE_DAI_DIGITAL_DOWNLINK))    {        return;    }#if (MAKE_TELEMATICS == TRUE)    AUD_AUDIO_START_STOP_IND_T * msgptr = NULL;#endif    if (eventqueuehandler.Exists())    /*  There's something to play and the mute_bit is false   */    {         // If MP3 player is at the top of the queue, do not disable the AM low power flag.        // Since there is no DSP involvement, the phone can go to low power.        if (tone.fields.id != DL_AUDIO_TONE_TYPE_MP3_PLAYER)        {            suDisableLowPowerFlag(AudioLowPowerHandle, &err);    // disable low power mode        }#if (MAKE_MP3 == TRUE)        //  The FM radio chip is powered off when we leave FM radio mode.        //  If we need to use the headset mic or speaker, we must enable an amp.        //  IF   there is an FM headset present        //  AND  the tone is NOT an alert        //  AND  the tone is audible         //  NOTE: This last condition will prevent us from turning on the        //  FM headset amp when we're in FM radio mode.        //  THEN enable the amp for the mic and speaker.        if ( ( DL_AccGetConnectionStatus( DL_ACC_DM_FM_RADIO ) == TRUE )        &&   ( path_type != AM_AUDIO_PATH_ID_ALERT_LITE )        &&   ( path_type != AM_AUDIO_PATH_ID_MULTIMEDIA_ALERT)#if ( (MAKE_FTR_VR == TRUE) || (MAKE_FTR_VA == TRUE) )        &&   ( path_type != AM_AUDIO_PATH_ID_VA_VR_NON_AUDIO )  //  NON-AUDIBLE#endif        &&   ( path_type  < AM_AUDIO_PATH_ID_DATA ) )#else            /*  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 )#endif            {            /* Enable FM headset amplifier */            if ( ( DL_AccGetConnectionStatus( DL_ACC_DM_FM_RADIO) == TRUE ) &&#if ( (MAKE_FTR_VR == TRUE) || (MAKE_FTR_VA == TRUE) )                 ( ( ( path_type != AM_AUDIO_PATH_ID_VA_VR_NON_AUDIO      ) &&#endif                     ( !eventqueuehandler.FindItem((TD_AUD_TONE_REQ_TONE_TYPE_T)DL_AUDIO_TONE_TYPE_RADIO) ) ||                     ( relay_layer.is_incall() == TRUE  )                 )                )#endif#endif        {            /*Make the timer stop, so we don't turn off SW B+ */            if(am_fm_power_timer.IsActive())            {                am_timer_handler.Stop(&am_fm_power_timer);            }#if (MAKE_HDW_EMU_BUS == FALSE)            /*  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 )#endif            {                /*Make sure the clock is low so we don't latch data*/                primitive_builder.aud_hPortWrite( HAPI_FM_CLOCK,                                                  HAPI_SIGNAL_DEASSERT,                                                  AM_HW_FM_CLOCK     );                /*Apply power */                primitive_builder.aud_hPortWrite( HAPI_SW_BPLUS_EN,                                                  HAPI_SIGNAL_ASSERT,                                                  AM_HW_SW_BPLUS_EN  );                /*Start unmuting the radio */                hPortConfigure(HAPI_FM_WRITE_EN);                 hPortConfigure(HAPI_FM_DATA_TX);                primitive_builder.aud_hPortWrite( HAPI_FM_DATA_TX,                                                  HAPI_SIGNAL_ASSERT,                                                  AM_HW_FM_DATA_TX   );                suSleep(10,NULL);                primitive_builder.aud_hPortWrite( HAPI_FM_WRITE_EN,                                                   HAPI_SIGNAL_DEASSERT,                                                  AM_HW_FM_WRITE_EN  );            }#endif#endif        }               /* Set the Entertainment Mute line if applicable */        if   (relay_layer.is_incall() ||               ((path_type != AM_AUDIO_PATH_ID_VA_VR_NON_AUDIO) &&              (path_type != AM_AUDIO_PATH_ID_INVALID_TONE)))         {     #if (AUDIO_GSM != TRUE)            if(DL_AccGetConnectionStatus(DL_ACC_DM_USB_CARKIT) == TRUE)            {                /*Make the timer stop, so we don't turn off Ent Mute */                if(am_fm_power_timer.IsActive())                {                    am_timer_handler.Stop(&am_fm_power_timer);                }                DL_AudSetMuteAlertState(DL_AUDIO_ENTERTAINMENT_MUTE_TYPE, TRUE);            }            else      #endif            if(DL_AccGetConnectionStatus(DL_ACC_DM_CE_BUS_ZIHF) == TRUE)            {                /*Make the timer stop, so we don't turn off Ent Mute */                if(am_fm_power_timer.IsActive())                {                    am_timer_handler.Stop(&am_fm_power_timer);                }                /*  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, pcap or atlas ul. */                if (( HAPI_get_power_ic_type() == HAPI_POWER_IC_TYPE_PCAP ) ||                    ( HAPI_get_power_ic_type() == HAPI_POWER_IC_TYPE_AUL ))#endif                {                    /*Set the entertainment mute*/                    hPortConfigure(HAPI_FM_ACC_MUTE_EN);                    /*Active low, so disable = logic 1*/                    primitive_builder.aud_hPortWrite( HAPI_FM_ACC_MUTE_EN,                                                      HAPI_SIGNAL_DISABLE,                                                      AM_HW_FM_ACC_MUTE_EN );                }#endif            }        }        /* if a rerun, here the bit gets masked */        tone.fields.rerun = rerun;              // Adjust the path types to the below tones        if (   (    ( tone.fields.id >= DL_AUDIO_TONE_TYPE_KEY_LITE_ID_LIMIT        )                 && ( tone.fields.id <  DL_AUDIO_TONE_TYPE_RINGER_KEY_LITE_ID_LIMIT )               )           )        {#if ( (MAKE_FTR_VR == TRUE) || (MAKE_FTR_VA == TRUE) )            //  Don't route tones to the transducer/speakerphone if we're doing VA playback.            if ( va_vr_server.is_va_active() == FALSE  )#endif            {                // these tones have the same priority as key tones, but                // need to be routed to transducer                path_type = AM_AUDIO_PATH_ID_ALERT_LITE;            }        }#if ( (MAKE_FTR_VR == TRUE) || (MAKE_FTR_VA == TRUE) )        if( path_type == AM_AUDIO_PATH_ID_VA_VR_IO ||            path_type == AM_AUDIO_PATH_ID_VA_IO ||            path_type == AM_AUDIO_PATH_ID_VR_IO ||            path_type == AM_AUDIO_PATH_ID_VA_VR_OUTPUT ||            path_type == AM_AUDIO_PATH_ID_VA_VR_NON_AUDIO )        {            /* if VA/VR request, use tone from the va/vr server */            tone.type = DL_AUDIO_TONE_TYPE_INVALID_TONE;        }        else#endif        {            tone.type = relay_layer.get_tone(tone.type);        }                AM_AUDIO_INFO audio_path;        audio_path.tone                  = tone;        audio_path.vib_type              = front->VibrateType;        audio_path.path_type             = path_type;        audio_path.dsp_seq               = front->DSPSequenceID;        audio_path.vol_step              = front->AppliedVol;        audio_path.instruction_mask      = 0L;#if ( (MAKE_FTR_VR == TRUE) || (MAKE_FTR_VA == TRUE) )        audio_path.va_vr_command         = va_vr_server.get_command( path_type );        audio_path.va_vr_data_ptr        = va_vr_server.get_data_ptr( path_type );  #endif              audio_path.tone_insertion_metho

⌨️ 快捷键说明

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