Jetson nano microphone tdm config

Hi

I am using Jetpack 4.3 and I installed some lib into rootfs. Is there anyting you want to check on my device so I can check if the file is used from older version ?

My hardware setup is . I put Jetson production module plugin into the Jetson nano dev kit’s carrier board. I will reflash with sdmanager . but I remembered that I tried before it was the same problem.

Thanks

Hello!

Sorry, I realised that you are using the eMMC version of the Nano module. This is not supported by jetson-io and so we cannot use it to configure the IOs. So what you need to do is …

  1. Download the Jetson Nano pinmux spreadsheet for the module: https://developer.nvidia.com/jetson-nano-pinmux
  2. Use the pinmux spreadsheet to configure the pins as needed.
  3. Click the ‘Generate DT’ button to export the pin configuration (it will output some device-tree source files)
  4. Update the DT files Linux_for_Tegra/sources/hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-pinmux-p3448-0002-b00.dtsi and Linux_for_Tegra/sources/hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-gpio-p3448-0002-b00.dtsi with the newly created files.
  5. Rebuild the kernel DTBs [0]
  6. Copy the DTB to the Linux_for_Tegra/kernel/dtb directory and reflash.

Regards,
Jon

[0] Welcome — Jetson Linux<br/>Developer Guide 34.1 documentation

Great, Let me try this out. Thanks a lot

Hi ,

Is there document to explain how to change the pinmux spreadsheet ? I know my mic is are using following pin on jetson nano header.

  1. Pin 1 -3.3v
  2. PIN6-Gnd
  3. PIN12 BCLK
  4. PIN35 LRCLK
  5. PIN38 SDIN

How do I update the spreedsheet ? How to build kernel DTBs ? thanks

Hi Jon,

Another question . In the older forum post. it is known issue that DTB change will not enable the I2S4 change. and we have to patch the u-boot and reflash the u-boot . I2S audio output not working - #16 by mkumard . and you were on that thread as well.

Does that mean with Jetpack I can change DTB to enable the I2S ? if yes I still need your help to figure out how to use PINMUX spreadsheet.

Thanks

Hello!

  1. Update the pinmux spreadsheet
  • You just need to modify columns AS (Customer Usage) and AT (Pin Direction)
  • For I2S4, change rows 142, 144 and 145 so that the ‘Customer Usage’ is the ‘I2S4B_xxxx’ function.
  • Set the pin direction to bidirectional for the FS and SCLK. DIN can remain as input only.
  • Then click the ‘Generate DT’ button.
  1. To rebuild the DTB see the link in my previous post. Building the DTB is built as part of the kernel build.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fkernel_custom.html%23wwpID0E02C0HA

Since Jetpack 4.3, we only need to change the DTB for the pinmux settings to take effect. U-Boot no longer does any pinmux configuration and so yes we only need to change the DTB to enable I2S.

Regards,
Jon

Hi Jon,

Thanks. it works . but I would like to understand few things.I rebuild the DTB files and copy tegra210-p3448-0002-p3449-0000-b00.dtb to Linux_for_Tegra/kernel/dtb directory and reflash.

  • On Nano, I found two dtb with different md5 and I am wondering which one is used. why they are different on the device? did flash.sh append something on the dtb after I copied ?
  1. /boot/dtb/tegra210-p3448-0002-p3449-0000-b00.dtb. --this one’s md5 does not match the one I generated
  2. /boot/tegra210-p3448-0002-p3449-0000-b00.dtb --this one’s md5 is same as the one I generated
  • On Linus host I saw there dtb .what are dtb in Linux_for_Tegra/bootloader used for ?
  1. Linux_for_Tegra/kernel/dtb/tegra210-p3448-0002-p3449-0000-b00.dtb. – this is the one I generated and copied over
  2. Linux_for_Tegra/bootloader/tegra210-p3448-0002-p3449-0000-b00.dtb. – this one’s md5 is different
  3. Linux_for_Tegra/bootloader/tegra210-p3448-0002-p3449-0000-b00.dtb.sb – this one’s md5 is different from above two.

Thanks

Hi Terry,

Great news! Sorry for not catching you had the eMMC variant before!

Yes this is a bit confusing indeed. Let me see if I can explain …

