Sound card transplantation

If you can, if it is not easy to achieve,Optional one channel.

How do I need to set it up?

I have referenced https://devtalk.nvidia.com/default/topic/1027508/jetson-tx2/tlv320aic32x4-evaluation-board-with-tx2/9

Am I also a problem with codec mixers?

If so, I have related setup parameters
This is a configuration given by the official

DAC: Mono Playback to AC coupled Headphone output
####################################################### 
# Mono Playback to AC coupled Headphone output #
 # Switch SW1 on AC-COUPLED position #
# DAC connected to headphone output through mixer path #
# Mixer Gain = 0dB; Output amplifier gain = 0dB #
# AC coupled headphone configuration # 
#I2S, 16-bits, fs = 44.1KHz # 
#MCLK = 11.2896MHz; BCLK = 2.8224MHz; WCLK = 44.1KHz # 
####################################################### 
# # Page 0 selected 
w 30 00 00
# # Software Reset
w 30 01 80 
# # fs(ref) setting and DAC data 
w 30 07 8A 
# # DAC unmuted, 0dB gain 
w 30 2B 00 
# # AC-coupling output 
w 30 0E C0 
# # DAC powered up 
w 30 25 80 
# # HPCOM as independent single-ended output 
w 30 26 10 
# # DAC routed to HPOUT output 
w 30 3D 80 
# # HPOUT output powered up, 0dB 
w 30 41 0D 
# # DAC reference current 100% 
w 30 6D C0
DAC: Mono Playback to Line output
#######################################################
# Mono Playback to Line output # 
# DAC connected to line output through mixer path #
# Mixer Gain = 0dB;#
# Output amplifier gain = 0dB # I2S, 16-bits,#
#fs = 44.1KHz # MCLK = 11.2896MHz; BCLK = 2.8224MHz;#
# WCLK = 44.1KHz # 
####################################################### 
# # Page 0 selected 
w 30 00 00 
# # Software Reset 
w 30 01 80 
# # fs(ref) setting and DAC data 
w 30 07 8A 
# # DAC unmuted, 0dB gain 
w 30 2B 00 
# # DAC powered up 
w 30 25 80 
# # DAC routed to LEFT_LOP output 
w 30 52 80 
# # LEFT_LOP output powered up, 0dB 
w 30 56 0D 
# # DAC routed to RIGHT_LOP output 
w 30 59 80 
# # RIGHT_LOP output powered up, 0dB 
w 30 5D 0D 
# # DAC reference current 100% 
w 30 6D C0

I passed the host computer test and found that this configuration can work with both the headphones and the speakers.

DAC		
    - left data to LDAC and right data to RDAC		w 30 07 8A
    - volume control = 0dB		                w 30 29 02
    - Connected to outputs via mixer mode		w 30 2B 00
		                                        w 30 0E C0
High Power Outputs		
    - Single-ended headphone outputs		        w 30 25 E0
    - AC-coupled headphone configuration		w 30 26 10
    - LDAC to HPLOUT		                        w 30 2F 80
    - RDAC to HPRDAC		                        w 30 40 80
    - Mixer gain = 0dB		                        w 30 41 0D
    - Output amplifier gain = 0dB		        w 30 33 0D

I also quoted https://devtalk.nvidia.com/default/topic/1036139/jetson-tx2/tx2-asoc-with-tlv320aic32x4/1
Made the following changes
1.tegra_t186ref_mobile_rt565x.c:

static int tegra_t186ref_dai_init(struct snd_soc_pcm_runtime *rtd,
					int rate,
					int channels,
					u64 formats,
					bool is_playback)
{

	idx = tegra_machine_get_codec_dai_link_idx_t18x("ti-capture");
	/* check if idx has valid number */
	if (idx != -EINVAL) {
		dai_params =
		(struct snd_soc_pcm_stream *)card->rtd[idx].dai_link->params;

		dai_params->rate_min = clk_rate;
		dai_params->formats = (machine->fmt_via_kcontrol == 2) ?
                                (1ULL << SNDRV_PCM_FORMAT_S32_LE) : formats;

		if (!machine->is_codec_dummy) {
			/*err = snd_soc_dai_set_sysclk(card->rtd[idx].codec_dai, RT5659_SCLK_S_MCLK, clk_out_rate, SND_SOC_CLOCK_IN);*/
			err = snd_soc_dai_set_sysclk(card->rtd[idx].codec_dai, 0, 12000000, SND_SOC_CLOCK_IN);
			if (err < 0) {
				dev_err(card->dev, "codec_dai clock not set clk_out_rate-%d\n", clk_out_rate);
				return err;
			}
		}
	}

}

