TLV320aic32x4 audio codec is not detecting for tx2i

Hello,

Environment: Ubuntu 18.04. Jetpack 4.4 with 32.4.4
TLV320aic32x4 audio codec is not detecting for tx2i. we have enabled driver CONFIG_SND_SOC_TLV320AIC32X4=y and added codec dts ( aic32x4: tlv320aic32x4.1-0018@18 {
compatible = “ti,tlv320aic32x4”;
status = “okay”;
reg = <0x18>;
clocks = <&tegra_car TEGRA186_CLK_AUD_MCLK>;
clock-names = “mclk”;
dv-supply = <&battery_reg>;
av-supply = <&battery_reg>;
iov-supply = <&battery_reg>;
};
) and i2c device 0x18 is uu(reserved) but audio not able to hear. Is there any method to detect audio codec?
any help will be greatly appreciated.

Thanks,
Parashuram

Hi Parashuram,

Please check below L4T doc if can have idea on your issue:
https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fasoc_driver.18.2.html%23wwpID0E0TD0HA

Hello Kayccc,

Please have a look below outputs
pbjetson@elma:~$ dmesg | grep “ASoC”
The dmesg output nothing to show:
pbjetson@elma:~$ sudo cat /sys/kernel/debug/asoc/codecs
**[sudo] password for pbjetson: **
tegra186-dspk.1
tegra186-dspk.0
tegra186-asrc
tegra186-arad
tegra210-ope.0
tegra210-mvc.1
tegra210-mvc.0
tegra186-afc.5
tegra186-afc.4
tegra186-afc.3
tegra186-afc.2
tegra186-afc.1
tegra186-afc.0
tegra210-sfc.3
tegra210-sfc.2
tegra210-sfc.1
tegra210-sfc.0
tegra210-mixer
tegra210-adx.3
tegra210-adx.2
tegra210-adx.1
tegra210-adx.0
tegra210-amx.3
tegra210-amx.2
tegra210-amx.1
tegra210-amx.0
tegra210-dmic.3
tegra210-dmic.2
tegra210-dmic.1
tegra210-dmic.0
tegra210-i2s.5
tegra210-i2s.4
tegra210-i2s.3
tegra210-i2s.2
tegra210-i2s.1
tegra210-i2s.0
tegra186-admaif
tegra210-axbar
tlv320aic32x4.0-0018
spdif_dit:spdif-dit.13@d
spdif_dit:spdif-dit.12@c
spdif_dit:spdif-dit.11@b
spdif_dit:spdif-dit.10@a
spdif_dit:spdif-dit.9@9
spdif_dit:spdif-dit.8@8
spdif_dit:spdif-dit.7@7
spdif_dit:spdif-dit.6@6
spdif_dit:spdif-dit.5@5
spdif_dit:spdif-dit.4@4
spdif_dit:spdif-dit.3@3
spdif_dit:spdif-dit.2@2
spdif_dit:spdif-dit.1@1
spdif_dit:spdif-dit.0@0
snd-soc-dummy
The SPDIF codec is enabled
CONFIG_SND_SOC_SDPIF=y

could you please help me out.

Regards,
Parashuram

Hi Parashuram,

Could you please share all DT changes done to enable TLV320aic32x4 in your tree?

Please check the section 40-pin GPIO Expansion Header for further guidance on pinmux settings and Device Tree changes required.

Thanks,
Sharad

There is enough info available related to TLV320aic32x4 on this portal Search results for 'TLV320aic32x4 ' - NVIDIA Developer Forums. Kindly refer these as well.

Hello!

Per the feedback provided here, please check the following to ensure that the DT has been updated correctly and the driver is enabled as expected.

$ ls /proc/device-tree/i2c\@c240000/
$ zcat /proc/config.gz | grep CONFIG_SND_SOC_TLV320AIC32X4

By the way, it will be easier to review your changes if you can post diff’s for the files you are modifying rather than the entire file.

Regards,
Jon

Hello Jonathanh,
please find the outputs below commands

`ls /proc/device-tree/i2c@c240000/
'#address-cells'   bmp280@77         clocks       dma-names   i2cmux@70     iommus          lp8556-backlight-s-wqxga-10-1@2c   phandle         reset-names        scl-gpio       status
 ak8963@0d         clock-frequency   cm32180@48   dmas        icm20628@68   iqs263@44       name                               prod-settings   resets             sda-gpio
 bmi160@69         clock-names       compatible   gpio@20     interrupts    linux,phandle   ov23850_c@36                       reg             rt5659.1-001a@1a  '#size-cells'
Preformatted text`

I’m using I2C 0 port with node 3160000 for TLV320AIC3204

ls /proc/device-tree/i2c@3160000/
'#address-cells'      clocks       gpio@21       ina3221x@41   iommus                            phandle         resets         status              tlv320aic32x4.1-0018@18
 clock-frequency      compatible   gpio@74       ina3221x@42   linux,phandle                     prod-settings   scl-gpio       system_monitor@2f   tps65132@3e
 clock-generator@6b   dma-names    gpio@77       ina3221x@43   lp8557-backlight-s-wuxga-8-0@2c   reg             sda-gpio       temp_sensor1@4f
 clock-names          dmas         ina3221x@40   interrupts    name                              reset-names    '#size-cells'   temp_sensor2@4e

$ zcat /proc/config.gz | grep CONFIG_SND_SOC_TLV320AIC32X4
CONFIG_SND_SOC_TLV320AIC32X4=y
CONFIG_SND_SOC_TLV320AIC32X4_I2C=y
CONFIG_SND_SOC_TLV320AIC32X4_SPI=y

Hello,
DT changes are below. with respective the node i2c@3160000

