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.

TLV320AIC3120: aic31xx_wait_bits: Failed! with AGC enabled

Part Number: TLV320AIC3120


Software/Hardware:

  • Raspbian (Linux)

  • i2c-tools

  • ALSA including alsamixer

  • Raspberry Pi 4 compute module

  • TLV320AIC3120 is i2c slave

tlv320aic31xx-codec 1-0018: aic31xx_wait_bits: Failed! 0x24 was 0x40 expected 0x0 (0, 0x40, 500000 us)

tlv320aic31xx-codec 1-0018: ASoC: POST_PMD: ADC event failed: -1

I receive the above dmesg error when executing arecord command with AGC enabled. Using aplay and arecord are still functional. Im hoping to gather more information or possible causes.

  • During playback or arecod, would you be so kind and capture the I2S clk waveform including WS clk and bit clk to me?

  • At the start of arecord. Blue BCLK and Yellow is WCLK.

  • The clks seems awful. What the sample rate do you want to record? The bitclk is 59.92Hz, wclk is 11.12Hz. None of two are the good clk freq.

    One more thing, kindly get the sequence of i2s and i2c clk. In theory i2s clk should be earlier than i2c clk(codec power on command).

  • Yellow(CH.1) is I2S CLK same as BCLK. Blue(CH.2) is i2c CLk/ SCL

  • still abnormal. Can you share the DTS file? and tell me how you make these clk work.

  • // Definitions for 3120 miniDSP
    /dts-v1/;
    /plugin/;
    
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/sound/tlv320aic31xx-micbias.h>
    
    / {
    	compatible = "brcm,bcm2835";
    
    	fragment@0 {
    		target = <&i2s>;
    		__overlay__ {
    			status = "okay";
    		};
    	};
    
    	fragment@1 {
    		target = <&i2c1>;
    		__overlay__ {
    			#address-cells = <1>;
                #size-cells = <0>;
    			status = "okay";
    			clock-frequency = <100000>;
    			pinctrl-names = "default";
    
    			tlv320aic31xx: tlv320aic3120@18 {
    				#sound-dai-cells = <0>;
    				reg = <0x18>;
    				compatible = "ti,tlv320aic3120";
    //				ai31xx-micbias-vg = <MICBIAS_OFF>;
    //				ai31xx-micbias-vg = <MICBIAS_2_0V>;
    				ai31xx-micbias-vg = <MICBIAS_2_5V>;
    //				ai31xx-micbias-vg = <MICBIAS_AVDD>;
    
    				reset-gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
    
    //				ai31xx-ocmv = 0;
    //				ai31xx-ocmv = 1;
    //				ai31xx-ocmv = 2;
    //				ai31xx-ocmv = 3;
    				status = "okay";
    			};
    		};
    	};
    
    	fragment@2 {
    		target = <&sound>;
    		__overlay__ {
    			compatible = "simple-audio-card";
    			i2s-controller = <&i2s>;
    			status = "okay";
    			simple-audio-card,name = "tlv320aic3120-hifi";
    			simple-audio-card,bitclock-slave = <&sound_master>;
    			simple-audio-card,frame-slave = <&sound_master>;
    			simple-audio-card,format = "i2s";
    
    			simple-audio-card,widgets =
    				"Microphone", "Mic In",
    				"Speaker", "Speaker Driver";
    			simple-audio-card,routing =
    				"MIC1LP", "MICBIAS",
    //				"MIC1LP", "Mic In",
    //				"MIC1RP", "Mic In",
    				"MIC1LP", "Mic In",
    				"ADC", "MIC1LP",
    				"Capture", "MIC1LP",
    				"Speaker Driver", "SPK ClassD"; /*these are widget names mapped to options in the TI driver */
    
    
    			simple-audio-card,cpu {
    				sound-dai = <&i2s>;
    			};
    
    			sound_master: simple-audio-card,codec {
    				sound-dai = <&tlv320aic31xx>;
    				system-clock-frequency = <12000000>; /* this matches sai1 */
    				
    			};
    		};
    	};
    };
    

  • According to the DTS, the ws/bit clk are generated by the platform, would you be so kind and consult the platform vendor on how to set the clk well.