TLV320AIC3110: Assistance Needed with Device-Tree Configuration for TLV320AIC3110

Part Number: TLV320AIC3110

Tool/software:

We are currently testing the following configuration in the device-tree [linux-6.6.36] to verify the TLV320AIC3110 codec with TPA3110D2PWP amplifier.

However, we are not able to get voltage at MICBIAS & not getting audio at headset playback.

Request:
Please provide support with the correct device-tree configuration for TLV320AIC3110.

Schematic of hardware design is available in support ticket below. We have also attached device tree for review.

https://e2e.ti.com/support/audio-group/audio/f/audio-forum/1526295/tlv320aic3110-audio-codec-with-power-amplifier?tisearch=e2e-sitesearch&keymatch=tlv320aic3110#

DEVICE-TREE:

    tlv320aic3110: audio-codec@18 {
        #sound-dai-cells = <0>;
        compatible = "ti,tlv320aic3110";
        reg = <0x18>;

        HPVDD-supply = <&reg_vcc_3v3>;
        SPRVDD-supply = <&reg_vcc_3v3>;
        SPLVDD-supply = <&reg_vcc_3v3>;
        AVDD-supply = <&reg_vcc_3v3>;
        IOVDD-supply = <&reg_vcc_1v8>;
        DVDD-supply = <&reg_vcc_1v8>;
        reset-gpios = <&gpio4 31 GPIO_ACTIVE_LOW>;
        ai31xx-micbias-vg = <MICBIAS_2_5V>;
    };
.
.
.
    sound {
        compatible = "simple-audio-card";
        simple-audio-card,name = "kirtan_sak";
        simple-audio-card,format = "i2s";
        simple-audio-card,bitclock-master = <&dailink_master>;
        simple-audio-card,frame-master = <&dailink_master>;

        dailink_master: simple-audio-card,cpu {
            sound-dai = <&sai1>;
            system-clock-direction-out;
        };

        dailink_codec: simple-audio-card,codec {
            sound-dai = <&tlv320aic3110>;
            system-clock-frequency = <12000000>;
        };
    };
