Hi Teams,
Our product is using TLV320ADC3140 codec. we want to record 4Ch analog mic with TDM mode.
However, we always record failed with below message:
arecord: pcm_read:2221: read error: Input/output error
ALSA record command:
# arecord -f dat -t wav -c 4 4ch.wav
This codec MCLK, BCLK, FCLK is input from a clock generator.
The oscilloscope measurement signals are 24.576MHz, 3.072MHz, and 48KHz respectively.
CPU side is using MCASP2. AXR5 is rx connect with tlv320adc3140's SDOUT.
ACLKX, AFSX is input from clock generator,too.
ACLKX = 3.072MHz.
AFSX = 48KHz
Below is my device tree:
&main_pmx0 { mcasp2_pins_default: mcasp2-pins-default { pinctrl-single,pins = < AM62X_IOPAD(0x0178, PIN_INPUT, 2) /* (AC20) RGMII2_TD3.MCASP2_ACLKX */ AM62X_IOPAD(0x0174, PIN_INPUT, 2) /* (AD21) RGMII2_TD2.MCASP2_AFSX */ AM62X_IOPAD(0x0184, PIN_INPUT, 2) /* (AE23) RGMII2_RD0.MCASP2_AXR2 */ AM62X_IOPAD(0x0164, PIN_OUTPUT, 2) /* (AA19) RGMII2_TX_CTL.MCASP2_AXR4 */ AM62X_IOPAD(0x0168, PIN_INPUT, 2) /* (AE21) RGMII2_TXC.MCASP2_AXR5 */ >; }; }; /* Redefine rgmii2 pins avoid pinctrl conflict */ &main_rgmii2_pins_default { pinctrl-single,pins = < AM62X_IOPAD(0x188, PIN_INPUT, 0) /* (AB20) RGMII2_RD1 */ AM62X_IOPAD(0x18c, PIN_INPUT, 0) /* (AC21) RGMII2_RD2 */ AM62X_IOPAD(0x190, PIN_INPUT, 0) /* (AE22) RGMII2_RD3 */ AM62X_IOPAD(0x180, PIN_INPUT, 0) /* (AD23) RGMII2_RXC */ AM62X_IOPAD(0x17c, PIN_INPUT, 0) /* (AD22) RGMII2_RX_CTL */ AM62X_IOPAD(0x16c, PIN_OUTPUT, 0) /* (Y18) RGMII2_TD0 */ AM62X_IOPAD(0x170, PIN_OUTPUT, 0) /* (AA18) RGMII2_TD1 */ >; }; &main_i2c2 { status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&i2c2_pins_default>; clock-frequency = <400000>; tlv320adc3140: audio-codec@4c { status = "okay"; #sound-dai-cells = <0>; compatible = "ti,tlv320adc3140"; reg = <0x4c>; pinctrl-names = "default"; pinctrl-0 = <&audio_mic_rst_pins_default>; ti,mic-bias-source = <0>; ti,pdm-edge-select = <1 1 1 1>; ti,gpio-config = <10 0>; ti,gpi-config = <0 0 0 0>; ti,gpo-config-1 = <0 0>; ti,gpo-config-2 = <0 0>; ti,gpo-config-3 = <0 0>; ti,gpo-config-4 = <0 0>; ti,slot-mapping = <0 1 2 3>; ti,asi-tx-driver = <0>; reset-gpios = <&main_gpio1 6 GPIO_ACTIVE_HIGH>; }; }; &tlv320_mclk { clock-frequency = <24576000>; }; &mcasp1 { status = "disabled"; }; &mcasp2 { status = "okay"; #sound-dai-cells = <0>; pinctrl-names = "defualt"; pinctrl-0 = <&mcasp2_pins_default>; op-mode = <0>; tdm-slots = <4>; //assigned-clock-rates = <24576000>; num-serializer = <6>; serial-dir = < 0 0 1 0 1 2 >; tx-num-evt = <32>; rx-num-evt = <32>; }; &codec_audio { /delete-property/ simple-audio-card,widgets; /delete-property/ simple-audio-card,routing; simple-audio-card,format = "i2s"; simple-audio-card,widgets = "Microphone", "Mic"; simple-audio-card,routing = "MIC1P", "Mic", "MIC1M", "Mic", "MIC2P", "Mic", "MIC2M", "Mic", "MIC3P", "Mic", "MIC3M", "Mic", "MIC4P", "Mic", "MIC4M", "Mic"; //mclk-fs = <512>; simple-audio-card,bitclock-master = <&sound_cpu>; simple-audio-card,frame-master = <&sound_cpu>; sound_cpu: simple-audio-card,cpu { sound-dai = <&mcasp2>; clocks = <&tlv320_mclk>; dai-tdm-slot-num = <4>; dai-tdm-slot-width = <32>; dai-tdm-slot-rx-mask = <1 1 1 1>; }; simple-audio-card,codec { sound-dai = <&tlv320adc3140>; dai-tdm-slot-num = <4>; dai-tdm-slot-width = <32>; dai-tdm-slot-tx-mask = <1 1 1 1>; }; };
Below is i2c register when record.
Is there any content that is wrong?