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.

Linux/TLV320AIC3104: audio code integration issue on TX2 platform

Part Number: TLV320AIC3104

Tool/software: Linux

Hi TI team,

I am integrating TI TLV320AIC3104 on TX2 platform which is running on Linux tegra-ubuntu 4.4.38. 

The kernel configure,  DTS file are adjusted for enabling tlv320aic3x driver, and tlv320aic3x driver is enabled according to the log.

The aic3x_probe(), aic3x_set_dai_fmt(),  and aic3x_set_dai_sysclk() are called sequentially.

But there is no sound output when I enter the following command in console:

aplay -D hw:tegrasndt186ref,0 my.wav

Note: the my.wav is the Front_Right.wav copied from /usr/share/sounds/alsa/.

Currently, we only connect HPLOUT and HPLCOM as sound output.

I would like to know how to set the registers for playback.

Should I modify the tlv320aic3x driver?

Below is my DTS file:

	tegra_sound: sound {
		compatible = "nvidia,tegra-audio-t186ref-mobile-rt565x";
		nvidia,model = "tegra-snd-t186ref-mobile-rt565x";
		nvidia,num-codec-link = <13>;
		nvidia,num-clk = <8>;
		nvidia,clk-rates = < 270950400	/* PLLA_x11025_RATE */
				     11289600	/* AUD_MCLK_x11025_RATE */
				     45158400	/* PLLA_OUT0_x11025_RATE */
				     45158400	/* AHUB_x11025_RATE */
				     245760000  /* PLLA_x8000_RATE */
				     12288000	/* AUD_MCLK_x8000_RATE */
				     49152000	/* PLLA_OUT0_x8000_RATE */
				     49152000 >;/* AHUB_x8000_RATE */
		clocks = <&tegra_car TEGRA186_CLK_PLLP_OUT0>,
			<&tegra_car TEGRA186_CLK_PLLA>,
			<&tegra_car TEGRA186_CLK_PLL_A_OUT0>,
			<&tegra_car TEGRA186_CLK_AHUB>,
			<&tegra_car TEGRA186_CLK_CLK_M>,
			<&tegra_car TEGRA186_CLK_AUD_MCLK>;
		clock-names = "pll_p_out1", "pll_a", "pll_a_out0", "ahub",
				"clk_m", "extern1";
		resets = <&tegra_car TEGRA186_RESET_AUD_MCLK>;
		reset-names = "extern1_rst";

		status = "okay";
		nvidia,audio-routing =
			"z OUT",		"z HPLOUT",
			"z OUT",		"z HPLCOM";
			/*
			"x Headphone",	"x OUT",
			"x IN",			"x Mic",
			"y Headphone",	"y OUT",
			"y IN",			"y Mic",
			"z Headphone",	"z OUT",
			"z IN",			"z Mic",
			"m Headphone",	"m OUT",
			"m IN",			"m Mic",
			"n Headphone",	"n OUT",
			"n IN",			"n Mic",
			"o Headphone",	"o OUT",
			"o IN",			"o Mic",
			"a IN",			"a Mic",
			"b IN",			"b Mic",
			"c IN",			"c Mic",
			"d IN",			"d Mic",
			"e Headphone",	"e OUT",
			"e IN",			"e Mic",
			"d1 Headphone",	"d1 OUT",
			"d2 Headphone",	"d2 OUT";
			*/

		nvidia,xbar = <&tegra_axbar>;

		rt565x_dai_link: nvidia,dai-link-1 {
			link-name = "rt565x-playback";
			cpu-dai = <&tegra_i2s3>;
			codec-dai = <&spdif_dit0>;
			cpu-dai-name = "I2S3";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <0>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "x";
			status = "disabled";
		};
		nvidia,dai-link-2 {
			link-name = "spdif-dit-1";
			cpu-dai = <&tegra_i2s2>;
			codec-dai = <&spdif_dit1>;
			cpu-dai-name = "I2S2";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <1>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "y";
			status = "disabled";
		};
		tlv320aic3104_dai_link: nvidia,dai-link-3 {
			link-name = "ti-playback";
			cpu-dai = <&tegra_i2s1>;
			codec-dai = <&aic3x>;
			cpu-dai-name = "I2S1";
			codec-dai-name = "tlv320aic3x-hifi";
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <0>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "z";
			status = "okay";
		};
		...

and

	i2c@31c0000 {
		status = "okay";
		aic3x: tlv320aic3x-codec.6-0018@18 {
			compatible = "ti,tlv320aic3104";
			status = "okay";
			reg = <0x18>;
			gpio-reset = <&tegra_main_gpio TEGRA_MAIN_GPIO(J, 6) GPIO_ACTIVE_LOW>;
			clocks = <&tegra_car TEGRA186_CLK_AUD_MCLK>;
			clock-names = "mclk";

			AVDD-supply = <&vdd_3v3>;
			IOVDD-supply = <&vdd_1v8_ap>;
			DRVDD-supply = <&vdd_3v3>;
			DVDD-supply = <&vdd_1v8_ap>;
		};
	};

Regards,

C.T.

  • C.T.

    We do not support nor developed the Tegra platform, so I recommend you post this question on the NVIDA forum. Nevertheless, should your tegra_sound instruct to use "ti,tlv320aic3104" or point to the tlv320aic3104 driver that is further down defined in your device-tree file for i2c?

    Ensure that your I2C transactions are happening and the device is connected to the I2C bus on the proper pin.

    Also test to see if the kernel detects the codec on sys/devices/*.i2c and see if there are any errors on i2c on the dmesg.

    For example of linux audio using Sitara platform, see this link. It walks you through the configuration of the codec driver, platform driver, and machine driver  through the device tree. You will need to do something similar for the Tegra platform.

    best regards,

      Pedro