TLV320AIC3204 Driver will support for AGX Orin 64GB SOM?

Dear Team,

We experienced audio codec driver problems when we first started using the TX2i SOM.
We used the TLV320AIC3204 TI audio codec for the TX2i, but the driver did not support it. You stated that the driver would be added to the future L4T package.

We are now using the AGX Orin Module to develop our custom card, which will use the TLV320AIC04 audio codec.
The TLV320AIC3204 Audio codec driver will support or not for AGX Orin SOM, Please kindly let us know.
Currently, we are using the Orin Dev kit with Latest Jetpack and L4T R35.1 package.

It would be really great if you could let us know.

Regards,
Parashuram

Sorry for the late response, I’m checking with internal team to see if can share the status, please stay tuned.

Hello Kaycc,

I’m awaiting your response. It would be very grateful if you could let me know.

Thanks,
Parashuram

Hi Parashuram.Biradar

Thanks for your patience.
The codec is not supported out of the box in Jetpack releases. Mostly the reason is there are N number of audio codecs that users want to integrate on the development platform and the codec driver is not owned by NVIDIA in such cases. Hopefully there will be a repository in future which can list down all the codecs supported.

But for now, I can help you on the integration of your audio codec.
I suggest you to go through below reference on the process of integration:

Audio Setup and Development — Jetson Linux Developer Guide documentation (refer to DT and driver changes required).

In case you see any issues, go through if you are facing one of the listed issues.
https://docs.nvidia.com/jetson/archives/r35.2.1/DeveloperGuide/text/SD/Communications/AudioSetupAndDevelopment.html#troubleshooting

In case you still face the issues, update here with necessary logs.

Thanks.

Hello spujar,

Thank you for your response and will check out the link you provided. If further support is required, I’ll let you know.

Regards,
Parashuram

Hello Pujar,

I followed the wiki link you provided and made the necessary changes.
I’ve connected the AGX Orin I2C and I2S2 connectors to the audio codec, but the sound is not coming.
The TLV320AIC3204 audio codec changes for the Orin dev kit are followed here.

Pinmux changes:

index 06b25b19f..90f6f0293 100644
--- a/bootloader/t186ref/BCT/tegra234-mb1-bct-pinmux-p3701-0000.dtsi
+++ b/bootloader/t186ref/BCT/tegra234-mb1-bct-pinmux-p3701-0000.dtsi
@@ -289,6 +289,16 @@
 				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
 			};
 
+			soc_gpio33_pq6 {
+				nvidia,pins = "soc_gpio33_pq6";
+				nvidia,function = "extperiph4";
+				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
+				nvidia,tristate = <TEGRA_PIN_DISABLE>;
+				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
+				nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
+				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
+			};
+
 			soc_gpio37_pr0 {
 				nvidia,pins = "soc_gpio37_pr0";
 				nvidia,function = "gp";
@@ -449,6 +459,42 @@
 				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
 			};
 
+			soc_gpio41_ph7 {
+				nvidia,pins = "soc_gpio41_ph7";
+				nvidia,function = "i2s2";
+				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
+				nvidia,tristate = <TEGRA_PIN_DISABLE>;
+				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
+				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
+			};
+
+			soc_gpio42_pi0 {
+				nvidia,pins = "soc_gpio42_pi0";
+				nvidia,function = "i2s2";
+				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
+				nvidia,tristate = <TEGRA_PIN_DISABLE>;
+				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
+				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
+			};
+
+			soc_gpio43_pi1 {
+				nvidia,pins = "soc_gpio43_pi1";
+				nvidia,function = "i2s2";
+				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
+				nvidia,tristate = <TEGRA_PIN_ENABLE>;
+				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
+				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
+			};
+
+			soc_gpio44_pi2 {
+				nvidia,pins = "soc_gpio44_pi2";
+				nvidia,function = "i2s2";
+				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
+				nvidia,tristate = <TEGRA_PIN_DISABLE>;
+				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
+				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
+			};
+
 			gen1_i2c_scl_pi3 {
 				nvidia,pins = "gen1_i2c_scl_pi3";
 				nvidia,function = "i2c1";
@@ -1217,16 +1263,6 @@
 				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
 			};
 
