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.

TLV320AIC3104: can't aplay and record

Part Number: TLV320AIC3104

Hello

 I am using linux4.19 kernel, chip is tlv320aic3104, and then the menuconfig configuration <*> Texas Instruments TLV320AIC3x CODECs, my device tree configuration when the audio input, I can control the output from bypass to RIHGHT_LOP/M. What I want to achieve is a configuration with red differential inputs, and green differential outputs. But when I execute arecord -D hw:0,0 -f S16_LE -d 10 -c 2 -r 16 -t wav 001.wav, the audio doesn't output from the i2s to the cpu, play the audio aplay sin.wav sound comes out from the cpu, But I'm not sure it made it into the 3104 chip. When using linux4.1 before, configuring audio was able to achieve what I needed, I couldn't achieve it using the same configuration.

 

I hope to achieve my needs through alsa command and ask for your help.

Best Regards

 

Note 1: I noticed a change in the numid number between the old version of the alsa command and the new version. For example:

numid=42,iface=MIXER,name='Right Line1L Mux'、numid=43,iface=MIXER,name='RightLine1RMux'

Note 2: My command to configure the recording is

amixer cset numid=32,iface=MIXER,name='PGA Capture Switch' on,of

amixer cset numid=31,iface=MIXER,name='PGA Capture Volume' 31,31

amixer cset numid=23,iface=MIXER,name='AGC Switch' off,off

amixer cset numid=40,iface=MIXER,name='Left Line1L Mux' 2

amixer cset numid=44,iface=MIXER,name='Left PGA Mixer Line1L Switch' on

amixer cset numid=37,iface=MIXER,name='Left HPCOM Mux'

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

So far I find that when I configure the path, the register 0x66 is configured to 0xa2 (i2cset -y -f 0 0x18 0x66 0xa2). Do one play and no sound will be generated (0x66 will change back to 0x02), do one more path configuration, configure register 0x66 to 0xa2 again (i2cset -y -f 0 0x18 0x66 0xa2), play audio and find sound (check that the 0x66 register has been changed to 0xa2).

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

My device tree:

sound {
		compatible = "simple-audio-card";
		simple-audio-card,name = "tlv320aic3104";
		simple-audio-card,format = "i2s";
		simple-audio-card,mclk-fs = <256>;
		simple-audio-card,bitclock-master = <&dailink0_master>;
		simple-audio-card,frame-master = <&dailink0_master>;
		simple-audio-card,widgets =
			"Microphone", "Microphone Jack",
			"Headphone", "Headphone Jack",
			"Speaker", "External Speaker",
			"Line", "Line Out",
			"Line", "Line In";
		,routing =
			"MIC_IN", "Microphone Jack",
			"Headphone Jack", "HP_OUT",
			"LINE1L", "Line In",
			"LINE1R", "Line In",
			"Headphone Jack", "RLOUT",
			"Headphone Jack", "LLOUT";

		dailink0_master:simple-audio-card,cpu {
			sound-dai = <&sai1 0>;
		};

		simple-audio-card,codec {
			sound-dai = <&codec 0>;
			/* clocks = <&clks IMX6UL_CLK_SAI1>; */
		};
	};

&clks {
	assigned-clocks = <&clks IMX6UL_CLK_PLL4_AUDIO_DIV>;
	/* assigned-clock-rates = <1179648000>; */
	assigned-clock-rates = <786432000>;
	/* assigned-clock-rates = <705600000>; */
};

&i2c1 {
	clock-frequency = <100000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c1>;
	status = "okay";
	
	codec: tlv320aic3104@18 {
		#sound-dai-cells = <0>;
		compatible = "ti,tlv320aic3104";
		reg = <0x18>;
		gpio-reset = <&gpio5 2 GPIO_ACTIVE_LOW>;
		ai3x-micbias-vg = <0>;
		/* Regulators */
		DRVDD-supply = <&reg_3p3v>;
		AVDD-supply = <&reg_3p3v>;
		IOVDD-supply = <&reg_3p3v>;
		DVDD-supply = <&reg_1p8v>;
		status = "okay";
	};

	eeprom@50 {
		compatible = "atmel,24c02";
		reg = <0x50>;
	};
};

&sai1 {
	#sound-dai-cells = <0>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sai1>;
	assigned-clocks = <&clks IMX6UL_CLK_SAI1_SEL>,
			  <&clks IMX6UL_CLK_SAI1>;
	assigned-clock-parents = <&clks IMX6UL_CLK_PLL4_AUDIO_DIV>;
	/* assigned-clock-rates = <2>, <12288000>; */
	assigned-clock-rates = <2>, <24576000>;
	/* assigned-clock-rates = <2>, <28224000>; */
	status = "okay";
};

recording

aplaying

  • Hi Ka ka,

    For the regdump, I found that below several errors:

    1. Input ADC PGA are muted, 

    2. Micbias is powered down

    3.Line out is not routed

    Which means you have wrong routing path in your driver and make it doesn't work. You should correct it by amixer setting

    Thanks

    Kevin