Can't record from dmic to rt5640 to i2s2 (JPversion 6.1, r36.4.0)

Hello,

Playback is working. Capture is not working. I tried the example from Audio Setup and Development — Jetson Linux<br/>Developer Guide 34.1 documentation

#RT5640 Codec Mixer Controls (apply on Jetson AGX Orin)
amixer -c APE cset name=“CVB-RT RECMIXL BST1 Switch” “on”
amixer -c APE cset name=“CVB-RT RECMIXR BST2 Switch” “on”
amixer -c APE cset name=“CVB-RT IN1 Boost” 8
amixer -c APE cset name=“CVB-RT IN2 Boost” 8
amixer -c APE cset name=“CVB-RT Stereo ADC1 Mux” “ADC”
amixer -c APE cset name=“CVB-RT Stereo ADC MIXL ADC1 Switch” “on”
amixer -c APE cset name=“CVB-RT Stereo ADC MIXR ADC1 Switch” “on”
arecord -Dhw:APE,0 -c 2 -r 48000 -f S16_LE -d 10 out.wav

But no sound data in the out.wav at all. I checked the MCLK and I2S2 is working. But MIC_IN1P doesn’t have data.(Myabe the DMIC_CLK doesn’t work, either.)

My shcematic of DMIC and rt5640

Here are some log for debugging.
dt.log (334.6 KB)
dmesg.txt (130.6 KB)

dapm log

