Sound card transplantation

I use the tlv320aic3109 decoder
reference https://devtalk.nvidia.com/default/topic/1036139/jetson-tx2/tx2-asoc-with-tlv320aic32x4/1

However, the following error occurred

3.732085] Release 3.2.0 from 19.12.2014                                                                            [    3.732284] net can1: mttcan device registered (regs=ffffff8000fda000, irq=428)                                      [    3.737469] cpuidle: Initializing cpuidle driver init for Denver cluster                                             [    3.737595] cpuidle: Initializing cpuidle driver init for A57 cluster                                                [    3.738543] tachometer tegra-tachometer: Tachometer driver tegra-tachometer registered                               [    3.738546] Tachometer driver initialized with pulse_per_rev: 2 and win_len: 2                                       [    3.740899] usbcore: registered new interface driver snd-usb-audio                                                   [    3.742617] tegra210_adsp_audio_platform_probe: platform probe started                                               [    3.743791] tegra210-adsp adsp_audio: Default param-type to BYTE for mp3-dec1                                        [    3.748523] input: tegra-hda HDMI/DP,pcm=3 as /devices/3510000.hda/sound/card0/input0                                [    3.748773] input: tegra-hda HDMI/DP,pcm=7 as /devices/3510000.hda/sound/card0/input1                                [    3.749091] tegra210-adsp adsp_audio: Default param-type to BYTE for spkprot                                         [    3.749816] tegra210-adsp adsp_audio: Default param-type to BYTE for src                                             [    3.750215] tegra210-adsp adsp_audio: Default param-type to BYTE for aac-dec1                                        [    3.750598] tegra210-adsp adsp_audio: Default param-type to BYTE for aec                                             [    3.750603] tegra210-adsp adsp_audio: adma channel page address dt entry not found                                   [    3.750606] tegra210-adsp adsp_audio: using adma channel page 0                                                      [    3.762049] tegra210_adsp_audio_platform_probe probe successfull.                                                    [    3.762050] OPE platform probe                                                                                       [    3.762133] OPE platform probe successful                                                                            [    3.777920] tegra-snd-t186ref-mobile-rt565x sound: Failed to get HP Det GPIO, should be handled by codec             [    3.780190] tegra-snd-t186ref-mobile-rt565x sound: ASoC: CODEC DAI tlv320aic31xx-hifi not registered                 [    3.780196] tegra-snd-t186ref-mobile-rt565x sound: snd_soc_register_card failed (-517)                               [    3.780839] GACT probability NOT on                                                                                  [    3.780848] Mirror/redirect action on                                                                                [    3.780861] u32 classifier                                                                                           [    3.780862]     Actions configured

This is because of what?
[ 3.780190] tegra-snd-t186ref-mobile-rt565x sound: ASoC: CODEC DAI tlv320aic31xx-hifi not registered [ 3.780196] tegra-snd-t186ref-mobile-rt565x sound: snd_soc_register_card failed (-517)

I replaced it tlv320aic31xx -> tlv320aic3x

[    3.888175] cpuidle: Initializing cpuidle driver init for A57 cluster
[    3.889064] tachometer tegra-tachometer: Tachometer driver tegra-tachometer registered
[    3.889067] Tachometer driver initialized with pulse_per_rev: 2 and win_len: 2
[    3.891220] usbcore: registered new interface driver snd-usb-audio
[    3.892060] regulator_get() failed for (1-0018,IOVDD), -19
[    3.892063] tlv320aic3x-codec 1-0018: Failed to get supply 'IOVDD': -19
[    3.892065] tlv320aic3x-codec 1-0018: Failed to request supplies: -19
[    3.893140] tegra210_adsp_audio_platform_probe: platform probe started
[    3.893645] tegra210-adsp adsp_audio: Default param-type to BYTE for mp3-dec1
[    3.893858] tegra210-adsp adsp_audio: Default param-type to BYTE for spkprot
[    3.896962] tegra210-adsp adsp_audio: Default param-type to BYTE for src
[    3.897239] tegra210-adsp adsp_audio: Default param-type to BYTE for aac-dec1
[    3.897589] tegra210-adsp adsp_audio: Default param-type to BYTE for aec
[    3.897593] tegra210-adsp adsp_audio: adma channel page address dt entry not found
[    3.897594] tegra210-adsp adsp_audio: using adma channel page 0
[    3.898051] tegra210_adsp_audio_platform_probe probe successfull.
[    3.898051] input: tegra-hda HDMI/DP,pcm=3 as /devices/3510000.hda/sound/card0/input0
[    3.898169] input: tegra-hda HDMI/DP,pcm=7 as /devices/3510000.hda/sound/card0/input1
[    3.907577] OPE platform probe
[    3.907639] OPE platform probe successful
[    3.914288] tegra-snd-t186ref-mobile-rt565x sound: Failed to get HP Det GPIO, should be handled by codec
[    3.915600] tegra-snd-t186ref-mobile-rt565x sound: ASoC: CODEC DAI tlv320aic3x-hifi not registered
[    3.915603] tegra-snd-t186ref-mobile-rt565x sound: snd_soc_register_card failed (-517)

