美文网首页
着耳机看TV或听MP4时,来闹铃或电话打断后,耳机端声音突然变大

着耳机看TV或听MP4时,来闹铃或电话打断后,耳机端声音突然变大

作者: 简书20188 | 来源:发表于2018-07-31 19:24 被阅读0次

    插着耳机看TV或听MP4时,来闹铃或电话等打断后,耳机端声音突然变大

    [SOLUTION]来自半导体社区

    问题原因:

    插着耳机进TV,此时是耳机模式,输出设备是耳机,而来闹铃后,因为闹铃是耳机和外放都有声音,输出设备是耳机和

    外放一起,

    当闹铃停掉后再进TV,在获取音量时使用的device是both即耳机和外放,所以导致获取的音频参数值是用normal的音频

    参数,音量变大。

    修改方法:

    在aud_audio.c文件中aud_audio_set_volume_req_hdlr函数里修改,去掉红色字体部分的code

    void aud_audio_set_volume_req_hdlr(ilm_struct *ilm_ptr)

    {

    ...

    case AUD_VOLUME_MEDIA:

    if (req_p->apply)

    {

    #ifdef __MED_VID_DEC_MOD__

    if (vid_is_dummy_aud_playing() == KAL_FALSE)

    #endif /* __MED_VID_DEC_MOD__ */

    {

    /* if it's headset mode and output to both earphone & loud speaker, use normal mode

    gain value */

    if (aud_context_p->audio_mode == AUD_MODE_HEADSET &&

    aud_context_p->melody_output_device == AUDIO_DEVICE_SPEAKER_BOTH)

    {

    aud_melody_set_volume_by_mode(VOL_NORMAL, req_p->volume);

    }

    #if defined(TV_OUT_SUPPORT)

    /* TV out is on, and audio output to TV only */

    else if (audio_tv_cable_in &&

    !audio_tv_loud_speaker &&

    aud_context_p->melody_output_device != AUDIO_DEVICE_SPEAKER_BOTH)

    {

    aud_melody_set_volume_by_mode(VOL_TV_OUT, req_p->volume);

    }

    #endif /* TV_OUT_SUPPORT */

    else

    {

    aud_melody_set_volume_by_mode(aud_context_p->audio_mode, req_p->volume);

    }

    current_playing_melody_volume_level = req_p->volume;

    }

    /* disable audio mute when the volume is set again */

    aud_context_p->audio_mute = KAL_FALSE;

    }

    break;

    ...

    #ifdef __ATV_SUPPORT__

    case AUD_VOLUME_ATV:

    /* if it's headset mode and output to both earphone & loud speaker, use normal mode gain

    value */

    if (aud_context_p->audio_mode == AUD_MODE_HEADSET &&

    aud_context_p->melody_output_device == AUDIO_DEVICE_SPEAKER_BOTH)

    {

    aud_atv_set_volume_by_mode(VOL_NORMAL, req_p->volume);

    }

    #if defined(TV_OUT_SUPPORT)

    /* TV out is on, and audio output to TV only */

    else if (audio_tv_cable_in &&

    !audio_tv_loud_speaker &&

    aud_context_p->melody_output_device != AUDIO_DEVICE_SPEAKER_BOTH)

    {

    aud_atv_set_volume_by_mode(VOL_TV_OUT, req_p->volume);

    }

    #endif /* TV_OUT_SUPPORT */

    else

    {

    aud_atv_set_volume_by_mode(aud_context_p->audio_mode, req_p->volume);

    }

    current_playing_melody_volume_level = req_p->volume;

    /* disable audio mute when the volume is set again */

    aud_context_p->audio_mute = KAL_FALSE;

    break;

    #endif /* __ATV_SUPPORT__ */

    ...

    相关文章

      网友评论

          本文标题:着耳机看TV或听MP4时,来闹铃或电话打断后,耳机端声音突然变大

          本文链接:https://www.haomeiwen.com/subject/nlxkvftx.html