Audio Codec WM8960 on TX2

Looking at the wm8960 driver it appears that there are two places it will return the ‘failed to configure clock’ in wm8960_configure_clocking() (which is not very helpful). Can you check exactly where it is failing? Looking more at the driver I am wondering if it is failing because wm8960->freq_in is not set correctly. Looks like this is set by wm8960_set_dai_pll() and maybe we are missing a call to snd_soc_dai_set_pll(). Maybe check the raspberrypi driver to see what it calls to initiaise the codec.

Regards,
Jon

It is failing here:

/* check if the sysclk frequency is available. */
	for (i = 0; i < ARRAY_SIZE(sysclk_divs); ++i) {
		if (sysclk_divs[i] == -1)
			continue;
		sysclk = freq_out / sysclk_divs[i];
		for (j = 0; j < ARRAY_SIZE(dac_divs); ++j) {
			if (sysclk == dac_divs[j] * lrclk) {
				for (k = 0; k < ARRAY_SIZE(bclk_divs); ++k)
					if (sysclk == bclk * bclk_divs[k] / 10)
						break;
				if (k != ARRAY_SIZE(bclk_divs))
					break;
			}
		}
		if (j != ARRAY_SIZE(dac_divs))
			break;
	}

	if (i != ARRAY_SIZE(sysclk_divs)) {
		goto configure_clock;
	} else if (wm8960->clk_id != WM8960_SYSCLK_AUTO) {
		dev_err(codec->dev, "failed to configure clock\n");
		return -EINVAL;
	}

I added some debug logs. This is the output:

[  476.447287] wm8960 1-001a: sysclk_divs[0] = 1
[  476.453583] wm8960 1-001a: sysclk = 12288000                                                           
[  476.459731] wm8960 1-001a: lrclk = 0                                                                   
[  476.465350] wm8960 1-001a: bclk = 0
[  476.470634] wm8960 1-001a: dac_divs[0] = 256
[  476.476470] wm8960 1-001a: dac_divs[1] = 384
[  476.482295] wm8960 1-001a: dac_divs[2] = 512
[  476.488051] wm8960 1-001a: dac_divs[3] = 768
[  476.493700] wm8960 1-001a: dac_divs[4] = 1024
[  476.499091] wm8960 1-001a: dac_divs[5] = 1408
[  476.504422] wm8960 1-001a: dac_divs[6] = 1536
[  476.509611] wm8960 1-001a: sysclk_divs[1] = -1
[  476.514745] wm8960 1-001a: sysclk_divs[2] = 2
[  476.519755] wm8960 1-001a: sysclk = 12288000
[  476.524643] wm8960 1-001a: lrclk = 0
[  476.528803] wm8960 1-001a: bclk = 0
[  476.532854] wm8960 1-001a: dac_divs[0] = 256
[  476.537673] wm8960 1-001a: dac_divs[1] = 384
[  476.542453] wm8960 1-001a: dac_divs[2] = 512
[  476.547196] wm8960 1-001a: dac_divs[3] = 768
[  476.551923] wm8960 1-001a: dac_divs[4] = 1024
[  476.556710] wm8960 1-001a: dac_divs[5] = 1408
[  476.561502] wm8960 1-001a: dac_divs[6] = 1536
[  476.566287] wm8960 1-001a: sysclk_divs[3] = -1
[  476.571167] wm8960 1-001a: failed to configure clock
[  476.580074] wm8960 1-001a: ASoC: Failed to prepare bias: -22
[  476.686691] tegra210-i2s tegra210-i2s.0: Failed at I2S0_TX sw reset
[  476.693435] tegra210-i2s tegra210-i2s.0: ASoC: PRE_PMU: I2S1 DAP TX event failed: -22

It seems the problem is that lrclk and bclk are zero. They are initialized in the wm8960_hw_params() function, so I also added some debug outputs there. The result is the following:

[  197.688580] wm8960 1-001a: sysclk_divs[0] = 1
[  197.695010] wm8960 1-001a: sysclk = 12288000                                                           
[  197.701235] wm8960 1-001a: lrclk = 0                                                                   
[  197.706886] wm8960 1-001a: bclk = 0                                                                    
[  197.712184] wm8960 1-001a: dac_divs[0] = 256                                                           
[  197.718000] wm8960 1-001a: dac_divs[1] = 384                                                           
[  197.723829] wm8960 1-001a: dac_divs[2] = 512                                                           
[  197.729534] wm8960 1-001a: dac_divs[3] = 768                                                           
[  197.735204] wm8960 1-001a: dac_divs[4] = 1024                                                          
[  197.740535] wm8960 1-001a: dac_divs[5] = 1408                                                          
[  197.745824] wm8960 1-001a: dac_divs[6] = 1536                                                          
[  197.750979] wm8960 1-001a: sysclk_divs[1] = -1                                                         
[  197.756138] wm8960 1-001a: sysclk_divs[2] = 2                                                          
[  197.761173] wm8960 1-001a: sysclk = 12288000                                                           
[  197.766099] wm8960 1-001a: lrclk = 0                                                                   
[  197.770291] wm8960 1-001a: bclk = 0                                                                    
[  197.774368] wm8960 1-001a: dac_divs[0] = 256                                                           
[  197.779205] wm8960 1-001a: dac_divs[1] = 384                                                           
[  197.784025] wm8960 1-001a: dac_divs[2] = 512                                                           
[  197.788801] wm8960 1-001a: dac_divs[3] = 768                                                           
[  197.793546] wm8960 1-001a: dac_divs[4] = 1024                                                          
[  197.798362] wm8960 1-001a: dac_divs[5] = 1408                                                          
[  197.803147] wm8960 1-001a: dac_divs[6] = 1536
[  197.807934] wm8960 1-001a: sysclk_divs[3] = -1
[  197.812820] wm8960 1-001a: failed to configure clock
[  197.821741] wm8960 1-001a: ASoC: Failed to prepare bias: -22
[  197.827907] wm8960 1-001a: wm8960->bclk = 1536000
[  197.833099] wm8960 1-001a: wm8960->lrclk = 48000
[  197.938661] tegra210-i2s tegra210-i2s.0: Failed at I2S0_TX sw reset
[  197.945390] tegra210-i2s tegra210-i2s.0: ASoC: PRE_PMU: I2S1 DAP TX event failed: -22

As you can see, the wm8960_hw_params() is called after the wm8960_configure_clocking() which causes the failure of the clock configuration. When I try to play the file again, the “failed to configure clock” error message disappears:

[  206.092305] wm8960 1-001a: sysclk_divs[0] = 1
[  206.097666] wm8960 1-001a: sysclk = 12288000
[  206.103036] wm8960 1-001a: lrclk = 48000
[  206.107939] wm8960 1-001a: bclk = 1536000
[  206.112878] wm8960 1-001a: dac_divs[0] = 256
[  206.118098] wm8960 1-001a: bclk_divs[0] = 10
[  206.123309] wm8960 1-001a: bclk_divs[1] = 15
[  206.128509] wm8960 1-001a: bclk_divs[2] = 20
[  206.133483] wm8960 1-001a: bclk_divs[3] = 30
[  206.138412] wm8960 1-001a: bclk_divs[4] = 40
[  206.143259] wm8960 1-001a: bclk_divs[5] = 55
[  206.148104] wm8960 1-001a: bclk_divs[6] = 60
[  206.152864] wm8960 1-001a: bclk_divs[7] = 80
[  206.157920] wm8960 1-001a: wm8960->bclk = 1536000
[  206.163225] wm8960 1-001a: wm8960->lrclk = 48000
[  206.268912] tegra210-i2s tegra210-i2s.0: Failed at I2S0_TX sw reset
[  206.275748] tegra210-i2s tegra210-i2s.0: ASoC: PRE_PMU: I2S1 DAP TX event failed: -22

Unfortunately, it still doesn’t work. What is the meaning of the remaining errors from tegra210-i2s?

This means that the Tegra I2S interface is not receiving the I2S bit clock. There are two possibilities here …

  1. The codec is not generating the bit clock (if you have a scope you should be able to check)
  2. The Tegra pin for the bclk does not have the input-enable set. We can check if the input-enable is set by …
$ sudo grep dap1 /sys/kernel/debug/tegra_pinctrl_reg
Bank: 0 Reg: 0x02431028 Val: 0x00000400 -> dap1_fs_pj3
Bank: 0 Reg: 0x02431030 Val: 0x00000458 -> dap1_din_pj2
Bank: 0 Reg: 0x02431038 Val: 0x00000400 -> dap1_dout_pj1
Bank: 0 Reg: 0x02431040 Val: 0x00000400 -> dap1_sclk_pj0

The input-enable is bit 6 and so I believe that by default it is not enabled. The official process to update the pin settings is a bit convoluted …

However, for testing you can try …

$ sudo busybox devmem 0x02431028 32 0x454
$ sudo busybox devmem 0x02431040 32 0x454

Now with regard to the other errors, I am still not certain we have the clocking configured right. I had a look at the schematics for the ‘ReSpeaker 2-Mics Pi HAT’ and it does show a 24MHz oscillator. Also I have a look at another driver, sound/soc/fsl/fsl-asoc-card.c, that uses this codec. I think that what we need to do is something like …

diff --git a/sound/soc/tegra-alt/tegra_t186ref_mobile_rt565x.c b/sound/soc/tegra-alt/tegra_t186ref_mobile_rt565x.c
index 36572f1a9288..569a9211376f 100644
--- a/sound/soc/tegra-alt/tegra_t186ref_mobile_rt565x.c
+++ b/sound/soc/tegra-alt/tegra_t186ref_mobile_rt565x.c
@@ -44,6 +44,7 @@
 #include <sound/pcm_params.h>
 #include <sound/soc.h>
 #include "../codecs/rt5659.h"
+#include "../codecs/wm8960.h"
 
 #include "tegra_asoc_utils_alt.h"
 #include "tegra_asoc_machine_alt.h"
@@ -314,6 +315,32 @@ static int tegra_t186ref_dai_init(struct snd_soc_pcm_runtime *rtd,
                }
        }
 
+       idx = tegra_machine_get_codec_dai_link_idx_t18x("wm8960-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 = formats;
+
+               err = snd_soc_dai_set_pll(card->rtd[idx].codec_dai,
+                                         WM8960_SYSCLK_PLL, WM8960_SYSCLK_MCLK,
+                                         24000000, clk_out_rate);
+               if (err) {
+                       dev_err(dev, "failed to configure codec PLL: %d\n", err);
+                       return err;
+               }
+
+               err = snd_soc_dai_set_sysclk(card->rtd[idx].codec_dai,
+                                            WM8960_SYSCLK_PLL, clk_out_rate,
+                                            SND_SOC_CLOCK_IN);
+               if (err < 0) {
+                       dev_err(card->dev, "codec_dai clock not set\n");
+                       return err;
+               }
+       }
+

