mt6735 MIC 音量的调整及原理介绍
时间:10-02
整理:3721RD
点击:
[DESCRIPTION]
MIC 音量的调整及原理介绍
[SOLUTION]
audio_ver1_volume_custom_default.h
#define VER1_AUD_VOLUME_MIC \
64,112,192,144,192,192,184,184,184,184,184,0,0,0,0,\
255,192,192,180,192,192,196,184,184,184,184,0,0,0,0,\
255,208,208,180,255,208,196,0,0,0,0,0,0,0,0,\
255,208,208,164,255,208,172,0,0,0,0,0,0,0,0
enum VolumeMode
{
VOLUME_NORMAL_MODE = 0,
VOLUME_HEADSET_MODE,
VOLUME_SPEAKER_MODE,
VOLUME_HEADSET_SPEAKER_MODE,
NUM_OF_VOL_MODE
};
上面四种Mode,每一行代表一种Mode,可以在上面数组中调整值。
然后会在AudiomtkVolumeController.cpp代码中写死index.(基本上都是3或4),所以有些值修改没用。(各个版本文件稍有区别)
//-----MIC VOLUME SETTING
ALOGD(" not define MTK_AUDIO_GAIN_TABLE_SUPPORT");
degradegain = (unsigned char)MampUplinkGain(mVolumeParam.audiovolume_mic[VOLUME_NORMAL_MODE][4]);
SetULTotalGain(Idle_Normal_Record, mVolumeParam.audiovolume_mic[VOLUME_NORMAL_MODE][4]);
SetMicGain(Idle_Normal_Record, degradegain);
degradegain = (unsigned char)MampUplinkGain(mVolumeParam.audiovolume_mic[VOLUME_HEADSET_MODE][4]);
SetULTotalGain(Idle_Headset_Record, mVolumeParam.audiovolume_mic[VOLUME_HEADSET_MODE][4]);
SetMicGain(Idle_Headset_Record, degradegain);
degradegain = (unsigned char)MampUplinkGain(mVolumeParam.audiovolume_mic[VOLUME_NORMAL_MODE][3]);
SetULTotalGain(Normal_Mic, mVolumeParam.audiovolume_mic[VOLUME_NORMAL_MODE][3]);
SetMicGain(Normal_Mic, degradegain);
degradegain = (unsigned char)MampUplinkGain(mVolumeParam.audiovolume_mic[VOLUME_HEADSET_MODE][3]);
SetULTotalGain(Headset_Mic, mVolumeParam.audiovolume_mic[VOLUME_HEADSET_MODE][3]);
SetMicGain(Headset_Mic, degradegain);
degradegain = (unsigned char)MampUplinkGain(mVolumeParam.audiovolume_mic[VOLUME_SPEAKER_MODE][3]);
SetULTotalGain(Handfree_Mic, mVolumeParam.audiovolume_mic[VOLUME_SPEAKER_MODE][3]);
SetMicGain(Handfree_Mic, degradegain);
degradegain = (unsigned char)MampUplinkGain(mVolumeParam.audiovolume_mic[VOLUME_NORMAL_MODE][0]);
SetULTotalGain(TTY_CTM_Mic, mVolumeParam.audiovolume_mic[VOLUME_NORMAL_MODE][0]);
SetMicGain(TTY_CTM_Mic , degradegain);
所以有两种方法可以根据不同的Mode调整MIC音量,一个是调整数组或相应nvram的值,其次是修改代码中写死的index值.
MIC 音量的调整及原理介绍
[SOLUTION]
audio_ver1_volume_custom_default.h
#define VER1_AUD_VOLUME_MIC \
64,112,192,144,192,192,184,184,184,184,184,0,0,0,0,\
255,192,192,180,192,192,196,184,184,184,184,0,0,0,0,\
255,208,208,180,255,208,196,0,0,0,0,0,0,0,0,\
255,208,208,164,255,208,172,0,0,0,0,0,0,0,0
enum VolumeMode
{
VOLUME_NORMAL_MODE = 0,
VOLUME_HEADSET_MODE,
VOLUME_SPEAKER_MODE,
VOLUME_HEADSET_SPEAKER_MODE,
NUM_OF_VOL_MODE
};
上面四种Mode,每一行代表一种Mode,可以在上面数组中调整值。
然后会在AudiomtkVolumeController.cpp代码中写死index.(基本上都是3或4),所以有些值修改没用。(各个版本文件稍有区别)
//-----MIC VOLUME SETTING
ALOGD(" not define MTK_AUDIO_GAIN_TABLE_SUPPORT");
degradegain = (unsigned char)MampUplinkGain(mVolumeParam.audiovolume_mic[VOLUME_NORMAL_MODE][4]);
SetULTotalGain(Idle_Normal_Record, mVolumeParam.audiovolume_mic[VOLUME_NORMAL_MODE][4]);
SetMicGain(Idle_Normal_Record, degradegain);
degradegain = (unsigned char)MampUplinkGain(mVolumeParam.audiovolume_mic[VOLUME_HEADSET_MODE][4]);
SetULTotalGain(Idle_Headset_Record, mVolumeParam.audiovolume_mic[VOLUME_HEADSET_MODE][4]);
SetMicGain(Idle_Headset_Record, degradegain);
degradegain = (unsigned char)MampUplinkGain(mVolumeParam.audiovolume_mic[VOLUME_NORMAL_MODE][3]);
SetULTotalGain(Normal_Mic, mVolumeParam.audiovolume_mic[VOLUME_NORMAL_MODE][3]);
SetMicGain(Normal_Mic, degradegain);
degradegain = (unsigned char)MampUplinkGain(mVolumeParam.audiovolume_mic[VOLUME_HEADSET_MODE][3]);
SetULTotalGain(Headset_Mic, mVolumeParam.audiovolume_mic[VOLUME_HEADSET_MODE][3]);
SetMicGain(Headset_Mic, degradegain);
degradegain = (unsigned char)MampUplinkGain(mVolumeParam.audiovolume_mic[VOLUME_SPEAKER_MODE][3]);
SetULTotalGain(Handfree_Mic, mVolumeParam.audiovolume_mic[VOLUME_SPEAKER_MODE][3]);
SetMicGain(Handfree_Mic, degradegain);
degradegain = (unsigned char)MampUplinkGain(mVolumeParam.audiovolume_mic[VOLUME_NORMAL_MODE][0]);
SetULTotalGain(TTY_CTM_Mic, mVolumeParam.audiovolume_mic[VOLUME_NORMAL_MODE][0]);
SetMicGain(TTY_CTM_Mic , degradegain);
所以有两种方法可以根据不同的Mode调整MIC音量,一个是调整数组或相应nvram的值,其次是修改代码中写死的index值.
路过!