-			soc_gpio33_pq6 {
-				nvidia,pins = "soc_gpio33_pq6";
-				nvidia,function = "rsvd0";
-				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
-				nvidia,tristate = <TEGRA_PIN_ENABLE>;
-				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
-				nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
-				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
-			};
-
 			soc_gpio35_pq7 {
 				nvidia,pins = "soc_gpio35_pq7";
 				nvidia,function = "rsvd0";
@@ -1375,42 +1411,6 @@
 				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
 			};
 
-			soc_gpio41_ph7 {
-				nvidia,pins = "soc_gpio41_ph7";
-				nvidia,function = "rsvd2";
-				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
-				nvidia,tristate = <TEGRA_PIN_ENABLE>;
-				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
-				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
-			};
-
-			soc_gpio42_pi0 {
-				nvidia,pins = "soc_gpio42_pi0";
-				nvidia,function = "rsvd2";
-				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
-				nvidia,tristate = <TEGRA_PIN_ENABLE>;
-				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
-				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
-			};
-
-			soc_gpio43_pi1 {
-				nvidia,pins = "soc_gpio43_pi1";
-				nvidia,function = "rsvd2";
-				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
-				nvidia,tristate = <TEGRA_PIN_ENABLE>;
-				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
-				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
-			};
-
-			soc_gpio44_pi2 {
-				nvidia,pins = "soc_gpio44_pi2";
-				nvidia,function = "rsvd2";
-				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
-				nvidia,tristate = <TEGRA_PIN_ENABLE>;
-				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
-				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
-			};
-
 			cpu_pwr_req_pi5 {
 				nvidia,pins = "cpu_pwr_req_pi5";
 				nvidia,function = "rsvd0";

diff --git a/bootloader/tegra234-mb1-bct-gpio-p3701-0000.dtsi b/bootloader/tegra234-mb1-bct-gpio-p3701-0000.dtsi
index 1bc8272b9..c8b380d90 100644
--- a/bootloader/tegra234-mb1-bct-gpio-p3701-0000.dtsi
+++ b/bootloader/tegra234-mb1-bct-gpio-p3701-0000.dtsi
@@ -34,7 +34,6 @@
 				TEGRA234_MAIN_GPIO(Z, 7)
 				TEGRA234_MAIN_GPIO(P, 4)
 				TEGRA234_MAIN_GPIO(P, 6)
-				TEGRA234_MAIN_GPIO(Q, 6)
 				TEGRA234_MAIN_GPIO(Q, 7)
 				TEGRA234_MAIN_GPIO(R, 1)
 				TEGRA234_MAIN_GPIO(N, 4)
@@ -45,10 +44,7 @@
 				TEGRA234_MAIN_GPIO(G, 7)
 				TEGRA234_MAIN_GPIO(H, 0)
 				TEGRA234_MAIN_GPIO(H, 5)
-				TEGRA234_MAIN_GPIO(H, 7)
-				TEGRA234_MAIN_GPIO(I, 0)
 				TEGRA234_MAIN_GPIO(I, 1)
-				TEGRA234_MAIN_GPIO(I, 2)
 				TEGRA234_MAIN_GPIO(AC, 3)
 				TEGRA234_MAIN_GPIO(AC, 4)
 				TEGRA234_MAIN_GPIO(AC, 5)
@@ -84,6 +80,10 @@
 				TEGRA234_MAIN_GPIO(A, 2)
 				>;
 			gpio-output-high = <
+				TEGRA234_MAIN_GPIO(H, 7)
+				TEGRA234_MAIN_GPIO(I, 0)
+				TEGRA234_MAIN_GPIO(I, 2)
+				TEGRA234_MAIN_GPIO(Q, 6)
 				TEGRA234_MAIN_GPIO(Y, 0)
 				TEGRA234_MAIN_GPIO(Y, 1)
 				TEGRA234_MAIN_GPIO(Y, 2)

DTS changes in /sources/hardware/nvidia/platform/t23x/concord/kernel-dts/cvb/tegra234-p3737-audio.dtsi

diff --git a/sources/hardware/nvidia/platform/t23x/concord/kernel-dts/cvb/tegra234-p3737-audio.dtsi b/sources/hardware/nvidia/platform/t23x/concord/kernel-dts/cvb/tegra234-p3737-audio.dtsi
index 3acc0854e..5fca0b78d 100644
--- a/sources/hardware/nvidia/platform/t23x/concord/kernel-dts/cvb/tegra234-p3737-audio.dtsi
+++ b/sources/hardware/nvidia/platform/t23x/concord/kernel-dts/cvb/tegra234-p3737-audio.dtsi
@@ -14,6 +14,35 @@
 #include <audio/tegra-platforms-audio-dmic3-5-switch.dtsi>
 
 / {
+	/*Added Audio codec DT Changes*/
+        i2c@c250000 {
+		fsync-width = <0>;
+                aic32x4: tlv320aic32x4.1-0018@18 {
+                        compatible = "ti,tlv320aic32x4";
+                        status = "okay";
+                        reg = <0x18>;
+                        clocks = <&bpmp TEGRA234_CLK_AUD_MCLK>;
+                        //clocks = <&tegra_car TEGRA186_CLK_AUD_MCLK>; 
+                        clock-names = "mclk";
+                        dv-supply = <&battery_reg>;
+                        av-supply = <&battery_reg>;
+                        iov-supply = <&battery_reg>;
+
+                        #sound-dai-cells = <1>;
+                        sound-name-prefix = "TI-TLV320";
+
+                };
+        };
+	
+	clocks {
+    		aic32x4_mclk: aic32x4_mclk {
+       			 compatible = "fixed-clock";
+        		#clock-cells = <0>;
+        		clock-frequency = <12288000>;
+        		clock-output-names = "aic32x4-mclk";
+        		status = "okay";
+    		};
+	};
 	aconnect@2a41000 {
 		status = "okay";
 
@@ -26,9 +55,16 @@
 		};
 
 		ahub {
+			status = "okay";
 			/* I2S4 in Short frame sync for BT SCO */
 			i2s@2901300 {
-				bclk-ratio = <4>;
+				blck-ratio = <4>;
+				status = "okay";
+				};
+			/*I2S2 in Short frame sync for BT SCO */
+                        i2s@2901100 {
+				//bclk-ratio = <4>;
+			        status = "okay";
 			};
 		};
 	};
@@ -41,7 +77,6 @@
 		nvidia,model = "NVIDIA Jetson AGX Orin HDA";
 		status = "okay";
 	};