Looking at the wm8960 driver used for the re-speaker, looks like they hard-coded the 24MHz …

We should not need to do that if we configure the PLL correctly. I still do not understand who is calling wm8960_configure_clocking() when it fails the first time. Seems that it should be called by the codec’s hw_params() function or in the codec probe (which would happen early on). Do you know who is calling this when bclk and lrclk are zero? I guess you could add a ‘dump_stack()’ that would show you the call stack when it is called.

Regards,
Jon

I can see the clock for some seconds using the scope.

This gives me the following output:

Bank: 0 Reg: 0x02431028 Val: 0x00000440 -> dap1_fs_pj3
Bank: 0 Reg: 0x02431030 Val: 0x00000450 -> dap1_din_pj2
Bank: 0 Reg: 0x02431038 Val: 0x00000440 -> dap1_dout_pj1
Bank: 0 Reg: 0x02431040 Val: 0x00000440 -> dap1_sclk_pj0
Bank: 0 Reg: 0x0243102c Val: 0x01616000 -> drive_dap1_fs
Bank: 0 Reg: 0x02431034 Val: 0x01616000 -> drive_dap1_din
Bank: 0 Reg: 0x0243103c Val: 0x01616000 -> drive_dap1_dout
Bank: 0 Reg: 0x02431044 Val: 0x01616000 -> drive_dap1_sclk

Did not help.

Using these changes, I get the following output:
aplay:

Playing WAVE 'LRMonoPhase4.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
aplay: set_params:1297: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 48000
PERIOD_TIME: (42666 42667)
PERIOD_SIZE: 2048
PERIOD_BYTES: 8192
PERIODS: 4
BUFFER_TIME: (170666 170667)
BUFFER_SIZE: 8192
BUFFER_BYTES: 32768
TICK_TIME: 0

dmesg:

[   39.729069] WM8960 PLL: Unsupported N=4
[   39.734919] tegra-snd-t186ref-mobile-rt565x sound: failed to configure codec PLL: -22
[   39.746796] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   39.754943] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -22

When I change the clock to 12288000, I don’t get this error message. That’s weird, because of the 24MHz oscillator. On the Raspberry, I don’t know which clock they use. As you said, they hardcoded 24Mhz, but in the device tree, they set the mclk to 12288000 (see https://github.com/respeaker/seeed-voicecard/blob/master/seeed-2mic-voicecard-overlay.dts ).

Here is the call stack:

[   80.971606] Call trace:
[   80.975819] [<ffffffc000089860>] dump_backtrace+0x0/0x100
[   80.982958] [<ffffffc000089a28>] show_stack+0x14/0x1c
[   80.989719] [<ffffffc00033cdf8>] dump_stack+0x98/0xc0
[   80.996446] [<ffffffc00097fb3c>] wm8960_configure_clocking+0x124/0x3ec
[   81.004675] [<ffffffc000980234>] wm8960_set_bias_level_out3+0x1b0/0x1f4
[   81.012969] [<ffffffc00097ef8c>] wm8960_set_bias_level+0x18/0x20
[   81.020634] [<ffffffc0009671f0>] snd_soc_codec_set_bias_level+0x18/0x20
[   81.028886] [<ffffffc00096e01c>] snd_soc_dapm_set_bias_level+0xa4/0x1e4
[   81.037058] [<ffffffc000970134>] dapm_pre_sequence_async+0x90/0xcc
[   81.044790] [<ffffffc0000c4aa8>] async_run_entry_fn+0x44/0x180
[   81.052157] [<ffffffc0000bc2d0>] process_one_work+0x154/0x434
[   81.059417] [<ffffffc0000bc6e4>] worker_thread+0x134/0x40c
[   81.066404] [<ffffffc0000c1f30>] kthread+0xe0/0xf4
[   81.072664] [<ffffffc000084f90>] ret_from_fork+0x10/0x40

I get the same stack if I run it multiple times. So something must be happen in between…

The 12288000 in device-tree does not make sense to me. You may wish to check with the vendor of the board if it really is 24MHz or not.

Looking at the wm8960 data sheet it can accept an MCLK of upto 33MHz and so 24MHz is certainly valid.

Looking at the wm8960, I can see that the reason why configuring the PLL now fails is because the ratio between the MCLK and output clock is not large enough. Furthermore reading the wm8960 datasheet it states that the PLL performs best when the output frequency is between 90MHz and 100MHz. And ‘Table 45 PLL Frequency Examples’ in the datasheet shows that with a 24MHz MCLK, we want the output frequency of the PLL to be 98.304MHz and then divide this down to 12.288MHz. So from looking at the datasheet something like …

diff --git a/sound/soc/tegra-alt/tegra_t186ref_mobile_rt565x.c b/sound/soc/tegra-alt/tegra_t186ref_mobile_rt565x.c
index 36572f1a9288..ad8b3f9e3000 100644
--- a/sound/soc/tegra-alt/tegra_t186ref_mobile_rt565x.c
+++ b/sound/soc/tegra-alt/tegra_t186ref_mobile_rt565x.c
@@ -44,6 +44,7 @@
 #include <sound/pcm_params.h>
 #include <sound/soc.h>
 #include "../codecs/rt5659.h"
+#include "../codecs/wm8960.h"
 
 #include "tegra_asoc_utils_alt.h"
 #include "tegra_asoc_machine_alt.h"
@@ -314,6 +315,69 @@ static int tegra_t186ref_dai_init(struct snd_soc_pcm_runtime *rtd,
                }
        }
 
+       idx = tegra_machine_get_codec_dai_link_idx_t18x("wm8960-playback");
+       /* check if idx has valid number */
+       if (idx != -EINVAL) {
+               unsigned int pll_f2;
+               int sysclk_div
+
+               dai_params =
+               (struct snd_soc_pcm_stream *)card->rtd[idx].dai_link->params;
+
+               dai_params->rate_min = clk_rate;
+               dai_params->formats = formats;
+
+               /*
+                * Per the wm8960 data-sheet the PLL performs best in the range of
+                * 90-100MHz, therefore set the PLL to operate as close to 100MHz
+                * as we can.
+                */
+               pll_f2 = (100000000/clk_out_rate) * clk_out_rate;
+
+               if (pll_f2 < 90000000 || pll_f2 > 100000000)
+                       dev_warn(dev, "PLL frequency is not optimal: %dHz\n", pll_f2);
+
+               err = snd_soc_dai_set_pll(card->rtd[idx].codec_dai,
+                                         WM8960_SYSCLK_PLL, WM8960_SYSCLK_MCLK,
+                                         24000000, pll_f2);
+               if (err) {
+                       dev_err(dev, "failed to configure codec PLL: %d\n", err);
+                       return err;
+               }
+
+               /*
+                * The wm8960 has a fixed divide-by-4 divider on the output of
+                * the PLL and so take this into account when calculating the
+                * sysclk divider.
+                */
+               sysclk_div = (pll_f2/(clk_out_rate * 4));
+
+               if (sysclk_div == 0) {
+                       dev_err(dev, "codec sysclk frequency is too slow!\n");
+                       return -EINVAL;
+               }
+
+               sysclk_div = sysclk_div == 1 ? 0 : 2;
+
+               err = snd_soc_dai_set_clkdiv(card->rtd[idx].codec_dai,
+                                            WM8960_SYSCLKDIV, sysclk_div);
+               if (err) {
+                       dev_err(dev,
+                               "failed to configure codec clock divider: %d\n",
+                               err);
+                       return err;
+               }
+
+               err = snd_soc_dai_set_sysclk(card->rtd[idx].codec_dai,
+                                            WM8960_SYSCLK_PLL, (pll_f2/(sysclk_div *4)),
+                                            SND_SOC_CLOCK_IN);
+               if (err < 0) {
+                       dev_err(card->dev, "codec_dai clock not set\n");
+                       return err;
+               }
+       }
+

Please note that I am not familiar with this codec and so it is a bit of guess work. However, I don’t see any reason why this cannot work.

With regard to the Tegra I2S error, maybe we should ensure that the word clock (lrclk) and bit clock frequencies being generated by the codec match what we would expect first. It is important to get the clock configuration right first.

Regards,
Jon

Hi Jon,

I am not in the office the rest of the week. I will check the clocks and give you feedback next week.

Thanks for your help,
Markus

I checked the frequency using the oscilloscope. It is 24MHz.

The code is failing when setting the pll. Looking at the codec driver code, it checks if the factor is valid:

static int pll_factors(unsigned int source, unsigned int target,
		       struct _pll_div *pll_div)
{
	unsigned long long Kpart;
	unsigned int K, Ndiv, Nmod;

	pr_debug("WM8960 PLL: setting %dHz->%dHz\n", source, target);

	/* Scale up target to PLL operating frequency */
	target *= 4;

	Ndiv = target / source;
	if (Ndiv < 6) {
		source >>= 1;
		pll_div->pre_div = 1;
		Ndiv = target / source;
	} else
		pll_div->pre_div = 0;

	if ((Ndiv < 6) || (Ndiv > 12)) {
		pr_err("WM8960 PLL: Unsupported N=%d\n", Ndiv);
		return -EINVAL;
	}

	pll_div->n = Ndiv;
	Nmod = target % source;
	Kpart = FIXED_PLL_SIZE * (long long)Nmod;

	do_div(Kpart, source);

	K = Kpart & 0xFFFFFFFF;

	/* Check if we need to round */
	if ((K % 10) >= 5)
		K += 5;

	/* Move down to proper range now rounding is done */
	K /= 10;

	pll_div->k = K;

	pr_debug("WM8960 PLL: N=%x K=%x pre_div=%d\n",
		 pll_div->n, pll_div->k, pll_div->pre_div);

	return 0;
}

As you can see, they multiply the target with 4. So I think we should set the output frequency to pll_f2 divided by 4:

err = snd_soc_dai_set_pll(card->rtd[idx].codec_dai,
                          WM8960_SYSCLK_PLL, WM8960_SYSCLK_MCLK,
                          24000000, pll_f2/4);

When I try this, I do not get any error message from the codec (at least after starting aplay two times). Here is the output:

[  895.730786] wm8960 1-001a: sysclk = 12288000
[  895.739626] wm8960 1-001a: lrclk = 48000
[  895.747239] wm8960 1-001a: bclk = 1536000
[  895.754947] wm8960 1-001a: sysclk_divs[0] = 1
[  895.763036] wm8960 1-001a: dac_divs[0] = 256
[  895.770251] wm8960 1-001a: bclk_divs[0] = 10
[  895.777365] wm8960 1-001a: bclk_divs[1] = 15
[  895.784164] wm8960 1-001a: bclk_divs[2] = 20
[  895.790940] wm8960 1-001a: bclk_divs[3] = 30
[  895.797286] wm8960 1-001a: bclk_divs[4] = 40
[  895.803657] wm8960 1-001a: bclk_divs[5] = 55
[  895.809963] wm8960 1-001a: bclk_divs[6] = 60
[  895.816185] wm8960 1-001a: bclk_divs[7] = 80
[  895.822627] wm8960 1-001a: wm8960->bclk = 1536000
[  895.829188] wm8960 1-001a: wm8960->lrclk = 48000
[  895.945838] tegra210-i2s tegra210-i2s.0: Failed at I2S0_TX sw reset
[  895.953496] tegra210-i2s tegra210-i2s.0: ASoC: PRE_PMU: I2S1 DAP TX event failed: -22

The sysclk seems to be ok regarding table 45 in the datasheet. I probed the bit clock and got a frequency of 3.072MHz which is two times the bit clock from the debug output. That’s wrong I think, isn’t it?
Also, I can not see the lrclk. The signal is continously high.

Regards,
Markus

This was my fault. I probed the wrong pin. I can see the lrclk now, its frequency is 96kHz. It should be 48kHz I guess. So the frequencies of the probed clocks are two times the expected ones. Because the clocks are generated from the sysclk, I think the sysclk is already wrong.

Yes I may not have had the sysclk dividers quite right, it was a bit of guess work. There is a good diagram in the codec data sheet showing the clock dividers, etc and so you may wish to use this to figure out the correct configuration.

Regards,
Jon

Hi Jon,

I finally got the clocks working, lrclk is now 48kHz and bclk 1.536MHz. This is the code I used:

idx = tegra_machine_get_codec_dai_link_idx_t18x("wm8960-playback");
       /* check if idx has valid number */
       if (idx != -EINVAL) {
               unsigned int pll_f2;
               //int sysclk_div;

               dai_params =
               (struct snd_soc_pcm_stream *)card->rtd[idx].dai_link->params;

               dai_params->rate_min = clk_rate;
               dai_params->formats = formats;

               /*
                * Per the wm8960 data-sheet the PLL performs best in the range of
                * 90-100MHz, therefore set the PLL to operate as close to 100MHz
                * as we can.
                */
               pll_f2 = (100000000/clk_out_rate) * clk_out_rate;

               if (pll_f2 < 90000000 || pll_f2 > 100000000)
                       dev_warn(card->dev, "PLL frequency is not optimal: %dHz\n", pll_f2);
               
               err = snd_soc_dai_set_sysclk(card->rtd[idx].codec_dai,
                                            WM8960_SYSCLK_PLL, (pll_f2/4),
                                            SND_SOC_CLOCK_IN);
                if (err < 0) {
                        dev_err(card->dev, "codec_dai clock not set\n");
                        return err;
                }
                
                err = snd_soc_dai_set_pll(card->rtd[idx].codec_dai,
                                         WM8960_SYSCLK_PLL, WM8960_SYSCLK_MCLK,
                                         24000000, pll_f2/4);
                if (err) {
                    dev_err(card->dev, "failed to configure codec PLL: %d\n", err);
                    return err;
                }
       }

I could remove the part where you set the sysclk_div, because it is configured inside the wm8960_configure_clocking() function. Also I had to set the sysclk to pll_f2/4. Otherwise the configuration of the clock dividers is wrong. I don’t know why it is implemented in that way, maybe I am still using it wrong. Nevertheless, the clocks look ok now. This is the output:

[   37.581371] wm8960 1-001a: sysclk = 24576000
[   37.591973] wm8960 1-001a: lrclk = 48000
[   37.602312] wm8960 1-001a: bclk = 1536000
[   37.612711] wm8960 1-001a: sysclk_divs[0] = 1
[   37.621920] wm8960 1-001a: dac_divs[0] = 256
[   37.630155] wm8960 1-001a: dac_divs[1] = 384
[   37.638291] wm8960 1-001a: dac_divs[2] = 512
[   37.646414] wm8960 1-001a: bclk_divs[0] = 10
[   37.653826] wm8960 1-001a: bclk_divs[1] = 15
[   37.660700] wm8960 1-001a: bclk_divs[2] = 20
[   37.667201] wm8960 1-001a: bclk_divs[3] = 30
[   37.673671] wm8960 1-001a: bclk_divs[4] = 40
[   37.680159] wm8960 1-001a: bclk_divs[5] = 55
[   37.686494] wm8960 1-001a: bclk_divs[6] = 60
[   37.692741] wm8960 1-001a: bclk_divs[7] = 80
[   37.699053] wm8960 1-001a: bclk_divs[8] = 110
[   37.705398] wm8960 1-001a: bclk_divs[9] = 120
[   37.711532] wm8960 1-001a: bclk_divs[10] = 160
[   37.717383] wm8960 1-001a: sysclk_div = 1
[   37.722872] wm8960 1-001a: bclk_div   = 160
[   37.728450] wm8960 1-001a: dac_div    = 512
[   37.734191] wm8960 1-001a: wm8960->bclk = 1536000
[   37.740324] wm8960 1-001a: wm8960->lrclk = 48000
[   37.746423] wm8960 1-001a: Set deemphasis 0
[   37.853063] tegra210-i2s tegra210-i2s.0: Failed at I2S0_TX sw reset
[   37.860697] tegra210-i2s tegra210-i2s.0: ASoC: PRE_PMU: I2S1 DAP TX event failed: -22

Now, the problem is that I cannot see any audio data transferred between codec and Jetson. It doesn’t matter if I try to play or record something. Any idea?

Also I still have the issue with the order of the codec initialization. The function wm8960_hw_params() has to be called before the wm8960_configure_clocking(). Otherwise, bclk and lrclk are not initialized and the playback fails at the first try. How is it possible to change this?

Regards,
Markus

Hi Markus,

I know we discussed this before, but did you remember to update the pinmux configuration to set the input-enable? What does the following show …

$ sudo grep dap1 /sys/kernel/debug/tegra_pinctrl_reg

With regard to the ordering issue, I wonder if we need to configure the sysclk and pll etc, earlier. Can you try moving the code into a init function for the wm8960 …

@@ -523,6 +586,11 @@ static int tegra_t186ref_compr_set_params(struct snd_compr_stream *cstream)
 }
 #endif
 
+static int tegra_t186ref_wm8960_init(struct snd_soc_pcm_runtime *rtd)
+{
+       ...
+}
+
 static int tegra_t186ref_pcm1864_init(struct snd_soc_pcm_runtime *rtd)
 {
        int err;
@@ -973,6 +1041,9 @@ static void dai_link_setup(struct platform_device *pdev)
                        else if (strstr(tegra_t186ref_codec_links[i].name,
                                "pcm1864-link1"))
                                tegra_t186ref_codec_links[i].init = tegra_t186ref_pcm1864_init;
+                       else if (strstr(tegra_t186ref_codec_links[i].name,
+                               "wm8960-playback"))
+                               tegra_t186ref_codec_links[i].init = tegra_t186ref_wm8960_init;
                }
        }

Regards,
Jon

As you wrote before, I use the following commands to change the pinmux:

sudo busybox devmem 0x02431028 32 0x454
sudo busybox devmem 0x02431040 32 0x454

These are the outputs before and after running the commands:

Before:

Bank: 0 Reg: 0x02431028 Val: 0x00000440 -> dap1_fs_pj3
Bank: 0 Reg: 0x02431030 Val: 0x00000450 -> dap1_din_pj2
Bank: 0 Reg: 0x02431038 Val: 0x00000440 -> dap1_dout_pj1
Bank: 0 Reg: 0x02431040 Val: 0x00000440 -> dap1_sclk_pj0
Bank: 0 Reg: 0x0243102c Val: 0x01616000 -> drive_dap1_fs
Bank: 0 Reg: 0x02431034 Val: 0x01616000 -> drive_dap1_din
Bank: 0 Reg: 0x0243103c Val: 0x01616000 -> drive_dap1_dout
Bank: 0 Reg: 0x02431044 Val: 0x01616000 -> drive_dap1_sclk

After:

Bank: 0 Reg: 0x02431028 Val: 0x00000454 -> dap1_fs_pj3
Bank: 0 Reg: 0x02431030 Val: 0x00000450 -> dap1_din_pj2
Bank: 0 Reg: 0x02431038 Val: 0x00000440 -> dap1_dout_pj1
Bank: 0 Reg: 0x02431040 Val: 0x00000454 -> dap1_sclk_pj0
Bank: 0 Reg: 0x0243102c Val: 0x01616000 -> drive_dap1_fs
Bank: 0 Reg: 0x02431034 Val: 0x01616000 -> drive_dap1_din
Bank: 0 Reg: 0x0243103c Val: 0x01616000 -> drive_dap1_dout
Bank: 0 Reg: 0x02431044 Val: 0x01616000 -> drive_dap1_sclk

The result is equal in both cases: sysclk and lrclk are ok, but nothing happens on the data pins.

This does not work because the clk_out_rate is not available at this time. I think the wm8960_hw_params() has to be called before wm8960_configure_clocking(). Looking at the backtraces, it seems that they are not called from the machine driver (tegra_t186ref_mobile_rt565x.c):

# wm8960_configure_clocking:
[  130.461978] Call trace:
[  130.467085] [<ffffffc000089860>] dump_backtrace+0x0/0x100
[  130.475220] [<ffffffc000089a28>] show_stack+0x14/0x1c
[  130.483043] [<ffffffc00033cdf8>] dump_stack+0x98/0xc0
[  130.490814] [<ffffffc00097fc0c>] wm8960_configure_clocking+0xfc/0x454
[  130.499996] [<ffffffc0009803f0>] wm8960_set_bias_level_out3+0x1c4/0x208
[  130.509324] [<ffffffc00097ef8c>] wm8960_set_bias_level+0x18/0x20
[  130.518030] [<ffffffc0009671f0>] snd_soc_codec_set_bias_level+0x18/0x20
[  130.527358] [<ffffffc00096e01c>] snd_soc_dapm_set_bias_level+0xa4/0x1e4
[  130.536700] [<ffffffc000970134>] dapm_pre_sequence_async+0x90/0xcc
[  130.545664] [<ffffffc0000c4aa8>] async_run_entry_fn+0x44/0x180
[  130.554289] [<ffffffc0000bc2d0>] process_one_work+0x154/0x434
[  130.562850] [<ffffffc0000bc6e4>] worker_thread+0x134/0x40c
[  130.571139] [<ffffffc0000c1f30>] kthread+0xe0/0xf4
[  130.578680] [<ffffffc000084f90>] ret_from_fork+0x10/0x40

