This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TLV320AIC3262:将 audiocodec 设置为主器件

Guru**** 2380720 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/audio-group/audio/f/audio-forum/1357348/tlv320aic3262-setting-audiocodec-as-master

器件型号:TLV320AIC3262

为了将 Audiocodec 配置为主机,我们修改了 DTS,但仍然没有声音在播放从 arecord 命令录制的声音后:- arecord -r 16000测试

这是 SOC 是主设备时3262 audiocodec 设备以前的 DTS 节点条目( 在此播放命令中,可以播放以上 arecord 命令录制的声音。 ):-

sound0: sound0 {
compatible = "simple-audio-card";
simple-audio-card,name = "BeagleBoard-X15";

simple-audio-card,format = "dsp_b";
simple-audio-card,bitclock-master = <&cpu_dai>;
simple-audio-card,frame-master = <&cpu_dai>;
simple-audio-card,bitclock-inversion;

cpu_dai: simple-audio-card,cpu {
sound-dai = <&mcasp3>;
clocks = <&clkout2_clk>;
system-clock-id = <MCASP_CLK_HCLK_AUXCLK>;

};

sound0_master: simple-audio-card,codec {
sound-dai = <&tlv320aic3262>;
clocks = <&clkout2_clk>;

};
};


这是修改后的 DTS 条目、如下所示:

sound0: sound0 {
compatible = "simple-audio-card";
simple-audio-card,name = "BeagleBoard-X15";

simple-audio-card,format = "dsp_b";
simple-audio-card,bitclock-master = <&sound0_master>;
simple-audio-card,frame-master = <&sound0_master>;
simple-audio-card,bitclock-inversion;

cpu_dai: simple-audio-card,cpu {
sound-dai = <&mcasp3>;
clocks = <&clkout2_clk>;
system-clock-id = <MCASP_CLK_HCLK_AUXCLK>;

};

sound0_master: simple-audio-card,codec {
sound-dai = <&tlv320aic3262>;
clocks = <&clkout2_clk>;
system-clock-frequency=<22579200>;
system-clock-direction-out;
};
};