<...>-3912    [000] .......   740.292812: snd_soc_dapm_path: *ADMAIF1 XBAR-TX -> (direct) -> ADMAIF1 XBAR-Capture
       <...>-3912    [000] .......   740.292815: snd_soc_dapm_path: *ADMAIF1 Mux -> (direct) -> ADMAIF1 XBAR-TX
     arecord-3912    [000] .......   740.292919: snd_soc_dapm_path: *I2S2 XBAR-RX -> I2S2 -> ADMAIF1 Mux
     arecord-3912    [000] .......   740.292923: snd_soc_dapm_path: *I2S2 XBAR-Playback -> (direct) -> I2S2 XBAR-RX
     arecord-3912    [000] .......   740.292925: snd_soc_dapm_path: *tegra-dlink-40-capture -> (direct) -> I2S2 XBAR-Playback
     arecord-3912    [000] .......   740.292927: snd_soc_dapm_path: *I2S2 CIF-Capture -> (direct) -> tegra-dlink-40-capture
     arecord-3912    [000] .......   740.292929: snd_soc_dapm_path: *I2S2 TX -> (direct) -> I2S2 CIF-Capture
     arecord-3912    [000] .......   740.292931: snd_soc_dapm_path: *I2S2 DAP-Playback -> (direct) -> I2S2 TX
     arecord-3912    [000] .......   740.292933: snd_soc_dapm_path: *rt5640-playback-capture -> (direct) -> I2S2 DAP-Playback
     arecord-3912    [000] .......   740.292935: snd_soc_dapm_path: *CVB-RT AIF1 Capture -> (direct) -> rt5640-playback-capture
     arecord-3912    [000] .......   740.292936: snd_soc_dapm_path: *CVB-RT AIF1TX -> (direct) -> CVB-RT AIF1 Capture
     arecord-3912    [000] .......   740.292939: snd_soc_dapm_path: *CVB-RT SDI1 TX Mux -> (direct) -> CVB-RT AIF1TX
     arecord-3912    [000] .......   740.292940: snd_soc_dapm_path: *CVB-RT DAI1 TX Mux -> (direct) -> CVB-RT AIF1TX
     arecord-3912    [000] .......   740.292945: snd_soc_dapm_path: *CVB-RT IF1 ADC -> 1:1|2:2 -> CVB-RT DAI1 TX Mux
     arecord-3912    [000] .......   740.292948: snd_soc_dapm_path: *CVB-RT IF1 ADC R -> (direct) -> CVB-RT IF1 ADC
     arecord-3912    [000] .......   740.292950: snd_soc_dapm_path: *CVB-RT IF1 ADC L -> (direct) -> CVB-RT IF1 ADC
     arecord-3912    [000] .......   740.292956: snd_soc_dapm_path: *CVB-RT Stereo ADC MIXR -> (direct) -> CVB-RT IF1 ADC R
     arecord-3912    [000] .......   740.292957: snd_soc_dapm_path: *CVB-RT Stereo ADC MIXR -> (direct) -> CVB-RT ANC
     arecord-3912    [000] .......   740.292960: snd_soc_dapm_path: *CVB-RT Stereo ADC MIXL -> (direct) -> CVB-RT IF1 ADC L
     arecord-3912    [000] .......   740.292961: snd_soc_dapm_path: *CVB-RT Stereo ADC MIXL -> (direct) -> CVB-RT ANC
     arecord-3912    [000] .......   740.292966: snd_soc_dapm_path: *CVB-RT Stereo ADC R1 Mux -> ADC1 Switch -> CVB-RT Stereo ADC MIXR
     arecord-3912    [000] .......   740.292968: snd_soc_dapm_path: *CVB-RT Stereo ADC L1 Mux -> ADC1 Switch -> CVB-RT Stereo ADC MIXL
     arecord-3912    [000] .......   740.292970: snd_soc_dapm_path: *CVB-RT ADC R -> ADCR -> CVB-RT Mono ADC R1 Mux
     arecord-3912    [000] .......   740.292971: snd_soc_dapm_path: *CVB-RT ADC R -> ADC -> CVB-RT Stereo ADC R1 Mux
     arecord-3912    [000] .......   740.292974: snd_soc_dapm_path: *CVB-RT ADC L -> ADCL -> CVB-RT Mono ADC L1 Mux
     arecord-3912    [000] .......   740.292974: snd_soc_dapm_path: *CVB-RT ADC L -> ADC -> CVB-RT Stereo ADC L1 Mux
     arecord-3912    [000] .......   740.292978: snd_soc_dapm_path: *CVB-RT RECMIXR -> (direct) -> CVB-RT ADC R
     arecord-3912    [000] .......   740.292982: snd_soc_dapm_path: *CVB-RT RECMIXL -> (direct) -> CVB-RT ADC L
     arecord-3912    [000] .......   740.292985: snd_soc_dapm_path: *CVB-RT BST2 -> BST2 Switch -> CVB-RT RECMIXR
     arecord-3912    [000] .......   740.292993: snd_soc_dapm_path: *CVB-RT BST1 -> BST1 Switch -> CVB-RT RECMIXL
     arecord-3912    [000] .......   740.292996: snd_soc_dapm_path: *CVB-RT IN2N -> (direct) -> CVB-RT INR VOL
     arecord-3912    [000] .......   740.292997: snd_soc_dapm_path: *CVB-RT IN2N -> (direct) -> CVB-RT BST2
     arecord-3912    [000] .......   740.292998: snd_soc_dapm_path: *CVB-RT IN2P -> (direct) -> CVB-RT INL VOL
     arecord-3912    [000] .......   740.292999: snd_soc_dapm_path: *CVB-RT IN2P -> (direct) -> CVB-RT BST2
     arecord-3912    [000] .......   740.293001: snd_soc_dapm_path: *CVB-RT IN1N -> (direct) -> CVB-RT BST1
     arecord-3912    [000] .......   740.293002: snd_soc_dapm_path: *CVB-RT IN1P -> (direct) -> CVB-RT BST1
     arecord-3912    [000] .......   740.293005: snd_soc_dapm_path: *CVB-RT Mic Jack -> (direct) -> CVB-RT IN2P
     arecord-3912    [000] .......   740.293005: snd_soc_dapm_path: *CVB-RT Mic Jack -> (direct) -> CVB-RT IN1P

Hope this information is helpful for debugging

Hello,