# wm8960_hw_params:
[  130.730953] Call trace:
[  130.733887] [<ffffffc000089860>] dump_backtrace+0x0/0x100
[  130.739800] [<ffffffc000089a28>] show_stack+0x14/0x1c
[  130.745355] [<ffffffc00033cdf8>] dump_stack+0x98/0xc0
[  130.750906] [<ffffffc00097ffc0>] wm8960_hw_params+0x5c/0x258
[  130.757085] [<ffffffc000977958>] soc_dai_hw_params+0x28/0x68
[  130.763271] [<ffffffc00096f200>] snd_soc_dai_link_event+0x280/0x38c
[  130.770076] [<ffffffc000970508>] dapm_seq_check_event.isra.31+0x134/0x2c0
[  130.777428] [<ffffffc000970740>] dapm_seq_run_coalesced+0x94/0x1c8
[  130.784190] [<ffffffc000970918>] dapm_seq_run+0xa4/0x404
[  130.790091] [<ffffffc000971b84>] dapm_power_widgets+0x524/0x970
[  130.796618] [<ffffffc000974184>] snd_soc_dapm_stream_event+0x8c/0xa8
[  130.803603] [<ffffffc0009757a8>] soc_pcm_prepare+0x10c/0x1ec
[  130.809913] [<ffffffc000942718>] snd_pcm_do_prepare+0x1c/0x38
[  130.816313] [<ffffffc00094217c>] snd_pcm_action_single+0x40/0x88
[  130.822985] [<ffffffc000942234>] snd_pcm_action_nonatomic+0x70/0x90
[  130.829921] [<ffffffc000945d38>] snd_pcm_common_ioctl1+0xb98/0xde4
[  130.836781] [<ffffffc000946164>] snd_pcm_playback_ioctl1+0x1e0/0x318
[  130.843834] [<ffffffc0009462c8>] snd_pcm_playback_ioctl+0x2c/0x44
[  130.850636] [<ffffffc0001e6350>] do_vfs_ioctl+0x324/0x5e4
[  130.856755] [<ffffffc0001e6694>] SyS_ioctl+0x84/0x98
[  130.862450] [<ffffffc000084ff0>] el0_svc_naked+0x24/0x28

Does this mean that we have to change it somewhere else or can we just include an additional function call inside the machine driver? I’m not really familiar with the linux audio subsystem, so I would appreciate if you could help me with this issue.

And by ‘equal’ you mean you still see the error message regarding the sw reset? If so then the I2S interface is still not seeing the bit clock. It definitely works because this has been tested (doing an external loopback between I2S interfaces on TX2). So the only thing I can think of is that the bit clock is not turning on quick enough. Can you insert a large mdelay (ie. 1 second will be more than enough but enough to prove if this is the issue) after the bitclock on the codec is enabled (probably in the codec hw_params function)?

Ah yes good point. So what I would do is this …

  1. Move the code the sets up the codec clock to a new function that takes the clk_out_rate as a parameter (in addition to any other parameters you need to pass).
  2. Call this new function from both the codec init function (here with a default clk_out_rate, for example 48000 * 256 = 12288000) and then from the machine driver hw_params (as you had before).

Regards,
Jon

yes

I don’t know which function activates the bitclock output. I checked different places inside the codec driver but could not find the right one. You think it should be the wm8960_hw_params()? I waited at the end of this function but the clock was not activated at this point. I also checked the other functions of the codec driver but could not find the one which is activating the clocks. Here are the function calls that I logged:

[  +3.008311] wm8960 1-001a: wm8960_set_dai_sysclk
[  +0.005267] wm8960 1-001a: Use PLL
[  +0.004032] wm8960 1-001a: Set sysclk to 24576000
[  +0.005354] wm8960 1-001a: wm8960_set_dai_pll
[  +0.004985] wm8960 1-001a: wm8960_set_pll
[  +0.004627] WM8960 PLL: setting 24000000Hz->24576000Hz
[  +0.005763] WM8960 PLL: N=8 K=3126e9 pre_div=1
[  +0.005783] wm8960 1-001a: Turn PLL on
[  +0.259237] wm8960 1-001a: Turn PLL on done
[  +0.008696] wm8960 1-001a: wm8960_set_bias_level_out3
[  +2.008434] wm8960 1-001a: SND_SOC_BIAS_PREPARE
[  +0.005193] wm8960 1-001a: wm8960_configure_clocking
[  +0.006229] wm8960 1-001a: wm8960_set_bias_level_out3 done
[  +2.007594] wm8960 1-001a: wm8960_hw_params
[  +2.004936] wm8960 1-001a: wm8960->bclk = 1536000
[  +0.005341] wm8960 1-001a: wm8960->lrclk = 48000
[  +0.005213] wm8960 1-001a: wm8960_set_deemph
[  +0.004845] wm8960 1-001a: Set deemphasis 0
[  +0.004966] wm8960 1-001a: wm8960_hw_params done
[  +2.005306] wm8960 1-001a: wm8960_mute 0
[  +5.004884] wm8960 1-001a: wm8960_mute done
[  +5.105465] tegra210-i2s tegra210-i2s.0: Failed at I2S0_TX sw reset
[  +0.006869] tegra210-i2s tegra210-i2s.0: ASoC: PRE_PMU: I2S1 DAP TX event failed: -22
!!!!!!!!!!! clocks start here !!!!!!!!!!!!!
[  +0.009653] wm8960 1-001a: wm8960_set_bias_level_out3
[  +2.007763] wm8960 1-001a: SND_SOC_BIAS_ON
[  +0.004801] wm8960 1-001a: wm8960_set_bias_level_out3 done
[  +3.221974] wm8960 1-001a: wm8960_set_bias_level_out3
[  +2.006238] wm8960 1-001a: SND_SOC_BIAS_PREPARE
[  +0.005196] wm8960 1-001a: wm8960_set_bias_level_out3 done
[  +2.006686] wm8960 1-001a: wm8960_mute 1
[Dec 6 16:38] wm8960 1-001a: wm8960_mute done
[  +5.008451] wm8960 1-001a: wm8960_set_bias_level_out3
[  +2.005757] wm8960 1-001a: SND_SOC_BIAS_STANDBY
[  +0.005270] wm8960 1-001a: wm8960_set_bias_level_out3 done

I can see the clocks only after the error message already occured. It seems that wm8960_mute is the last function of the codec driver but also this function does not activate the bitclock. Maybe something else activates the codec clocks? It’s weird.

I did this, but it gives me the same result. The thing is that wm8960_hw_params() is called too late. Due to this, the wm8960->bclk and wm8960->lrclk is not set. Do you know which function calls the codec’s hw_params()? Maybe I could try to change the order there?

Regards,
Markus

Yes sounds like the problem is that the clocks are turned on too late. Probably the best thing to do is check the codec datasheet and see what bit in what register enables the bit-clock and then figure out in the driver where this is done.

Hmmm … indeed. I am not sure if the problem is that the codec is in some odd bias state on boot and assumes that when the set_bias function is called the bclk lrclk should have already been configured. Seems like a bug in the codec driver. I checked the latest version of the driver in the latest Linux kernel but seems to behave the same way. You may wish to ask the codec vendor about this.

Regards,
Jon

Ok, I think I found the issue. The bitclock is activated after enabling the ADC or DAC. Both are activated through DAPM widgets. I enabled some debug output using this guide: Debugging DAPM for ASoC codec | Experiences
The result is the following:

# tracer: nop
#
# entries-in-buffer/entries-written: 326/326   #P:4
#
#                              _-----=> irqs-off
#                             / _----=> need-resched
#                            | / _---=> hardirq/softirq
#                            || / _--=> preempt-depth
#                            ||| /     delay
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |       |   ||||       |         |
           aplay-3419  [000] ...1  1755.975400: snd_soc_dapm_start: card=tegra-snd-t186ref-mobile-rt565x
           aplay-3419  [000] ...1  1755.975578: snd_soc_dapm_widget_power: widget=Playback 1 val=1
           aplay-3419  [000] ...1  1755.975582: snd_soc_dapm_widget_power: widget=ADMAIF1 Receive val=1
           aplay-3419  [000] ...1  1755.975588: snd_soc_dapm_path: *ADMAIF1 RX <- (direct) <- ADMAIF1 Receive
           aplay-3419  [000] ...1  1755.975591: snd_soc_dapm_widget_power: widget=ADMAIF1 RX val=1
           aplay-3419  [000] ...1  1755.975601: snd_soc_dapm_path:  I2S1 Mux <- ARAD1 <- ARAD1 RX
           aplay-3419  [000] ...1  1755.975604: snd_soc_dapm_path:  I2S1 Mux <- ADX4-4 <- ADX4-4 RX
           aplay-3419  [000] ...1  1755.975608: snd_soc_dapm_path:  I2S1 Mux <- ADX4-3 <- ADX4-3 RX
           aplay-3419  [000] ...1  1755.975611: snd_soc_dapm_path:  I2S1 Mux <- ADX4-2 <- ADX4-2 RX
           aplay-3419  [000] ...1  1755.975613: snd_soc_dapm_path:  I2S1 Mux <- ADX4-1 <- ADX4-1 RX
           aplay-3419  [000] ...1  1755.975616: snd_soc_dapm_path:  I2S1 Mux <- AMX4 <- AMX4 RX
           aplay-3419  [000] ...1  1755.975618: snd_soc_dapm_path:  I2S1 Mux <- ADX3-4 <- ADX3-4 RX
           aplay-3419  [000] ...1  1755.975621: snd_soc_dapm_path:  I2S1 Mux <- ADX3-3 <- ADX3-3 RX
           aplay-3419  [000] ...1  1755.975623: snd_soc_dapm_path:  I2S1 Mux <- ADX3-2 <- ADX3-2 RX
           aplay-3419  [000] ...1  1755.975625: snd_soc_dapm_path:  I2S1 Mux <- ADX3-1 <- ADX3-1 RX
           aplay-3419  [000] ...1  1755.975628: snd_soc_dapm_path:  I2S1 Mux <- AMX3 <- AMX3 RX
           aplay-3419  [000] ...1  1755.975630: snd_soc_dapm_path:  I2S1 Mux <- ASRC1-6 <- ASRC1-6 RX
           aplay-3419  [000] ...1  1755.975632: snd_soc_dapm_path:  I2S1 Mux <- ASRC1-5 <- ASRC1-5 RX
           aplay-3419  [000] ...1  1755.975635: snd_soc_dapm_path:  I2S1 Mux <- ASRC1-4 <- ASRC1-4 RX
           aplay-3419  [000] ...1  1755.975637: snd_soc_dapm_path:  I2S1 Mux <- ASRC1-3 <- ASRC1-3 RX
           aplay-3419  [000] ...1  1755.975640: snd_soc_dapm_path:  I2S1 Mux <- ASRC1-2 <- ASRC1-2 RX
           aplay-3419  [000] ...1  1755.975642: snd_soc_dapm_path:  I2S1 Mux <- ASRC1-1 <- ASRC1-1 RX
           aplay-3419  [000] ...1  1755.975644: snd_soc_dapm_path:  I2S1 Mux <- I2S6 <- I2S6 RX
           aplay-3419  [000] ...1  1755.975646: snd_soc_dapm_path:  I2S1 Mux <- DMIC4 <- DMIC4 RX
           aplay-3419  [000] ...1  1755.975649: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF20 <- ADMAIF20 RX
           aplay-3419  [000] ...1  1755.975651: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF19 <- ADMAIF19 RX
           aplay-3419  [000] ...1  1755.975654: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF18 <- ADMAIF18 RX
           aplay-3419  [000] ...1  1755.975656: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF17 <- ADMAIF17 RX
           aplay-3419  [000] ...1  1755.975658: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF16 <- ADMAIF16 RX
           aplay-3419  [000] ...1  1755.975661: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF15 <- ADMAIF15 RX
           aplay-3419  [000] ...1  1755.975663: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF14 <- ADMAIF14 RX
           aplay-3419  [000] ...1  1755.975666: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF13 <- ADMAIF13 RX
           aplay-3419  [000] ...1  1755.975668: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF12 <- ADMAIF12 RX
           aplay-3419  [000] ...1  1755.975671: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF11 <- ADMAIF11 RX
           aplay-3419  [000] ...1  1755.975674: snd_soc_dapm_path:  I2S1 Mux <- ADX2-4 <- ADX2-4 RX
           aplay-3419  [000] ...1  1755.975676: snd_soc_dapm_path:  I2S1 Mux <- ADX2-3 <- ADX2-3 RX
           aplay-3419  [000] ...1  1755.975678: snd_soc_dapm_path:  I2S1 Mux <- ADX2-2 <- ADX2-2 RX
           aplay-3419  [000] ...1  1755.975680: snd_soc_dapm_path:  I2S1 Mux <- ADX2-1 <- ADX2-1 RX
           aplay-3419  [000] ...1  1755.975683: snd_soc_dapm_path:  I2S1 Mux <- AMX2 <- AMX2 RX
           aplay-3419  [000] ...1  1755.975685: snd_soc_dapm_path:  I2S1 Mux <- ADX1-4 <- ADX1-4 RX
           aplay-3419  [000] ...1  1755.975687: snd_soc_dapm_path:  I2S1 Mux <- ADX1-3 <- ADX1-3 RX
           aplay-3419  [000] ...1  1755.975689: snd_soc_dapm_path:  I2S1 Mux <- ADX1-2 <- ADX1-2 RX
           aplay-3419  [000] ...1  1755.975691: snd_soc_dapm_path:  I2S1 Mux <- ADX1-1 <- ADX1-1 RX
           aplay-3419  [000] ...1  1755.975693: snd_soc_dapm_path:  I2S1 Mux <- AMX1 <- AMX1 RX
           aplay-3419  [000] ...1  1755.975696: snd_soc_dapm_path:  I2S1 Mux <- DMIC3 <- DMIC3 RX
           aplay-3419  [000] ...1  1755.975699: snd_soc_dapm_path:  I2S1 Mux <- DMIC2 <- DMIC2 RX
           aplay-3419  [000] ...1  1755.975701: snd_soc_dapm_path:  I2S1 Mux <- DMIC1 <- DMIC1 RX
           aplay-3419  [000] ...1  1755.975703: snd_soc_dapm_path:  I2S1 Mux <- IQC2-2 <- IQC2-2 RX
           aplay-3419  [000] ...1  1755.975705: snd_soc_dapm_path:  I2S1 Mux <- IQC2-1 <- IQC2-1 RX
           aplay-3419  [000] ...1  1755.975707: snd_soc_dapm_path:  I2S1 Mux <- IQC1-2 <- IQC1-2 RX
           aplay-3419  [000] ...1  1755.975710: snd_soc_dapm_path:  I2S1 Mux <- IQC1-1 <- IQC1-1 RX
           aplay-3419  [000] ...1  1755.975712: snd_soc_dapm_path:  I2S1 Mux <- MVC2 <- MVC2 RX
           aplay-3419  [000] ...1  1755.975714: snd_soc_dapm_path:  I2S1 Mux <- MVC1 <- MVC1 RX
           aplay-3419  [000] ...1  1755.975716: snd_soc_dapm_path:  I2S1 Mux <- OPE1 <- OPE1 RX
           aplay-3419  [000] ...1  1755.975718: snd_soc_dapm_path:  I2S1 Mux <- AFC6 <- AFC6 RX
           aplay-3419  [000] ...1  1755.975720: snd_soc_dapm_path:  I2S1 Mux <- AFC5 <- AFC5 RX
           aplay-3419  [000] ...1  1755.975722: snd_soc_dapm_path:  I2S1 Mux <- AFC4 <- AFC4 RX
           aplay-3419  [000] ...1  1755.975724: snd_soc_dapm_path:  I2S1 Mux <- AFC3 <- AFC3 RX
           aplay-3419  [000] ...1  1755.975726: snd_soc_dapm_path:  I2S1 Mux <- AFC2 <- AFC2 RX
           aplay-3419  [000] ...1  1755.975728: snd_soc_dapm_path:  I2S1 Mux <- AFC1 <- AFC1 RX
           aplay-3419  [000] ...1  1755.975731: snd_soc_dapm_path:  I2S1 Mux <- SPDIF1-2 <- SPDIF1-2 RX
           aplay-3419  [000] ...1  1755.975733: snd_soc_dapm_path:  I2S1 Mux <- SPDIF1-1 <- SPDIF1-1 RX
           aplay-3419  [000] ...1  1755.975736: snd_soc_dapm_path:  I2S1 Mux <- MIXER1-5 <- MIXER1-5 RX
           aplay-3419  [000] ...1  1755.975738: snd_soc_dapm_path:  I2S1 Mux <- MIXER1-4 <- MIXER1-4 RX
           aplay-3419  [000] ...1  1755.975740: snd_soc_dapm_path:  I2S1 Mux <- MIXER1-3 <- MIXER1-3 RX
           aplay-3419  [000] ...1  1755.975745: snd_soc_dapm_path:  I2S1 Mux <- MIXER1-2 <- MIXER1-2 RX
           aplay-3419  [000] ...1  1755.975748: snd_soc_dapm_path:  I2S1 Mux <- MIXER1-1 <- MIXER1-1 RX
           aplay-3419  [000] ...1  1755.975750: snd_soc_dapm_path:  I2S1 Mux <- SFC4 <- SFC4 RX
           aplay-3419  [000] ...1  1755.975753: snd_soc_dapm_path:  I2S1 Mux <- SFC3 <- SFC3 RX
           aplay-3419  [000] ...1  1755.975755: snd_soc_dapm_path:  I2S1 Mux <- SFC2 <- SFC2 RX
           aplay-3419  [000] ...1  1755.975757: snd_soc_dapm_path:  I2S1 Mux <- SFC1 <- SFC1 RX
           aplay-3419  [000] ...1  1755.975759: snd_soc_dapm_path:  I2S1 Mux <- I2S5 <- I2S5 RX
           aplay-3419  [000] ...1  1755.975761: snd_soc_dapm_path:  I2S1 Mux <- I2S4 <- I2S4 RX
           aplay-3419  [000] ...1  1755.975763: snd_soc_dapm_path:  I2S1 Mux <- I2S3 <- I2S3 RX
           aplay-3419  [000] ...1  1755.975766: snd_soc_dapm_path:  I2S1 Mux <- I2S2 <- I2S2 RX
           aplay-3419  [000] ...1  1755.975768: snd_soc_dapm_path:  I2S1 Mux <- I2S1 <- I2S1 RX
           aplay-3419  [000] ...1  1755.975770: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF10 <- ADMAIF10 RX
           aplay-3419  [000] ...1  1755.975773: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF9 <- ADMAIF9 RX
           aplay-3419  [000] ...1  1755.975775: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF8 <- ADMAIF8 RX
           aplay-3419  [000] ...1  1755.975777: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF7 <- ADMAIF7 RX
           aplay-3419  [000] ...1  1755.975779: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF6 <- ADMAIF6 RX
           aplay-3419  [000] ...1  1755.975782: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF5 <- ADMAIF5 RX
           aplay-3419  [000] ...1  1755.975784: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF4 <- ADMAIF4 RX
           aplay-3419  [000] ...1  1755.975786: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF3 <- ADMAIF3 RX
           aplay-3419  [000] ...1  1755.975788: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF2 <- ADMAIF2 RX
           aplay-3419  [000] ...1  1755.975791: snd_soc_dapm_path: *I2S1 Mux <- ADMAIF1 <- ADMAIF1 RX
           aplay-3419  [000] ...1  1755.975793: snd_soc_dapm_widget_power: widget=I2S1 Mux val=1
           aplay-3419  [000] ...1  1755.975800: snd_soc_dapm_path: *I2S1 TX <- (direct) <- I2S1 Mux
           aplay-3419  [000] ...1  1755.975802: snd_soc_dapm_widget_power: widget=I2S1 TX val=1
           aplay-3419  [000] ...1  1755.975805: snd_soc_dapm_path: *I2S1 Transmit <- (direct) <- I2S1 TX
           aplay-3419  [000] ...1  1755.975808: snd_soc_dapm_widget_power: widget=I2S1 Transmit val=1
           aplay-3419  [000] ...1  1755.975811: snd_soc_dapm_path: *I2S1 Transmit-I2S1 CIF Receive <- (direct) <- I2S1 Transmit
           aplay-3419  [000] ...1  1755.975814: snd_soc_dapm_widget_power: widget=I2S1 Transmit-I2S1 CIF Receive val=1
           aplay-3419  [000] ...1  1755.975817: snd_soc_dapm_path: *I2S1 CIF Receive <- (direct) <- I2S1 Transmit-I2S1 CIF Receive
           aplay-3419  [000] ...1  1755.975820: snd_soc_dapm_widget_power: widget=I2S1 CIF Receive val=1
           aplay-3419  [000] ...1  1755.975823: snd_soc_dapm_path: *I2S1 CIF RX <- (direct) <- I2S1 CIF Receive
           aplay-3419  [000] ...1  1755.975826: snd_soc_dapm_widget_power: widget=I2S1 CIF RX val=1
           aplay-3419  [000] ...1  1755.975828: snd_soc_dapm_path: *I2S1 DAP TX <- (direct) <- I2S1 CIF RX
           aplay-3419  [000] ...1  1755.975831: snd_soc_dapm_widget_power: widget=I2S1 DAP TX val=1
           aplay-3419  [000] ...1  1755.975835: snd_soc_dapm_path: *I2S1 DAP Transmit <- (direct) <- I2S1 DAP TX
           aplay-3419  [000] ...1  1755.975837: snd_soc_dapm_widget_power: widget=I2S1 DAP Transmit val=1
           aplay-3419  [000] ...1  1755.975840: snd_soc_dapm_path: *I2S1 DAP Transmit-x Playback <- (direct) <- I2S1 DAP Transmit
           aplay-3419  [000] ...1  1755.975843: snd_soc_dapm_widget_power: widget=I2S1 DAP Transmit-x Playback val=1
           aplay-3419  [000] ...1  1755.975846: snd_soc_dapm_path: *x Playback <- (direct) <- I2S1 DAP Transmit-x Playback
           aplay-3419  [000] ...1  1755.975848: snd_soc_dapm_widget_power: widget=x Playback val=1
           aplay-3419  [000] ...1  1755.975852: snd_soc_dapm_path: *x Right DAC <- (direct) <- x Playback
           aplay-3419  [000] ...1  1755.975855: snd_soc_dapm_widget_power: widget=x Right DAC val=1
           aplay-3419  [000] ...1  1755.975858: snd_soc_dapm_path: *x Left DAC <- (direct) <- x Playback
           aplay-3419  [000] ...1  1755.975860: snd_soc_dapm_widget_power: widget=x Left DAC val=1
           aplay-3419  [000] ...1  1755.975864: snd_soc_dapm_path: *x Right Output Mixer <- PCM Playback Switch <- x Right DAC
           aplay-3419  [000] ...1  1755.975868: snd_soc_dapm_path:  x Right Output Mixer <- Boost Bypass Switch <- x Right Boost Mixer
           aplay-3419  [000] ...1  1755.975872: snd_soc_dapm_path:  x Right Output Mixer <- RINPUT3 Switch <- x RINPUT3
           aplay-3419  [000] ...1  1755.975875: snd_soc_dapm_widget_power: widget=x Right Output Mixer val=1
           aplay-3419  [000] ...1  1755.975880: snd_soc_dapm_path: *x Left Output Mixer <- PCM Playback Switch <- x Left DAC
           aplay-3419  [000] ...1  1755.975883: snd_soc_dapm_path:  x Left Output Mixer <- Boost Bypass Switch <- x Left Boost Mixer
           aplay-3419  [000] ...1  1755.975886: snd_soc_dapm_path:  x Left Output Mixer <- LINPUT3 Switch <- x LINPUT3
           aplay-3419  [000] ...1  1755.975889: snd_soc_dapm_widget_power: widget=x Left Output Mixer val=1
           aplay-3419  [000] ...1  1755.975893: snd_soc_dapm_path: *x Right Speaker PGA <- (direct) <- x Right Output Mixer
           aplay-3419  [000] ...1  1755.975896: snd_soc_dapm_path: *x ROUT1 PGA <- (direct) <- x Right Output Mixer
           aplay-3419  [000] ...1  1755.975899: snd_soc_dapm_widget_power: widget=x ROUT1 PGA val=1
           aplay-3419  [000] ...1  1755.975902: snd_soc_dapm_path: *x Left Speaker PGA <- (direct) <- x Left Output Mixer
           aplay-3419  [000] ...1  1755.975906: snd_soc_dapm_path: *x LOUT1 PGA <- (direct) <- x Left Output Mixer
           aplay-3419  [000] ...1  1755.975908: snd_soc_dapm_widget_power: widget=x LOUT1 PGA val=1
           aplay-3419  [000] ...1  1755.975911: snd_soc_dapm_path: *x HP_R <- (direct) <- x ROUT1 PGA
           aplay-3419  [000] ...1  1755.975914: snd_soc_dapm_widget_power: widget=x HP_R val=1
           aplay-3419  [000] ...1  1755.975917: snd_soc_dapm_path: *x HP_L <- (direct) <- x LOUT1 PGA
           aplay-3419  [000] ...1  1755.975919: snd_soc_dapm_widget_power: widget=x HP_L val=1
           aplay-3419  [000] ...1  1755.975922: snd_soc_dapm_path: *x Headphone <- (direct) <- x HP_R
           aplay-3419  [000] ...1  1755.975924: snd_soc_dapm_path: *x Headphone <- (direct) <- x HP_L
           aplay-3419  [000] ...1  1755.975927: snd_soc_dapm_widget_power: widget=x Headphone val=1
           aplay-3419  [000] ...1  1755.976105: snd_soc_dapm_walk_done: tegra-snd-t186ref-mobile-rt565x: checks 25 power, 24 path, 107 neighbour
           aplay-3419  [000] ...1  1755.976113: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=1
           aplay-3419  [000] ...1  1755.976116: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=1
           aplay-3419  [000] ...1  1755.976118: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=2
           aplay-3419  [000] ...1  1755.976121: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=2
   kworker/u12:0-3149  [005] ...1  1755.976186: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=2
   kworker/u12:1-54    [004] ...1  1755.976402: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=1
   kworker/u12:1-54    [004] ...1  1755.976410: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=1
   kworker/u12:1-54    [004] ...1  1755.976412: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=2
   kworker/u12:1-54    [004] ...1  1755.976415: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=2
   kworker/u12:1-54    [004] ...1  1755.976421: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=1
   kworker/u12:1-54    [004] ...1  1755.976423: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=1
   kworker/u12:1-54    [004] ...1  1755.976425: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=2
   kworker/u12:1-54    [004] ...1  1755.976427: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=2
   kworker/u12:5-1892  [004] ...1  1755.977176: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=1
   kworker/u12:5-1892  [004] ...1  1755.977181: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=1
   kworker/u12:5-1892  [004] ...1  1755.977182: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=2
   kworker/u12:5-1892  [004] ...1  1755.977183: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=2
   kworker/u12:0-3149  [000] ...1  1756.008242: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=2
           aplay-3419  [003] ...1  1756.008291: snd_soc_dapm_widget_event_start: widget=I2S1 DAP Transmit-x Playback val=1
           aplay-3419  [003] ...1  1761.062143: snd_soc_dapm_widget_event_done: widget=I2S1 DAP Transmit-x Playback val=1
           aplay-3419  [003] ...1  1761.062147: snd_soc_dapm_widget_event_start: widget=I2S1 Transmit-I2S1 CIF Receive val=1
           aplay-3419  [003] ...1  1761.062150: snd_soc_dapm_widget_event_done: widget=I2S1 Transmit-I2S1 CIF Receive val=1
           aplay-3419  [003] ...1  1761.062150: snd_soc_dapm_widget_event_start: widget=I2S1 DAP Transmit-x Playback val=2
           aplay-3419  [000] ...1  1761.071728: snd_soc_dapm_widget_event_done: widget=I2S1 DAP Transmit-x Playback val=2
           aplay-3419  [000] ...1  1761.071731: snd_soc_dapm_widget_event_start: widget=I2S1 Transmit-I2S1 CIF Receive val=2
           aplay-3419  [000] ...1  1761.071734: snd_soc_dapm_widget_event_done: widget=I2S1 Transmit-I2S1 CIF Receive val=2
           aplay-3419  [000] ...1  1761.071741: snd_soc_dapm_widget_event_start: widget=I2S1 DAP TX val=1
           aplay-3419  [000] ...1  1761.186028: snd_soc_dapm_widget_event_done: widget=I2S1 DAP TX val=1
   kworker/u12:3-150   [004] ...1  1761.195598: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=3
   kworker/u12:0-3149  [004] ...1  1761.206050: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=3
   kworker/u12:0-3149  [004] ...1  1761.206052: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=3
   kworker/u12:0-3149  [004] ...1  1761.206073: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=3
   kworker/u12:0-3149  [004] ...1  1761.206074: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=3
   kworker/u12:0-3149  [004] ...1  1761.206075: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=3
   kworker/u12:0-3149  [004] ...1  1761.206075: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=3
   kworker/u12:3-150   [004] ...1  1761.212292: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=3
           aplay-3419  [005] ...1  1761.212306: snd_soc_dapm_done: card=tegra-snd-t186ref-mobile-rt565x
           aplay-3419  [004] ...1  1762.424799: snd_soc_dapm_start: card=tegra-snd-t186ref-mobile-rt565x
           aplay-3419  [004] ...1  1762.424859: snd_soc_dapm_widget_power: widget=Playback 1 val=0
           aplay-3419  [004] ...1  1762.424861: snd_soc_dapm_path: *ADMAIF1 Receive <- (direct) <- Playback 1
           aplay-3419  [004] ...1  1762.424862: snd_soc_dapm_path: *ADMAIF1 Receive <- (direct) <- ADMAIF1 CIF Receive-ADMAIF1 Receive
           aplay-3419  [004] ...1  1762.424863: snd_soc_dapm_widget_power: widget=ADMAIF1 Receive val=0
           aplay-3419  [004] ...1  1762.424864: snd_soc_dapm_path: *ADMAIF1 RX <- (direct) <- ADMAIF1 Receive
           aplay-3419  [004] ...1  1762.424864: snd_soc_dapm_widget_power: widget=ADMAIF1 RX val=0
           aplay-3419  [004] ...1  1762.424867: snd_soc_dapm_path:  I2S1 Mux <- ARAD1 <- ARAD1 RX
           aplay-3419  [004] ...1  1762.424868: snd_soc_dapm_path:  I2S1 Mux <- ADX4-4 <- ADX4-4 RX
           aplay-3419  [004] ...1  1762.424868: snd_soc_dapm_path:  I2S1 Mux <- ADX4-3 <- ADX4-3 RX
           aplay-3419  [004] ...1  1762.424869: snd_soc_dapm_path:  I2S1 Mux <- ADX4-2 <- ADX4-2 RX
           aplay-3419  [004] ...1  1762.424869: snd_soc_dapm_path:  I2S1 Mux <- ADX4-1 <- ADX4-1 RX
           aplay-3419  [004] ...1  1762.424870: snd_soc_dapm_path:  I2S1 Mux <- AMX4 <- AMX4 RX
           aplay-3419  [004] ...1  1762.424870: snd_soc_dapm_path:  I2S1 Mux <- ADX3-4 <- ADX3-4 RX
           aplay-3419  [004] ...1  1762.424871: snd_soc_dapm_path:  I2S1 Mux <- ADX3-3 <- ADX3-3 RX
           aplay-3419  [004] ...1  1762.424871: snd_soc_dapm_path:  I2S1 Mux <- ADX3-2 <- ADX3-2 RX
           aplay-3419  [004] ...1  1762.424871: snd_soc_dapm_path:  I2S1 Mux <- ADX3-1 <- ADX3-1 RX
           aplay-3419  [004] ...1  1762.424872: snd_soc_dapm_path:  I2S1 Mux <- AMX3 <- AMX3 RX
           aplay-3419  [004] ...1  1762.424872: snd_soc_dapm_path:  I2S1 Mux <- ASRC1-6 <- ASRC1-6 RX
           aplay-3419  [004] ...1  1762.424873: snd_soc_dapm_path:  I2S1 Mux <- ASRC1-5 <- ASRC1-5 RX
           aplay-3419  [004] ...1  1762.424873: snd_soc_dapm_path:  I2S1 Mux <- ASRC1-4 <- ASRC1-4 RX
           aplay-3419  [004] ...1  1762.424874: snd_soc_dapm_path:  I2S1 Mux <- ASRC1-3 <- ASRC1-3 RX
           aplay-3419  [004] ...1  1762.424874: snd_soc_dapm_path:  I2S1 Mux <- ASRC1-2 <- ASRC1-2 RX
           aplay-3419  [004] ...1  1762.424875: snd_soc_dapm_path:  I2S1 Mux <- ASRC1-1 <- ASRC1-1 RX
           aplay-3419  [004] ...1  1762.424875: snd_soc_dapm_path:  I2S1 Mux <- I2S6 <- I2S6 RX
           aplay-3419  [004] ...1  1762.424876: snd_soc_dapm_path:  I2S1 Mux <- DMIC4 <- DMIC4 RX
           aplay-3419  [004] ...1  1762.424876: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF20 <- ADMAIF20 RX
           aplay-3419  [004] ...1  1762.424877: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF19 <- ADMAIF19 RX
           aplay-3419  [004] ...1  1762.424877: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF18 <- ADMAIF18 RX
           aplay-3419  [004] ...1  1762.424878: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF17 <- ADMAIF17 RX
           aplay-3419  [004] ...1  1762.424878: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF16 <- ADMAIF16 RX
           aplay-3419  [004] ...1  1762.424879: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF15 <- ADMAIF15 RX
           aplay-3419  [004] ...1  1762.424879: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF14 <- ADMAIF14 RX
           aplay-3419  [004] ...1  1762.424880: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF13 <- ADMAIF13 RX
           aplay-3419  [004] ...1  1762.424880: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF12 <- ADMAIF12 RX
           aplay-3419  [004] ...1  1762.424881: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF11 <- ADMAIF11 RX
           aplay-3419  [004] ...1  1762.424881: snd_soc_dapm_path:  I2S1 Mux <- ADX2-4 <- ADX2-4 RX
           aplay-3419  [004] ...1  1762.424882: snd_soc_dapm_path:  I2S1 Mux <- ADX2-3 <- ADX2-3 RX
           aplay-3419  [004] ...1  1762.424882: snd_soc_dapm_path:  I2S1 Mux <- ADX2-2 <- ADX2-2 RX
           aplay-3419  [004] ...1  1762.424883: snd_soc_dapm_path:  I2S1 Mux <- ADX2-1 <- ADX2-1 RX
           aplay-3419  [004] ...1  1762.424883: snd_soc_dapm_path:  I2S1 Mux <- AMX2 <- AMX2 RX
           aplay-3419  [004] ...1  1762.424884: snd_soc_dapm_path:  I2S1 Mux <- ADX1-4 <- ADX1-4 RX
           aplay-3419  [004] ...1  1762.424884: snd_soc_dapm_path:  I2S1 Mux <- ADX1-3 <- ADX1-3 RX
           aplay-3419  [004] ...1  1762.424884: snd_soc_dapm_path:  I2S1 Mux <- ADX1-2 <- ADX1-2 RX
           aplay-3419  [004] ...1  1762.424885: snd_soc_dapm_path:  I2S1 Mux <- ADX1-1 <- ADX1-1 RX
           aplay-3419  [004] ...1  1762.424885: snd_soc_dapm_path:  I2S1 Mux <- AMX1 <- AMX1 RX
           aplay-3419  [004] ...1  1762.424886: snd_soc_dapm_path:  I2S1 Mux <- DMIC3 <- DMIC3 RX
           aplay-3419  [004] ...1  1762.424887: snd_soc_dapm_path:  I2S1 Mux <- DMIC2 <- DMIC2 RX
           aplay-3419  [004] ...1  1762.424888: snd_soc_dapm_path:  I2S1 Mux <- DMIC1 <- DMIC1 RX
           aplay-3419  [004] ...1  1762.424888: snd_soc_dapm_path:  I2S1 Mux <- IQC2-2 <- IQC2-2 RX
           aplay-3419  [004] ...1  1762.424889: snd_soc_dapm_path:  I2S1 Mux <- IQC2-1 <- IQC2-1 RX
           aplay-3419  [004] ...1  1762.424889: snd_soc_dapm_path:  I2S1 Mux <- IQC1-2 <- IQC1-2 RX
           aplay-3419  [004] ...1  1762.424890: snd_soc_dapm_path:  I2S1 Mux <- IQC1-1 <- IQC1-1 RX
           aplay-3419  [004] ...1  1762.424890: snd_soc_dapm_path:  I2S1 Mux <- MVC2 <- MVC2 RX
           aplay-3419  [004] ...1  1762.424890: snd_soc_dapm_path:  I2S1 Mux <- MVC1 <- MVC1 RX
           aplay-3419  [004] ...1  1762.424891: snd_soc_dapm_path:  I2S1 Mux <- OPE1 <- OPE1 RX
           aplay-3419  [004] ...1  1762.424891: snd_soc_dapm_path:  I2S1 Mux <- AFC6 <- AFC6 RX
           aplay-3419  [004] ...1  1762.424892: snd_soc_dapm_path:  I2S1 Mux <- AFC5 <- AFC5 RX
           aplay-3419  [004] ...1  1762.424892: snd_soc_dapm_path:  I2S1 Mux <- AFC4 <- AFC4 RX
           aplay-3419  [004] ...1  1762.424893: snd_soc_dapm_path:  I2S1 Mux <- AFC3 <- AFC3 RX
           aplay-3419  [004] ...1  1762.424893: snd_soc_dapm_path:  I2S1 Mux <- AFC2 <- AFC2 RX
           aplay-3419  [004] ...1  1762.424893: snd_soc_dapm_path:  I2S1 Mux <- AFC1 <- AFC1 RX
           aplay-3419  [004] ...1  1762.424894: snd_soc_dapm_path:  I2S1 Mux <- SPDIF1-2 <- SPDIF1-2 RX
           aplay-3419  [004] ...1  1762.424894: snd_soc_dapm_path:  I2S1 Mux <- SPDIF1-1 <- SPDIF1-1 RX
           aplay-3419  [004] ...1  1762.424895: snd_soc_dapm_path:  I2S1 Mux <- MIXER1-5 <- MIXER1-5 RX
           aplay-3419  [004] ...1  1762.424895: snd_soc_dapm_path:  I2S1 Mux <- MIXER1-4 <- MIXER1-4 RX
           aplay-3419  [004] ...1  1762.424896: snd_soc_dapm_path:  I2S1 Mux <- MIXER1-3 <- MIXER1-3 RX
           aplay-3419  [004] ...1  1762.424896: snd_soc_dapm_path:  I2S1 Mux <- MIXER1-2 <- MIXER1-2 RX
           aplay-3419  [004] ...1  1762.424896: snd_soc_dapm_path:  I2S1 Mux <- MIXER1-1 <- MIXER1-1 RX
           aplay-3419  [004] ...1  1762.424897: snd_soc_dapm_path:  I2S1 Mux <- SFC4 <- SFC4 RX
           aplay-3419  [004] ...1  1762.424897: snd_soc_dapm_path:  I2S1 Mux <- SFC3 <- SFC3 RX
           aplay-3419  [004] ...1  1762.424898: snd_soc_dapm_path:  I2S1 Mux <- SFC2 <- SFC2 RX
           aplay-3419  [004] ...1  1762.424898: snd_soc_dapm_path:  I2S1 Mux <- SFC1 <- SFC1 RX
           aplay-3419  [004] ...1  1762.424898: snd_soc_dapm_path:  I2S1 Mux <- I2S5 <- I2S5 RX
           aplay-3419  [004] ...1  1762.424899: snd_soc_dapm_path:  I2S1 Mux <- I2S4 <- I2S4 RX
           aplay-3419  [004] ...1  1762.424899: snd_soc_dapm_path:  I2S1 Mux <- I2S3 <- I2S3 RX
           aplay-3419  [004] ...1  1762.424900: snd_soc_dapm_path:  I2S1 Mux <- I2S2 <- I2S2 RX
           aplay-3419  [004] ...1  1762.424900: snd_soc_dapm_path:  I2S1 Mux <- I2S1 <- I2S1 RX
           aplay-3419  [004] ...1  1762.424901: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF10 <- ADMAIF10 RX
           aplay-3419  [004] ...1  1762.424901: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF9 <- ADMAIF9 RX
           aplay-3419  [004] ...1  1762.424901: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF8 <- ADMAIF8 RX
           aplay-3419  [004] ...1  1762.424902: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF7 <- ADMAIF7 RX
           aplay-3419  [004] ...1  1762.424902: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF6 <- ADMAIF6 RX
           aplay-3419  [004] ...1  1762.424903: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF5 <- ADMAIF5 RX
           aplay-3419  [004] ...1  1762.424903: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF4 <- ADMAIF4 RX
           aplay-3419  [004] ...1  1762.424904: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF3 <- ADMAIF3 RX
           aplay-3419  [004] ...1  1762.424904: snd_soc_dapm_path:  I2S1 Mux <- ADMAIF2 <- ADMAIF2 RX
           aplay-3419  [004] ...1  1762.424904: snd_soc_dapm_path: *I2S1 Mux <- ADMAIF1 <- ADMAIF1 RX
           aplay-3419  [004] ...1  1762.424905: snd_soc_dapm_widget_power: widget=I2S1 Mux val=0
           aplay-3419  [004] ...1  1762.424906: snd_soc_dapm_path: *I2S1 TX <- (direct) <- I2S1 Mux
           aplay-3419  [004] ...1  1762.424907: snd_soc_dapm_widget_power: widget=I2S1 TX val=0
           aplay-3419  [004] ...1  1762.424907: snd_soc_dapm_path: *I2S1 Transmit <- (direct) <- I2S1 TX
           aplay-3419  [004] ...1  1762.424908: snd_soc_dapm_widget_power: widget=I2S1 Transmit val=0
           aplay-3419  [004] ...1  1762.424908: snd_soc_dapm_path: *I2S1 Transmit-I2S1 CIF Receive <- (direct) <- I2S1 Transmit
           aplay-3419  [004] ...1  1762.424909: snd_soc_dapm_widget_power: widget=I2S1 Transmit-I2S1 CIF Receive val=0
           aplay-3419  [004] ...1  1762.424909: snd_soc_dapm_path: *I2S1 CIF Receive <- (direct) <- I2S1 Transmit-I2S1 CIF Receive
           aplay-3419  [004] ...1  1762.424910: snd_soc_dapm_widget_power: widget=I2S1 CIF Receive val=0
           aplay-3419  [004] ...1  1762.424911: snd_soc_dapm_path: *I2S1 CIF RX <- (direct) <- I2S1 CIF Receive
           aplay-3419  [004] ...1  1762.424911: snd_soc_dapm_widget_power: widget=I2S1 CIF RX val=0
           aplay-3419  [004] ...1  1762.424911: snd_soc_dapm_path: *I2S1 DAP TX <- (direct) <- I2S1 CIF RX
           aplay-3419  [004] ...1  1762.424912: snd_soc_dapm_widget_power: widget=I2S1 DAP TX val=0
           aplay-3419  [004] ...1  1762.424913: snd_soc_dapm_path: *I2S1 DAP Transmit <- (direct) <- I2S1 DAP TX
           aplay-3419  [004] ...1  1762.424913: snd_soc_dapm_widget_power: widget=I2S1 DAP Transmit val=0
           aplay-3419  [004] ...1  1762.424914: snd_soc_dapm_path: *I2S1 DAP Transmit-x Playback <- (direct) <- I2S1 DAP Transmit
           aplay-3419  [004] ...1  1762.424914: snd_soc_dapm_widget_power: widget=I2S1 DAP Transmit-x Playback val=0
           aplay-3419  [004] ...1  1762.424915: snd_soc_dapm_path: *x Playback <- (direct) <- I2S1 DAP Transmit-x Playback
           aplay-3419  [004] ...1  1762.424915: snd_soc_dapm_widget_power: widget=x Playback val=0
           aplay-3419  [004] ...1  1762.424916: snd_soc_dapm_path: *x Right DAC <- (direct) <- x Playback
           aplay-3419  [004] ...1  1762.424916: snd_soc_dapm_widget_power: widget=x Right DAC val=0
           aplay-3419  [004] ...1  1762.424917: snd_soc_dapm_path: *x Left DAC <- (direct) <- x Playback
           aplay-3419  [004] ...1  1762.424917: snd_soc_dapm_widget_power: widget=x Left DAC val=0
           aplay-3419  [004] ...1  1762.424918: snd_soc_dapm_path: *x Right Output Mixer <- PCM Playback Switch <- x Right DAC
           aplay-3419  [004] ...1  1762.424919: snd_soc_dapm_path:  x Right Output Mixer <- Boost Bypass Switch <- x Right Boost Mixer
           aplay-3419  [004] ...1  1762.424920: snd_soc_dapm_path:  x Right Output Mixer <- RINPUT3 Switch <- x RINPUT3
           aplay-3419  [004] ...1  1762.424921: snd_soc_dapm_widget_power: widget=x Right Output Mixer val=0
           aplay-3419  [004] ...1  1762.424921: snd_soc_dapm_path: *x Left Output Mixer <- PCM Playback Switch <- x Left DAC
           aplay-3419  [004] ...1  1762.424922: snd_soc_dapm_path:  x Left Output Mixer <- Boost Bypass Switch <- x Left Boost Mixer
           aplay-3419  [004] ...1  1762.424922: snd_soc_dapm_path:  x Left Output Mixer <- LINPUT3 Switch <- x LINPUT3
           aplay-3419  [004] ...1  1762.424923: snd_soc_dapm_widget_power: widget=x Left Output Mixer val=0
           aplay-3419  [004] ...1  1762.424923: snd_soc_dapm_path: *x ROUT1 PGA <- (direct) <- x Right Output Mixer
           aplay-3419  [004] ...1  1762.424924: snd_soc_dapm_widget_power: widget=x ROUT1 PGA val=0
           aplay-3419  [004] ...1  1762.424924: snd_soc_dapm_path: *x LOUT1 PGA <- (direct) <- x Left Output Mixer
           aplay-3419  [004] ...1  1762.424925: snd_soc_dapm_widget_power: widget=x LOUT1 PGA val=0
           aplay-3419  [004] ...1  1762.424925: snd_soc_dapm_path: *x HP_R <- (direct) <- x ROUT1 PGA
           aplay-3419  [004] ...1  1762.424926: snd_soc_dapm_widget_power: widget=x HP_R val=0
           aplay-3419  [004] ...1  1762.424926: snd_soc_dapm_path: *x HP_L <- (direct) <- x LOUT1 PGA
           aplay-3419  [004] ...1  1762.424927: snd_soc_dapm_widget_power: widget=x HP_L val=0
           aplay-3419  [004] ...1  1762.424927: snd_soc_dapm_path: *x Headphone <- (direct) <- x HP_R
           aplay-3419  [004] ...1  1762.424928: snd_soc_dapm_path: *x Headphone <- (direct) <- x HP_L
           aplay-3419  [004] ...1  1762.424928: snd_soc_dapm_widget_power: widget=x Headphone val=0
           aplay-3419  [004] ...1  1762.424989: snd_soc_dapm_walk_done: tegra-snd-t186ref-mobile-rt565x: checks 22 power, 22 path, 107 neighbour
   kworker/u12:0-3149  [000] ...1  1762.425010: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=2
   kworker/u12:3-150   [003] ...1  1762.425021: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=2
   kworker/u12:3-150   [003] ...1  1762.425022: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=2
   kworker/u12:3-150   [003] ...1  1762.425048: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=2
   kworker/u12:3-150   [003] ...1  1762.425049: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=2
   kworker/u12:3-150   [003] ...1  1762.425050: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=2
   kworker/u12:3-150   [003] ...1  1762.425050: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=2
   kworker/u12:0-3149  [000] ...1  1762.442033: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=2
           aplay-3419  [003] ...1  1762.442420: snd_soc_dapm_widget_event_start: widget=I2S1 DAP Transmit-x Playback val=4
           aplay-3419  [003] ...1  1762.452188: snd_soc_dapm_widget_event_done: widget=I2S1 DAP Transmit-x Playback val=4
           aplay-3419  [003] ...1  1762.452191: snd_soc_dapm_widget_event_start: widget=I2S1 Transmit-I2S1 CIF Receive val=4
           aplay-3419  [003] ...1  1762.452194: snd_soc_dapm_widget_event_done: widget=I2S1 Transmit-I2S1 CIF Receive val=4
   kworker/u12:0-3149  [000] ...1  1762.452224: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=1
   kworker/u12:5-1892  [004] ...1  1762.452229: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=1
   kworker/u12:5-1892  [004] ...1  1762.452230: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=1
   kworker/u12:5-1892  [004] ...1  1762.452231: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=0
   kworker/u12:5-1892  [004] ...1  1762.452231: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=0
   kworker/u12:5-1892  [004] ...1  1762.452261: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=1
   kworker/u12:5-1892  [004] ...1  1762.452261: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=1
   kworker/u12:5-1892  [004] ...1  1762.452261: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=0
   kworker/u12:5-1892  [004] ...1  1762.452262: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=0
   kworker/u12:5-1892  [004] ...1  1762.452268: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=1
   kworker/u12:5-1892  [004] ...1  1762.452269: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=1
   kworker/u12:5-1892  [004] ...1  1762.452269: snd_soc_bias_level_start: card=tegra-snd-t186ref-mobile-rt565x val=0
   kworker/u12:5-1892  [004] ...1  1762.452270: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=0
   kworker/u12:0-3149  [000] ...1  1762.469339: snd_soc_bias_level_done: card=tegra-snd-t186ref-mobile-rt565x val=1
           aplay-3419  [003] ...1  1762.469358: snd_soc_dapm_done: card=tegra-snd-t186ref-mobile-rt565x