— a/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
+++ b/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
@@ -217,6 +217,15 @@
238 239 240 241 242 244 245 246
247 248 249 250 251 253 254 255 >;
};
+ aic32x4: tlv320aic32x4.0-0018@18 {
+ compatible = “ti,tlv320aic32x4”;
+ status = “okay”;
+ reg = <0x18>;
+ clocks = <&tegra_car TEGRA186_CLK_AUD_MCLK>;
+ clock-names = “mclk”;
+ };

    };

Regrdas,
Parashuram

Hello!

OK, great. I don’t see anything to suggest that the codec is not detected. Furthermore, I see that you do see it listed under …

$ sudo cat /sys/kernel/debug/asoc/codecs

This means that the codec has been probed successfully by the kernel and in other words it is detected.

In your DT you have …

    nvidia,xbar = <&tegra_axbar>;
	rt565x_dai_link: nvidia,dai-link-1 {
                        link-name = "ti-capture";
                        cpu-dai = <&tegra_i2s1>;
                        codec-dai = <&aic32x4>;
                        cpu-dai-name = "I2S1";
                        codec-dai-name = "tlv320aic32x4-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";
                };
		nvidia,dai-link-2 {
    			link-name = "aic32x4-codec";
    			cpu-dai = <&tegra_i2s1>;
    			codec-dai = <&aic32x4>;
    			cpu-dai-name = "I2S1";
    			codec-dai-name = "aic32x4";
    			format = "i2s";
    			bitclock-master;
    			frame-master;
			format = "dsp_a";
			fsync-width = <0>;
    			bit-format = "s16_le";
   			name-prefix = "x";
                	status = "okay";
		};

You should only have 1 link for the codec and not 2. So you should remove one of these.

Next you need to ensure you have the ‘nvidia,audio-routing’ DT node set up as Igal has in this post for the codec.

Did you modify the codec driver as Igal has?

Have you tried using his play.sh and record.sh scripts?

Regards,
Jon

Hello Jonathanh,

I have added only one link codec and nvidia,audio-routing please find the attached complete DT.
after doing changes from igal in tlv320aic32x4,c getting error please find the error log.
ran both scripts and attached.
I’m trying nvidia asoc wiki also but not able get TI codec up. could you please help us to get codec up .
Record_out.log (3.3 KB) Play_out.log (2.7 KB)
tegra186-quill-common.dtsi.txt (36.3 KB) build_error.txt (4.9 KB)

Regards,
Parashuram

Hello!

Please provide a diff of both the codec and DT change that you have made. That will be easier for us to see what has been changed.

Thanks
Jon

Hello Jonathanh,

I made changes in tegra_machine_driver_mobile.c and DT following below.

diff --git a/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c b/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c
index fbca4699d..fe73a70c2 100644
--- a/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c
+++ b/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.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"
 