When you flash Nano by calling flash.sh, the DTB that is passed to flash.sh (via the jetson-nano-qspi.conf file and this will be the one in Linux_for_Tegra/kernel/dtb), it modified by flash.sh. The flash.sh has a function called append_bootargs_to_dtb() that updates the bootargs under the chosen node. The modified dtb is placed under Linux_for_Tegra/bootloader and then during the actual flashing of the rootfs copied to /boot/dtb/. The DTB with the .sb extension is a copy generated by flash.sh for sata booting (looking at flash.sh), however, I cannot say that I know the exact usage of this copy. In other words, how it is used for sata booting.

Regards,
Jon

Hi Jon,

Thanks a lot for the help. !!!
Btw is there a way to issue a cold reboot command on Nano . we have problem with usb camera after soft reboot .

thanks
terry

Hi Jon,

I am trying to using gstreamer to read two mic and enable and send via rtsp. could you suggest a gsteramer pipeline ?

gst-launch-1.0 -v alsasrc device=“hw:tegrasndt210ref,0” ! ??

Thanks

any suggestions on audio ?

Thanks,

Hi Terry,

Please can you start a new thread for this and the appropriate person for USB will be able to assist.

Thanks
Jon

HI John,

will do. thanks

HI John,

I did make i2s4 stereo Adafruit I2S MEMS microphone working by doing following command
amixer -c tegrasndt210ref cset name=‘ADMAIF1 Mux’ I2S4
arecord -D hw:tegrasndt210ref,0 -r 48000 -f S32_LE -c 2 -d 10 test.wav.

But i still can not get another tmd mic working . the 4 mic arrary board is https://www.cdiweb.com/datasheets/notwired/ds-nw-aud-ics52000.pdf which is using invensense mic
https://www.cdiweb.com/datasheets/invensense/ds-000121%20ics-52000%20data%20sheet%20v1%201.pdf

I followed your instructions . but it does not sound correct after record. should i change other audio configurations ?

amixer -c tegrasndt210ref cset name=‘I2S4 codec frame mode’ dsp-a
arecord -D hw:tegrasndt210ref,0 -c 4 -r 48000 -f S32_LE cap.wav

THanks

Hello!

Yes that looks correct to me. To be honest, because there is not much to configure, if you we the I2S interface outputing the frame and bit clocks as expected, then there is no much else that needs to be configured on the Tegra side and you may wish to probe the data output from the MIC to see if it is actually outputting any audio.

Regards,
Jon

mic output data . but nano can record just not correct.

how can i change the frame sync bit clock ? how do i change nano side to be able to record this tdm mic array? could you suggest the next step ?

hi Jon,

  1. Pin 1 -3.3v
  2. PIN6-Gnd
  3. PIN12 BCLK
  4. PIN35 LRCLK
  5. PIN38 SDIN

for these pin . are the configuration same for i2s mode and tdm mode. as i mentioned i have configured these pin for i2s it is working . do i need configure these pin different for tdm ?

I looked at the NV_Jetson_Nano_Module_Pinmux_Config_Template.xls .
row 142, 144 and 145 . i set Customer Usage to be I2S4B_xxxx’ function. but i also noticed that there are option DAP4_DIN DAP4_FS DAP4_CLK are these for tdm mode. ? the excel does not allow me to choose it saying " cannot assign a pin direction for an unused pin"

Hello!

The same pins are used for both I2S mode and TDM mode. The is no different configuration needed in the pinmux settings.

What is the width of the fsync signal in terms of bit clocks? Typically, you want a 1 bit fsync for DSP-A/B modes.

Jon

hi Jon,

thanks for the confirmation. I tried the 1 bit . by recompiling the dtb . but it does not help
hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-porg-p3448-common.dtsi. is this correct place to change this ?

   sdhci@700b0200 { /* SDMMC2 for Wifi */

@@ -329,7 +332,7 @@
i2s@702d1300 {
regulator-supplies = “vddio-uart”;
vddio-uart-supply = <&max77620_sd3>;

  •                           fsync-width = <15>;
    
  •                           fsync-width = <0>;
                              status = "okay";
    
                              /*
    

@@ -399,7 +402,7 @@
codec-dai = <&spdif_dit0>;
cpu-dai-name = “I2S4”;
codec-dai-name = “dit-hifi”;

  •                   format = "i2s";
    
  •                   format = "dsp_a";
                      bitclock-slave;
                      frame-slave;
                      bitclock-noninversion;
    

~
~
~
~