android7.1+msm8937双MIC改为单MIC(晓龙相机录像声音小)
发布日期:2021-06-30 21:58:54 浏览次数:2 分类:技术文章

本文共 5523 字,大约阅读时间需要 18 分钟。

android7.1+msm8937双MIC改为单MIC(晓龙相机录像声音小)

 

1.    问题背景

晓龙相机录像的时候,回播视频发现外放声音非常小,但如果用耳机来听则正常。

2.    产品和参考设计MIC的差别

 

我们产品

开发板

MIC_IN1_P/M

主MIC

主MIC

MIC_IN2_P/M

耳机

耳机

MIC_IN3_P/M

NC

副MIC

 

3.    录音时抓log和分析

录像的时候用logcat | grep snd_device抓log,如下

01-03 06:15:41.267   704 1035 D audio_hw_primary: select_devices: out_snd_device(2: speaker)in_snd_device(0: )

01-03 06:15:41.267   704 1035 D msm8916_platform: platform_can_split_snd_device: snd_device(2)num devices(1) new_snd_devices(5)

01-03 06:15:41.267   704 1035 I msm8916_platform: platform_check_and_set_codec_backend_cfg: becf:new_snd_devices[0] is speaker

01-03 06:15:41.267   704 1035 E msm8916_platform: platform_check_backends_match: Invalidsnd_device =

01-03 06:15:41.267   704 1035 D msm8916_platform: platform_can_split_snd_device: snd_device(2)num devices(0) new_snd_devices(0)

01-03 06:15:41.267   704 1035 D audio_hw_primary: enable_snd_device: snd_device(2: speaker)

01-03 06:15:41.309   704 1035 D msm8916_platform: platform_can_split_snd_device: snd_device(2)num devices(1) new_snd_devices(-299367304)

01-03 06:15:44.810   704 1035 D audio_hw_primary: disable_snd_device: snd_device(2: speaker)

01-03 06:15:44.810   704 1035 D msm8916_platform: platform_can_split_snd_device: snd_device(2)num devices(0) new_snd_devices(0)

01-03 06:15:53.127   704 1035 D audio_hw_primary: select_devices: out_snd_device(2: speaker)in_snd_device(0: )

01-03 06:15:53.127   704 1035 D msm8916_platform: platform_can_split_snd_device: snd_device(2)num devices(1) new_snd_devices(6)

01-03 06:15:53.127   704 1035 I msm8916_platform: platform_check_and_set_codec_backend_cfg: becf:new_snd_devices[0] is speaker

01-03 06:15:53.127   704 1035 E msm8916_platform: platform_check_backends_match: Invalidsnd_device =

01-03 06:15:53.128   704 1035 D msm8916_platform: platform_can_split_snd_device: snd_device(2)num devices(0) new_snd_devices(0)

01-03 06:15:53.128   704 1035 D audio_hw_primary: enable_snd_device: snd_device(2: speaker)

01-03 06:15:53.152   704 1035 D msm8916_platform: platform_can_split_snd_device: snd_device(2)num devices(1) new_snd_devices(-299367304)

01-03 06:15:57.753   704 1035 D audio_hw_primary: disable_snd_device: snd_device(2: speaker)

01-03 06:15:57.753   704 1035 D msm8916_platform: platform_can_split_snd_device: snd_device(2)num devices(0) new_snd_devices(0)

01-03 06:18:01.804   704 1035 D audio_hw_primary: select_devices: out_snd_device(2: speaker)in_snd_device(0: )

01-03 06:18:01.805   704 1035 D msm8916_platform: platform_can_split_snd_device: snd_device(2)num devices(1) new_snd_devices(8)

01-03 06:18:01.805   704 1035 I msm8916_platform: platform_check_and_set_codec_backend_cfg: becf:new_snd_devices[0] is speaker

01-03 06:18:01.805   704 1035 E msm8916_platform: platform_check_backends_match: Invalidsnd_device =

01-03 06:18:01.805   704 1035 D msm8916_platform: platform_can_split_snd_device: snd_device(2)num devices(0) new_snd_devices(0)