我们还缺少什么?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嗨、Guy

    您将从何处获得 aic3262驱动程序代码?

    您会是如此善良并共享运行时日志吗?

    我有一个关于你的新 DTS 设置的问题:因为 aic3262已经被设置为主:

    simple-audio-card、bitclock-master =<&sound0_MASTER>;
    simple-audio-card、frame-master =<&sound0_MASTER>;

    为什么仍然需要  CPU_dai 的时钟和系统时钟 ID:simple-audio-card、cpu?

    希望以下链接可以为您提供帮助。

    (+) TLV320AIC3262:TLV320AIC3262配置为主模式-音频论坛-音频- TI E2E 支持论坛

    (+) TLV320AIC3262:AIC3262 I2S 配置问题-音频论坛-音频- TI E2E 支持论坛

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    1、GitHub 的驱动程序代码被移植使用。 源链接如下所示:

    https://github.com/bigbiff/kernel_asus_tf700t/blob/master/sound/soc codecs/tlv320aic326x.h

    https://github.com/bigbiff/kernel_asus_tf700t/blob/master/sound/soc codecs/tlv320aic326x.c

    2.插入设备驱动程序时 dmesg 的输出如下所示。

    [  121.410195] #aic3x_i2c_probe: Entered
    [  121.414464] #aic3x_i2c_probe: Done ret 0
    [  121.419382] of_get_named_gpiod_flags: can't parse 'simple-audio-card,hp-det-gpio' property of node '/sound0[0]'
    [  121.419396] of_get_named_gpiod_flags: can't parse 'simple-audio-card,mic-det-gpio' property of node '/sound0[0]'
    [  121.419452] #aic3262_probe: Invoked..
    [  121.423133] #reg_def_conf: Invoked..
    [  121.457930] #reg_def_conf: Done..
    [  121.461506] #aic3262_probe: I2C IRQ Configuration is Wrong. 			Please check it..
    [  121.469032] #aic3262_asi_default_config: Invoked. Will Config ASI Registers to Defaults..
    [  121.477374] #aic3262_set_bias_level: Codec Active 0[0]
    [  121.483177] aic3262_add_controls++
    [  121.486814] #Completed adding new dapm widget controls size=40
    [  121.492795] aic3262-codec 3-0018: Control not supported for path IN1L -> [IN1L Route] -> Left ADC
    [  121.501726] aic3262-codec 3-0018: ASoC: no dapm match for IN1L --> IN1L Route --> Left ADC
    [  121.510091] aic3262-codec 3-0018: ASoC: Failed to add route IN1L -> IN1L Route -> Left ADC
    [  121.518617] aic3262-codec 3-0018: Control not supported for path IN2L -> [IN2L Route] -> Left ADC
    [  121.527604] aic3262-codec 3-0018: ASoC: no dapm match for IN2L --> IN2L Route --> Left ADC
    [  121.535935] aic3262-codec 3-0018: ASoC: Failed to add route IN2L -> IN2L Route -> Left ADC
    [  121.544441] aic3262-codec 3-0018: Control not supported for path IN3L -> [IN3L Route] -> Left ADC
    [  121.553420] aic3262-codec 3-0018: ASoC: no dapm match for IN3L --> IN3L Route --> Left ADC
    [  121.561780] aic3262-codec 3-0018: ASoC: Failed to add route IN3L -> IN3L Route -> Left ADC
    [  121.570112] aic3262-codec 3-0018: Control not supported for path IN4L -> [IN4L Route] -> Left ADC
    [  121.579070] aic3262-codec 3-0018: ASoC: no dapm match for IN4L --> IN4L Route --> Left ADC
    [  121.587368] aic3262-codec 3-0018: ASoC: Failed to add route IN4L -> IN4L Route -> Left ADC
    [  121.595727] aic3262-codec 3-0018: Control not supported for path IN1R -> [IN1R Route] -> Right ADC
    [  121.604739] aic3262-codec 3-0018: ASoC: no dapm match for IN1R --> IN1R Route --> Right ADC
    [  121.613183] aic3262-codec 3-0018: ASoC: Failed to add route IN1R -> IN1R Route -> Right ADC
    [  121.621586] aic3262-codec 3-0018: Control not supported for path IN2R -> [IN2R Route] -> Right ADC
    [  121.630640] aic3262-codec 3-0018: ASoC: no dapm match for IN2R --> IN2R Route --> Right ADC
    [  121.639042] aic3262-codec 3-0018: ASoC: Failed to add route IN2R -> IN2R Route -> Right ADC
    [  121.647465] aic3262-codec 3-0018: Control not supported for path IN3R -> [IN3R Route] -> Right ADC
    [  121.656494] aic3262-codec 3-0018: ASoC: no dapm match for IN3R --> IN3R Route --> Right ADC
    [  121.664929] aic3262-codec 3-0018: ASoC: Failed to add route IN3R -> IN3R Route -> Right ADC
    [  121.673376] aic3262-codec 3-0018: Control not supported for path IN4R -> [IN4R Route] -> Right ADC
    [  121.682441] aic3262-codec 3-0018: ASoC: no dapm match for IN4R --> IN4R Route --> Right ADC
    [  121.690881] aic3262-codec 3-0018: ASoC: Failed to add route IN4R -> IN4R Route -> Right ADC
    [  121.699322] #Completed adding DAPM routes
    [  121.703356] #Completed updating dapm
    [  121.707174] #aic3262_probe: done..
    [  121.710689] #aic3262_multi_i2s_set_dai_sysclk: DAI ID 1 Freq 22579200 Direction 0
    [  121.718312] aic3262_multi_i2s_asi1_set_dai_fmt: DAI_ID 1 fmt 4869
    [  121.724729] #aic3262_multi_i2s_asi1_set_dai_fmt: Configuring ASI1 as Frame Master..
    [  121.732449] #aic3262_multi_i2s_asi1_set_dai_fmt: Configuring ASI1 for DSP_B Mode..
    [  121.741273] asoc-simple-card sound0: aic3262-asi1 <-> 48468000.mcasp mapping ok
    [  121.748631] asoc-simple-card sound0: ASoC: no DMI vendor name!
    [  121.755291] #aic3262_set_bias_level: Codec Active 0[0]
    
    

    3. DTS 更改如我在 PREV 帖子中所述。 除了这些之外,驱动程序会发生变化,正如我们在另一个相关查询中所建议的: https://e2e.ti.com/support/audio-group/audio/f/audio-forum/1356927/tlv320aic3262-configure-wclk/5175612#5175612 by  , 亦按以下方式注册:  

    diff --git soc a/sound/soci codecs/tlv320aic3x.c b/sound/sound/tlv320aic326x.c soc
    索引1ca2dd1..3183432 100644
    ---Sound soc codecs/tlv320aic326x.c
    ++ b/sound/solic/c11gcodecs/tlv320aic326x.c soc
    @@-1235,7 +1235,7 @@静态常量结构 aic3262_rate_divs aic3262_divs[]={
    {{0、60、1}、{0、61、 1}}}}、
    {15000,000,11025、1、4、96、 128、8、6128、8、 6、4、
    {{0、60、1}、{0、61、 1}}}}、
    -{22579,200,11025、1、37632、 128、4、4128、4、 4、4、
    +{22579,200,11025、1、65307、 128、3、12,128、3、 12、4、
    {{0、60、1}、{0、61、 1}}}}、
    {11289,600,11025、1、37632、 128、4、2128、4、 2、4、
    {{0、60、1}、{0、61、 1}}}}、
    @@-1254、7 +1254、8 @@静态常量结构 aic3262_rate_divs aic3262_divs[]={
    {10000,000,16000、1、4、96、 128、8、6128、8、 6、4、
    {{0、60、1}、{0、61、 1}}}}、

    -
    +{22579,200,16000、1、65307、 128、3、12,128、3、 12、4、
    +{0、60、1}、{0、61、 1}}}}、
    {15000,000,16000、1、4、96、 128、8、6128、8、 6、4、
    {{0、60、1}、{0、61、 1}}}}、

    @@-2307,6+2308,8 @@ static int aic3262_multi_I2S_hw_params (struct snd_pcm_Substream * Substream,

    i = aic3262_get_divs (aic3262->SYSCLK、params_rate (参数));

    I2C_verify_book0 (分量);

    @@-2828、7 + 2831、10 @@静态常量结构 aic3262_configs aic3262_reg_init[]={
    {0、REF_PWR_DLY、0x01}、

    //时钟初始化
    -{0、DAC_ADC_CLKIN_REG、0x00}、/* DAC ADC CLKIN*/
    +//{0、DAC_ADC_CLKIN_REG、0x00}、/* DAC ADC CLKIN*/
    +{0、DAC_ADC_CLKIN_REG、0x33}、/* DAC ADC CLKIN*/
    +{0、PLL_CKIN_DIV、0x02}、/* PLL_CLKIN 分频器*/
    +

    4. AUDIOCODEC 寄存器设置:

    4.1在 从麦克风进行录音之前设置了以下寄存器。

    #ASI 配置
    /usr/sbin/i2cset -f -y 3 0x18 0x00 0x04

    /usr/sbin/i2cset -f -y 3 0x18 0x0a 0x24

    4.2在从麦克风录音时设置了以下寄存器。

    /usr/sbin/i2cset -f -y 3 0x18 0x00 0x00
    /usr/sbin/i2cset -f -y 3 0x18 0x0c 0x8c
    /usr/sbin/i2cset -f -y 3 0x18 0x00 0x04
    /usr/sbin/i2cset -f -y 3 0x18 0x0c 0x88

    5.示波器的时钟验证:-

    在设置4.1和4.2中提到的寄存器后、探测了 WCLK 和 BCLK。 它们的值后来被证明为 16kHz 和256kHz  
    和-90度。 根据我们的理解、使用6中提到的命令以16kHz 采样率录制音频似乎是可以的:-

     

    6. arecord 用于验证麦克风: 用于录制的命令 是:-

    ARecord -r 16000 -f S16_LE 测试16

    然后在使用 aplay 播放 test16时,播放速度比实际速度速度慢(速度)。 如何解决该问题?

    用于 播放录制文件的命令是:-

    aplay -r 16000 -f S16_LE 测试16

     

    ------------------ -------------------------------------------------------------------------------------------------------------

    为什么  CPU_dai 仍然需要时钟和系统时钟-id:simple-audio-card,cpu?

    即使 从 DTS 删除这些(时钟和系统时钟 ID)条目、也会观察到上述第6点所述的相同行为。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    内核版本是什么、请转储所有寄存器。

    还请将录制的音频剪辑上传到此处。 我将检查位流。