修改mic录音播放音量太小 & MODE_IN_COMMUNICATION模式的声音大小 问题(MTK)

vendor/mediatek/proprietary/hardware/audio/mt8127/aud_drv/AudioALSAVolumeController.cpp

@@ -1418,6 +1418,9 @@ void AudioALSAVolumeController::ApplyAmpGain(int Gain, uint32_t mode, uint32_t d
     // set line out buffer to 0Db.
     SetLinoutLGain(LINE_OUT_BUFFER_ODB_INDEX);
     SetLinoutRGain(LINE_OUT_BUFFER_ODB_INDEX);
+    if( device == 15 ){
+          DegradedBGain = 4;
+       }
     SetSpeakerGain(DegradedBGain);
 }


--- a/kernel-3.18/sound/soc/mediatek/mt_soc_audio_8127/mt_soc_codec_63xx.c
+++ b/kernel-3.18/sound/soc/mediatek/mt_soc_audio_8127/mt_soc_codec_63xx.c
@@ -2215,13 +2215,15 @@ void SetMicPGAGain(void)
        if (index > index2)
                index = index2;
        /* const int PreAmpGain[] = {-6, 0, 6, 12, 18, 24}; */
-       pmic_set_ana_reg(AUDTOP_CON0, index << 4, 0x00000070);
+       //pmic_set_ana_reg(AUDTOP_CON0, index << 4, 0x00000070);
+       pmic_set_ana_reg(AUDTOP_CON0, 5 << 4, 0x00000070);
        /* set mic2 PGA gain */
        index = mCodec_data->mAudio_Ana_Volume[AUDIO_ANALOG_VOLUME_MICAMP2];
        pr_debug("%s(), mic2 index = %d, index2 = %d\n", __func__, index, index2);
        if (index > index2)
                index = index2;
-       pmic_set_ana_reg(AUDTOP_CON1, index << 8, 0x00000700);
+       //pmic_set_ana_reg(AUDTOP_CON1, index << 8, 0x00000700);
+       pmic_set_ana_reg(AUDTOP_CON1, 5 << 8, 0x00000700);
 }
 
 static bool GetAdcStatus(void)

你可能感兴趣的:(android)