-
 	tegra_sound: sound {
 		status = "okay";
 		compatible = "nvidia,tegra186-ape";
@@ -52,6 +87,20 @@
 		clock-names = "pll_a", "pll_a_out0", "extern1";
 		assigned-clocks = <&bpmp_clks TEGRA234_CLK_AUD_MCLK>;
 		assigned-clock-parents = <&bpmp_clks TEGRA234_CLK_PLLA_OUT0>;
+			nvidia-audio-card,widgets =
+    				"Headphone",    "TI-TLV320 Headphone",
+    				"Microphone",   "TI-TLV320 Mic",
+    				"Line",         "TI-TLV320 Line In",
+    				"Line",         "TI-TLV320 Line Out";
+
+			nvidia-audio-card,routing =
+    				"TI-TLV320 Headphone",   "TI-TLV320 HP_OUT",
+    				"TI-TLV320 MIC_IN",      "TI-TLV320 Mic",
+    				"TI-TLV320 ADC",         "TI-TLV320 Mic Bias",
+    				"TI-TLV320 LINE_IN",     "TI-TLV320 Line In",
+    				"TI-TLV320 Line Out",    "TI-TLV320 LINE_OUT";
+                	nvidia-audio-card,mclk-fs = <256>;
+
 	};
 
 	tegra_sound_graph: sound_graph {
@@ -203,16 +252,28 @@
  * platform specific files.
  */
 
-hdr40_snd_link_i2s: &i2s2_to_codec { };
+hdr40_snd_link_i2s: &i2s2_to_codec {
+	link-name = "ti-capture";
+    	bitclock-master;
+    	frame-master;	
+	codec {
+        	sound-dai = <&aic32x4>;
+        	prefix = "TI-TLV320";
+    	};
+};
 
 /* Override with BT SCO entries */
 &i2s4_to_codec {
 	format = "dsp_a";
 	bitclock-inversion;
 };
+&i2s2_to_codec {
+        format = "dsp_a";
+        bitclock-inversion;
+};

Kconfig chages

diff --git a/sources/kernel/nvidia/sound/soc/tegra-alt/Kconfig b/sources/kernel/nvidia/sound/soc/tegra-alt/Kconfig
index eed57b8e5..84ff1bc14 100644
--- a/sources/kernel/nvidia/sound/soc/tegra-alt/Kconfig
+++ b/sources/kernel/nvidia/sound/soc/tegra-alt/Kconfig
@@ -201,6 +201,9 @@ config SND_SOC_TEGRA210_AUDIO_ALT
 	select SND_SOC_RT5640
 	select SND_SOC_RT5659
 	select SND_SOC_SGTL5000
+	select SND_SOC_TLV320AIC32X4
+        select SND_SOC_TLV320AIC32X4_I2C

Tegra machine driver changes

diff --git a/sources/kernel/nvidia/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver.c b/sources/kernel/nvidia/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver.c
index 28dd5f479..a81bad443 100644
--- a/sources/kernel/nvidia/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver.c
+++ b/sources/kernel/nvidia/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver.c
@@ -30,6 +30,7 @@
 #include <dt-bindings/sound/tas2552.h>
 #include "rt5659.h"
 #include "sgtl5000.h"
+#include "tlv320aic32x4.h"
 #include "tegra_asoc_machine_alt.h"
 #include "tegra210_xbar_alt.h"
 
@@ -391,6 +392,21 @@ static int tegra_machine_fepi_init(struct snd_soc_pcm_runtime *rtd)
 
 	return 0;
 }
