Enable I2S

Board: Jetson Nano Developer Kit
JetPack / L4T Version:*JetPack 4.6.3 (L4T R32.7.3)
Use Case: Connecting I2S microphone (ICS43432) on I2S4B pins (GPIO header: pin 12, 35, 38, 6)
i have enabled I2S4 on Jetson Nano (P3448-0000) using a custom DTB overlay.
After rebooting, I verified that the I2S4 node is active:
cat /proc/device-tree/ahub/i2s@702d1300/status
Output okay
However, when I run:
arecord -l

the I2S4 audio interface is not listed in the capture devices.
/dts-v1/;
/plugin/;

{
compatible = “nvidia,jetson-nano”;

fragment@0 {
    target-path = "/ahub/i2s@702d1300";
    __overlay__ {
        status = "okay";
    };
};

fragment@1 {
    target-path = "/sound";
    __overlay__ {
        nvidia,dai-link-5 {
            link-name = "ics43432-mic";
            cpu-dai-name = "I2S4";
            codec-dai-name = "snd-soc-dummy-dai";
            format = "i2s";
            bitclock-slave;
            frame-slave;
            bitclock-noninversion;
            frame-noninversion;
            bit-format = "s32_le";
            srate = <16000>;
            num-channel = <1>;
            name-prefix = "x";
            status = "okay";
        };
    };
};

};

this is the dts file
Do I need to make any additional changes ?

Hi,

Greetings!

If you are just using I2S pins, just setting the pinmux per Configuring the Jetson Expansion Headers — NVIDIA Jetson Linux Developer Guide for I2S and ensuring status of I2S and dai-link that has I2S connected to dummy codec is “okay” should be sufficient

arecord -l only lists all the available pcm devices

Since I2S should be set as clock master by default, try arecord after setting relevant mixer settings(Refer Audio Setup and Development — NVIDIA Jetson Linux Developer Guide)

Please get in touch for any further help

Thanks!

Hi atalambedu

II want to record sound using the ICS43432 microphone connected to the 40-pin header. Is it possible with the prebuilt image?

Yes, it is feasible. Boot image without modifications. Then from the UI ensure pinmux is configured for I2S on 40 pin header and then set mixer controls as suggested in earlier comment and then trigger arecord and share the observation

Having said that, we have only tested certain variant of codec at our end and have not directly tested the said MICs

Thanks

Hi atalambedu,
I have configured the 40-pin header on my Jetson Nano using the Jetson-IO tool and enabled I2S4. I selected “Save and reboot to reconfigure pins,” and the system rebooted successfully and Created and Installed Custom Overlay

Created this file (tegra-i2s4b-overlay.dts):
/dts-v1/;
/plugin/;

/ {
compatible = “nvidia,jetson-nano”;

 fragment@0 {
     target-path = "/ahub/i2s@702d1400";
     __overlay__ {
         status = "okay";
     };
 };

 fragment@1 {
     target-path = "/sound";
     __overlay__ {
         nvidia,dai-link-1 {
             link-name = "i2s4b-dummy-codec";
             cpu-dai = <&i2s4b>;
             codec-dai = <&dummy_codec>;
             cpu-dai-name = "I2S4";
             codec-dai-name = "dummy_codec";
             format = "i2s";
             bitclock-master;
             frame-master;
             bit-format = "s16_le";
             srate = <16000>;
             num-channel = <1>;
             name-prefix = "I2S4";
             status = "okay";
         };
     };
 };

};