As one can see, the I2S widgets are enabled before the codec widgets. Therefore the clocks are not available when the Jetson expect them. Is this a bug?

To confirm my assumption, I activated the DAC manually inside the wm8960_hw_params():

snd_soc_update_bits(codec, WM8960_POWER2, 0x180, 0x3 << 7);  // DAC Left/Right

With this workaround, I can see the clocks on the oscilloscope earlier and the error message disappears.
I also can probe the audio data now. Unfortunately, I still can not hear anything when playing an audio file. Also recording does not work. Mic boost was activated and I could see some data on the scope.

I would appreciate if you can give me some hints for further debugging the issue.

Thanks,
Markus

OK, great. Do you see any userspace controls for these DACs?

amixer -c tegrasndt186ref controls | grep DAC

If so you could try enabling from userspace instead of the driver.

At first glance the routing seems fine as it appears to be routed to the headphones which you had before. I am not sure why the routing would be different between what you had before when the codec was the slave. Check for some ‘Headphone Playback Volume’, ‘LOUT1 PGA’ and ‘ROUT1 PGA’ controls. Make sure the PGAs are enabled.

Regards,
Jon

Hi Jon,

These are the controls:

numid=597,iface=MIXER,name='x DAC Deemphasis Switch'
numid=596,iface=MIXER,name='x DAC Polarity'