+/*Added for TLV320AIC32X4 Audio codec changes*/
+static int tegra_machine_aic32x4_init(struct snd_soc_pcm_runtime *rtd)
+{
+        struct device *dev = rtd->card->dev;
+        int err;
+
+        err = snd_soc_dai_set_sysclk(rtd->codec_dai, aic32x4_SYSCLK, 12288000,
+                                     SND_SOC_CLOCK_IN);
+        if (err) {
+                dev_err(dev, "failed to set aic32x4 sysclk!\n");
+                return err;
+        }
+
[components.txt|attachment](upload://8ySRy1fs06izDHbBt81EARhy5iT.txt) (1008 Bytes)

+        return 0;
+}
 
 static int tegra_machine_rt565x_init(struct snd_soc_pcm_runtime *rtd)
 {
@@ -451,6 +467,8 @@ static int codec_init(struct tegra_machine *machine)
 			dai_links[i].init = tegra_machine_rt565x_init;
 		else if (strstr(dai_links[i].name, "fe-pi-audio-z-v2"))
 			dai_links[i].init = tegra_machine_fepi_init;
+		else if (strstr(dai_links[i].name, "ti-capture"))
+                        dai_links[i].init = tegra_machine_aic32x4_init;
 		else if (strstr(dai_links[i].name, "respeaker-4-mic-array"))
 			dai_links[i].init = tegra_machine_respeaker_init;
 	}

Linux kernel configuration:

root@ubuntu:/home/orin# zcat /proc/config.gz | grep "TLV320AIC3"
# CONFIG_SND_SOC_TLV320AIC31XX is not set
CONFIG_SND_SOC_TLV320AIC32X4=y
CONFIG_SND_SOC_TLV320AIC32X4_I2C=y
# CONFIG_SND_SOC_TLV320AIC32X4_SPI is not set
CONFIG_SND_SOC_TLV320AIC3X=y

Please find the attached reference log
i2cdetect

dmesg.log (75.3 KB)
components.txt (1008 Bytes)
dais.txt.txt (3.9 KB)
dt.log (491.4 KB)

Any help would be greatly appreciated!
Regards,
parashuram

Hello Pujar,

Please reply, I’m waiting for your response. Many thanks.

Parashuram

Hi Parshuram,

Sorry for delayed response.

In the dmesg.log you attached I see following error.
[ 16.033797] tegra-asoc:: probe of sound failed with error -22

You need to first check why you are getting this error in first place. Since it is failing you won’t see any APE sound card.

Note that you are providing ‘#sound-dai-cells’ as ‘1’ in codec node and DAI array is expected. You need to mention the index when you specify ‘sound-dai’ property in codec subnode of DAI link.
Can you check if following fixes your issue?

+hdr40_snd_link_i2s: &i2s2_to_codec {
+	link-name = "ti-capture";
+    	bitclock-master;
+    	frame-master;	
+	codec {
+        	sound-dai = <&aic32x4 0>;
+        	prefix = "TI-TLV320";
+    	};
+};

Hello Sameer,

Thanks for your reply,

[ 16.033797] tegra-asoc:: probe of sound failed with error -22

The error is gone now.
here are my DT changes to the audio codec.

diff --git a/sources/hardware/nvidia/platform/t23x/concord/kernel-dts/cvb/tegra234-p3737-audio.dtsi b/sources/hardware/nvidia/platform/t23x/concord/kernel-dts/cvb/tegra234-p3737-audio.dtsi
index 3acc0854e..625f00d04 100644
--- a/sources/hardware/nvidia/platform/t23x/concord/kernel-dts/cvb/tegra234-p3737-audio.dtsi
+++ b/sources/hardware/nvidia/platform/t23x/concord/kernel-dts/cvb/tegra234-p3737-audio.dtsi
@@ -14,6 +14,31 @@
 #include <audio/tegra-platforms-audio-dmic3-5-switch.dtsi>
 
 / {
+	/*Added Audio codec DT Changes*/
+        i2c@c250000 {
+		fsync-width = <0>;
+                aic32x4: tlv320aic32x4.1-0018@18 {
+                        compatible = "ti,tlv320aic32x4";
+                        status = "okay";
+                        reg = <0x18>;
+                        clocks = <&bpmp TEGRA234_CLK_AUD_MCLK>;
+                        //clocks = <&tegra_car TEGRA186_CLK_AUD_MCLK>; 
+                        clock-names = "mclk";
+                        dv-supply = <&battery_reg>;
+                        av-supply = <&battery_reg>;
+                        iov-supply = <&battery_reg>;
+                };
+        };
+	
+	clocks {
+    		aic32x4_mclk: aic32x4_mclk {
+       			compatible = "fixed-clock";
+        		#clock-cells = <0>;
+        		clock-frequency = <12288000>;
+        		clock-output-names = "aic32x4-mclk";
+        		status = "okay";
+    		};
+	};
 	aconnect@2a41000 {
 		status = "okay";
 
@@ -26,9 +51,16 @@
 		};
 
 		ahub {
+			status = "okay";
 			/* I2S4 in Short frame sync for BT SCO */
 			i2s@2901300 {
-				bclk-ratio = <4>;
+				blck-ratio = <4>;
+				status = "okay";
+				};
+			/*I2S2 in Short frame sync for BT SCO */
+                        i2s@2901100 {
+				//bclk-ratio = <4>;
+			        status = "okay";
 			};
 		};
 	};
@@ -41,7 +73,6 @@
 		nvidia,model = "NVIDIA Jetson AGX Orin HDA";
 		status = "okay";
 	};