I found another record topic of wm8904

I thought I didn’t add hdr40_snd_i2s_dap_ep
, so I added hdr40_snd_i2s_dap_ep like below,

i2s@2901100 {
	ports {
		port@1 {
			hdr40_snd_i2s_dap_ep: endpoint {
				dai-format = "i2s";
				remote-endpoint = <&rt5640_ep>;
			};
		};
	};
};

but it still doesn’t work…

dt2.log (335.0 KB)

Please help me with dt2.log(the latest device-tree) if I miss something for capture.

BTW, Does it work if we use i2s2 for playback and capture? I mean not doing at the same time. I ask this question because I saw the wm8904 post, looks like they took different i2s to do playback and capture.

hi @ruei_chang

From the data you’ve shared, the device tree configuration appears to be fine. However, we still need to confirm whether the RT5640 codec is providing the clock to the DMIC hardware, as that’s a critical part of the setup.

Also, during both playback and capture, please dump the regmap as described in the Jetson Audio Setup and Development guide. That information will help me analyze the situation further and provide more accurate guidance.

In parallel, can you please check with the Realtek vendor to see if any specific mixer control configuration or device tree changes are required to enable DMIC support with the RT5640 codec.

Hello rituc,

Thank you for your assistance. Here is some logs

amixersettings.txt (324.9 KB)
dt3.log (335.0 KB)
kernel_log.txt (129.7 KB)
reg_dump_2901100i2s.txt (585 Bytes)

I will ask my codec vendor as well. Thank you.

Hello,

I finally got my DMIC working.

I asked my vendor and had several amixer tests. Here is my final amixer configuration:

amixer -c APE cset name=“CVB-RT RECMIXL BST1 Switch” “on”
amixer -c APE cset name=“CVB-RT RECMIXR BST2 Switch” “on”
amixer -c APE cset name=“CVB-RT IN1 Boost” 8
amixer -c APE cset name=“CVB-RT IN2 Boost” 8
amixer -c APE cset name=“CVB-RT Stereo ADC1 Mux” “ADC”
amixer -c APE cset name=“CVB-RT Stereo ADC2 Mux” “DMIC1”
amixer -c APE cset name=“CVB-RT Stereo ADC MIXL ADC2 Switch” 1
amixer -c APE cset name=“CVB-RT Stereo ADC MIXR ADC2 Switch” 1
amixer -c APE cset name=“CVB-RT DAI select” “1:1|2:2”
amixer -c APE cset name=“CVB-RT ADC Capture Switch” 1

And also modified the following:

realtek,dmic1-data-pin = <RT5640_DMIC1_DATA_PIN_IN1P>;

The arecord is working fine.

arecord -Dhw:APE,0 -c 2 -r 48000 -f S16_LE -d 30 out.wav

My vendor said I have to ensure the following registers are set up like below so that DMIC1 can work:

mx75[15]=1’b
mx61[15]=1’b
mx62[15]=1’b
mxFA[0]=1’b
mx27[15:0]=5040’h

1 Like

Here is additional information regarding the headphone microphone.

My headphone microphone connects to the RT5604’s IN3P and IN3N pins. The schematic design reference is based on the RT5640 datasheet.

Additionally, MICBIAS1 is connected to IN3P.

The following entries should be added to the nvidia-audio-card routing: "

“CVB-RT IN3P”, “CVB-RT Mic Jack”,
CVB-RT Mic Jack" and “CVB-RT MICBIAS1”.

Running the amixer commands below will then allow voice capture by using arecord:

amixer -c APE cset name=“CVB-RT RECMIXR BST3 Switch” “on”
amixer -c APE cset name=“CVB-RT RECMIXL BST3 Switch” “on”
amixer -c APE cset name=“CVB-RT IN3 Boost” 8
amixer -c APE cset name=“CVB-RT DAI select” “1:1|2:2”
amixer -c APE cset name=“CVB-RT ADC Capture Switch” 1

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.