I2S bit clock is in-accurate on Xavier NX

Hi,

I am working on Xavier NX Devkit with I2S5 port on 40-pin Connector. I have configured the I2S5 to be master on Xavier, such that LRCLK is generated by Xavier. Everything works ok with 32-bit audio recording, but for 16-bit audio recording the I2S bit clock is not correct.

The audio hardware which I connected to the 40-pin header is Respeaker 2-Mic HAT board and we use the driver from this repository.

(1) What works fine:
When I try to record a 32K 32-bit stereo audio,
word clock is 32 KHz as expected.
bit clock is 2MHz as expected.

(2) What does not work fine:
When I try to record a 32K 16-bit stereo audio,
word clock is 32 KHz as expected.
bit clock is still 2MHz, though we would expect it to be 1 MHz.
Since bit clock is incorrect the audio codec has problem sending the Right channel data correctly. As a consequence the right channel data in the recording gets messed up - its all noise. Left channel data gets recorded correctly.

I have attached the clock summary, and amixer contents dump while making 16-bit recording.

32khz_16_bits_clk_summary.txt (34.1 KB)
32khz_16_bits_amixer_contents.txt (293.7 KB)

Is there anything which looks obviously wrong in our alsa settings?

Thanks and Regards,
KS

Hello!

I do not see anything immediately wrong with your settings/configuration and yes I would expect the I2S bit clock to scale with the sample size as you expect. Hence it seems odd that it is not changing.

The I2S clock speed is calculated here and then assuming that the Tegra I2S is the master, which it appears to be, the rate is set in this function.

Regards,
Jon