This is a probe defer error (-517) which can be normal if the codec has not yet been registered. The kernel should try to probe the sound driver again later. If the codec is never registered then you will see these messages repeated several times until the kernel boots. It would be helpful if you could attach the complete kernel dmesg output and device-tree changes that you have made.

Regards,
Jon

Yes, the codec is not registered successfully.
This is my dmesg and dtb

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 OUT",		"z HPLOUT",
            "z OUT",		"z HPROUT",
            "z OUT",		"z LLOUT",
            "z OUT",		"z RLOUT",
             "z OUT",		"z HPLCOM",
            "z OUT",		"z HPRCOM",
            "z LINE1L",		"z IN",
            "z LINE1R",		"z IN";
            	
		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 = <48000>;
			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";
		};	
	
		nvidia,dai-link-3 {
			link-name = "spdif-dit-2";
			cpu-dai = <&tegra_i2s3>;
			codec-dai = <&spdif_dit2>;
			cpu-dai-name = "I2S3";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <1>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "x";
			status = "okay";
		};

dmesg.log (96.2 KB)

Can you please clarify the audio codec you are using? I don’t see a tlv320aic3109 on the TI website.

The reason I ask is because there are two drivers …

  1. sound/soc/codecs/tlv320aic3x.c
    This driver is compatible with the following devices …
    “ti,tlv320aic3x” - Generic TLV320AIC3x device
    “ti,tlv320aic33” - TLV320AIC33
    “ti,tlv320aic3007” - TLV320AIC3007
    “ti,tlv320aic3106” - TLV320AIC3106
    “ti,tlv320aic3104” - TLV320AIC3104

  2. sound/soc/codecs/tlv320aic31xx.c
    This driver is compatible with the following devices …
    “ti,tlv320aic310x” - Generic TLV320AIC31xx with mono speaker amp
    “ti,tlv320aic311x” - Generic TLV320AIC31xx with stereo speaker amp
    “ti,tlv320aic3100” - TLV320AIC3100 (mono speaker amp, no MiniDSP)
    “ti,tlv320aic3110” - TLV320AIC3110 (stereo speaker amp, no MiniDSP)
    “ti,tlv320aic3120” - TLV320AIC3120 (mono speaker amp, MiniDSP)
    “ti,tlv320aic3111” - TLV320AIC3111 (stereo speaker amp, MiniDSP)
    “ti,tlv320dac3100” - TLV320DAC3100 (no ADC, mono speaker amp, no MiniDSP)

Looking at your dmesg log, the reason why the codec is not registered is because the supplies are missing from the device-tree binding …

[    3.743213] regulator_get() failed for (1-0018,IOVDD), -19
[    3.743217] tlv320aic3x-codec 1-0018: Failed to get supply 'IOVDD': -19
[    3.743220] tlv320aic3x-codec 1-0018: Failed to request supplies: -19

However, before we try to fix the above, let’s clarify exactly what codec you are using so we know we are using the correct driver.

Regards,
Jon

TI’s reply is TLC320AIC3X
Tlv320aic3109 is similar to tlv320aic3104

