zoukankan      html  css  js  c++  java
  • nau8822 codec driver 录音时mic bias 无法自动打开问题

    nau8822 codec driver 录音时mic bias 无法自动打开问题

    问题描述:

    kernel版本:3.10

    在nuc970上测试nau8822驱动时发现,虽然驱动中有如下定义:

    SND_SOC_DAPM_MICBIAS("Mic Bias", NAU8822_POWER_MANAGEMENT_1, 4, 0),

    但在播放录音时始终调不到该操作。

    在route上增加如下路径

    {"Left Boost Mixer", NULL, "Mic Bias"},

    后依然无法调用到Mic Bias。

    分析:

    经测试及查资料发现,是因为SND_SOC_DAPM_MICBIAS在3.10内核中不是起点或终点,所以如果定义mic bias为SND_SOC_DAPM_MICBIAS,它不能位于路径的起点或终点。

    一条完整的dapm音频路径,必然有起点和终点,我们把位于这些起点和终点的widget称之为端点widget。以下这些类型的widget可以成为端点widget:

    codec的输入输出引脚:

    snd_soc_dapm_output

    snd_soc_dapm_input

    外接的音频设备:

    snd_soc_dapm_hp

    snd_soc_dapm_spk

    snd_soc_dapm_line

    音频流(stream domain):

    snd_soc_dapm_adc

    snd_soc_dapm_dac

    snd_soc_dapm_aif_out

    snd_soc_dapm_aif_in

    snd_soc_dapm_dai_out

    snd_soc_dapm_dai_in

    电源、时钟和其它:

    snd_soc_dapm_supply

    snd_soc_dapm_regulator_supply

    snd_soc_dapm_clock_supply

    snd_soc_dapm_kcontrol

    解决方法有2:

    1.构造新的route使bias位于路径的中间,例如:

    {"Left Input Mixer", "Mic Switch", "Mic bias"},

    {"Mic bias", NULL, "LMICN"},

    {"Mic bias", NULL, "LMICP"},

    2.采用新的定义:SND_SOC_DAPM_SUPPLY代替SND_SOC_DAPM_MICBIAS来定义mic bias,具体定义如下:

    SND_SOC_DAPM_SUPPLY("Mic Bias",

    NAU8822_POWER_MANAGEMENT_1, 4, 0, NULL, 0),

    在route定义中增加如下route:

    {"Left Boost Mixer", NULL, "Mic Bias"},

    测试验证:

    只验证了方法2,修改代码后,在nuc970bsp中运行

    /usr/arecord -f S16_LE -r 8000 -c 2 -D plughw:0,0 test.wav

    成功调出mic bias,log如下:

    bash-3.2# /usr/arecord -f S16_LE -r 8000 -c 2 -D plughw:0,0 test.wav

    Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Stereo

    pop test : Queue RMICN: reg=0xffffffff, 0x1/0x1

    pop test : Queue RMICP: reg=0xffffffff, 0x1/0x1

    pop test : Queue LMICN: reg=0xffffffff, 0x1/0x1

    pop test : Queue LMICP: reg=0xffffffff, 0x1/0x1

    pop test : Queue RAUX: reg=0xffffffff, 0x1/0x1

    pop test : Queue R2: reg=0xffffffff, 0x1/0x1

    pop test : Queue LAUX: reg=0xffffffff, 0x1/0x1

    pop test : Queue L2: reg=0xffffffff, 0x1/0x1

    pop test : Queue Mic Bias: reg=0x1, 0x10/0x10

    pop test : Queue Capture: reg=0xffffffff, 0x1/0x1

    pop test : Queue Right Input Mixer: reg=0x2, 0x8/0x8

    pop test : Queue Left Input Mixer: reg=0x2, 0xc/0xc

    pop test : Queue Right Boost Mixer: reg=0x2, 0x20/0x20

    pop test : Queue Left Boost Mixer: reg=0x2, 0x30/0x30

    pop test : Queue Left Capture PGA: reg=0x2d, 0x0/0x40

    pop test : Queue Right Capture PGA: reg=0x2e, 0x0/0x40

    pop test : Queue Right ADC: reg=0x2, 0x2/0x2

    pop test : Queue Left ADC: reg=0x2, 0x3/0x3

  • 相关阅读:
    LAMP 服务器环境
    LAMP 环境搭建
    为何程序员总喜欢写技术博客,看完恍然大悟...
    沉入海底2年的微软数据中心浮出水面:故障率只有陆地上的1/8,除了长点贝类和藻类完全没问题...
    真正毁掉一个人的,是“打工者心态”
    包装严重的 IT 行业,作为面试官,我是如何甄别应聘者的包装程度
    一名测试实习生的心路历程(二)
    7年赚的2个亿,数学家6年就花光了,全砸在自家的房子上
    “蚂蚁牙黑,蚂蚁呀吼”一夜间火遍全网?别忽略了潜在风险
    面试常问的 25+ 个 Linux 命令
  • 原文地址:https://www.cnblogs.com/chuncky/p/4460186.html
Copyright © 2011-2022 走看看