我是靠谱客的博主 舒服心情,最近开发中收集的这篇文章主要介绍android7.1+msm8937双MIC改为单MIC(晓龙相机录像声音小),觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

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

 

我们通过系统采用的hardwareqcomaudioconfigsmsm8937mixer_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>

 

同时新修hardwareqcomaudioconfigsmsm8937msm8937.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

 

 

最后

以上就是舒服心情为你收集整理的android7.1+msm8937双MIC改为单MIC(晓龙相机录像声音小)的全部内容,希望文章能够帮你解决android7.1+msm8937双MIC改为单MIC(晓龙相机录像声音小)所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(71)

评论列表共有 0 条评论

立即
投稿
返回
顶部