-
 	tegra_sound: sound {
 		status = "okay";
 		compatible = "nvidia,tegra186-ape";
@@ -52,6 +83,41 @@
 		clock-names = "pll_a", "pll_a_out0", "extern1";
 		assigned-clocks = <&bpmp_clks TEGRA234_CLK_AUD_MCLK>;
 		assigned-clock-parents = <&bpmp_clks TEGRA234_CLK_PLLA_OUT0>;
+			nvidia-audio-card,widgets =
+    				"Headphone",    "TI-TLV320 Headphone",
+    				"Microphone",   "TI-TLV320 Mic",
+    				"Line",         "TI-TLV320 Line In",
+    				"Line",         "TI-TLV320 Line Out";
+
+			nvidia-audio-card,routing =
+    				"TI-TLV320 Headphone",   "TI-TLV320 HP_OUT",
+    				"TI-TLV320 MIC_IN",      "TI-TLV320 Mic",
+    				"TI-TLV320 ADC",         "TI-TLV320 Mic Bias",
+    				"TI-TLV320 LINE_IN",     "TI-TLV320 Line In",
+    				"TI-TLV320 Line Out",    "TI-TLV320 LINE_OUT";
+                nvidia-audio-card,mclk-fs = <256>;
 	};
 
 	tegra_sound_graph: sound_graph {
@@ -203,16 +269,28 @@
  * platform specific files.
  */
 
-hdr40_snd_link_i2s: &i2s2_to_codec { };
+hdr40_snd_link_i2s: &i2s2_to_codec {
+	link-name = "ti-capture";
+    	bitclock-master;
+    	frame-master;	
+	codec {
+        	sound-dai = <&aic32x4 0>;
+        	prefix = "TI-TLV320";
+    	};
+};
 
 /* Override with BT SCO entries */
 &i2s4_to_codec {
 	format = "dsp_a";
 	bitclock-inversion;
 };
+&i2s2_to_codec {
+        format = "dsp_a";
+        bitclock-inversion;
+};
 
 /* Audio graph related bindings */
-hdr40_snd_i2s_dap_ep: &i2s2_dap_ep { };
+hdr40_snd_i2s_dap_ep: &i2s2_dap_ep { }; 
 
 &i2s4_dap_ep {
 	dai-format = "dsp_a";

The error logs are in now.

[   15.009388] tegra-asoc: sound: ASoC: no source widget found for TI-TLV320 HP_OUT
[   15.017036] tegra-asoc: sound: ASoC: Failed to add route TI-TLV320 HP_OUT -> direct -> TI-TLV320 Headphone
[   15.017086] tegra-asoc: sound: ASoC: no sink widget found for TI-TLV320 MIC_IN
[   15.034474] tegra-asoc: sound: ASoC: Failed to add route TI-TLV320 Mic -> direct -> TI-TLV320 MIC_IN
[   15.034515] tegra-asoc: sound: ASoC: no source widget found for TI-TLV320 Mic Bias
[   15.050219] rtk_btusb: download_data done
[   15.051691] rtk_btusb: HCI reset.
[   15.051695] tegra-asoc: sound: ASoC: Failed to add route TI-TLV320 Mic Bias -> direct -> TI-TLV320 ADC
[   15.051725] tegra-asoc: sound: ASoC: no sink widget found for TI-TLV320 LINE_IN
[   15.063217] rtk_btusb: read_ver_rsp->lmp_subver = 0xcbc9
[   15.068844] tegra-asoc: sound: ASoC: Failed to add route TI-TLV320 Line In -> direct -> TI-TLV320 LINE_IN
[   15.068876] tegra-asoc: sound: ASoC: no source widget found for TI-TLV320 LINE_OUT
[   15.068877] tegra-asoc: sound: ASoC: Failed to add route TI-TLV320 LINE_OUT -> direct -> TI-TLV320 Line Out
[   15.075944] tegra-asoc: sound: snd_soc_register_card failed (-19)

Please find the attached complete dmesg log.
dmesg.log (76.5 KB)

Thanks,
Parashuram

Hi Parashuram,

The route properties you added under “nvidia-audio-card,routing” do not seem to be correct. The widgets you mentioned are not found and that is why the errors during boot.

You need to make sure to map to the right widgets. You can refer to the codec driver and then mention the exact names here with prefix.

Refer to below in the codec driver:

static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = {
        ...
        SND_SOC_DAPM_OUTPUT("HPL"),
        SND_SOC_DAPM_OUTPUT("HPR"),
        SND_SOC_DAPM_OUTPUT("LOL"),
        SND_SOC_DAPM_OUTPUT("LOR"),
        SND_SOC_DAPM_INPUT("IN1_L"),
        SND_SOC_DAPM_INPUT("IN1_R"),
        SND_SOC_DAPM_INPUT("IN2_L"),
        SND_SOC_DAPM_INPUT("IN2_R"),
        SND_SOC_DAPM_INPUT("IN3_L"),
        SND_SOC_DAPM_INPUT("IN3_R"),
        SND_SOC_DAPM_INPUT("CM_L"),
        SND_SOC_DAPM_INPUT("CM_R"),
};

instead of HP_OUT use HPL/HPR:

"TI-TLV320 Headphone",   "TI-TLV320 HPL",
"TI-TLV320 Headphone",   "TI-TLV320 HPR",

Similarly for others.

Hello,

I followed your instructions and made the necessary changes for the widget in DTS.

                        nvidia-audio-card,widgets =
                                "Headphone",    "TI-TLV320 Headphone",
                                "Microphone",   "TI-TLV320 Mic",
                                "Line",         "TI-TLV320 Line In",
                                "Line",         "TI-TLV320 Line Out";

                        nvidia-audio-card,routing =
                                "TI-TLV320 Headphone", "TI-TLV320 LOL",
                                "TI-TLV320 Headphone", "TI-TLV320 LOR",
                                "TI-TLV320 Headphone", "TI-TLV320 HPL",
                                "TI-TLV320 Headphone", "TI-TLV320 HPR",
                                "TI-TLV320 Left DAC", "TI-TLV320 Playback",
                                "TI-TLV320 Right DAC", "TI-TLV320 Playback",
                                "TI-TLV320 Mic Bias", "TI-TLV320 Mic",
                                "TI-TLV320 IN1_L", "TI-TLV320 Mic",
                                "TI-TLV320 IN1_R", "TI-TLV320 Mic",
                                "TI-TLV320 IN2_L", "TI-TLV320 Mic",
                                "TI-TLV320 IN2_R", "TI-TLV320 Mic",
                                "TI-TLV320 IN3_L", "TI-TLV320 Mic",
                                "TI-TLV320 IN3_R", "TI-TLV320 Mic",
                                "TI-TLV320 Capture", "TI-TLV320 Left ADC",
                                "TI-TLV320 Capture", "TI-TLV320 Right ADC";

The earlier error is gone now, and the one below has appeared.

[   15.466525] OF: /sound/nvidia-audio-card,dai-link@77/codec: could not get #sound-dai-cells for /i2c@c250000/tlv320aic32x4.1-0018@18
[   15.479708] tegra-asoc:: probe of sound failed with error -22

Please find the attached dmesg log.
dmesg.log (78.7 KB)

Will you kindly assist in finding a solution?

Thanks,
Parashuram

I think you missed the sound-dai-cells property from your codec node. The error actually points to this.

tlv320aic32x4.1-0018@18 {
...
#sound-dai-cells = <1>;
...
}

Check if above works.

Hello,

My DTS file looks as mentioned below after adding the dai-cells.

                aic32x4: tlv320aic32x4.1-0018@18 {
                        compatible = "ti,tlv320aic32x4";
                        status = "okay";
                        reg = <0x18>;
                        clocks = <&bpmp TEGRA234_CLK_AUD_MCLK>;
                        clock-names = "mclk";
                        dv-supply = <&battery_reg>;
                        av-supply = <&battery_reg>;
                        iov-supply = <&battery_reg>;
                        #sound-dai-cells = <1>;
                };
                        ...
			nvidia-audio-card,widgets =
    				"Headphone",    "TI-TLV320 Headphone",
    				//"Microphone",   "TI-TLV320 Mic",
    				 "Line",         "TI-TLV320 Line In",
    				 "Line",         "TI-TLV320 Line Out";

			nvidia-audio-card,routing =
        			"TI-TLV320 Headphone", "TI-TLV320 LOL",
                    "TI-TLV320 Headphone", "TI-TLV320 LOR",
			    	"TI-TLV320 Headphone", "TI-TLV320 HPL",
			    	"TI-TLV320 Headphone", "TI-TLV320 HPR",
			    	"TI-TLV320 Left DAC", "TI-TLV320 Playback",
			    	"TI-TLV320 Right DAC", "TI-TLV320 Playback",
			  	    /*"TI-TLV320 Mic Bias", "TI-TLV320 Mic", 
			    	"TI-TLV320 IN1_L", "TI-TLV320 Mic",
			    	"TI-TLV320 IN1_R", "TI-TLV320 Mic",
			    	"TI-TLV320 IN2_L", "TI-TLV320 Mic",
			    	"TI-TLV320 IN2_R", "TI-TLV320 Mic",
			    	"TI-TLV320 IN3_L", "TI-TLV320 Mic",
			    	"TI-TLV320 IN3_R", "TI-TLV320 Mic",*/
			    	"TI-TLV320 Capture", "TI-TLV320 Left ADC",
			    	"TI-TLV320 Capture", "TI-TLV320 Right ADC"; 

Not able here the sound from speakers.
Please find the attached reference logs.
dmeg.log (84.5 KB)
settings.txt (786.4 KB)
codecMixerControls.txt (2.9 KB)

Thanks,
Parashuram

Hello,

I’ve tried the mixer settings for speaker playback that is listed below, but I still can’t hear the sound coming from the speakers.

amixer -c APE sset 'ADMAIF2 Mux' 'I2S2'
amixer -c APE sset 'I2S2 Mux' 'ADMAIF2'
amixer -c APE cset name='TI-TLV320 Auto-mute Switch' 0
amixer -c APE cset name='TI-TLV320 HP DAC Playback Switch' 1
amixer -c APE cset name='TI-TLV320 HP Driver Gain Volume' 0
amixer -c APE cset name='TI-TLV320 HPL Output Mixer IN1_L Switch' 0
amixer -c APE cset name='TI-TLV320 HPR Output Mixer IN1_R Switch' 0
amixer -c APE cset name='TI-TLV320 HPL Output Mixer L_DAC Switch' 1
amixer -c APE cset name='TI-TLV320 HPR Output Mixer R_DAC Switch' 1
amixer -c APE cset name='TI-TLV320 LO DAC Playback Switch' 1

# 0: -6dB
amixer -c APE cset name='TI-TLV320 LO Driver Gain Volume' 0
amixer -c APE cset name='TI-TLV320 LOL Output Mixer L_DAC Switch' 1
amixer -c APE cset name='TI-TLV320 LOR Output Mixer R_DAC Switch' 1

# -63.5dB to 24dB: 0 ; 0dB
amixer -c APE cset name='TI-TLV320 PCM Playback Volume' 130
amixer -c APE cset name='TI-TLV320 PGA Level Volume' 95
amixer -c APE cset name='TI-TLV320 Mic PGA Switch' 0
amixer -c APE cset name='TI-TLV320 Right Input Mixer IN1_R P Switch' 1
amixer -c APE cset name='TI-TLV320 Right Input Mixer IN2_R P Switch' 0
amixer -c APE cset name='TI-TLV320 Right Input Mixer IN3_R P Switch' 1
amixer -c APE cset name='TI-TLV320 Left Input Mixer IN1_L P Switch' 1
amixer -c APE cset name='TI-TLV320 Left Input Mixer IN2_L P Switch' 0
amixer -c APE cset name='TI-TLV320 Left Input Mixer IN3_L P Switch' 1

amixer -c APE cset name='TI-TLV320 ADCFGA Left Mute Switch' 0
amixer -c APE cset name='TI-TLV320 ADCFGA Right Mute Switch' 0

find the attached logs for reference.
codecMixerControls.txt (2.9 KB)
dmesg.log (81.7 KB)
outout_amixer.log (4.1 KB)
tegra234-p3737-audio.dtsi (9.2 KB)

I’d appreciate it if you could tell us how to listen a sound from a codec.
I’ll be waiting for your response.
Thanks,
Parashuram

Hi Parashuram,

I don’t see any error prints in dmesg.log. Few things you can check.

What is the aplay command you are running? Please provide the reference.

Can you probe the signals on your codec board? You should see I2S bit and frame clocks to be active when your run the audio session.

Hello Sameer,

Thanks for your reply,

The aplay command which I’m using is aplay -D hw:APE,0 test.wave still can’t hear anything through speakers.

While playing the audio, we probed the I2S lane and found no transitions in any pins.
Please find the reference logs and images.


audo_mixer.sh (1.5 KB)
dmesg.log (81.3 KB)
mixer_output.txt (4.1 KB)

Thanks.
Parashuram

Hello Sameer,

I hope you’re doing well.
The issue hasn’t been solved yet. I can see that my Pinmux settings are fine. however, after making the necessary changes still cannot hear sound from the codec.

Here are a few logs and images for your reference.
pinconf-groups (39.3 KB)

sound

Could you please let me know how I can solve this issue.

Thanks.
Parashuram

You are using ADMAIF2 here. So aplay command you should be using is:
aplay -D hw:APE,1 test.wave

Please check if you get signals when you probe. If this is working then check audio output.

Hello,

I have entered the command as mentioned above.

orin@orin-desktop:~$ aplay -D hw:APE, 1 test.wav
Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Stereo
orin@orin-desktop:~$ 

The apply command immediately ends after entering the aplay command, and there is no transition in the I2S lanes.
the test.wav audio duration is 33 sec but aplay commands exits immediately.

Thanks,
Parashuram

Do you have a preference to use TLV codec is producer mode?
As per your DT settings, it seems to be configured in master mode and in such case TLV codec should be supplying I2S bit and frame clocks. This does not seem to happen as you don’t see any signal transition.

Can you instead try with TLV codec in consumer mode?

Update following to use Tegra I2S as producer and TLV codec as consumer:

hdr40_snd_link_i2s: &i2s2_to_codec {
	link-name = "ti-capture";
    	//bitclock-master;
  	//frame-master;	
	codec {
        	sound-dai = <&aic32x4 0>;
        	prefix = "TI-TLV320";
    	};
};