[Jetson Orin NX] ES7210 I2S4 Capture Fails with I/O Error: BE Link PCM Constraints Show "rate=0--1" and RATE_KNOT

1. Hardware Environment

表格

Item Value
Platform NVIDIA Jetson Orin NX (Tegra234)
L4T Version R36.4.3
Kernel 5.15.148-rt-tegra
Audio ADC ES7210 (Everest Semi, 4-channel)
I2C Bus Bus 1 (i2c@c240000)
I2C Address 0x40
I2S Interface I2S4 (DAP4)
MCLK PLLA_OUT0 → AUD_MCLK, 12.288MHz
ES7210 Role Slave (Jetson I2S4 acts as master and drives BCLK/LRCK)

2. Device Tree Configuration

ES7210 Codec Node

dts

i2c@c240000 {
    es7210: es7210@40 {
        compatible = "MicArray_0";
        reg = <0x40>;
        #sound-dai-cells = <0>;
        clocks = <&bpmp TEGRA234_CLK_AUD_MCLK>;
        clock-names = "mclk";
        assigned-clocks = <&bpmp TEGRA234_CLK_AUD_MCLK>;
        assigned-clock-rates = <12288000>;
        status = "okay";
    };
};

Reference sample configuration for sgtl5000:

dts

i2c@<addr> {
	sgtl5000: sgtl5000@0a {
    	compatible = "fsl,sgtl5000";
    	reg = <0x0a>;
    	clocks = <&sgtl5000_mclk>;
    	micbias-resistor-k-ohms = <2>;
    	micbias-voltage-m-volts = <3000>;
    	VDDA-supply = <&vdd_3v3>;
    	VDDIO-supply = <&vdd_3v3>;
    	status = "okay";
	};
};

i2s@<addr> {
	status = "okay";
};

DAI Link Override (Based on nvidia-audio-card C2C Link Template)

dts

&i2s4_to_codec {
    link-name = "es7210-capture";
    srate = <48000>;
    num-channel = <4>;
    bit-format = "s32_le";
    codec {
		sound-dai = <&es7210>;
		prefix = "ES7210";
    };
};

Original I2S4 C2C link template (tegra234-soc-audio-dai-links.dtsi):

dts

i2s4_to_codec: nvidia-audio-card,dai-link@79 {
    status = "okay";
    format = "i2s";
    link-type = <C2C_LINK>;   /* link-type = 2 */
    cpu {
        sound-dai = <&tegra_i2s4 I2S_DAP>;
    };
    codec {
        sound-dai = <&tegra_i2s4 I2S_DUMMY>;
    };
};

3. ES7210 Driver Macro Definitions

c

运行

#define ES7210_CHANNELS_MAX     MIC_CHN_4
#define ES7210_TDM_ENABLE       DISABLE
#define ES7210_NFS_ENABLE       DISABLE
#define ES7210_WORK_MODE        ES7210_NORMAL_I2S
#define RATIO_MCLK_LRCK         RATIO_MCLK_LRCK_256
#define ES7210_MCLK_SOURCE      FROM_PAD_PIN

4. Boot Logs

log

[    8.555086] es7210: loading out-of-tree module taints kernel.
[    8.556448] enter into es7210_i2c_probe!
[    8.557016] es7210_i2c_probe: CHP_ID1_REG3D = 0x72 (expect 0x72)
[    8.557481] es7210_i2c_probe: CHP_ID0_REG3E = 0x10 (expect 0x10)
[    8.557943] es7210_i2c_probe, ES7210 Version = 0!

# set_dai_fmt is called 5 times, all in Slave mode (ES7210 works as slave as expected)
[   10.914301] enter into es7210_set_dai_fmt
[   10.914308] es7210_set_dai_fmt Slave mode
[   10.917172] es7210_set_dai_fmt 1FS TDM Mode
[   11.302831] enter into es7210_set_dai_fmt
[   11.302839] es7210_set_dai_fmt Slave mode
[   11.305717] es7210_set_dai_fmt 1FS TDM Mode
... (repeated 5 times with identical logs)

# FE (ADMAIF) PCM constraints are normal: rate range 32000-192000
[   16.322387] ES7210_DBG: hw_complete: info=0x1c90103 fmt=0x404 ch=2-8 rate=32000-192000
[   16.335650] ES7210_DBG: hw_complete: info=0x1c90103 fmt=0x404 ch=2-8 rate=32000-192000
... (All 20 ADMAIF PCM instances show normal constraints)