The power of IOVDD should be 3.3V
Where should I add?

Where can I find this device on the TI website?

Regards,
Jon

http://www.ti.com/tool/tlv320aic3109evm-k?keyMatch=tlv320aic3109&tisearch=Search-EN-Everything

OK, is the codec on some TI evaluation board that is connected to the Jetson? If so then the codec is most likely powered by its own supply and therefore, we would need to have some sort of dummy regulator in device-tree because it is not a regulator that Tegra can control. I wonder if something like the following would work (not tested) …

diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index fe45a16a5142..bd0886066cd0 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -53,12 +53,9 @@
 
 #include "tlv320aic3x.h"
 
-#define AIC3X_NUM_SUPPLIES     4
+#define AIC3X_NUM_SUPPLIES     1
 static const char *aic3x_supply_names[AIC3X_NUM_SUPPLIES] = {
-       "IOVDD",        /* I/O Voltage */
-       "DVDD",         /* Digital Core Voltage */
-       "AVDD",         /* Analog DAC Voltage */
-       "DRVDD",        /* ADC Analog and Output Driver Voltage */
+       "dummy",
 };

Regards,
Jon

After the change did not solve the problem

[    3.735153] cpuidle: Initializing cpuidle driver init for A57 cluster
[    3.736090] tachometer tegra-tachometer: Tachometer driver tegra-tachometer registered
[    3.736094] Tachometer driver initialized with pulse_per_rev: 2 and win_len: 2
[    3.738342] usbcore: registered new interface driver snd-usb-audio
[    3.739059] regulator_get() failed for (1-0018,dummy), -19
[    3.739062] tlv320aic3x-codec 1-0018: Failed to get supply 'dummy': -19
[    3.739065] tlv320aic3x-codec 1-0018: Failed to request supplies: -19
[    3.740074] tegra210_adsp_audio_platform_probe: platform probe started
[    3.741001] tegra210-adsp adsp_audio: Default param-type to BYTE for mp3-dec1
[    3.744527] tegra210-adsp adsp_audio: Default param-type to BYTE for spkprot
[    3.744996] tegra210-adsp adsp_audio: Default param-type to BYTE for src
[    3.745430] tegra210-adsp adsp_audio: Default param-type to BYTE for aac-dec1
[    3.745881] tegra210-adsp adsp_audio: Default param-type to BYTE for aec
[    3.745886] tegra210-adsp adsp_audio: adma channel page address dt entry not found
[    3.745889] tegra210-adsp adsp_audio: using adma channel page 0
[    3.745932] input: tegra-hda HDMI/DP,pcm=3 as /devices/3510000.hda/sound/card0/input0
[    3.746145] tegra210_adsp_audio_platform_probe probe successfull.
[    3.746145] input: tegra-hda HDMI/DP,pcm=7 as /devices/3510000.hda/sound/card0/input1
[    3.757098] OPE platform probe
[    3.757178] OPE platform probe successful
[    3.764652] tegra-snd-t186ref-mobile-rt565x sound: Failed to get HP Det GPIO, should be handled by codec
[    3.766877] tegra-snd-t186ref-mobile-rt565x sound: ASoC: CODEC DAI tlv320aic3x-hifi not registered
[    3.766882] tegra-snd-t186ref-mobile-rt565x sound: snd_soc_register_card failed (-517)
[    3.767461] GACT probability NOT on
[    3.767470] Mirror/redirect action on
[    3.767481] u32 classifier
[    3.767482]     Actions configured
[    3.767508] nf_conntrack version 0.5.0 (65536 buckets, 262144 max)
[    3.768169] ipip: IPv4 over IPv4 tunneling driver
[    3.768508] Initializing XFRM netlink socket

Strangely, I can see 3 i2c addresses by plugging in the device

