How to enable I2S slave mode?

I’m using TX1 with R28.1.

when use I2S master/CODEC slave mode, it worked well.
Such as blow,

--------- MCLK ------------
| TX1 | --------> | CODEC |

--------- BitCLK ------------
| TX1 | --------> | CODEC |

--------- LRCLK ------------
| TX1 | --------> | CODEC |

--------- OUT ------------
| TX1 | --------> | CODEC |

But I want I2S slave/CODEC mode, it’s fail.
Such as blow,

--------- MCLK ------------
| TX1 | --------> | CODEC |

--------- BitCLK ------------
| TX1 | <-------- | CODEC |

--------- LRCLK ------------
| TX1 | <-------- | CODEC |

--------- OUT ------------
| TX1 | --------> | CODEC |

All of change is the dts file,
Such as blow,

nvidia,dai-link-1 {
//bitclock-slave;
bitclock-master;
//frame-slave;
frame-master;
}

And use alsa util to play,

amixer -c 0 sset ‘I2S1 Mux’ ‘ADMAIF1’
aplay -Dhw:0,0 piano2.wav

It report error,and end play.

[ 144.774903] tegra210-i2s tegra210-i2s.0: Failed at I2S0_TX sw reset
[ 144.781162] tegra210-i2s tegra210-i2s.0: ASoC: PRE_PMU: I2S1 DAP TX event failed: -22

I can measure the signal MCLK, BITCLK, LRCLK, just no the date “OUT”.

When I remove the codec chip, and use the default dummy codec to registe audio card.
Then I have the same error, when use “aplay”.

tegra210-i2s tegra210-i2s.0: Failed at I2S0_TX sw reset
tegra210-i2s tegra210-i2s.0: ASoC: PRE_PMU: I2S1 DAP TX event failed: -22

I have some questions.

  1. If there is no BITCLOCK and LRCLK, or they have some problem, can I2S generate data “OUT” in I2S slave mode?

  2. What’s the reason of I2S sw reset fail? Does the I2S sw reset need some special condition in I2S slave mode?

  3. When I use a dummy codec, the I2S loopback function worked in I2S master mode, but fail in I2S slave mode. Is that normal?

  4. Besides of codec setting, Any other things need to do for I2S slave mode?

Anyone can help me?

@zhili
I verify this mode without problem. Below is the DT that I modify.

nvidia,dai-link-1 {
			link-name = "rt565x-playback";
			cpu-dai = <&tegra_i2s1>;
			codec-dai = <&spdif_dit4>;
			cpu-dai-name = "I2S1";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bitclock-master;
			frame-master;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <0>;
			srate = <48000>;
			num-channel = <2>;
			name-prefix = "x";
		};

@ShaneCCC

When you verify this mode, do you use the dummy codec?

If you are using a real codec, please do me a favor to use the dummy codec.

If it’s possible, please remove the real codec.

It will report error on P2597 carrier board, which doesn’t have real codec.

If you have the same error, then I can confirm that the problem come from our carrier board.

Thank you very much!

@zhili
I got the same error message when remove the real codec.