2.tegra_asoc_utils_alt.c

int tegra_alt_asoc_utils_init(struct tegra_asoc_audio_clock_info *data,
                return -EINVAL;
 
        /* pll_p_out1 is not used for ahub for T210,T186 */
-       if (data->soc < TEGRA_ASOC_UTILS_SOC_TEGRA210) {
+       if (data->soc < TEGRA_ASOC_UTILS_SOC_TEGRA210)
                data->clk_pll_p_out1 = clk_get_sys(NULL, "pll_p_out1");
-               if (IS_ERR(data->clk_pll_p_out1)) {
-                       dev_err(data->dev, "Can't retrieve clk pll_p_out1\n");
-                       ret = PTR_ERR(data->clk_pll_p_out1);
-                       goto err;
-               }
+       else
+               data->clk_pll_p_out1 = tegra_alt_asoc_utils_get_clk(dev, false,
+                                                                   "pll_p_out1");
+       if (IS_ERR(data->clk_pll_p_out1)) {
+               dev_err(data->dev, "Can't retrieve clk pll_p_out1\n");
+               ret = PTR_ERR(data->clk_pll_p_out1);
+               goto err;
        }
 
        data->clk_m = tegra_alt_asoc_utils_get_clk(dev, false, "clk_m");
@@ -467,13 +469,13 @@ int tegra_alt_asoc_utils_set_parent(struct tegra_asoc_audio_clock_info *data,
                        return ret;
                }
        } else {
-               ret = clk_set_parent(data->clk_cdev1, data->clk_m);
+               ret = clk_set_parent(data->clk_cdev1, data->clk_pll_p_out1);
                if (ret) {
                        dev_err(data->dev, "Can't set clk cdev1/extern1 parent");
                        return ret;
                }
 
-               ret = clk_set_rate(data->clk_cdev1, 13000000);
+               ret = clk_set_rate(data->clk_cdev1, 12000000);
                if (ret) {
                        dev_err(data->dev, "Can't set clk rate");
                        return ret;

3.tlv320aic3x.c:

//SND_SOC_DAPM_DAC("Left DAC", "Left Playback", DAC_PWR, 7, 0),
SND_SOC_DAPM_DAC("Left DAC", "Playback", DAC_PWR, 7, 0),

//SND_SOC_DAPM_DAC("Right DAC", "Right Playback", DAC_PWR, 6, 0),
SND_SOC_DAPM_DAC("Right DAC", "Playback", DAC_PWR, 6, 0),

The J21 interface is used on the motherboard.
Pin7 AUDIO_I2S_MCLK_3V3-------------MCK
Pin35 AUDIO_I2S_SFSYNC_3V3-----------LRCK
Pin12 AUDIO_I2S_SRCLK_3V3-------------BCK
Pin40 AUDIO_I2S_SOUT_3V3--------------DOUT
Pin38 AUDIO_I2S_SDIN_3V3---------------DIN
I2C
Pin5 SDL
Pin3 SDA

Yes basically, we need to ensure that the codec mixer route and settings are configured correctly. The codec exposes various settings that we need to configure using amixer. I need to find sometime to look at this but each codec is different and so it takes a bit of time.

Regards,
Jon

The above is ONLY needed if the codec is the master. Who is driving the I2S bit clock and frame-sync? If it is Tegra then you do not need the above. The bit clock and frame-sync master is configured in the dai-link in device-tree.

I am not sure that the above is needed. So leave this for now.

Regards,
Jon

This is the clock that is mentioned in the manual.

#fs = 44.1KHz # MCLK = 11.2896MHz; BCLK = 2.8224MHz;#

WCLK = 44.1KHz

My encoder is slave mode

rt565x_dai_link: nvidia,dai-link-1 {
			link-name = "ti-capture";
			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";
		};

But my clock is not showing right。

nvidia@tegra-ubuntu:~$ sudo grep -r aud_mclk /sys/kernel/debug/clk/clk_summary
             aud_mclk                                       0            0    12287998    12288000          0 0

clk_summary.txt (34 KB)

Yes so if your codec is the slave then you do not need the clock changes mentioned in comment #25. Yes for 44.1kHz the aud_mclk should be 11.2896MHz and for 48kHz it will be 12.2288MHz.

Regards,
Jon

I modified the clock as follows

tegra_t186ref_mobile_rt565x.c:

idx = tegra_machine_get_codec_dai_link_idx_t18x("ti-capture");
	//idx = tegra_machine_get_codec_dai_link_idx_t18x("rt565x-playback");
	/* check if idx has valid number */
	if (idx != -EINVAL) {
		dai_params =
		(struct snd_soc_pcm_stream *)card->rtd[idx].dai_link->params;

		dai_params->rate_min = clk_rate;
		dai_params->formats = (machine->fmt_via_kcontrol == 2) ?
                                (1ULL << SNDRV_PCM_FORMAT_S32_LE) : formats;

		if (!machine->is_codec_dummy) {
			err = snd_soc_dai_set_sysclk(card->rtd[idx].codec_dai, RT5659_SCLK_S_MCLK, clk_out_rate, SND_SOC_CLOCK_IN);
			//err = snd_soc_dai_set_sysclk(card->rtd[idx].codec_dai, 0, 11289600, SND_SOC_CLOCK_IN);
			if (err < 0) {
				dev_err(card->dev, "codec_dai clock not set clk_out_rate-%d\n", clk_out_rate);
				return err;
			}
		}
	}

tegra_asoc_utils_alt.c

/* pll_p_out1 is not used for ahub for T210,T186 */
	if (data->soc < TEGRA_ASOC_UTILS_SOC_TEGRA210) {
//	if (data->soc < TEGRA_ASOC_UTILS_SOC_TEGRA210)
		data->clk_pll_p_out1 = clk_get_sys(NULL, "pll_p_out1");
		if (IS_ERR(data->clk_pll_p_out1)) {
			dev_err(data->dev, "Can't retrieve clk pll_p_out1\n");
			ret = PTR_ERR(data->clk_pll_p_out1);
			goto err;
		}
	}
//	else
//	data->clk_m = tegra_alt_asoc_utils_get_clk(dev, false, "clk_m");
	//	data->clk_pll_p_out1 = tegra_alt_asoc_utils_get_clk(dev, false, "pll_p_out1");
	//	if (IS_ERR(data->clk_pll_p_out1)) {
		//			dev_err(data->dev, "Can't retrieve clk pll_p_out1\n");
			//		ret = PTR_ERR(data->clk_pll_p_out1);
				//	goto err;
	//			}
		data->clk_m = tegra_alt_asoc_utils_get_clk(dev, false, "clk_m");
	if (IS_ERR(data->clk_m)) {
		dev_err(data->dev, "Can't retrieve clk clk_m\n");
		ret = PTR_ERR(data->clk_m);
		goto err;
	}
###################################################
	} else {
		ret = clk_set_parent(data->clk_cdev1, data->clk_m);
		//ret = clk_set_parent(data->clk_cdev1, data->clk_pll_p_out1);
		if (ret) {
			dev_err(data->dev, "Can't set clk cdev1/extern1 parent");
			return ret;
		}

		ret = clk_set_rate(data->clk_cdev1, 13000000);
		//ret = clk_set_rate(data->clk_cdev1, 11289600);
		if (ret) {
rt565x_dai_link: nvidia,dai-link-1 {
			link-name = "ti-capture";
			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 = <44100>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "z";
			status = "okay";
		};

But did not get 11.28896M

nvidia@tegra-ubuntu:~$ sudo grep -r aud_mclk /sys/kernel/debug/clk/clk_summary
[sudo] password for nvidia: 
             aud_mclk                                       0            0    19846153    19200000          0 0

Hello!

Can you ensure that the following are set for testing Line out …

# Line out
$ amixer -c tegrasndt186ref cset name='z Left Line Mixer DACL1 Switch' 1
$ amixer -c tegrasndt186ref cset name='z Left Line Mixer PGAL Bypass Switch' 1
$ amixer -c tegrasndt186ref cset name='z Right Line Mixer DACR1 Switch' 1
$ amixer -c tegrasndt186ref cset name='z Right Line Mixer PGAL Bypass Switch' 1
$ amixer -c tegrasndt186ref cset name='z Line Playback Switch' 1

After you set these, re-run the trace again as shown in comment #15 and ‘tegra-audio-debug.sh’ are shown in comment #17.

Regards,
Jon

If I follow #25 modification, I can get it.

nvidia@tegra-ubuntu:~$ sudo grep -r aud_mclk /sys/kernel/debug/clk/clk_summary
             aud_mclk                                       0            0    11217391    11333333          0 0

But there is still no sound during playback.

You should not need to make any changes to the above file. Please un-do any changes you have made.

Jon

As mentioned previously the change in comment #25 is not applicable in your case because the codec is not the clock master. Please remove this change.

Jon

I canceled the modification of tegra_asoc_utils_alt.c

nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name='z Left Line Mixer DACL1 Switch' 1
numid=923,iface=MIXER,name='z Left Line Mixer DACL1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name='z Left Line Mixer PGAL Bypass Switch' 1
numid=922,iface=MIXER,name='z Left Line Mixer PGAL Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name='z Right Line Mixer DACR1 Switch' 1
numid=931,iface=MIXER,name='z Right Line Mixer DACR1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name='z Right Line Mixer PGAL Bypass Switch' 1
numid=928,iface=MIXER,name='z Right Line Mixer PGAL Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name='z Line Playback Switch' 1
numid=609,iface=MIXER,name='z Line Playback Switch'
  ; type=BOOLEAN,access=rw------,values=2
  : values=on,on

trace1.txt (14.9 KB)
tegra-audio-debug.txt (730 KB)

My current configuration is
tegra186-quill-common.dtsi

i2c@c240000 {
		status = "okay";
		lp8556-backlight-s-wqxga-10-1@2c {
			status = "disabled";
			disable-on-kernel-charging;
			compatible = "ti,lp8556";
			reg = <0x2C>;

			bl-name = "pwm-backlight"; /* Match liblights naming expectations */
			init-brt = /bits/ 8 <0xFF>; /* Max brightness */
			dev-ctrl = /bits/ 8 <0x80>; /* PWM, enable standby mode */
			pwm-period = <40161>;

			pwm-names = "lp8556";
			pwms = <&tegra_pwm1 0 40161>;

			bl-measured = < 0 1 2 3 4 5 5 6
					7 8 9 10 11 11 12 13
					14 15 15 16 17 18 19 20
					21 22 22 23 24 25 26 27
					28 29 30 31 31 32 33 34
					35 36 37 37 38 39 40 41
					41 42 43 44 45 46 47 48
					48 49 50 51 52 53 54 54
					55 56 57 58 58 59 60 61
					62 63 64 65 66 67 68 69
					70 71 72 73 74 75 75 76
					77 78 79 80 81 82 83 84
					85 86 87 88 89 90 91 92
					93 94 94 95 96 97 98 99
					100 101 102 104 105 106 107 108
					109 110 111 112 113 114 115 116
					117 118 119 120 121 122 123 125
					126 127 128 129 130 131 132 133
					134 135 136 137 138 139 140 141
					142 143 144 146 147 148 149 150
					151 152 153 154 155 156 157 158
					159 160 161 162 163 164 165 167
					168 169 170 171 172 173 174 175
					176 178 179 180 181 182 183 184
					185 186 187 188 189 190 191 192
					193 194 195 196 197 199 200 201
					202 203 204 205 206 207 208 210
					211 212 213 214 215 216 217 219
					220 221 222 223 225 226 227 228
					229 230 231 233 234 235 236 237
					238 239 240 241 242 244 245 246
					247 248 249 250 251 253 254 255 >;
		};
         aic3x: tlv320aic3x-codec.1-0018@18{
         		compatible = "ti,tlv320aic3x";
         		status = "okay";
         		reg = <0x18>;
         		clocks = <&tegra_car TEGRA186_CLK_AUD_MCLK>;
         		clock-names = "mclk";
         		
         };
	};



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 =
			"x Headphone",		"x OUT",
			"x IN",			"x Mic",
			"y Headphone",		"y OUT",
			"y IN",			"y 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",
			"z LINE1L",			"z IN",
			"z LINE1R",			"z IN",
            "z OUT",		"z LLOUT",
             "z OUT",		"z RLOUT",
            "z OUT",		"z HPLOUT",
            "z OUT",		"z HPROUT",
            "z OUT",		"z HPRCOM",
            "z OUT",		"z HPLCOM";
            
		nvidia,xbar = <&tegra_axbar>;
	rt565x_dai_link: nvidia,dai-link-1 {
			link-name = "ti-capture";
			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 = <44100>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "z";
			status = "okay";
		};
		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 = "okay";
		};

tegra_t186ref_mobile_rt565x.c

static const struct snd_soc_dapm_widget tegra_t186ref_dapm_widgets[] = {
	SND_SOC_DAPM_HP(	"x Headphone Jack",	tegra_rt565x_event_hp),
	SND_SOC_DAPM_SPK(	"x Int Spk",		tegra_rt565x_event_int_spk),
	SND_SOC_DAPM_MIC(	"x Int Mic",		tegra_rt565x_event_int_mic),
	SND_SOC_DAPM_MIC(	"x Mic Jack",		tegra_rt565x_event_ext_mic),
	SND_SOC_DAPM_MIC(	"Int Mic",			NULL),
	SND_SOC_DAPM_HP(	"x Headphone", 		NULL),
	SND_SOC_DAPM_MIC(	"x Mic", 			NULL),
	SND_SOC_DAPM_HP(	"y Headphone", 		NULL),
	SND_SOC_DAPM_MIC(	"y Mic", 			NULL),
	SND_SOC_DAPM_HP(	"m Headphone", 		NULL),
	SND_SOC_DAPM_MIC(	"m Mic", 			NULL),
	SND_SOC_DAPM_HP(	"n Headphone", 		NULL),
	SND_SOC_DAPM_MIC(	"n Mic", 			NULL),
	SND_SOC_DAPM_HP(	"o Headphone", 		NULL),
	SND_SOC_DAPM_MIC(	"o Mic", 			NULL),
	SND_SOC_DAPM_MIC(	"a Mic", 			NULL),
	SND_SOC_DAPM_MIC(	"b Mic", 			NULL),
	SND_SOC_DAPM_MIC(	"c Mic", 			NULL),
	SND_SOC_DAPM_MIC(	"d Mic", 			NULL),
	SND_SOC_DAPM_HP(	"e Headphone", 		NULL),
	SND_SOC_DAPM_MIC(	"e Mic", 			NULL),
	SND_SOC_DAPM_SPK(	"d1 Headphone", 	NULL),
	SND_SOC_DAPM_SPK(	"d2 Headphone", 	NULL),
    SND_SOC_DAPM_LINE(	"z OUT", 			NULL),
	SND_SOC_DAPM_LINE(	"z IN", 			NULL),
};
nvidia@tegra-ubuntu:~$ sudo grep -r aud_mclk /sys/kernel/debug/clk/clk_summary
[sudo] password for nvidia: 
             aud_mclk                                       0            0    11289599    11289600          0 0

The good news is that the clock is right, but still can’t hear the sound.

I found the clock still has a problem.
should be
#fs = 44.1KHz # MCLK = 11.2896MHz; BCLK = 2.8224MHz;#

WCLK = 44.1KHz

But the clock I got through the logic analyzer is
WCLK=44.1KHZ
BCLK=1.43MHZ
MCLK=198.02-512.82KHZ Stable beating
DOUT=141.84-714KHZ Stable beating
But the clock I got through the instructions is correct.

nvidia@tegra-ubuntu:~$ sudo grep -r aud_mclk /sys/kernel/debug/clk/clk_summary
             aud_mclk                                       0            0    11289599    11289600          0 0

And I found that my I2C 0x18C is occupied?

nvidia@tegra-ubuntu:~$ sudo i2cdetect -r -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: 50 -- 52 -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

In addition, I saw this in tlv320aic3x, will it work?
SND_SOC_DAPM_OUTPUT(“Detection”) ??

SND_SOC_DAPM_ADC("Left ADC", "Left Capture", LINE1L_2_LADC_CTRL, 2, 0),
	SND_SOC_DAPM_MUX("Left Line1L Mux", SND_SOC_NOPM, 0, 0,
			 &aic3x_left_line1l_mux_controls),
	SND_SOC_DAPM_MUX("Left Line1R Mux", SND_SOC_NOPM, 0, 0,
			 &aic3x_left_line1r_mux_controls),

	/* Inputs to Right ADC */
	SND_SOC_DAPM_ADC("Right ADC", "Right Capture",
			 LINE1R_2_RADC_CTRL, 2, 0),
	SND_SOC_DAPM_MUX("Right Line1L Mux", SND_SOC_NOPM, 0, 0,
			 &aic3x_right_line1l_mux_controls),
	SND_SOC_DAPM_MUX("Right Line1R Mux", SND_SOC_NOPM, 0, 0,
			 &aic3x_right_line1r_mux_controls),

	/* Mic Bias */
	SND_SOC_DAPM_SUPPLY("Mic Bias", MICBIAS_CTRL, 6, 0,
			 mic_bias_event,
			 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),

	SND_SOC_DAPM_OUTPUT("LLOUT"),
	SND_SOC_DAPM_OUTPUT("RLOUT"),
	SND_SOC_DAPM_OUTPUT("HPLOUT"),
	SND_SOC_DAPM_OUTPUT("HPROUT"),
	SND_SOC_DAPM_OUTPUT("HPLCOM"),
	SND_SOC_DAPM_OUTPUT("HPRCOM"),

	SND_SOC_DAPM_INPUT("LINE1L"),
	SND_SOC_DAPM_INPUT("LINE1R"),

	/*
	 * Virtual output pin to detection block inside codec. This can be
	 * used to keep codec bias on if gpio or detection features are needed.
	 * Force pin on or construct a path with an input jack and mic bias
	 * widgets.
	 */
	SND_SOC_DAPM_OUTPUT("Detection"),
};

Where are you measuring the MCLK? On which pin of the J21 header? If you disconnect the MCLK from the codec do you see the correct frequency for MCLK?

What does the following show?

$ sudo grep aud_mclk /sys/kernel/debug/tegra_pinctrl_reg
Bank: 0 Reg: 0x02431020 Val: 0x00000400 -> aud_mclk_pj4
Bank: 0 Reg: 0x02431024 Val: 0x00708000 -> drive_aud_mclk

Regards,
Jon

Looking at the trace from comment #35 it looks like playback start for a very short duration 0.1 secs and then stops again. How long is the sample you are playing? From comment #37, it sounds like you are seeing the I2S signals driven and so that is a good indication that the audio path has been configured. So we need to figure out why the MCLK is not at the correct frequency, and then you need to check to see if the codec has other mixer settings (mute, volume, etc) that need to be configured.

Regards,
Jon

MCLK J21-pin7

nvidia@tegra-ubuntu:~$ sudo grep -r aud_mclk /sys/kernel/debug/clk/clk_summary   
aud_mclk       0            0    12287998    12288000          0 0       
nvidia@tegra-ubuntu:~$ sudo grep aud_mclk /sys/kernel/debug/tegra_pinctrl_reg  
  Bank: 0 Reg: 0x02431020 Val: 0x00000400 -> aud_mclk_pj4  
  Bank: 0 Reg: 0x02431024 Val: 0x00708000 -> drive_aud_mclk