.
.
.
&sai1 {
    #sound-dai-cells = <0>;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_sai1>;
    assigned-clocks = <&clk IMX8MP_CLK_SAI1>;
    assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
    assigned-clock-rates = <12288000>;
    fsl,sai-mclk-direction-output;
    fsl,sai-synchronous-rx;
    status = "okay";
};
.
.
.
    pinctrl_sai1: sai1grp {
        fsl,pins = <
            MX8MP_IOMUXC_SAI1_TXFSAUDIOMIX_SAI1_TX_SYNC    0x94
            MX8MP_IOMUXC_SAI1_TXCAUDIOMIX_SAI1_TX_BCLK    0x94
            MX8MP_IOMUXC_SAI1_RXD0AUDIOMIX_SAI1_RX_DATA00    0x94
            MX8MP_IOMUXC_SAI1_TXD0AUDIOMIX_SAI1_TX_DATA00    0x94
            MX8MP_IOMUXC_SAI1_MCLK__AUDIOMIX_SAI1_MCLK        0x94
        >;
    };

  •   

    Please review device tree we have used for coded.

      

    Please review if anything need to change in audio amplifier.

  • Hi Dharmendra,

    Our expert on the device trees is out of office today but will return tomorrow to follow up with you.

    Best regards,
    Jeff McPherson

  • Hi Dharmendra, 

    I think the dts looks good. Let me know if you are having any specific issues, I can look more into the driver to help with those.

    Best,
    Mir

  • Hi Mir,

    We are not receiving power at the MICBIAS voltage on pin 12.

    MIC:  arecord -D hw:0,0 -f S16_LE -r 48000 -c 2 -d 5 --buffer-size=4096 --period-size=1024 mic-test.wav

    Command is executed with no error.

    Additionally, there is no analog output signal at the headset pins 27 (LOUT) and 30 (ROUT).

    HEADSET:  aplay -D plughw:0,0 -f S16_LE -r 48000 -c 2 test.wav

    Thank you,
    Dharmendra

  • Hi Dharmendra,

    Do you not have any voltage coming out of MICBIAS? I wonder if the device is not reading all the associated .h files for the DTS config - it should be 2V by default out of MICBIAS, and I see you have set it to 2.5V. You can read this previous E2E about this issue:  TLV320AIC3100: TLV320AIC31XX-LINUX driver, Issues setting up mic bias, Raspberry Pi 4 

    You may also need to add the audio-routing property in the DTS file as described here: https://www.kernel.org/doc/Documentation/devicetree/bindings/sound/tlv320aic31xx.txt

    This would look like simple-audio-card,routing = like in the simple-card documentation: https://www.kernel.org/doc/Documentation/devicetree/bindings/sound/simple-card.txt

    But with labels like "HPL" and "HPR" and "MIC1LP" as defined in the aic31xx.txt file.

    Let me know if this helps! I would think the routing may also be affecting the mic bias, if there is no mic routed then maybe it will not turn on the bias to save power.

    Best,
    Mir

  • Hi  ,

    Thank you very much for your continued support.

    Using the routing you suggested, we are able to get the MICBIAS voltage at 2.5V.

    However, we are still unable to capture audio from the microphone with the following command:

    arecord -D hw:0,0 -f S16_LE -r 48000 -c 2 -d 5 mic-test.wav

    Could you please confirm which pins are responsible for the microphone input?
    We can probe the signals using a DSO if needed.

    For your reference, we have also attached the DTS file.

    &sai1 {
    	#sound-dai-cells = <0>;
    	pinctrl-names = "default";
    	pinctrl-0 = <&pinctrl_sai1>;
    	assigned-clocks = <&clk IMX8MP_CLK_SAI1>;
    	assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
    	assigned-clock-rates = <12288000>;
    	fsl,sai-mclk-direction-output;
    	status = "okay";
    };
    .
    .
    .
    &i2c6 {
    	clock-frequency = <100000>; /* Lower clock speed for external bus. */
    	pinctrl-names = "default";
    	pinctrl-0 = <&pinctrl_i2c6>;
    	status = "okay";
    
    	tlv320aic3110: audio-codec@18 {
    		#sound-dai-cells = <0>;
    		compatible = "ti,tlv320aic3110";
    		reg = <0x18>;
    		pinctrl-0 = <&pinctrl_tlv320aic3110>;
    
    		clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_SAI1_MCLK1>;
    		clock-names = "mclk";
    		assigned-clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_SAI1_MCLK1>;
    		assigned-clock-rates = <24576000>;
    		mclk-frequency = <24576000>;
    
    		HPVDD-supply = <&reg_vcc_3v3>;
    		SPRVDD-supply = <&reg_vcc_3v3>;
    		SPLVDD-supply = <&reg_vcc_3v3>;
    		AVDD-supply = <&reg_vcc_3v3>;
    		IOVDD-supply = <&reg_vcc_3v3>;
    		DVDD-supply = <&reg_vcc_1v8>;
    		reset-gpios = <&gpio4 31 GPIO_ACTIVE_LOW>;
    		gpios = <&gpio4 13 GPIO_ACTIVE_HIGH>;
    		ai31xx-micbias-vg = <MICBIAS_2_5V>;
    		ai31xx-ocmv = <3>;
    	};
    .
    .
    .
    	sound {
    		compatible = "simple-audio-card";
    		simple-audio-card,name = "kirtan_sak";
    		simple-audio-card,format = "i2s";
    		simple-audio-card,bitclock-master = <&dailink_master>;
    		simple-audio-card,frame-master = <&dailink_master>;
    		simple-audio-card,convert-rate = <48000>;
    
    		simple-audio-card,widgets =
    			"Microphone", "Microphone Jack",
    			"Headphone", "Headphone Jack";
    		simple-audio-card,routing =
    			"MIC1RP", "Microphone Jack",
    			"Microphone Jack", "MICBIAS",
        		"MIC1RP P-Terminal", "Microphone Jack",
        		"Microphone Jack", "MICBIAS",
    			"Headphone Jack", "HPL",
    			"Headphone Jack", "HPR";
    
    		dailink_master: simple-audio-card,cpu {
    			sound-dai = <&sai1>;
    			system-clock-direction-out;
    		};
    
    		dailink_codec: simple-audio-card,codec {
    			sound-dai = <&tlv320aic3110>;
    			system-clock-frequency = <12000000>;
    		};
    	};

    Thank you,

    Dharmendra Savaliya.

  • Hi Dharmendra,

    The microphone input is set to MIC1RP according to your DTS routing, although this is just the P terminal, typically you need both the P and M terminal to the PGA. I see for the M terminal of the PGA, it is just MIC1LM connected, and since you have this floating on your schematic, you will need to use software to configure the MIC1LM as connected to a common mode VCOM. It may not fully be supported in the driver right now, but here is what I found, I think we can either add a few more lines to the aic31xx.c driver file or check what is present in the amixer GUI...

    This is the register that needs to be changed to rout the M terminal of the PGA to VCOM, page 1 register 49 bits 7-6: 

    We see in the tlv320aic31xx.h file that page 1 register 49 is defined as "AIC31XX_MICPGAMI": 

    Searching for this in the tlv320aic31xx.c file, it is mentioned 3 times:

    First in the defaults section: 

    And then twice here:

    So, we are looking for the cm_m_enum to define which DTS file entry corresponds here. However, "cm_m_enum" is only mentioned once in this file and it is here. Meanwhile, mic1lm_m_enum is mentioned like this:

    So, to change the common mode setting intuitively with the driver, we would need to add an equivalent snd_kcontrol_new entry for cm_m_enum, something like this:

    Then, we could target the common mode connection in the dts routing file similar to what you have already done for "MIC1RP P-Terminal".

    ALSO, note that you will need to include one of these settings for the mic selection to work, even for your MIC1RP P-Terminal:

    I believe these are the sort of things that should populate in amixer, the GUI is called alsamixer. Please check that before you change anything in the driver, I am sorry if I made it more complicated. If changing alamixer or the DTS does not help, we can try changing the default register values as well. Please send over a screenshot of your alsamixer settings that you see, and if you can take a register dump during recording that will be helpful as well.

    Best,
    Mir

  • Hi  

    If there are any other compatible microphones available, please let us know so that we can proceed with redesigning the layout accordingly.

    We required microphone with strong noise cancellation capabilities to ensure optimal performance.

    We are currently facing challenges with the integration of the electret microphone.

    It is critical that we finalize the microphone selection at the earliest so that we can move forward with production.

    Your prompt support on this matter will be highly appreciated.

    Hi  

    These are our amixer settings and codec register dump while record using mic.
    Help here with driver changes or amixer GUI changes with necessary commands

    Amixer-Contents

    root@imx8mp-arkenstone:~# amixer scontents
    Simple mixer control 'Speaker Analog',0
      Capabilities: pvolume
      Playback channels: Front Left - Front Right
      Limits: Playback 0 - 127
      Mono:
      Front Left: Playback 0 [0%] [-63.50dB]
      Front Right: Playback 0 [0%] [-63.50dB]
    Simple mixer control 'Speaker Driver',0
      Capabilities: pvolume pswitch
      Playback channels: Front Left - Front Right
      Limits: Playback 0 - 3
      Mono:
      Front Left: Playback 0 [0%] [6.00dB] [off]
      Front Right: Playback 0 [0%] [6.00dB] [off]
    Simple mixer control 'Speaker Left',0
      Capabilities: pswitch pswitch-joined
      Playback channels: Mono
      Mono: Playback [off]
    Simple mixer control 'Speaker Right',0
      Capabilities: pswitch pswitch-joined
      Playback channels: Mono
      Mono: Playback [off]
    Simple mixer control 'Mic PGA',0
      Capabilities: cvolume cvolume-joined
      Capture channels: Mono
      Limits: Capture 0 - 119
      Mono: Capture 95 [80%] [47.50dB]
    Simple mixer control 'ADC',0
      Capabilities: cvolume cvolume-joined cswitch cswitch-joined
      Capture channels: Mono
      Limits: Capture 0 - 64
      Mono: Capture 51 [80%] [5.50dB] [on]
    Simple mixer control 'ADC Fine',0
      Capabilities: cvolume cvolume-joined
      Capture channels: Mono
      Limits: Capture 0 - 4
      Mono: Capture 3 [75%] [0.30dB]
    Simple mixer control 'DAC',0
      Capabilities: pvolume
      Playback channels: Front Left - Front Right
      Limits: Playback 0 - 175
      Mono:
      Front Left: Playback 70 [40%] [-28.50dB]
      Front Right: Playback 70 [40%] [-28.50dB]
    Simple mixer control 'DAC Left Input',0
      Capabilities: enum
      Items: 'Off' 'Left Data' 'Right Data' 'Mono'
      Item0: 'Left Data'
    Simple mixer control 'DAC Right Input',0
      Capabilities: enum
      Items: 'Off' 'Right Data' 'Left Data' 'Mono'
      Item0: 'Right Data'
    Simple mixer control 'HP Analog',0
      Capabilities: pvolume
      Playback channels: Front Left - Front Right
      Limits: Playback 0 - 127
      Mono:
      Front Left: Playback 102 [80%] [-12.50dB]
      Front Right: Playback 102 [80%] [-12.50dB]
    Simple mixer control 'HP Driver',0
      Capabilities: pvolume pswitch
      Playback channels: Front Left - Front Right
      Limits: Playback 0 - 9
      Mono:
      Front Left: Playback 8 [89%] [8.00dB] [on]
      Front Right: Playback 8 [89%] [8.00dB] [on]
    Simple mixer control 'HP Left',0
      Capabilities: pswitch pswitch-joined
      Playback channels: Mono
      Mono: Playback [on]
    Simple mixer control 'HP Output Driver Power-On time',0
      Capabilities: enum
      Items: '0us' '15.3us' '153us' '1.53ms' '15.3ms' '76.2ms' '153ms' '304ms' '610ms' '1.22s' '3.04s' '6.1s'
      Item0: '304ms'
    Simple mixer control 'HP Output Driver Ramp-up step',0
      Capabilities: enum
      Items: '0ms' '0.98ms' '1.95ms' '3.9ms'
      Item0: '0.98ms'
    Simple mixer control 'HP Right',0
      Capabilities: pswitch pswitch-joined
      Playback channels: Mono
      Mono: Playback [on]
    Simple mixer control 'MIC1LM M-Terminal',0
      Capabilities: enum
      Items: 'Off' 'FFR 10 Ohm' 'FFR 20 Ohm' 'FFR 40 Ohm'
      Item0: 'FFR 20 Ohm'
    Simple mixer control 'MIC1LM P-Terminal',0
      Capabilities: enum
      Items: 'Off' 'FFR 10 Ohm' 'FFR 20 Ohm' 'FFR 40 Ohm'
      Item0: 'Off'
    Simple mixer control 'MIC1LP P-Terminal',0
      Capabilities: enum
      Items: 'Off' 'FFR 10 Ohm' 'FFR 20 Ohm' 'FFR 40 Ohm'
      Item0: 'Off'
    Simple mixer control 'MIC1RP P-Terminal',0
      Capabilities: enum
      Items: 'Off' 'FFR 10 Ohm' 'FFR 20 Ohm' 'FFR 40 Ohm'
      Item0: 'FFR 20 Ohm'
    Simple mixer control 'Output Left From Left DAC',0
      Capabilities: pswitch pswitch-joined
      Playback channels: Mono
      Mono: Playback [on]
    Simple mixer control 'Output Left From MIC1LP',0
      Capabilities: pswitch pswitch-joined
      Playback channels: Mono
      Mono: Playback [off]
    Simple mixer control 'Output Left From MIC1RP',0
      Capabilities: pswitch pswitch-joined
      Playback channels: Mono
      Mono: Playback [off]
    Simple mixer control 'Output Right From MIC1RP',0
      Capabilities: pswitch pswitch-joined
      Playback channels: Mono
      Mono: Playback [off]
    Simple mixer control 'Output Right From Right DAC',0
      Capabilities: pswitch pswitch-joined
      Playback channels: Mono
      Mono: Playback [on]
    Simple mixer control 'Volume Soft Stepping',0
      Capabilities: enum
      Items: 'fast' 'slow' 'disabled'
      Item0: 'fast'
    root@imx8mp-arkenstone:~# 
    

    Register dump during record

    [   89.086040] reg[0x00] = 0x00000000
    [   89.090699] reg[0x01] = 0x00000000
    [   89.094123] reg[0x02] = 0x00000001
    [   89.098783] reg[0x03] = 0x00000054
    [   89.102207] reg[0x04] = 0x00000003
    [   89.105628] reg[0x05] = 0x00000091
    [   89.109046] reg[0x06] = 0x00000008
    [   89.112462] reg[0x07] = 0x00000007
    [   89.115868] reg[0x08] = 0x00000080
    [   89.119280] reg[0x09] = 0x00000000
    [   89.122696] reg[0x0a] = 0x00000000
    [   89.126111] reg[0x0b] = 0x00000088
    [   89.129529] reg[0x0c] = 0x00000082
    [   89.132943] reg[0x0d] = 0x00000000
    [   89.136362] reg[0x0e] = 0x00000080
    [   89.139766] reg[0x0f] = 0x00000080
    [   89.143182] reg[0x10] = 0x00000000
    [   89.146598] reg[0x11] = 0x00000000
    [   89.150014] reg[0x12] = 0x00000088
    [   89.153431] reg[0x13] = 0x00000082
    [   89.156848] reg[0x14] = 0x00000080
    [   89.160252] reg[0x15] = 0x00000080
    [   89.163665] reg[0x16] = 0x00000004
    [   89.167079] reg[0x17] = 0x00000000
    [   89.170492] reg[0x18] = 0x00000000
    [   89.173906] reg[0x19] = 0x00000000
    [   89.177321] reg[0x1a] = 0x00000000
    [   89.180735] reg[0x1b] = 0x00000000
    [   89.184140] reg[0x1c] = 0x00000000
    [   89.187558] reg[0x1d] = 0x00000020
    [   89.190983] reg[0x1e] = 0x00000088
    [   89.194400] reg[0x1f] = 0x00000000
    [   89.197816] reg[0x20] = 0x00000000
    [   89.201231] reg[0x21] = 0x00000000
    [   89.204659] reg[0x22] = 0x00000000
    [   89.208061] reg[0x23] = 0x00000000
    [   89.213042] reg[0x24] = 0x00000080
    [   89.217691] reg[0x25] = 0x00000000
    [   89.222369] reg[0x26] = 0x00000011
    [   89.227038] reg[0x27] = 0x00000000
    [   89.230462] reg[0x28] = 0x00000000
    [   89.233879] reg[0x29] = 0x00000000
    [   89.237298] reg[0x2a] = 0x00000000
    [   89.240714] reg[0x2b] = 0x00000000
    [   89.245671] reg[0x2c] = 0x00000000
    [   89.250316] reg[0x2d] = 0x00000000
    [   89.254977] reg[0x2e] = 0x00000000
    [   89.259644] reg[0x2f] = 0x00000000
    [   89.263065] reg[0x30] = 0x00000000
    [   89.266486] reg[0x31] = 0x00000000
    [   89.269903] reg[0x32] = 0x00000000
    [   89.273317] reg[0x33] = 0x00000002
    [   89.276733] reg[0x34] = 0x00000030
    [   89.280135] reg[0x35] = 0x00000002
    [   89.283551] reg[0x36] = 0x00000000
    [   89.286967] reg[0x37] = 0x00000002
    [   89.290386] reg[0x38] = 0x00000002
    [   89.293800] reg[0x39] = 0x00000010
    [   89.297213] reg[0x3a] = 0x00000010
    [   89.300628] reg[0x3b] = 0x00000000
    [   89.304032] reg[0x3c] = 0x00000001
    [   89.307450] reg[0x3d] = 0x00000000
    [   89.310868] reg[0x3e] = 0x00000000
    [   89.314284] reg[0x3f] = 0x00000014
    [   89.317702] reg[0x40] = 0x0000000c
    [   89.321116] reg[0x41] = 0x000000d9
    [   89.324532] reg[0x42] = 0x000000d9
    [   89.329202] reg[0x43] = 0x00000000
    [   89.332619] reg[0x44] = 0x00000043
    [   89.336021] reg[0x45] = 0x00000018
    [   89.339439] reg[0x46] = 0x00000000
    [   89.342855] reg[0x47] = 0x00000000
    [   89.346269] reg[0x48] = 0x00000000
    [   89.349687] reg[0x49] = 0x00000000
    [   89.353100] reg[0x4a] = 0x00000000
    [   89.356517] reg[0x4b] = 0x000000c0
    [   89.359921] reg[0x4c] = 0x00000010
    [   89.363334] reg[0x4d] = 0x00000088
    [   89.366751] reg[0x4e] = 0x0000007e
    [   89.370166] reg[0x4f] = 0x000000e0
    [   89.373582] reg[0x50] = 0x00000000
    [   89.376999] reg[0x51] = 0x00000000
    [   89.380414] reg[0x52] = 0x00000010
    [   89.383819] reg[0x53] = 0x0000001b
    [   89.387234] reg[0x54] = 0x00000000
    [   89.390651] reg[0x55] = 0x00000000
    [   89.394063] reg[0x56] = 0x00000000
    [   89.397481] reg[0x57] = 0x00000000
    [   89.400896] reg[0x58] = 0x00000071
    [   89.404317] reg[0x59] = 0x00000000
    [   89.407724] reg[0x5a] = 0x00000000
    [   89.411138] reg[0x5b] = 0x00000000
    [   89.414553] reg[0x5c] = 0x00000000
    [   89.417968] reg[0x5d] = 0x00000000
    [   89.421381] reg[0x5e] = 0x00000000
    [   89.424797] reg[0x5f] = 0x00000000
    [   89.428202] reg[0x60] = 0x00000000
    [   89.431617] reg[0x61] = 0x00000000
    [   89.435034] reg[0x62] = 0x00000000
    [   89.438448] reg[0x63] = 0x00000000
    [   89.441865] reg[0x64] = 0x00000000
    [   89.445282] reg[0x65] = 0x00000000
    [   89.448698] reg[0x66] = 0x00000000
    [   89.452102] reg[0x67] = 0x00000000
    [   89.455522] reg[0x68] = 0x00000000
    [   89.458938] reg[0x69] = 0x00000000
    [   89.462354] reg[0x6a] = 0x00000000
    [   89.465769] reg[0x6b] = 0x00000000
    [   89.469182] reg[0x6c] = 0x00000000
    [   89.472598] reg[0x6d] = 0x00000000
    [   89.476002] reg[0x6e] = 0x00000000
    [   89.479416] reg[0x6f] = 0x00000000
    [   89.482831] reg[0x70] = 0x00000000
    [   89.486246] reg[0x71] = 0x00000000
    [   89.489664] reg[0x72] = 0x00000000
    [   89.493075] reg[0x73] = 0x00000000
    [   89.496488] reg[0x74] = 0x00000000
    [   89.499892] reg[0x75] = 0x0000007a
    [   89.503304] reg[0x76] = 0x00000000
    [   89.506719] reg[0x77] = 0x00000000
    [   89.510136] reg[0x78] = 0x00000000
    [   89.513561] reg[0x79] = 0x00000000
    [   89.516980] reg[0x7a] = 0x00000000
    [   89.520395] reg[0x7b] = 0x00000000
    [   89.523799] reg[0x7c] = 0x00000000
    [   89.527213] reg[0x7d] = 0x00000000
    [   89.530629] reg[0x7e] = 0x00000000
    [   89.534045] reg[0x7f] = 0x00000000
    

  • Hi Dharmendra,

    It is not clear to me that the microphone is the source of your issues. I don't believing changing microphones would fix anything as there is no evidence from what you and Mir have discussed so far. As long as the electrolet mic is outputting a voltage that is seen on the scope, the issue lies in the codec configuration. 

    Best regards,
    Jeff McPherson

  • Hi  

    We are getting volage on MICBIAS of mic when we try to record using mic.
    but when we probed MIC1RP - there is no signal while we are speaking on mic.

    Can you please help to debug this issue (BTW we are using ICS-40212 mic) ?

    Thank You

    Dharmendra Savaliya

  • Hi, 

    Can you verify that your MICBIAS is within these ranges from the mic datasheet, in relation to the mic ground connection:

    Best,
    Mir