01-03 06:18:01.805   704 1035 D audio_hw_primary: enable_snd_device: snd_device(2: speaker)

01-03 06:18:01.838   704 1035 D msm8916_platform: platform_can_split_snd_device: snd_device(2)num devices(1) new_snd_devices(-299367304)

01-03 06:18:10.213   704 1035 D audio_hw_primary: disable_snd_device: snd_device(2: speaker)

01-03 06:18:10.213   704 1035 D msm8916_platform: platform_can_split_snd_device: snd_device(2)num devices(0) new_snd_devices(0)

01-03 06:18:10.294   704 3960 Daudio_hw_primary: select_devices: out_snd_device(0: ) in_snd_device(87:handset-stereo-dmic-ef)

01-03 06:18:10.295   704 3960 D msm8916_platform: platform_can_split_snd_device: snd_device(87)num devices(0) new_snd_devices(0)

01-03 06:18:10.295   704 3960 D audio_hw_primary: enable_snd_device: snd_device(87:handset-stereo-dmic-ef)

01-03 06:18:10.331   704 3960 D msm8916_platform: platform_can_split_snd_device: snd_device(87)num devices(1) new_snd_devices(-350227112)

01-03 06:18:10.519   704 1035 D audio_hw_primary: select_devices: out_snd_device(2: speaker)in_snd_device(0: )

01-03 06:18:10.519   704 1035 D msm8916_platform: platform_can_split_snd_device: snd_device(2)num devices(1) new_snd_devices(18)

01-03 06:18:10.519   704 1035 I msm8916_platform: platform_check_and_set_codec_backend_cfg: becf:new_snd_devices[0] is speaker

通过红色部分关键内容D audio_hw_primary:select_devices: out_snd_device(0: ) in_snd_device(87: handset-stereo-dmic-ef)可知录音的时候用到了副MIC(也就是snd_device),对应的设备名称为handset-stereo-dmic-ef

 

我们通过系统采用的hardware\qcom\audio\configs\msm8937\mixer_paths_qrd_sku2.xml文件,查看handset-stereo-dmic-ef的内容如下:

<pathname="handset-stereo-dmic-ef">

       <path name="speaker-dmic-endfire" />

</path>

可知handset-stereo-dmic-ef调用了speaker-dmic-endfire,接着看speaker-dmic-endfire

   <!-- Dual MIC devices -->

   <path name="speaker-dmic-endfire">

       <path name="adc1" />

       <ctl name="DEC2 MUX" value="ADC2" />

       <ctl name="MI2S_TX Channels" value="Two" />

       <ctl name="ADC2 MUX" value="INP3" />

</path>

可知采用的是双升到,要改为单MIC,修改后如下:

<pathname="speaker-dmic-endfire">

       <path name="adc1" />

</path>

 

同时新修hardware\qcom\audio\configs\msm8937\msm8937.mk下相关内容,修改前如下:

##fluencetype can be "fluence" or"fluencepro" or "none"

PRODUCT_PROPERTY_OVERRIDES += \

ro.qc.sdk.audio.fluencetype=fluence\

persist.audio.fluence.voicecall=true\

persist.audio.fluence.voicerec=false\

persist.audio.fluence.audiorec=true\

persist.audio.fluence.speaker=true

 

改后

##fluencetype can be "fluence" or"fluencepro" or "none"

PRODUCT_PROPERTY_OVERRIDES += \

ro.qc.sdk.audio.fluencetype=none\

#ro.qc.sdk.audio.fluencetype=fluence\

persist.audio.fluence.voicecall=true\

persist.audio.fluence.voicerec=false\

#persist.audio.fluence.audiorec=true\

persist.audio.fluence.speaker=true

 

 

转载地址:https://loongembedded.blog.csdn.net/article/details/80088055 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:android_N项目(高通平台 CTS修改总结
下一篇:高通8xxx平台双MIC设置

发表评论

最新留言

做的很好,不错不错
[***.243.131.199]2024年04月07日 09时33分34秒