@@ -283,7 +284,7 @@ static int tegra_machine_set_params(struct snd_soc_card *card,
 
 static int tegra_machine_dai_init(struct snd_soc_pcm_runtime *runtime,
 				  unsigned int rate, unsigned int channels,
-				  u64 formats)
+				  u64 formats, bool is_palyback)
 {
 	struct snd_soc_card *card = runtime->card;
 	struct tegra_machine *machine = snd_soc_card_get_drvdata(card);
@@ -310,7 +311,6 @@ static int tegra_machine_dai_init(struct snd_soc_pcm_runtime *runtime,
 	err = tegra_machine_set_params(card, machine, rate, channels, formats);
 	if (err < 0)
 		return err;
-
 	rtd = snd_soc_get_pcm_runtime(card, "rt565x-playback");
 	if (rtd) {
 		dai_params =
@@ -327,6 +327,23 @@ static int tegra_machine_dai_init(struct snd_soc_pcm_runtime *runtime,
 			return err;
 		}
 	}
+//Added TLV320AIC32X4
+	rtd = snd_soc_get_pcm_runtime(card, "ti-capture");
+        if (rtd) {
+                dai_params =
+                (struct snd_soc_pcm_stream *)rtd->dai_link->params;
+
+                dai_params->rate_min = srate;
+                dai_params->formats = (machine->fmt_via_kcontrol == 2) ?
+                        (1ULL << SNDRV_PCM_FORMAT_S32_LE) : formats;
+		err = snd_soc_dai_set_sysclk(rtd->codec_dai, RT5659_SCLK_S_MCLK,
+                                             aud_mclk, SND_SOC_CLOCK_IN);
+                if (err < 0) {
+                        dev_err(card->dev, "codec_dai clock not set\n");
+                        return err;
+                }
+        }
+//Ended
 
 	rtd = snd_soc_get_pcm_runtime(card, "rt565x-codec-sysclk-bclk1");
 	if (rtd) {
@@ -440,10 +457,17 @@ static int tegra_machine_pcm_hw_params(struct snd_pcm_substream *substream,
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_card *card = rtd->card;
 	int err;
+	bool is_playback;
+
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+		is_playback = true;
+	else
+		is_playback = false;
 
 	err = tegra_machine_dai_init(rtd, params_rate(params),
 				     params_channels(params),
-				     1ULL << params_format(params));
+				     (1ULL << (params_format(params))),
+			is_playback);
 	if (err < 0) {
 		dev_err(card->dev, "Failed dai init\n");
 		return err;
@@ -593,7 +617,29 @@ static int tegra_machine_rt565x_init(struct snd_soc_pcm_runtime *rtd)
 
 	return 0;
 }
+//Added tlv320aic32x4
+
+static int tegra_machine_aic32x4_init(struct snd_soc_pcm_runtime *rtd)
+{
+    struct device *dev = rtd->card->dev;
+    int err;
+
+//	codec_rate      = tegra_machine_srate_values[machine->rate_via_kcontrol];
+//	clk_rate        = (machine->rate_via_kcontrol) ? codec_rate : rate;
+
+//	clk_out_rate = machine->audio_clock.clk_out_rate;
+
+    err = snd_soc_dai_set_sysclk(rtd->codec_dai, AIC32X4_FREQ_25000000, 12288000,
+                                SND_SOC_CLOCK_IN);
+    if (err) {
+        dev_err(dev, "failed to set aic32x4 sysclk! \n");
+        return err;
+    }
+
+    return 0;
+}
 
+//Ended
 static int codec_init(struct tegra_machine *machine)
 {
 	struct snd_soc_dai_link *dai_links = machine->asoc->dai_links;
@@ -611,6 +657,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;
 	}
 
 	return 0;

DT changes

diff --git a/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi b/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
old mode 100644
new mode 100755
index 9416a21..f32ca45
--- a/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
+++ b/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
@@ -166,6 +166,16 @@
 				rom-val = /bits/ 8 <0x05>;
 			};
 		};
+ 	aic32x4: tlv320aic32x4.1-0018@18 {
+                        compatible = "ti,tlv320aic32x4";
+                        status = "okay";
+                        reg = <0x18>;
+                        clocks = <&tegra_car TEGRA186_CLK_AUD_MCLK>;
+                        clock-names = "mclk";
+                        dv-supply = <&battery_reg>;
+                        av-supply = <&battery_reg>;
+                        iov-supply = <&battery_reg>;
+                };	
 	};
 
 	i2c@c240000 {
@@ -668,7 +678,8 @@
 #endif
 	ahub {
 		/* I2S6 */
-		i2s@2901500 {
+		i2s@2901100 {
+			status = "okay";
 			bclk-ratio = <4>;
 		};
 
@@ -695,15 +706,24 @@
 	tegra_sound: sound {
 		compatible = "nvidia,tegra-audio-t186ref-mobile-rt565x";
 		nvidia,model = "tegra-snd-t186ref-mobile-rt565x";
-		nvidia,num-codec-link = <12>;
-		clocks = <&tegra_car TEGRA186_CLK_PLLA>,
-			 <&tegra_car TEGRA186_CLK_PLL_A_OUT0>,
-			 <&tegra_car TEGRA186_CLK_AUD_MCLK>;
-		clock-names = "pll_a", "pll_a_out0", "extern1";
-		assigned-clocks = <&tegra_car TEGRA186_CLK_PLL_A_OUT0>,
-				  <&tegra_car TEGRA186_CLK_AUD_MCLK>;
-		assigned-clock-parents = <&tegra_car TEGRA186_CLK_PLLA>,
-					 <&tegra_car TEGRA186_CLK_PLL_A_OUT0>;
+		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";
 
@@ -745,6 +765,7 @@
 			name-prefix = "x";
 			status = "okay";
 		};
+/*
 		nvidia,dai-link-2 {
 			link-name = "spdif-dit-1";
 			cpu-dai = <&tegra_i2s2>;
@@ -757,8 +778,9 @@
 			num-channel = <2>;
 			ignore_suspend;
 			name-prefix = "y";
-			status = "okay";
+			status = "disabled";
 		};
+*/		
 		nvidia,dai-link-3 {
 			link-name = "spdif-dit-2";
 			cpu-dai = <&tegra_i2s3>;
@@ -770,8 +792,8 @@
 			srate = <48000>;
 			num-channel = <2>;
 			ignore_suspend;
-			name-prefix = "z";
-			status = "okay";
+			name-prefix = "a";
+			status = "disabled";
 		};
 		nvidia,dai-link-4 {
 			link-name = "spdif-dit-3";
@@ -785,7 +807,7 @@
 			num-channel = <2>;
 			ignore_suspend;
 			name-prefix = "m";
-			status = "okay";
+			status = "disabled";
 		};
 		nvidia,dai-link-5 {
 			link-name = "spdif-dit-4";
@@ -799,7 +821,7 @@
 			num-channel = <2>;
 			ignore_suspend;
 			name-prefix = "n";
-			status = "okay";
+			status = "disabled";
 		};
 		nvidia,dai-link-6 {
 			link-name = "spdif-dit-6";
@@ -816,7 +838,7 @@
 			num-channel = <1>;
 			ignore_suspend;
 			name-prefix = "o";
-			status = "okay";
+			status = "disabled";
 		};
 		nvidia,dai-link-7 {
 			link-name = "spdif-dit-7";
@@ -830,7 +852,7 @@
 			ignore_suspend;
 			num-channel = <2>;
 			name-prefix = "a";
-			status = "okay";
+			status = "disabled";
 		};
 		nvidia,dai-link-8 {
 			link-name = "spdif-dit-8";
@@ -844,7 +866,7 @@
 			ignore_suspend;
 			num-channel = <2>;
 			name-prefix = "b";
-			status = "okay";
+			status = "disabled";
 		};
 		nvidia,dai-link-9 {
 			link-name = "spdif-dit-9";
@@ -858,7 +880,7 @@
 			ignore_suspend;
 			num-channel = <2>;
 			name-prefix = "c";
-			status = "okay";
+			status = "disabled";
 		};
 		nvidia,dai-link-10 {
 			link-name = "spdif-dit-10";
@@ -872,7 +894,7 @@
 			ignore_suspend;
 			num-channel = <2>;
 			name-prefix = "d";
-			status = "okay";
+			status = "disabled";
 		};
 		nvidia,dai-link-11 {
 			link-name = "dspk1-playback";
@@ -886,7 +908,7 @@
 			num-channel = <2>;
 			ignore_suspend;
 			name-prefix = "d3";
-			status = "okay";
+			status = "disabled";
 		};
 		dspk_1_dai_link: nvidia,dai-link-12 {
 			link-name = "dspk-playback-l";
@@ -914,10 +936,31 @@
 			num-channel = <2>;
 			ignore_suspend;
 			name-prefix = "d2";
-			status = "okay";
-                };
-	};
+			status = "disabled";
+		};
 
+		nvidia,dai-link-2 {
+            		link-name = "ti-capture";
+            		cpu-dai = <&tegra_i2s1>;
+            		codec-dai = <&aic32x4>;
+            		cpu-dai-name = "I2S1";
+            		codec-dai-name = "tlv320aic32x4-hifi";
+         		tx-mask = <0xFF>;
+          		rx-mask = <0xFF>;            
+            		format = "i2s";
+            		bitclock-slave;
+            		frame-slave;
+            		bitclock-noninversion;
+            		frame-noninversion;
+           		bit-format = "s16_le";
+            		bclk_ratio = <1>;
+            		srate = <44100>;
+            		num-channel = <2>;
+            		ignore_suspend;
+            		name-prefix = "z";
+			status = "okay"; 
+		};
+	};
 	backlight {
 		status = "okay";
 		panel-s-wuxga-8-0-bl {

Dmesg logs are here
dmesg | grep ASoC
[ 2.411212] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_R
[ 2.411215] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_R → 10 kOhm → CM_R to Right Mixer Negative Resistor
[ 2.411238] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_R
[ 2.411241] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_R → 20 kOhm → CM_R to Right Mixer Negative Resistor
[ 2.411265] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_R
[ 2.411268] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_R → 40 kOhm → CM_R to Right Mixer Negative Resistor
[ 2.416418] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_L
[ 2.416420] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_L → 10 kOhm → CM_L to Left Mixer Negative Resistor
[ 2.416457] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_L
[ 2.416459] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_L → 20 kOhm → CM_L to Left Mixer Negative Resistor
[ 2.416480] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_L
[ 2.416482] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_L → 40 kOhm → CM_L to Left Mixer Negative Resistor
[ 2.426113] tegra-asoc: sound: ASoC: failed to init ti-capture: -22
[ 2.426115] tegra-asoc: sound: ASoC: failed to instantiate card -22

dmesg | grep asoc
[ 2.426108] tegra-asoc: sound: failed to set aic32x4 sysclk!
[ 2.426113] tegra-asoc: sound: ASoC: failed to init ti-capture: -22
[ 2.426115] tegra-asoc: sound: ASoC: failed to instantiate card -22
[ 2.432065] tegra-asoc: sound: snd_soc_register_card failed (-22)
[ 2.432227] tegra-asoc:: probe of sound failed with error -22

Could you please let me know how to add the sysclk for TLV320AIC32X4 device.

Regards,
Parashuram

Hello!

From the looking at your changes I see you have …

+    err = snd_soc_dai_set_sysclk(rtd->codec_dai, AIC32X4_FREQ_25000000, 12288000,
+                                SND_SOC_CLOCK_IN);
+    if (err) {
+        dev_err(dev, "failed to set aic32x4 sysclk! \n");
+        return err;
+    }

However, if you are using the same tlv320aic32x4.c as Igal was using then, the driver is expecting …

static int aic32x4_set_dai_sysclk(struct snd_soc_dai *codec_dai,
				  int clk_id, unsigned int freq, int dir)
{
	struct snd_soc_codec *codec = codec_dai->codec;
	struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec);

	switch (freq) {
	case AIC32X4_FREQ_12000000:
	case AIC32X4_FREQ_24000000:
	case AIC32X4_FREQ_25000000:
		aic32x4->sysclk = freq;
		return 0;
	}
	printk(KERN_ERR "aic32x4: invalid frequency to set DAI system clock\n");
	return -EINVAL;
}

So per Igal changes you need to do something like …

err = snd_soc_dai_set_sysclk(card->rtd[idx].codec_dai, 0, 12000000, SND_SOC_CLOCK_IN);

However, this assumes that you have configured the AUD_MCLK to be 12MHz. For L4T r32.x, you can configure the AUD_MCLK to be a fixed rate as described in this doc.

Regards,
Jon

Hello Jonathanh,

I have made sysclk changes in driver file so there is no error now.
please have look in the driver file.

diff --git a/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c b/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c
index fbca4699d..2b3568fd0 100644
--- a/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c
+++ b/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.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"
 
@@ -282,10 +283,11 @@ static int tegra_machine_set_params(struct snd_soc_card *card,
 }
 
 static int tegra_machine_dai_init(struct snd_soc_pcm_runtime *runtime,
-				  unsigned int rate, unsigned int channels,
-				  u64 formats)
+				  int rate, unsigned int channels,
+				  u64 formats, bool is_palyback)
 {
 	struct snd_soc_card *card = runtime->card;
+	//struct snd_soc_card *card = rtd->card;
 	struct tegra_machine *machine = snd_soc_card_get_drvdata(card);
 	struct snd_soc_pcm_stream *dai_params;
 	unsigned int aud_mclk, srate;
@@ -310,7 +312,6 @@ static int tegra_machine_dai_init(struct snd_soc_pcm_runtime *runtime,
 	err = tegra_machine_set_params(card, machine, rate, channels, formats);
 	if (err < 0)
 		return err;
-
 	rtd = snd_soc_get_pcm_runtime(card, "rt565x-playback");
 	if (rtd) {
 		dai_params =
@@ -327,6 +328,20 @@ static int tegra_machine_dai_init(struct snd_soc_pcm_runtime *runtime,
 			return err;
 		}
 	}
+//Added TLV320AIC32X4
+	rtd = snd_soc_get_pcm_runtime(card, "ti-capture");
+        if (rtd) {
+                dai_params =
+                (struct snd_soc_pcm_stream *)rtd->dai_link->params;
+                dai_params->rate_min = srate;
+		 dai_params->channels_min = channels;
+        	dai_params->formats = formats;
+                if (err < 0) {
+                        dev_err(card->dev, "codec_dai clock not parashuram set\n");
+                        return err;
+                }
+        }
+//Ended
 
 	rtd = snd_soc_get_pcm_runtime(card, "rt565x-codec-sysclk-bclk1");
 	if (rtd) {
@@ -440,10 +455,17 @@ static int tegra_machine_pcm_hw_params(struct snd_pcm_substream *substream,
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_card *card = rtd->card;
 	int err;
+	bool is_playback;
+
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+		is_playback = true;
+	else
+		is_playback = false;
 
 	err = tegra_machine_dai_init(rtd, params_rate(params),
 				     params_channels(params),
-				     1ULL << params_format(params));
+				     (1ULL << (params_format(params))),
+			is_playback);
 	if (err < 0) {
 		dev_err(card->dev, "Failed dai init\n");
 		return err;
@@ -593,7 +615,22 @@ static int tegra_machine_rt565x_init(struct snd_soc_pcm_runtime *rtd)
 
 	return 0;
 }
+//Added tlv320aic32x4
+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, 0, 12000000,
+                                SND_SOC_CLOCK_IN);
+    if (err) {
+        dev_err(dev, "failed to set aic32x4 sysclk!\n");
+        return err;
+    }
 
+    return 0;
+}
+//Ended
 static int codec_init(struct tegra_machine *machine)
 {
 	struct snd_soc_dai_link *dai_links = machine->asoc->dai_links;
@@ -611,6 +648,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;
 	}
 
 	return 0;

The error is now related to I2S1
can you please let me know where I’m creating a duplicate filename?

nfs@nfs-desktop:~$ dmesg | grep I2S1
[    2.410317] sysfs: cannot create duplicate filename '/devices/sound/I2S1 CIF'
[    2.410469] kobject_add_internal failed for I2S1 CIF with -EEXIST, don't try to register things with the same name in the same directory.
nfs@nfs-desktop:~$ dmesg | grep sound
[    0.466480] iommu: Adding device sound to group 52
[    2.319564] input: tegra-hda HDMI/DP,pcm=3 as /devices/3510000.hda/sound/card0/input0
[    2.319699] input: tegra-hda HDMI/DP,pcm=7 as /devices/3510000.hda/sound/card0/input1
[    2.404206] tegra-asoc: sound: ADMAIF1 <-> ADMAIF1 mapping ok
[    2.404287] tegra-asoc: sound: ADMAIF2 <-> ADMAIF2 mapping ok
[    2.404366] tegra-asoc: sound: ADMAIF3 <-> ADMAIF3 mapping ok
[    2.404441] tegra-asoc: sound: ADMAIF4 <-> ADMAIF4 mapping ok
[    2.404543] tegra-asoc: sound: ADMAIF5 <-> ADMAIF5 mapping ok
[    2.404615] tegra-asoc: sound: ADMAIF6 <-> ADMAIF6 mapping ok
[    2.404685] tegra-asoc: sound: ADMAIF7 <-> ADMAIF7 mapping ok
[    2.404756] tegra-asoc: sound: ADMAIF8 <-> ADMAIF8 mapping ok
[    2.404826] tegra-asoc: sound: ADMAIF9 <-> ADMAIF9 mapping ok
[    2.404894] tegra-asoc: sound: ADMAIF10 <-> ADMAIF10 mapping ok
[    2.404966] tegra-asoc: sound: ADMAIF11 <-> ADMAIF11 mapping ok
[    2.405039] tegra-asoc: sound: ADMAIF12 <-> ADMAIF12 mapping ok
[    2.405108] tegra-asoc: sound: ADMAIF13 <-> ADMAIF13 mapping ok
[    2.405176] tegra-asoc: sound: ADMAIF14 <-> ADMAIF14 mapping ok
[    2.405247] tegra-asoc: sound: ADMAIF15 <-> ADMAIF15 mapping ok
[    2.405318] tegra-asoc: sound: ADMAIF16 <-> ADMAIF16 mapping ok
[    2.405387] tegra-asoc: sound: ADMAIF17 <-> ADMAIF17 mapping ok
[    2.405456] tegra-asoc: sound: ADMAIF18 <-> ADMAIF18 mapping ok
[    2.405529] tegra-asoc: sound: ADMAIF19 <-> ADMAIF19 mapping ok
[    2.405599] tegra-asoc: sound: ADMAIF20 <-> ADMAIF20 mapping ok
[    2.410317] sysfs: cannot create duplicate filename '/devices/sound/I2S1 CIF'
[    2.410473] tegra-asoc: sound: ASoC: failed to register runtime device: -17
[    2.410476] tegra-asoc: sound: ASoC: failed to instantiate card -17
[    2.417112] tegra-asoc: sound: snd_soc_register_card failed (-17)
[    2.417339] tegra-asoc:: probe of sound failed with error -17
nfs@nfs-desktop:~$ dmesg | grep tlv
[    2.393675] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_R
[    2.393679] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_R -> 10 kOhm -> CM_R to Right Mixer Negative Resistor
[    2.393698] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_R
[    2.393700] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_R -> 20 kOhm -> CM_R to Right Mixer Negative Resistor
[    2.393719] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_R
[    2.393721] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_R -> 40 kOhm -> CM_R to Right Mixer Negative Resistor
[    2.398652] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_L
[    2.398655] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_L -> 10 kOhm -> CM_L to Left Mixer Negative Resistor
[    2.398675] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_L
[    2.398677] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_L -> 20 kOhm -> CM_L to Left Mixer Negative Resistor
[    2.398697] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_L
[    2.398699] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_L -> 40 kOhm -> CM_L to Left Mixer Negative Resistor

Thanks,
Parashuram

Hello!

With regard to the above, I believe that you have two dai-links in DT that both reference to I2S1. Please ensure that you only have 1 dai-link that references I2S1.

Regards
Jon

Hello Jonathanh,

I have made changes for DT with related I2S1 that’s working fine now.
I’m referring igle DT.
DT changes are below

diff --git a/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi b/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
old mode 100644
new mode 100755
index 9416a21..acf8d76
--- a/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
+++ b/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
@@ -166,6 +166,16 @@
 				rom-val = /bits/ 8 <0x05>;
 			};
 		};
