TLV320AIC3204: Not able to capture the audio on headphone

Part Number: TLV320AIC3204

Tool/software:

Hello team,

I am trying to connect the tlv320aic3204 audio codec with MI2S interface of QCS8550 processor.

Processor : QCS8550 LE

Audio codec : tlv320aic3204

Interface : MI2S0

Pin configurations :  SD0 -> D_IN, SD1 -> D_OUT

I am executing below mentioned command to configure the codec registers:

i2cset -f -y 2 0x18 0x00 0x00;i2cset -f -y 2 0x18 0x01 0x01;i2cset -f -y 2 0x18 0x0B 0x81;i2cset -f -y 2 0x18 0x0C 0x84;i2cset -f -y 2 0x18 0x0D 0x00;i2cset -f -y 2 0x18 0x0E 0x40;i2cset -f -y 2 0x18 0x3C 0x08;i2cset -f -y 2 0x18 0x00 0x01;i2cset -f -y 2 0x18 0x01 0x00;i2cset -f -y 2 0x18 0x02 0x00;i2cset -f -y 2 0x18 0x7B 0x01;i2cset -f -y 2 0x18 0x14 0x25;i2cset -f -y 2 0x18 0x0A 0x02;i2cset -f -y 2 0x18 0x0C 0x08;i2cset -f -y 2 0x18 0x0D 0x08;i2cset -f -y 2 0x18 0x10 0x00;i2cset -f -y 2 0x18 0x11 0x00;i2cset -f -y 2 0x18 0x09 0x30;i2cset -f -y 2 0x18 0x00 0x00;i2cset -f -y 2 0x18 0x3F 0xD4;i2cset -f -y 2 0x18 0x40 0x00;i2cset -f -y 2 0x18 0x00 0x01;i2cset -f -y 2 0x18 0x03 0xC0;i2cset -f -y 2 0x18 0x04 0xC0;i2cset -f -y 2 0x18 0x00 0x00;i2cset -f -y 2 0x18 0x51 0xCC;i2cset -f -y 2 0x18 0x52 0x00;i2cset -f -y 2 0x18 0x12 0x81;i2cset -f -y 2 0x18 0x13 0x81;i2cset -f -y 2 0x18 0x66 0xC0;i2cset -f -y 2 0x18 0x3E 0x03

Apart from that, I am executing below commands for mixer configurations:

qtitinymix "Mic PGA Switch" 1

qtitinymix "IN1_L to Left Mixer Positive Resistor" 1

qtitinymix "ADCFGA Left Mute Switch" 0

qtitinymix "AGC Left Switch" 1

qtitinymix "ADC Level Volume" 64

qtitinymix "PGA Level Volume" 95

qtitinymix "AGC Max PGA" 60

qtitinymix "AGC Noise Threshold" 31

I am executing below command to capture the audio:

agmcap /data/test.wav -D 100 -d 101 -r 48000 -b 16 -c 1 -i MI2S-LPAIF-TX-PRIMARY

With these configurations, it will not capturing the audio. I am attaching different different i2c dump to get the register details:

1. After setting above mentioned configurations:

Page-0:

