dts文件修改:
qcom,audio-routing =
"RX_BIAS", "MCLK",
"LDO_H", "MCLK",
"SPK_OUT", "MCLK",
"SPK_OUT", "EXT_VDD_SPKR",
"Lineout_1 amp", "LINEOUT1",
"Lineout_2 amp", "LINEOUT2",
"AMIC1", "MIC BIAS1 External",
"MIC BIAS1 External", "Handset Mic",
"AMIC2", "MIC BIAS2 External",
"MIC BIAS2 External", "Headset Mic",
"AMIC3", "MIC BIAS1 External",
"MIC BIAS1 External", "ANCRight Headset Mic",
修改对应的Mic名称,如second mic,再在msm8226.c里面修改对应名称的widget。
在build.prop里面设置 ro.qc.sdk.audio.fluencetype=fluence(none,fluence,fluencepro),然后adb push ./build.prop /system/ ; adb shell ; chmod 0644 /system/build.prop ;
跟下代码:
(platform.c)
platform_init() ->property_get("ro.qc.sdk.audio.fluencetype", value, ""); -> else if (!strncmp("fluence", value, sizeof("fluence"))) {my_data->fluence_type = FLUENCE_DUAL_MIC;} ->
platform_get_input_snd_device(); ->
if (out_device & AUDIO_DEVICE_OUT_EARPIECE ||
out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE) {
if (my_data->fluence_type == FLUENCE_NONE ||
my_data->fluence_in_voice_call == false) {
snd_device = SND_DEVICE_IN_HANDSET_MIC;
} else {
snd_device = SND_DEVICE_IN_VOICE_DMIC;
adev->acdb_settings |= DMIC_FLAG;
}
}
return snd_device ;
->
(audio_hw.c)
select_devices(); ->
in_snd_device = platform_get_input_snd_device(adev->platform, usecase->stream.out->devices);
所以最后会把SND_DEVICE_IN_VOICE_DMIC 传给in_snd_device .可在以下log看到;
ALOGD("%s: out_snd_device(%d: %s) in_snd_device(%d: %s)", __func__,
out_snd_device, platform_get_snd_device_name(out_snd_device),
in_snd_device, platform_get_snd_device_name(in_snd_device)); ->const char *platform_get_snd_device_name(snd_device_t snd_device)
{
if (snd_device >= SND_DEVICE_MIN && snd_device < SND_DEVICE_MAX)
return device_table[snd_device];
else
return "";
} ->
device_table[snd_device]就是在platform.h中定义的名称[SND_DEVICE_IN_VOICE_DMIC] = "voice-dmic-ef",
再追下acdb的代码:
enable_snd_device() -> (audio_hw.c)
platform_send_audio_calibration() ->(plaform.c)
acdb_dev_id = acdb_device_table[snd_device];
my_data->acdb_send_audio_cal(acdb_dev_id, acdb_dev_type); ->(acdb-loader.c)
acdb_loader_send_audio_cal();
双mic的验证:
1, mm-audio-ftm 做工厂测试
2,使用tinymix命令
3,使用QACT工具
4,使用QXDM log, 如果是双mic 会抓到如下节点
11-12.15-23.isf.0x158A.pcm.0x140.VPTX_ECNEAR_IN.0x1.tx.wav
11-12.15-23.isf.0x158A.pcm.0x140.VPTX_ECNEAR_IN.0x2.tx.wav
直观听声音就行!
分析:需要打开log文件:
1, echo -n "file wcd9306.c +p" > /sys/kernel/debug/dynamic_debug/control
echo -n "file msm8226.c +p" > /sys/kernel/debug/dynamic_debug/control
echo -n "file soc-dapm.c +p" > /sys/kernel/debug/dynamic_debug/control
2,#define LOG_NDEBUG 0 分别在platform.c和audio_hw.c