+ 	aic32x4: tlv320aic32x4.1-0018@18 {
+                        compatible = "ti,tlv320aic32x4";
+                        status = "okay";
+                        reg = <0x18>;
+                        clocks = <&tegra_car TEGRA186_CLK_AUD_MCLK>;
+                        clock-names = "mclk";
+                        dv-supply = <&battery_reg>;
+                        av-supply = <&battery_reg>;
+                        iov-supply = <&battery_reg>;
+                };	
 	};
 
 	i2c@c240000 {
@@ -668,7 +678,8 @@
 #endif
 	ahub {
 		/* I2S6 */
-		i2s@2901500 {
+		i2s@2901100 {
+			status = "okay";
 			bclk-ratio = <4>;
 		};
 
@@ -695,60 +706,60 @@
 	tegra_sound: sound {
 		compatible = "nvidia,tegra-audio-t186ref-mobile-rt565x";
 		nvidia,model = "tegra-snd-t186ref-mobile-rt565x";
-		nvidia,num-codec-link = <12>;
-		clocks = <&tegra_car TEGRA186_CLK_PLLA>,
-			 <&tegra_car TEGRA186_CLK_PLL_A_OUT0>,
-			 <&tegra_car TEGRA186_CLK_AUD_MCLK>;
-		clock-names = "pll_a", "pll_a_out0", "extern1";
-		assigned-clocks = <&tegra_car TEGRA186_CLK_PLL_A_OUT0>,
-				  <&tegra_car TEGRA186_CLK_AUD_MCLK>;
-		assigned-clock-parents = <&tegra_car TEGRA186_CLK_PLLA>,
-					 <&tegra_car TEGRA186_CLK_PLL_A_OUT0>;
+		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 =
-			"x Headphone",		"x OUT",
-			"x IN",			"x Mic",
+			"z IN",				"z IN1_R",
+			"z IN", 			"z IN1_L",
+			"z LOR",			"z OUT",
+			"z LOL",			"z OUT"
+/*			"x Headphone",		"x OUT",
+			"x IN",				"x Mic",
 			"y Headphone",		"y OUT",
-			"y IN",			"y Mic",
-			"z Headphone",		"z OUT",
-			"z IN",			"z Mic",
+			"y IN",				"y Mic",
+			"z IN",				"z OUT",
 			"m Headphone",		"m OUT",
-			"m IN",			"m Mic",
+			"m IN",				"m Mic",
 			"n Headphone",		"n OUT",
-			"n IN",			"n Mic",
+			"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",
+			"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",
-			"d3 Headphone",		"d3 OUT";
+			"d2 Headphone",		"d2 OUT"*/;
 
 		nvidia,xbar = <&tegra_axbar>;
 		mclk-fs = <256>;

could you please help me how to make changes for MIC and Headphone?
please find the below dmesg for current DT changes

  nfs@nfs-desktop:~$ dmesg | grep sound
    [    0.462480] iommu: Adding device sound to group 52
    [    2.313102] input: tegra-hda HDMI/DP,pcm=3 as /devices/3510000.hda/sound/card0/input3
    [    2.313225] input: tegra-hda HDMI/DP,pcm=7 as /devices/3510000.hda/sound/card0/input4
    [    2.391116] tegra-asoc: sound: ADMAIF1 <-> ADMAIF1 mapping ok
    [    2.391194] tegra-asoc: sound: ADMAIF2 <-> ADMAIF2 mapping ok
    [    2.391363] tegra-asoc: sound: ADMAIF3 <-> ADMAIF3 mapping ok
    [    2.391438] tegra-asoc: sound: ADMAIF4 <-> ADMAIF4 mapping ok
    [    2.391506] tegra-asoc: sound: ADMAIF5 <-> ADMAIF5 mapping ok
    [    2.391575] tegra-asoc: sound: ADMAIF6 <-> ADMAIF6 mapping ok
    [    2.391645] tegra-asoc: sound: ADMAIF7 <-> ADMAIF7 mapping ok
    [    2.391713] tegra-asoc: sound: ADMAIF8 <-> ADMAIF8 mapping ok
    [    2.391785] tegra-asoc: sound: ADMAIF9 <-> ADMAIF9 mapping ok
    [    2.391854] tegra-asoc: sound: ADMAIF10 <-> ADMAIF10 mapping ok
    [    2.391925] tegra-asoc: sound: ADMAIF11 <-> ADMAIF11 mapping ok
    [    2.391996] tegra-asoc: sound: ADMAIF12 <-> ADMAIF12 mapping ok
    [    2.392068] tegra-asoc: sound: ADMAIF13 <-> ADMAIF13 mapping ok
    [    2.392137] tegra-asoc: sound: ADMAIF14 <-> ADMAIF14 mapping ok
    [    2.392208] tegra-asoc: sound: ADMAIF15 <-> ADMAIF15 mapping ok
    [    2.392278] tegra-asoc: sound: ADMAIF16 <-> ADMAIF16 mapping ok
    [    2.392343] tegra-asoc: sound: ADMAIF17 <-> ADMAIF17 mapping ok
    [    2.392423] tegra-asoc: sound: ADMAIF18 <-> ADMAIF18 mapping ok
    [    2.392489] tegra-asoc: sound: ADMAIF19 <-> ADMAIF19 mapping ok
    [    2.392557] tegra-asoc: sound: ADMAIF20 <-> ADMAIF20 mapping ok
    [    2.402314] tegra-asoc: sound: ASoC: no sink widget found for z IN
    [    2.402317] tegra-asoc: sound: ASoC: Failed to add route z IN1_R -> direct -> z IN
    [    2.402349] tegra-asoc: sound: ASoC: no sink widget found for z IN
    [    2.402351] tegra-asoc: sound: ASoC: Failed to add route z IN1_L -> direct -> z IN
    [    2.402376] tegra-asoc: sound: ASoC: no source widget found for z OUT
    [    2.402378] tegra-asoc: sound: ASoC: Failed to add route z OUT -> direct -> z LOR
    [    2.402404] tegra-asoc: sound: ASoC: no source widget found for z OUT
    [    2.402406] tegra-asoc: sound: ASoC: Failed to add route z OUT -> direct -> z LOL
    nfs@nfs-desktop:~$ dmesg | grep tlv
    [    2.379935] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_R
    [    2.379939] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_R -> 10 kOhm -> CM_R to Right Mixer Negative Resistor
    [    2.379966] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_R
    [    2.379969] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_R -> 20 kOhm -> CM_R to Right Mixer Negative Resistor
    [    2.379994] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_R
    [    2.379997] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_R -> 40 kOhm -> CM_R to Right Mixer Negative Resistor
    [    2.385395] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_L
    [    2.385397] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_L -> 10 kOhm -> CM_L to Left Mixer Negative Resistor
    [    2.385415] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_L
    [    2.385417] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_L -> 20 kOhm -> CM_L to Left Mixer Negative Resistor
    [    2.385436] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_L
    [    2.385437] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_L -> 40 kOhm -> CM_L to Left Mixer Negative Resistor
    [    2.412046] tlv320aic32x4 0-0018: ASoC: mux z CM_R to Right Mixer Negative Resistor has no paths
    [    2.412551] tlv320aic32x4 0-0018: ASoC: mux z CM_L to Left Mixer Negative Resistor has no paths

Please find the complete DT tegra186-quill-common.dtsi.txt (33.1 KB)
Regards,
Parashuram

Hello!

You need to populate the ‘z In’ and ‘z Out’ widgets in the machine driver

	SND_SOC_DAPM_LINE(	"z IN", 			NULL),
	SND_SOC_DAPM_LINE(	"z OUT", 			NULL),

Alternatively, you could use the existing ‘z Headphone’ and ‘z Mic’ instead of ‘z OUT’ and ‘z In’ respectively, because these are already defined.

Regards,
Jon

Hello Jonathanh,

I have made changes according to igle but still is not getting.
I followed this wiki
DT changes is here

 status = "okay";
                nvidia,audio-routing =
                                       "x Headphone Jack", "x HPO L Playback",
            "x Headphone Jack", "x HPO R Playback",
            "x IN1P",           "x Mic Jack",
            "x Int Spk",        "x SPO Playback",
            "x DMIC L1",        "x Int Mic",
            "x DMIC L2",        "x Int Mic",
            "x DMIC R1",        "x Int Mic",
            "x DMIC R2",        "x Int Mic",
            "y Headphone",      "y OUT",
            "y IN",             "y Mic",
            "z IN",             "z OUT",
            "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",
            "d1 Headphone",     "d1 OUT",
            "d2 Headphone",     "d2 OUT";
                nvidia,xbar = <&tegra_axbar>;
                mclk-fs = <256>;

but still not able to initialize audio could you please look into this

nfs@nfs-desktop:~$ dmesg | grep tlv
[    2.445007] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_R
[    2.445010] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_R -> 10 kOhm -> CM_R to Right Mixer Negative Resistor
[    2.445030] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_R
[    2.445032] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_R -> 20 kOhm -> CM_R to Right Mixer Negative Resistor
[    2.445050] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_R
[    2.445052] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_R -> 40 kOhm -> CM_R to Right Mixer Negative Resistor
[    2.450148] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_L
[    2.450151] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_L -> 10 kOhm -> CM_L to Left Mixer Negative Resistor
[    2.450171] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_L
[    2.450173] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_L -> 20 kOhm -> CM_L to Left Mixer Negative Resistor
[    2.450192] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_L
[    2.450194] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_L -> 40 kOhm -> CM_L to Left Mixer Negative Resistor
[    2.477479] tlv320aic32x4 0-0018: ASoC: mux z CM_R to Right Mixer Negative Resistor has no paths
[    2.478005] tlv320aic32x4 0-0018: ASoC: mux z CM_L to Left Mixer Negative Resistor has no paths
nfs@nfs-desktop:~$ dmesg | grep sound
[    0.462167] iommu: Adding device sound to group 52
[    2.369440] input: tegra-hda HDMI/DP,pcm=3 as /devices/3510000.hda/sound/card0/input3
[    2.369567] input: tegra-hda HDMI/DP,pcm=7 as /devices/3510000.hda/sound/card0/input4
[    2.456127] tegra-asoc: sound: ADMAIF1 <-> ADMAIF1 mapping ok
[    2.456207] tegra-asoc: sound: ADMAIF2 <-> ADMAIF2 mapping ok
[    2.456286] tegra-asoc: sound: ADMAIF3 <-> ADMAIF3 mapping ok
[    2.456358] tegra-asoc: sound: ADMAIF4 <-> ADMAIF4 mapping ok
[    2.456429] tegra-asoc: sound: ADMAIF5 <-> ADMAIF5 mapping ok
[    2.456509] tegra-asoc: sound: ADMAIF6 <-> ADMAIF6 mapping ok
[    2.456584] tegra-asoc: sound: ADMAIF7 <-> ADMAIF7 mapping ok
[    2.456789] tegra-asoc: sound: ADMAIF8 <-> ADMAIF8 mapping ok
[    2.456866] tegra-asoc: sound: ADMAIF9 <-> ADMAIF9 mapping ok
[    2.456936] tegra-asoc: sound: ADMAIF10 <-> ADMAIF10 mapping ok
[    2.457010] tegra-asoc: sound: ADMAIF11 <-> ADMAIF11 mapping ok
[    2.457083] tegra-asoc: sound: ADMAIF12 <-> ADMAIF12 mapping ok
[    2.457155] tegra-asoc: sound: ADMAIF13 <-> ADMAIF13 mapping ok
[    2.457227] tegra-asoc: sound: ADMAIF14 <-> ADMAIF14 mapping ok
[    2.457298] tegra-asoc: sound: ADMAIF15 <-> ADMAIF15 mapping ok
[    2.457371] tegra-asoc: sound: ADMAIF16 <-> ADMAIF16 mapping ok
[    2.457442] tegra-asoc: sound: ADMAIF17 <-> ADMAIF17 mapping ok
[    2.457517] tegra-asoc: sound: ADMAIF18 <-> ADMAIF18 mapping ok
[    2.457589] tegra-asoc: sound: ADMAIF19 <-> ADMAIF19 mapping ok
[    2.457662] tegra-asoc: sound: ADMAIF20 <-> ADMAIF20 mapping ok
[    2.467461] tegra-asoc: sound: ASoC: no source widget found for x HPO L Playback
[    2.467464] tegra-asoc: sound: ASoC: Failed to add route x HPO L Playback -> direct -> x Headphone Jack
[    2.467485] tegra-asoc: sound: ASoC: no source widget found for x HPO R Playback
[    2.467487] tegra-asoc: sound: ASoC: Failed to add route x HPO R Playback -> direct -> x Headphone Jack
[    2.467503] tegra-asoc: sound: ASoC: no sink widget found for x IN1P
[    2.467506] tegra-asoc: sound: ASoC: Failed to add route x Mic Jack -> direct -> x IN1P
[    2.467520] tegra-asoc: sound: ASoC: no source widget found for x SPO Playback
[    2.467522] tegra-asoc: sound: ASoC: Failed to add route x SPO Playback -> direct -> x Int Spk
[    2.467537] tegra-asoc: sound: ASoC: no sink widget found for x DMIC L1
[    2.467539] tegra-asoc: sound: ASoC: Failed to add route x Int Mic -> direct -> x DMIC L1
[    2.467554] tegra-asoc: sound: ASoC: no sink widget found for x DMIC L2
[    2.467555] tegra-asoc: sound: ASoC: Failed to add route x Int Mic -> direct -> x DMIC L2
[    2.467569] tegra-asoc: sound: ASoC: no sink widget found for x DMIC R1
[    2.467571] tegra-asoc: sound: ASoC: Failed to add route x Int Mic -> direct -> x DMIC R1
[    2.467585] tegra-asoc: sound: ASoC: no sink widget found for x DMIC R2
[    2.467587] tegra-asoc: sound: ASoC: Failed to add route x Int Mic -> direct -> x DMIC R2
[    2.467600] tegra-asoc: sound: ASoC: no source widget found for y OUT
[    2.467602] tegra-asoc: sound: ASoC: Failed to add route y OUT -> direct -> y Headphone
[    2.467616] tegra-asoc: sound: ASoC: no sink widget found for y IN
[    2.467618] tegra-asoc: sound: ASoC: Failed to add route y Mic -> direct -> y IN
[    2.467643] tegra-asoc: sound: ASoC: no source widget found for z OUT
[    2.467645] tegra-asoc: sound: ASoC: Failed to add route z OUT -> direct -> z IN

Regards,
Parashuram

Hello!

Sorry if this is not clear, but the “HPO R Playback”, “SPO Playback” and “DMIC Lx” are specific to the realtek codec that we test with. Hence this will not work for the tlv32aic32x4 codec. You need to see what DAPM input/outputs that the codec defines and then route them to those defined by the Tegra machine driver. So what you want is …

nvidia,audio-routing =
            "x Headphone", "x LOL",
            "x Headphone", "x LOR",
            "x IN1_L",           "x Mic",
            "x IN1_R",           "x Mic";

Regards,
Jon

Hello Jonathanh,

I tried with your changes but still not reflecting could please have below changes outputs.

DT changes are here

nvidia,audio-routing =
            "x Headphone", "x LOL",
            "x Headphone", "x LOR",
            "x IN1_L",           "x Mic",
            "x IN1_R",           "x Mic"; 

the reflected output is here

[    2.650614] tegra-asoc: sound: ASoC: no source widget found for x LOL
[    2.650618] tegra-asoc: sound: ASoC: Failed to add route x LOL -> direct -> x Headphone
[    2.650639] tegra-asoc: sound: ASoC: no source widget found for x LOR
[    2.650641] tegra-asoc: sound: ASoC: Failed to add route x LOR -> direct -> x Headphone
[    2.650657] tegra-asoc: sound: ASoC: no sink widget found for x IN1_L
[    2.650659] tegra-asoc: sound: ASoC: Failed to add route x Mic -> direct -> x IN1_L
[    2.650674] tegra-asoc: sound: ASoC: no sink widget found for x IN1_R
[    2.650676] tegra-asoc: sound: ASoC: Failed to add route x Mic -> direct -> x IN1_R

I followed with Igle DT changes but that is also not reflecting.
DT changes are here

         nvidia,audio-routing =
                        "z IN1_R",                      "z IN",
                        "z IN1_L",                      "z IN",
                        "z OUT",                        "z LOR",
                        "z OUT",                        "z LOL";

the reflected output is here

[    2.666019] tegra-asoc: sound: ASoC: no source widget found for z IN
[    2.666023] tegra-asoc: sound: ASoC: Failed to add route z IN -> direct -> z IN1_R
[    2.666053] tegra-asoc: sound: ASoC: no source widget found for z IN
[    2.666055] tegra-asoc: sound: ASoC: Failed to add route z IN -> direct -> z IN1_L
[    2.666081] tegra-asoc: sound: ASoC: no sink widget found for z OUT
[    2.666083] tegra-asoc: sound: ASoC: Failed to add route z LOR -> direct -> z OUT
[    2.666109] tegra-asoc: sound: ASoC: no sink widget found for z OUT
[    2.666111] tegra-asoc: sound: ASoC: Failed to add route z LOL -> direct -> z OUT

Regards,
Parashuram