So I think I still have to enable it from the driver. As workaround it would be ok for me. Nevertheless, I do not understand, why the Jetson stops waiting for the clock before the codec dapm widgets are enabled. Shouldn’t the I2S input of the Jetson wait for some time when it is configured in slave mode?

The headphone playback volume is ok. I also checked the other output controls using the alsamixer. Everything seems to be correct.

When I start playing an audio file after a reboot, I can hear it. Unfortunately it is played at wrong speed because of the wrong clock setting on the first run. When I try to play it again, the clocks are fine but I only hear some “clicking” noise. Do you have an idea?

Regards
Markus

It is during the enabling of the Tegra I2S interface (via the I2S DAPM widget) where the I2S interface is reset and we expect the I2S clock to be enabled at this point. So I am not sure that we can wait. Please note that I have tested the SGTL5000 (using the fe-pi audio Z V2 board) which works in the same way as being the I2S master and I have not had problems with it.

I can’t say that I do. However, I think that the wrong clock setting issue on the first run needs to be fixed as this should not happen and maybe the codec is not getting configured correctly. If you have a raspberrypi you could try testing the board with this and see how it is setting up the clocks. It is not clear to me if the codec is the master or slave with raspberrypi. I would have assumed it is the master, but I am not certain.

Regards,
Jon