高通8xxx平台双MIC设置

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值