zoukankan      html  css  js  c++  java
  • es8323codec调节录播音量大小

    描述:根据客户的需要,设备的录播音量有点小,需要调大一点。查看8323的规格书,发现有些寄存器是可以控制音量大小的。

    1.播放:

    规格书描述:

    可见,数字音量控制衰减信号在0.5分贝,增量从0到-96分贝,写入寄存器的值越大,衰减信号越强声音也就越小。

    驱动代码:sound/soc/codecs/es8323.c

    diff --git a/sound/soc/codecs/es8323.c b/sound/soc/codecs/es8323.c
    index 4323a17..d81b718 100755
    --- a/sound/soc/codecs/es8323.c
    +++ b/sound/soc/codecs/es8323.c
    @@ -851,8 +851,8 @@ static int es8323_probe(struct snd_soc_codec *codec)
            snd_soc_write(codec, 0x16, 0x53);
            snd_soc_write(codec, 0x17, 0x18);       /* I2S-16BIT */
            snd_soc_write(codec, 0x18, 0x02);
    -       snd_soc_write(codec, 0x1A, 0x0A);       /* DAC VOLUME=0DB */
    -       snd_soc_write(codec, 0x1B, 0x0A);
    +       snd_soc_write(codec, 0x1A, 0x03);       /* DAC VOLUME=0DB */
    +       snd_soc_write(codec, 0x1B, 0x03);
            snd_soc_write(codec, 0x26, 0x12);       /* Left DAC TO Left IXER */
            snd_soc_write(codec, 0x27, 0xb8);       /* Left DAC TO Left MIXER */
            snd_soc_write(codec, 0x28, 0x38);

    1A、1B转换为十进制就是26、27这两个寄存器,这里由0X0A改为0X03,播放声音明显有所增强。

    2.录音:

    规格书描述:

     这里我选的值是:ALC stereo,MAXGAIN: 29.5dB,  MINGAIN: +12dB,即11110000,18寄存器初始化时候写值0xf0.

  • 相关阅读:
    maven编译时GBK错误
    生产环境中,通过域名映射ip切换工具SwitchHosts
    Java中的Filter过滤器
    Notepad++远程连接Linux系统
    MySQL 创建帐号和对表的导入导出
    XML 初识
    MySQL 字符集的设置
    C# 委托
    肖申克的救赎
    C#指针 常用手段
  • 原文地址:https://www.cnblogs.com/wmc245376374/p/13088650.html
Copyright © 2011-2022 走看看