/ # i2cdump -f -y 2 0x18
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 00 00 60 00 00 11 04 00 00 00 00 81 84 00 40 02 ..`..??....??.@?
10: 00 08 81 81 80 01 00 04 00 00 01 00 00 00 01 00 .?????.?..?...?.
20: 00 00 00 00 44 aa 00 00 00 00 00 00 c0 06 c0 06 ....D?......????
30: 00 00 00 00 00 12 02 02 02 00 00 00 08 01 03 d4 .....????...????
40: 00 00 00 00 6f 38 00 00 00 00 00 ee 10 d8 7e e3 ....o8.....???~?
50: 00 cc 00 28 28 00 80 3e 3c 00 00 00 00 00 00 3e .?.((.?><......>
60: 3c 00 00 00 00 00 c0 00 00 00 00 00 00 00 00 00 <.....?.........
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

Page-1:

/ # i2cdump -f -y 2 0x18
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 01 00 00 c0 c0 00 00 00 00 30 02 10 08 08 00 00 ?..??....0????..
10: 00 00 40 40 25 00 00 00 00 00 00 00 00 00 00 00 ..@@%...........
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
30: 00 00 00 60 40 00 00 00 00 00 00 5f 5f 00 00 c0 ....@......__..?
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
70: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ...........?....
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

2. At the time of capturing the audio:

Page 0:

/ # i2cdump -f -y 2 0x18
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 00 00 60 00 00 91 04 00 00 00 00 81 84 00 80 02 ..`..??....??.??
10: 00 08 81 81 80 01 00 04 00 00 01 00 00 00 81 00 .?????.?..?...?.
20: 00 00 00 00 44 aa 11 00 00 00 00 00 c0 00 c0 06 ....D??.....?.??
30: 00 00 00 00 00 12 02 02 02 00 00 00 01 01 03 d8 .....????...????
40: 00 00 00 00 6f 38 00 00 00 00 00 ee 10 d8 7e e3 ....o8.....???~?
50: 00 cc 00 28 28 00 80 3e 3c 00 00 00 00 00 00 3e .?.((.?><......>
60: 3c 00 00 00 00 00 c0 00 00 00 00 00 00 00 00 00 <.....?.........
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

Page 1:

/ # i2cdump -f -y 2 0x18
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 01 00 00 c0 c0 00 00 00 00 30 02 10 08 08 00 00 ?..??....0????..
10: 00 00 40 40 25 00 00 00 00 00 00 00 00 00 00 00 ..@@%...........
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
30: 00 00 00 60 40 00 00 00 00 00 00 5f 5f 00 00 c0 ...`@......__..?
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
70: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ...........?....
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

I am attaching the audio codec schematics section here to get more clear about the connections.

Please help me to resolve audio capture issue. Please do let me know if more logs or data required.

Thanks and regards

  • Hello,

    Is there any update till yet?

    Thanks and regards

  • Hi Harsha,

    In regards to schematic, the connections look okay here are my comments:

    • Please remove the decoupling capacitors at MICBIAS output
    • It appears you are also shorting differential input pins together, this can result in no audio output, essentially seeing the common mode rejection of the input signal

    Can you confirm the I2S clock frequencies and probe the IN1 pins with an oscilloscope

    Regards,

  • Hello Daveon,

    Thank you for the response. We removed the decoupling capacitors from MICBIAS output. Apart from that, IN1_R pin is floating.(Differential lines are not shorted)

    - We measured the I2S clock signal and it is as expected (11.2 MHZ).

    - We are configuring the MICBIAS as mode-1 (01). So it is generating 2.1 V at MICBIAS.

    - When we are executing "agmcap" command, that time IN1 pin voltage is varying.

    Please do let me know, if more details require. Kindly help us to resolve this audio capturing issue.

    Thanks and regards

  • Hi Harsh,

    Thanks, here are some troubleshooting tips

    Can you provide a probe of IN1P pin to ensure a proper signal is fed to the device? Testing a 1kHz sine wave would be ideal

    Can you provide the frequency of BCLK, WCLK, and MCLK?

    If possible, ac couple unused analog input to gnd to prevent noise from coupling into active pins.

    Regards,

  • Hello Daveon,

    Thank you for providing the troubleshooting tips. We had removed the AC couple unused analog input to ground. But we are facing the same behavior.

    BCLK : 1.539 MHz

    WCLK : 48 kHz

    MCLK : 11.3 MHz

    I am attaching the signals as well for the reference.

               

                                              BCLK                                                                                            WCLK

                                        MCLK

    Apart from that, we made some changes in the hardware. We pulled down IN1_R pin with 2k register.

    Based on above image, we have taken R1 = 470 Ohm, R2  = 2k Ohm on IN1_L pin. Now we have provided AVdd with external supply (1.8 V).

    From the register sequence, I updated the sequence of register for the audio capture:

    i2cset -f -y 1 0x18 0x00 0x00
    i2cset -f -y 1 0x18 0x01 0x01
    i2cset -f -y 1 0x18 0x12 0x81
    i2cset -f -y 1 0x18 0x13 0x81
    i2cset -f -y 1 0x18 0x14 0x40
    i2cset -f -y 1 0x18 0x3D 0x07
    i2cset -f -y 1 0x18 0x43 0x80
    i2cset -f -y 1 0x18 0x00 0x01
    i2cset -f -y 1 0x18 0x01 0x08
    i2cset -f -y 1 0x18 0x02 0x00
    i2cset -f -y 1 0x18 0x0A 0x02
    i2cset -f -y 1 0x18 0x3D 0xFF
    i2cset -f -y 1 0x18 0x47 0x32
    i2cset -f -y 1 0x18 0x7B 0x01
    i2cset -f -y 1 0x18 0x34 0x80
    i2cset -f -y 1 0x18 0x36 0x80
    i2cset -f -y 1 0x18 0x37 0x00
    i2cset -f -y 1 0x18 0x39 0x00
    i2cset -f -y 1 0x18 0x3B 0x0C
    i2cset -f -y 1 0x18 0x3C 0x00
    i2cset -f -y 1 0x18 0x00 0x00
    i2cset -f -y 1 0x18 0x51 0x88
    i2cset -f -y 1 0x18 0x52 0x40
    i2cset -f -y 1 0x18 0x53 0x28
    i2cset -f -y 1 0x18 0x54 0x00
    i2cset -f -y 1 0x18 0x00 0x01
    i2cset -f -y 1 0x18 0x33 0x50

    Apart from that, I will have some queries.

    1. We provided the external MCLK, is it impact on MIC?

    2. We are trying to capture the audio in MONO mode (IN1_L_P line). Can you please provide the register sequence to capture the audio in mono mode?

    Please do let me know, more details is required. If I missed any mixer configurations, audio routing configurations, I2C registers configurations, please do let me know and support us.

    Thanks and regards

  • Hi Harsh,

    As an update,

    P0_0x51 = 0x88. ADC is configured to expect digital microphone input. This is not correct?

    P0_0x52 = 0x40. Change to 0x00 write to avoid writing to reserved register

    Your register sequence for recording audio looks okay, allow me more time to review your configuration

    Regards,

  • Hello,

    Did you find any thing where we are lacking? We tried with the different values for the 0x51 and 0x51 register from Page-0. Still we are facing the same issue.

  • I apologize for the delay, I will provide a tested script for mono recording tomorrow.

    Thank you for being patient 

  • Sure. Thank you for the support.

  • Hi Harsh,

    The issue is that 11.3 MHz is not a sufficient MCLK for 48kHz sampling frequency. With this MCLK, the sampling frequency that is supported would be a multiple of 44.1kHz, so if you want to record audio at that sample rate, you can use the script below:

    ###############################################
    # Software Reset
    ###############################################
    #
    # Select Page 0
    w 30 00 00
    #
    # Initialize the device through software reset
    w 30 01 01
    #
    ###############################################
    
    
    
    ###############################################
    # Clock Settings
    # ---------------------------------------------
    # The codec receives: MCLK = 11.2896 MHz,
    # BCLK = 2.8224 MHz, WCLK = 44.1 kHz
    ###############################################
    #
    # Select Page 0
    w 30 00 00
    #
    # NADC = 1, MADC = 2
    w 30 12 81 82
    #
    ###############################################
    
    
    
    ###############################################
    # Signal Processing Settings
    ###############################################
    #
    # Select Page 0
    w 30 00 00
    #
    # Set the ADC Mode to PRB_P1
    w 30 3d 01
    #
    ###############################################
    
    
    
    ###############################################
    # Initialize Codec
    ###############################################
    #
    # Select Page 1
    w 30 00 01
    #
    # Disable weak AVDD in presence of external
    # AVDD supply
    w 30 01 08
    #
    # Enable Master Analog Power Control
    w 30 02 00
    #
    # Select ADC PTM_R4
    w 30 3d 00
    #
    # Set the input powerup time to 3.1ms (for ADC)
    w 30 47 32
    #
    # Set the REF charging time to 40ms
    w 30 7b 01
    #
    ###############################################
    
    
    
    ###############################################
    # Recording Setup
    ###############################################
    #
    # Select Page 1
    w 30 00 01
    #
    # Route IN1L to LEFT_P with 20K input impedance
    w 30 34 80
    #
    # Route Common Mode to LEFT_M with impedance of 20K
    w 30 36 80
    # Unmute Left MICPGA, Gain selection of 6dB to make channel gain 0dB
    # Register of 6dB with input impedance of 20K => Channel Gain of 0dB
    w 30 3b 0c
    #
    # Select Page 0
    w 30 00 00
    #
    # Power up LADC
    w 30 51 80
    #
    # Unmute LADC
    w 30 52 00
    #
    ###############################################
    

    The above code can be used at 44.1 kHz based on MCLK.

    If you want to sample at 48kHz, you will have to use the PLL and manipulate the coefficients to achieve an ADC fs of 48kHz. You can access that calculator here: https://www.ti.com/tool/COEFFICIENT-CALC

    If you can support a larger MCLK frequency, then you can sample at 48kHz without the PLL.

    The audio was not recording due to an ASI bus error.