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.

【紧急求助】海思3559驱动TLV320AIC3101 采集音频没有数据,配置是否正确

Other Parts Discussed in Thread: TLV320AIC31, TLV320AIC3101, TLV320AIC3100

电路图如上:

配置参数如下:

tlv320aic31_write(IIC_device_addr[chip_num], 2, 0xaa);
tlv320aic31_write(IIC_device_addr[chip_num], 3, 0x10);
tlv320aic31_write(IIC_device_addr[chip_num], 7, 0x0a);
tlv320aic31_write(IIC_device_addr[chip_num], 8, 0xf0);
tlv320aic31_write(IIC_device_addr[chip_num], 9, 0x07);
tlv320aic31_write(IIC_device_addr[chip_num], 12, 0x50);
tlv320aic31_write(IIC_device_addr[chip_num], 14, 0x80);
tlv320aic31_write(IIC_device_addr[chip_num], 15, 0x00);
tlv320aic31_write(IIC_device_addr[chip_num], 16, 0x00);
tlv320aic31_write(IIC_device_addr[chip_num], 17, 0x0f);
tlv320aic31_write(IIC_device_addr[chip_num], 18, 0xf0);
tlv320aic31_write(IIC_device_addr[chip_num], 19, 0x04);
tlv320aic31_write(IIC_device_addr[chip_num], 24, 0x04);
//tlv320aic31_write(IIC_device_addr[chip_num], 22, 0x78);
tlv320aic31_write(IIC_device_addr[chip_num], 25, 0x40);
tlv320aic31_write(IIC_device_addr[chip_num], 37, 0xE0);
tlv320aic31_write(IIC_device_addr[chip_num], 38, 0x14);
tlv320aic31_write(IIC_device_addr[chip_num], 40, 0x80);
tlv320aic31_write(IIC_device_addr[chip_num], 41, 0x01);
tlv320aic31_write(IIC_device_addr[chip_num], 42, 0xA8);
tlv320aic31_write(IIC_device_addr[chip_num], 43, 0x00);
tlv320aic31_write(IIC_device_addr[chip_num], 44, 0x00);
tlv320aic31_write(IIC_device_addr[chip_num], 47, 0x80);
tlv320aic31_write(IIC_device_addr[chip_num], 51, 0x9f);
tlv320aic31_write(IIC_device_addr[chip_num], 64, 0x80);
tlv320aic31_write(IIC_device_addr[chip_num], 65, 0x9f);
tlv320aic31_write(IIC_device_addr[chip_num], 102, 0x32);

3559采集端的配置如下:

stACapAttr.enAudioMode = HI_MPP_AUDIO_MODE_I2S_SLAVE; /* I2S 从模式 */
stACapAttr.enBitwidth = HI_MPP_AUDIO_BITWIDTH_16; /* Bit width is 16 bits */
stACapAttr.enSampleRate = HI_MPP_AUDIO_SAMPLE_RATE_48;  /* 48K Sample rate */
stACapAttr.enSoundMode = HI_MPP_AUDIO_SOUND_MODE_STEREO; /* 立体声 */
stACapAttr.u32PtNumPerFrm = 1024; /* 每帧采样点个数 */

TLV320AIC3101一端的I2S配置成主模式,采集端3559是不是就应该配置成从模式。