and updated /boot/extlinux/extlinux.conf`

LABEL JetsonIO
MENU LABEL Custom Header Config:
LINUX /boot/Image
FDT /boot/kernel_tegra210-p3448-0000-p3449-0000-b00-user-custom.dtb
INITRD /boot/initrd
APPEND ${cbootargs} quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 overlay_dtb=/boot/tegra-i2s4b-overlay.dtbo

dtc -I dts -O dtb -o tegra-i2s4b-overlay.dtbo tegra-i2s4b-overlay.dts
sudo cp tegra-i2s4b-overlay.dtbo /boot/

inthings@inthings-desktop:~$ sudo /opt/nvidia/jetson-io/config-by-function.py -l enabled
Header 1 [default]: Jetson 40pin Header
Enabled functions (pins):

  1. i2s4 (12,35,38,40)
    Header 2: Jetson Nano CSI Connector
    No functions are enabled.
    Header 3: Jetson M.2 Key E Slot
    Enabled functions (pins):
  2. i2s3 (8,10,12,14)
    inthings@inthings-desktop:~$ for node in /proc/device-tree/ahub/i2s@*; do

echo -n "$node: ";
cat “$node/status”;
echo;
done
/proc/device-tree/ahub/i2s@702d1000: disabled
/proc/device-tree/ahub/i2s@702d1100: disabled
/proc/device-tree/ahub/i2s@702d1200: disabled
/proc/device-tree/ahub/i2s@702d1300: disabled
/proc/device-tree/ahub/i2s@702d1400: disabled
inthings@inthings-desktop:~$

This should have worked. But may be the target paths may be wrong.

One WAR can be

decompile /boot/kernel_tegra210-p3448-0000-p3449-0000-b00-user-custom.dtb to dts

Manually enable i2s4 status as okay and compile it back to dtb and try recording

or you could enable i2s as detailed here Audio Setup and Development — NVIDIA Jetson Linux Developer Guide in the dtsi files mentioned in Audio Setup and Development — NVIDIA Jetson Linux Developer Guide

Thanks

Hi atalambedu

  • Compiled the overlay and placed it in /boot/overlays/:
    dtc -I dts -O dtb -o /boot/overlays/tegra-i2s4b-overlay.dtbo tegra-i2s4b-overlay.dts

  • Decompiled /boot/kernel_tegra210-p3448-0000-p3449-0000-b00-user-custom.dtb, edited the node:

i2s@702d1400 {
status = “okay”;

};

  • Recompiled with:

sudo dtc -I dts -O dtb -o /boot/kernel_tegra210-p3448-0000-p3449-0000-b00-user-custom.dtb base.dts

  • Rebooted:

sudo reboot
`

  • Checked I2S status after reboot:
    for node in /proc/device-tree/ahub/i2s@*; do
    echo -n "$node: "; cat “$node/status”; echo;
    done

then still disabled why ? and Which I2S interface is supported on the 40-pin header of the Jetson Nano? Is it I2S4?

Hi,

My bad, Orin Nano has I2S2 on 40-pin header.

Please check the board interfaces listed here : Audio Setup and Development — NVIDIA Jetson Linux Developer Guide

But this should have been visible when you used Jetson I/O tool. May be it went out of notice

Further i2s@702d1200 may be relevant node where you have check if its status is okay

If not, we may have to edit relevant dtsi files mentioned in the alternate method and enable i2s2

Thanks

Hi atalambedu
i2s@702d1200 {
compatible = “nvidia,tegra210-i2s”;
reg = <0x702d1200 0x100>;
nvidia,ahub-i2s-id = <0x2>;
status = “okay”;
clocks = <0x26 0x12 0x26 0xf9 0x26 0x10b 0x26 0x160>;
clock-names = “i2s”, “i2s_clk_parent”, “ext_audio_sync”, “audio_sync”;
assigned-clocks = <0x26 0x12>;
assigned-clock-parents = <0x26 0xf9>;
assigned-clock-rates = <0x177000>;
prod-name = “i2s2_prod”;
pinctrl-names = “dap_active”, “dap_inactive”;
pinctrl-0;
pinctrl-1;
regulator-supplies = “vdd-1v8-dmic”;
vdd-1v8-dmic-supply = <0x3b>;
fsync-width = <0xf>;
linux,phandle = <0x55>;
phandle = <0x55>;
};
did this but still show disabled why ? what are the alternative method to enable 12s ?

Hi,

Which dts did you edit? tegra234.dtsi?

How did you recompile and flash the new kernel dtb?

Thanks