# BE (C2C link) PCM constraints abnormal: rate=0--1, rates=0x80000000 (RATE_KNOT)
[   16.457187] ES7210_DBG: __soc_pcm_open: after init_runtime_hw rates=0x80000000 fmt=0x445 ch=1-16 rate=0--1
[   16.457199] ES7210_DBG: __soc_pcm_open: SUCCESS
[   16.457202] ES7210_DBG: hw_complete: info=0x103 fmt=0x445 ch=1-16 rate=0--1
... (All 5 C2C BE PCM instances show abnormal constraints)

5. Recording Test & Errors

shell

# Configure XBAR routing
amixer -c APE cset name='I2S4 Mux' 'ADMAIF1'

# Start recording
arecord -D hw:APE,0 -c 4 -r 48000 -f S32_LE -d 5 /tmp/test.wav
Recording WAVE '/tmp/test.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Channels 4
arecord: pcm_read:2221: read error: Input/output error

ADMAIF1 is connected to I2S2 and ADMAIF2 is connected to I2S4 by default. For recording, route ADMAIF Mux to I2S4, not I2S4 Mux → ADMAIF (this is for playback).

For 4 channel recording the I2S format should be dsp-a, please set below control,

amixer -c APE cset name="I2S4 codec frame mode" "dsp-a"

Since I2S4 is connected to ADMAIF2 by default, try:

arecord -D hw:APE,1 -c 4 -r 48000 -f S32_LE -d 5 /tmp/test.wav

thanks,How to map schematic pin labels to their kernel/device tree names,

I cannot find the definition corresponding to i2s0_sclk in the kernel source code.

— 🤖 This is an automated AI response. I’m here to help, but please verify important details! —

Based on the provided context, I will try to help you with the issue you are experiencing with the ES7210 I2S4 capture on the Jetson Orin NX.

The issue seems to be related to the BE (C2C link) PCM constraints, which are showing abnormal values (rate=0–1, rates=0x80000000). This is causing the recording test to fail with an I/O error.

After reviewing the provided context, I noticed that the ES7210 driver macro definitions are set to use the normal I2S mode (ES7210_WORK_MODE ES7210_NORMAL_I2S) and the MCLK source is set to FROM_PAD_PIN. However, the boot logs show that the ES7210 is working as a slave, which is expected.

One possible solution to try is to modify the DAI link override to use the correct format and bit width. The current DAI link override is set to use the s32_le format, but the ES7210 driver is expecting a different format.

Here is an example of how you can modify the DAI link override:

&i2s4_to_codec {
    link-name = "es7210-capture";
    srate = <48000>;
    num-channel = <4>;
    bit-format = "s16_le"; // Change to s16_le format
    codec {
        sound-dai = <&es7210>;
        prefix = "ES7210";
    };
};

Additionally, you can try to modify the ES7210 driver macro definitions to use the correct MCLK source and ratio. For example:

#define ES7210_MCLK_SOURCE FROM_PLLA_OUT0
#define RATIO_MCLK_LRCK RATIO_MCLK_LRCK_512

After making these changes, you can try to recompile the kernel and test the recording again.

If the issue persists, you may want to try to debug the ES7210 driver further to see if there are any other issues that are causing the abnormal PCM constraints.

I hope this helps! Let me know if you have any further questions or if there’s anything else I can help you with.

— We support team will also look into your issue to have further suggestions soon. please stay tuned. —

Please check this section Jetson Orin NX Series — Jetson Linux Developer Guide documentation to find the respective pinmux sheet path and https://developer.nvidia.com/downloads/jetson-orin-nx-and-orin-nano-series-pinmux-config-template is the sheet.

JFYI, I2S0 corresponds to I2S2 not I2S4.

Hello. I tried to refer to the existing I2S3 device tree example to configure I2S2, but the sound card fails to be registered successfully. Could you please provide a complete device tree example for I2S2? I cannot find any reference samples of I2S2 in the kernel source code. Thank you very much.

This is our schematic diagram

Please share the DT file, pinmux, and dmesg logs from the target. You can refer to the debug log commands here: Debug log commands link.

Also, please confirm whether the codec I2S pins are connected to the Tegra I2S pins on the 40-pin header.

es7210.zip (1.9 MB)Thanks a million for your help. I’m not really good at this.