请帮忙确认下,以上电路和配置是不是匹配,我现在采集出来,没有声音。I2S的MCLK有时钟12M多。sample rate是否匹配?

  • 还是自己来回复吧,排除掉硬件方面的问题之后,因为mic接法不一样,配置需要改,配置如下:

    /*soft reset*/
    tlv320aic31_write(IIC_device_addr[chip_num],0x1,0x80);
    msleep(10);
    /*CLKDIV_IN uses MCLK*/
    tlv320aic31_write(IIC_device_addr[chip_num], 102, 0x32);

    #if 1
    /*PLL disable and select Q value*/
    tlv320aic31_write(IIC_device_addr[chip_num], 3, 0x10);
    #else
    /*PLL enable */
    tlv320aic31_write(IIC_device_addr[chip_num], 3, 0x82);/* P=2 */
    tlv320aic31_write(IIC_device_addr[chip_num], 4, 0x1c);/* J=28 */
    tlv320aic31_write(IIC_device_addr[chip_num], 5, 0x2c);
    tlv320aic31_write(IIC_device_addr[chip_num], 6, 0x8);/* reg 5 and 6 set D=2818*/
    tlv320aic31_write(IIC_device_addr[chip_num], 11, 0x1);/* R=1 */
    #endif


    /*left and right DAC open*/
    tlv320aic31_write(IIC_device_addr[chip_num], 7, 0xa);/* FSref = 48 kHz */

    /*sample*/
    tlv320aic31_write(IIC_device_addr[chip_num], 2, 0xaa);/* FS = FSref/6 */

    /*ctrl mode*/
    tlv320aic31_write(IIC_device_addr[chip_num], 8, 0x30);/* master mode */

    /*Audio Serial Data Interface Control*/
    //tlv320aic31_write(IIC_device_addr[chip_num], 9, 0x7);/* I2S mode,16bit */
    tlv320aic31_write(IIC_device_addr[chip_num], 9, 0x0);/* I2S mode,16bit */
    /*Audio Codec Digital Filter Control Register*/
    tlv320aic31_write(IIC_device_addr[chip_num], 12, 0x50);

    //tlv320aic31_write(IIC_device_addr[chip_num], 25, 0x0);
    tlv320aic31_write(IIC_device_addr[chip_num], 25, 0xC0);
    tlv320aic31_write(IIC_device_addr[chip_num], 17, 0xff);
    tlv320aic31_write(IIC_device_addr[chip_num], 18, 0xff);

    tlv320aic31_write(IIC_device_addr[chip_num], 15, 0x0);
    tlv320aic31_write(IIC_device_addr[chip_num], 16, 0x0);
    //tlv320aic31_write(IIC_device_addr[chip_num], 19, 0x7c);
    //tlv320aic31_write(IIC_device_addr[chip_num], 22, 0x7c);

    tlv320aic31_write(IIC_device_addr[chip_num], 19, 0x04);
    tlv320aic31_write(IIC_device_addr[chip_num], 22, 0x04);
    tlv320aic31_write(IIC_device_addr[chip_num], 24, 0x78);
    tlv320aic31_write(IIC_device_addr[chip_num], 21, 0x78);

    tlv320aic31_write(IIC_device_addr[chip_num], 28, 0x0);
    tlv320aic31_write(IIC_device_addr[chip_num], 31, 0x0);

    /*out ac-coupled*/
    tlv320aic31_write(IIC_device_addr[chip_num], 14, 0x80);

    /*left and right DAC power on*/
    tlv320aic31_write(IIC_device_addr[chip_num], 37, 0xe0);

    /*out common-mode voltage*/
    tlv320aic31_write(IIC_device_addr[chip_num], 40, 0x80);

    /*out path select*/
    tlv320aic31_write(IIC_device_addr[chip_num], 41, 0x0);

    /*DTS2014123002762 œ«Æô¶¯ÑÓʱÓÉ2sžÄΪ200ms*/
    tlv320aic31_write(IIC_device_addr[chip_num], 42, 0x78);

    /*left DAC not muted*/
    tlv320aic31_write(IIC_device_addr[chip_num], 43, 0x0);

    /*right DAC not muted*/
    tlv320aic31_write(IIC_device_addr[chip_num], 44, 0x0);

    tlv320aic31_write(IIC_device_addr[chip_num], 47, 0x80);

    /*HPLOUT is not muted*/
    tlv320aic31_write(IIC_device_addr[chip_num], 51, 0x9f);

    tlv320aic31_write(IIC_device_addr[chip_num], 64, 0x80);
    /*HPROUT is not muted*/
    tlv320aic31_write(IIC_device_addr[chip_num], 65, 0x9f);

    /*out short circuit protection*/
    tlv320aic31_write(IIC_device_addr[chip_num], 38, 0x3e);

  • 你好。我也在做这颗芯片,不过是TLV320AIC3100+3536.我查看了sdk里面的驱动,是TLV320AIC31,驱动应该不适用于300.官网提供的是基于alsa,设备树的驱动,而我的系统 采用gpio模拟i2c。所以想请教一下你的驱动是哪个,还是需要自己去移植。谢谢
  • 我是使用的海思的驱动,然后自己修改的,也是使用的gpio模拟i2c,主要要看看i2c总线的波形,tlv320aic3100有没有ack,如果没有ack那就是硬件有问题,有了ack,如果还不能工作,那就是配置参数的问题。
  • 3100和3101是有区别吧。3101是31的升级版,也就是sdk里面的驱动应该是大部分适配。3100的差别好大。估计要自己对着新驱动来做。新驱动是基于alsa来弄的。有什么好建议没。感觉入坑了。哈哈
  • 不好意思。再次打扰你。如果方便的话。能帮我用海思的sample录制一段音频么,这样我可以先单调试输出。万分感谢。
  • 我在外地出差,我用的驱动就是3100的,其实我只是用了i2c初始化的部分,这个和具体的芯片关系不大,主要是配置参数需要修改,如果有需要我可以把代码发给你,但是现在不方便要回公司才能给你。

  • 非常感谢,那你方便的时候发一下驱动给我。调了几天了。我的邮箱491532763@qq.com.谢谢
  • 您好,我们也在做这个的驱动,能不能麻烦您发给我一份,谢谢,我的邮箱是 275598563@qq.com,非常感谢您!
  • 你好,我也在研究HI3559跟TLV320AIC31, 请问TLV320AIC31控制口I2C、I2S与HI3559直接连吗?还是中间加一个1v8-3v3的隔离芯片?

    另外海思官方给的sdk里有 TLV320AIC31的驱动,用的是海思HI3559的哪路I2C口?