nvidia@tegra-ubuntu:~$ sudo i2cdetect -r -y 1
[sudo] password for nvidia: 
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: 50 -- 52 -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --
nvidia@tegra-ubuntu:~$ sudo i2cdump -f -y 1 0x18                                                                  [21/1802]
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 00 00 00 10 04 00 00 00 00 00 00 01 00 00 00 80    ...??......?...?
10: 80 ff ff 78 78 78 78 78 78 06 00 fe 00 00 fe 00    ?..xxxxxx?.?..?.
20: 40 00 00 00 00 00 00 00 00 00 00 80 80 00 00 00    @..........??...
30: 00 00 00 04 00 00 00 00 00 00 04 00 00 00 00 00    ...?......?.....
40: 00 04 00 00 00 00 00 00 04 00 00 00 00 00 00 00    .?......?.......
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
60: 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00    ......?.........
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
80: 00 00 00 10 04 00 00 00 00 00 00 01 00 00 00 80    ...??......?...?
90: 80 ff ff 78 78 78 78 78 78 06 00 fe 00 00 fe 00    ?..xxxxxx?.?..?.
a0: 40 00 00 00 00 00 00 00 00 00 00 80 80 00 00 00    @..........??...
b0: 00 00 00 04 00 00 00 00 00 00 04 00 00 00 00 00    ...?......?.....
c0: 00 04 00 00 00 00 00 00 04 00 00 00 00 00 00 00    .?......?.......
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
e0: 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00    ......?.........
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
nvidia@tegra-ubuntu:~$ sudo i2cdump -f -y 1 0x50
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: ff ff 22 2c fd 00 12 0c 1d 00 63 00 00 75 06 e6    ..",?.???.c..u??
10: e4 f0 3f e4 0f e5 74 7b 58 60 e6 60 00 ff ff ff    ??????t{X`?`....
20: ff ff 22 2c fd 00 12 0c 1d 00 63 00 00 75 06 e6    ..",?.???.c..u??
30: e4 f0 3f e4 0f e5 74 7b 58 60 e6 60 00 ff ff ff    ??????t{X`?`....
40: ff ff 22 2c fd 00 12 0c 1d 00 63 00 00 75 06 e6    ..",?.???.c..u??
50: e4 f0 3f e4 0f e5 74 7b 58 60 e6 60 00 ff ff ff    ??????t{X`?`....
60: ff ff 22 2c fd 00 12 0c 1d 00 63 00 00 75 06 e6    ..",?.???.c..u??
70: e4 f0 3f e4 0f e5 74 7b 58 60 e6 60 00 ff ff ff    ??????t{X`?`....
80: ff ff 22 2c fd 00 12 0c 1d 00 63 00 00 75 06 e6    ..",?.???.c..u??
90: e4 f0 3f e4 0f e5 74 7b 58 60 e6 60 00 ff ff ff    ??????t{X`?`....
a0: ff ff 22 2c fd 00 12 0c 1d 00 63 00 00 75 06 e6    ..",?.???.c..u??
b0: e4 f0 3f e4 0f e5 74 7b 58 60 e6 60 00 ff ff ff    ??????t{X`?`....
c0: ff ff 22 2c fd 00 12 0c 1d 00 63 00 00 75 06 e6    ..",?.???.c..u??
d0: e4 f0 3f e4 0f e5 74 7b 58 60 e6 60 00 ff ff ff    ??????t{X`?`....
e0: ff ff 22 2c fd 00 12 0c 1d 00 63 00 00 75 06 e6    ..",?.???.c..u??
f0: e4 f0 3f e4 0f e5 74 7b 58 60 e6 60 00 ff ff ff    ??????t{X`?`....
nvidia@tegra-ubuntu:~$ sudo i2cdump -f -y 1 0x52
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
10: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
20: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
40: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................

Can you ensure that ‘CONFIG_REGULATOR_DUMMY’ is enabled in the kernel configuration (arch/arm64/configs/tegra18_defconfig)? You can check by …

$ zcat /proc/config.gz | grep REGULATOR_DUMMY

Please attached the complete dmesg output.

Thanks
Jon

The good news, according to your suggestion, the problem is solved.
But there is still no sound and the pulse can be seen on the logic analyzer. Is my setting incorrect?

"z LINE1L",			"z IN",
            "z OUT",		"z LLOUT",
            "z OUT",		"z HPLOUT",
            "z OUT",		"z HPLCOM";
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_HP(	"z OUT", 			NULL),
	SND_SOC_DAPM_MIC(	"z IN", 			NULL),

dmesg.log (94.6 KB)

Hello!

Yes the routing looks OK to me. Are you trying playback or record? If you need both, let’s start with playback and work on record next.

For playback are you using the headphone or line-out outputs? I see you have both included in the route, but which interface are you using on the board?

Can you trace the DAPM power widgets when starting playback/capture?

echo 0 | sudo tee /sys/kernel/debug/tracing/trace
echo 0 | sudo tee /sys/kernel/debug/tracing/events/enable
echo 1 | sudo tee /sys/kernel/debug/tracing/tracing_on
echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_widget_power/enable

aplay ...

sudo cat /sys/kernel/debug/tracing/trace

Regards,
Jon

root@tegra-ubuntu:~# echo 0 sudo tee /sys/kernel/debug/tracing/trace
0 sudo tee /sys/kernel/debug/tracing/trace
root@tegra-ubuntu:~# echo 0 sudo tee /sys/kernel/debug/tracing/events/enable 
0 sudo tee /sys/kernel/debug/tracing/events/enable
root@tegra-ubuntu:~# echo 1 sudo tee /sys/kernel/debug/tracing/tracing_on 
1 sudo tee /sys/kernel/debug/tracing/tracing_on
root@tegra-ubuntu:~# echo 1 sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_widget_power/enable 
1 sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_widget_power/enable
root@tegra-ubuntu:~# sudo cat /sys/kernel/debug/tracing/trac
trace            trace_marker     trace_pipe       tracing_on       
trace_clock      trace_options    tracing_cpumask  tracing_thresh   
root@tegra-ubuntu:~# sudo cat /sys/kernel/debug/tracing/trac
trace            trace_marker     trace_pipe       tracing_on       
trace_clock      trace_options    tracing_cpumask  tracing_thresh   
root@tegra-ubuntu:~# sudo cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 0/0   #P:6
#
#                              _-----=> irqs-off
#                             / _----=> need-resched
#                            | / _---=> hardirq/softirq
#                            || / _--=> preempt-depth
#                            ||| /     delay
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |       |   ||||       |         |
root@tegra-ubuntu:~# echo 0 sudo tee /sys/kernel/debug/tracing/trace
0 sudo tee /sys/kernel/debug/tracing/trace
root@tegra-ubuntu:~# echo 0 sudo tee /sys/kernel/debug/tracing/events/enable 
0 sudo tee /sys/kernel/debug/tracing/events/enable
root@tegra-ubuntu:~# echo 1 sudo tee /sys/kernel/debug/tracing/tracing_on 
1 sudo tee /sys/kernel/debug/tracing/tracing_on
root@tegra-ubuntu:~# echo 1 sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_widget_power/enable 
1 sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_widget_power/enable
root@tegra-ubuntu:~# sudo cat /sys/kernel/debug/tracing/trac
trace            trace_marker     trace_pipe       tracing_on       
trace_clock      trace_options    tracing_cpumask  tracing_thresh   
root@tegra-ubuntu:~# sudo cat /sys/kernel/debug/tracing/trac
trace            trace_marker     trace_pipe       tracing_on       
trace_clock      trace_options    tracing_cpumask  tracing_thresh   
root@tegra-ubuntu:~# sudo cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 0/0   #P:6
#
#                              _-----=> irqs-off
#                             / _----=> need-resched
#                            | / _---=> hardirq/softirq
#                            || / _--=> preempt-depth
#                            ||| /     delay
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |       |   ||||       |         |
          amixer-1820  [005] ...1  6316.258699: snd_soc_dapm_start: card=tegra-snd-t186ref-mobile-rt565x
          amixer-1820  [005] ...1  6316.258825: snd_soc_dapm_walk_done: tegra-snd-t186ref-mobile-rt565x: checks 0 power, 0 
path, 0 neighbour
          amixer-1820  [005] ...1  6316.259050: snd_soc_dapm_done: card=tegra-snd-t186ref-mobile-rt565x
           aplay-1843  [003] ...1  6316.640119: snd_soc_dapm_start: card=tegra-snd-t186ref-mobile-rt565x
           aplay-1843  [003] ...1  6316.640185: snd_soc_dapm_path: *ADMAIF1 Receive <- (direct) <- Playback 1
           aplay-1843  [003] ...1  6316.640186: snd_soc_dapm_path: *ADMAIF1 Receive <- (direct) <- ADMAIF1 CIF Receive-ADM$
IF1 Receive
           aplay-1843  [003] ...1  6316.640247: snd_soc_dapm_walk_done: tegra-snd-t186ref-mobile-rt565x: checks 2 power, 2 
path, 2 neighbour
           aplay-1843  [003] ...1  6316.640469: snd_soc_dapm_done: card=tegra-snd-t186ref-mobile-rt565x
 alsa-sink-ADMAI-1007  [003] ...1  6347.985025: snd_soc_dapm_start: card=tegra-snd-t186ref-mobile-rt565x
 alsa-sink-ADMAI-1007  [003] ...1  6347.985092: snd_soc_dapm_widget_power: widget=Playback 1 val=1
 alsa-sink-ADMAI-1007  [003] ...1  6347.985092: snd_soc_dapm_widget_power: widget=ADMAIF1 Receive val=1
 alsa-sink-ADMAI-1007  [003] ...1  6347.985094: snd_soc_dapm_path: *ADMAIF1 RX <- (direct) <- ADMAIF1 Receive
 alsa-sink-ADMAI-1007  [003] ...1  6347.985095: snd_soc_dapm_widget_power: widget=ADMAIF1 RX val=1
 alsa-sink-ADMAI-1007  [003] ...1  6347.985107: snd_soc_dapm_path:  I2S1 Mux <- ARAD1 <- ARAD1 RX
 alsa-sink-ADMAI-1007  [003] ...1  6347.985108: snd_soc_dapm_path:  I2S1 Mux <- ADX4-4 <- ADX4-4 RX
 alsa-sink-ADMAI-1007  [003] ...1  6347.985109: snd_soc_dapm_path:  I2S1 Mux <- ADX4-3 <- ADX4-3 RX
 alsa-sink-ADMAI-1007  [003] ...1  6347.985109: snd_soc_dapm_path:  I2S1 Mux <- ADX4-2 <- ADX4-2 RX
 alsa-sink-ADMAI-1007  [003] ...1  6347.985110: snd_soc_dapm_path:  I2S1 Mux <- ADX4-1 <- ADX4-1 RX
 alsa-sink-ADMAI-1007  [003] ...1  6347.985110: snd_soc_dapm_path:  I2S1 Mux <- AMX4 <- AMX4 RX
 alsa-sink-ADMAI-1007  [003] ...1  6347.985111: snd_soc_dapm_path:  I2S1 Mux <- ADX3-4 <- ADX3-4 RX
 alsa-sink-ADMAI-1007  [003] ...1  6347.985111: snd_soc_dapm_path:  I2S1 Mux <- ADX3-3 <- ADX3-3 RX
 alsa-sink-ADMAI-1007  [003] ...1  6347.985111: snd_soc_dapm_path:  I2S1 Mux <- ADX3-2 <- ADX3-2 RX
 alsa-sink-ADMAI-1007  [003] ...1  6347.985112: snd_soc_dapm_path:  I2S1 Mux <- ADX3-1 <- ADX3-1 RX
 alsa-sink-ADMAI-1007  [003] ...1  6347.985112: snd_soc_dapm_path:  I2S1 Mux <- AMX3 <- AMX3 RX
 alsa-sink-ADMAI-1007  [003] ...1  6347.985113: snd_soc_dapm_path:  I2S1 Mux <- ASRC1-6 <- ASRC1-6 RX

trace.log (29.1 KB)

Hello!

Looks like the audio route is still not complete and the I2S interface is not being enabled. Can you run the attached script and send the output file generated?

Thanks
Jon
tegra-audio-debug.sh.txt (383 Bytes)

In the annex
tegra-audio-debug.txt (730 KB)

Can you respond to the above questions so I understand what you are testing and what interface on the codec you are using?

Jon

@jonathanh
Both, including recording and playback
Play contains headphones and speakers