Configuring frequency of AUDIO_MCLK

Hi,

In order to support future hardware development I have been doing some investigation to see if it is possible to configure the frequency of the I2S AUDIO_MCLK output. Currently we have measured the frequency to be 11.28 MHz. According to the documentation [1] section 4.6, the I2S interface supports a clock rate up to 24.5760 MHz.

I have looked at the Tegra X1 Technical Reference Manual [2] as well and I admit that it is more low-level than I am used to. Suffice to say that while it appears that it should be possible to operate AUDIO_MCLK at a different frequency.

Can anyone offer me any guidance on

  1. where I should look to see the currently configured clock rate of 11.28MHz
  2. how I would approach configuring the clock rate to a different value.

Regards,

[1] https://developer.nvidia.com/embedded/dlc/jetson-nano-system-module-datasheet
[2] http://developer.nvidia.com/embedded/dlc/tegra-x1-technical-reference-manual

Hello!

By default the AUD_MCLK is configured to be 256x the sampling rate. So if you are playing audio at 48kHz the AUD_MCLK will be 12.288MHz and if the sampling rate is 44.1kHz then it will be 11.28MHz (which is probably what you are seeing).

The reason why it is scaled by 256x is because this is a common scaling factor used by audio codecs when the codec is the I2S slave. This can be changed via the ‘mclk-fs’ device-tree property [0]. It is also possible to configure the AUD_MCLK to be a fixed clock rate via the nvidia,mclk-rate property in DT [1].

You can also check the current frequency that is configured by viewing the output from the clk_summary debugfs entry …

sudo grep aud_mclk /sys/kernel/debug/clk/clk_summary

Regards,
Jon

[0] https://nv-tegra.nvidia.com/gitweb/?p=linux-nvidia.git;a=blob;f=sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c;h=cbe8c5ff3c6a40584f70b050da3c1b5405a62acd;hb=5ce7e219fa2764b829a480389dec90c57a0c1eda#l1073

[1] https://nv-tegra.nvidia.com/gitweb/?p=linux-nvidia.git;a=blob;f=sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c;h=cbe8c5ff3c6a40584f70b050da3c1b5405a62acd;hb=5ce7e219fa2764b829a480389dec90c57a0c1eda#l1069

Hi Jon,

Thanks for the reply. It has taken us a few days to digest your response but I think we are making some progress.

To help us gain a deeper understanding of the I2S interface is there any further detailed documentation about the I2S interface?

Regards
Ben

Hi Ben,

We are in the process of updating the audio documentation for L4T and should be available soon.

For more details on the actual I2S interface itself, please refer to the Tegra X1 TRM [0]. Please refer to chapter ‘CHAPTER 23: AUDIO PROCESSING ENGINE’.

Regards,
Jon

[0] https://developer.nvidia.com/embedded/dlc/tegra-x1-technical-reference-manual

Hi Ben,

We have just released JetPack 4.3 (L4T 32.3.1) and the updated audio documentation is now available.

There is some good information in the following section about using the 40-pin header on the Jetson platforms for audio …

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide%2Fasoc_driver.17.2.html%23wwpID0E0CU0HA

Regards,
Jon

Hi Jon,

Thats great news! Thanks for keeping me updated.

I’ll pass on the information to the relevant people. I am sure it will take us some time to digest the new information but we will get back to you if there are any further questions.

Regards
Ben

Hi Ben,

Just to let you know that we have identified an issue with the Jetson.IO tool on Nano when updating Nano using SD card image. However, there is a simple fix availabe. Details are here:

https://devtalk.nvidia.com/default/topic/1068583/jetson-nano/jetpack-4-3-l4t-r32-3-1-released/post/5413341/#5413341

Regards,
Jon