TI中文支持网
TI专业的中文技术问题搜集分享网站

PROCESSOR-SDK-AM62X: Some problems with codec

Part Number:PROCESSOR-SDK-AM62X

In ti-processor-sdk-linux-rt-am62xx-evm-10.01.10.04,I want to use the CJC8990 as the audio codec on the AM62X chip, but the following error occurred when I was using it.


:~#aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: cjc8990hifi [cjc8990-hifi],device 0: 2b10000.audio-controller-cjc8990-hifi cjc8990-hifi-0 [2b10000.audio-controller-cjc8990-hifi cjc8990-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
:~##speaker-test -c 2 -t wav

speaker-test 1.2.11

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 16 to 131072
Period size range from 8 to 16384
Periods = 4
was set period_size = 12000
was set bufer_size = 48000
0 – Front Left
Write error: -5,Input/output error
xrun_recovery failed: -5,Input/output error
Transfer failed:Input/output error


My dts configuration is as follows:

main_macsp1_pins_default: main-mcasp1-default-pins {pinctrl-single,pins = <AM62X_IOPAD(0x0124, PIN_OUTPUT, 1)AM62X_IOPAD(0x0128, PIN_OUTPUT, 1)AM62X_IOPAD(0x0114, PIN_OUTPUT, 1)AM62X_IOPAD(0x010c, PIN_INPUT, 1)>;
};

cjc8990_mclk: clk-0 {#clock-cells = <0>;compatible = "fixed-clock";clock-frequency = <12288000>;
};

codec-audio: sound {compatible = "simple-audio-card";simple-audio-card,name = "cjc8990-hifi";simple-audio-card,widgets ="Headphone", "Headphone Jack","Line", "Line In","Microphone", "Microphone Jack";simple-audio-card,routing ="Headphone Jack", "LOUT1","Headphone Jack", "ROUT1","LINPUT1", "Line In","LINPUT2", "Line In","Microphone Jack", "Mic Bias";simple-audio-card,format = "i2s";simple-audio-card,bitclock-master = <&sound_master>;simple-audio-card,frame-master = <&sound_master>;simple-audio-card,bitclock-inversion;simple-audio-card,cpu {sound-dai = <&mcasp1>;};sound_master: simple-audio-card,codec {sound-dai = <&cjc8990>;clocks = <&cjc8990_mclk>;};
};

&main_i2c0 {status = "okay";clock-frequency = <100000>;rtc0: rtc-pcf8563@51 {compatible = "nxp,pcf8563";reg = <0x51>;#clock-cells = <0>;};cjc8990: audio-codec@1b {#sound-dai-cells = <0>;compatible = "cjc8990";reg = <0x1b>;clocks = <&cjc8990_mclk>;clock-names = "mclk";ai3x-micbias-vg = <1>;AVDD-supply = <&vcc_3v3_sys>;IOVDD-supply = <&vcc_3v3_sys>;DRVDD-supply = <&vcc_3v3_sys>;};
};

&mcasp1 {status = "okay";#sound-dai-cells = <0>;pinctrl-names = "default";pinctrl-0 = <&main_mcasp1_pns_default>;op-mode = <0>;tdm-slots = <2>;serial-dir = <1 0 2 00 0 0 00 0 0 00 0 0 0>;tx-num-evt = <0>;rx-num-evt = <0>;
};


Please tell me how I should deal with this problem so that I can use the cjc8990 codec chip normally.

Daniel:

您好

您能否确认 MCASP 时钟已正确配置并且在 MCASP 引脚上看到这些时钟?

,

zhaohang lai:

cjc8990 芯片上的 MCLK 引脚我给了外部的 12.288MHZ,我用示波器确认过,但是 AM62x 的 MCASP1_ACLKX 并没有任何输出。

,

zhaohang lai:

请给我一些建议或者帮助去解决这个问题,或者我还需要提供哪些信息?

,

Daniel:

您好

Can you provide the schematic or a visual on how your setup looks like between codec and MCASP?

Please refer the below document:

https://www.ti.com/lit/an/sprack0/sprack0.pdf

,

zhaohang lai:

 This is the schematic diagram,whether there is

 a problem?

,

Daniel:

您好

If you are using MCASP as slave in your DTS, your pin controls directions are incorrect

Please refer our DTS file where we are using MCASP as slave and Codec as Master.

https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi?h=ti-linux-6.12.y#n312

main_mcasp1_pins_default: main-mcasp1-default-pins {pinctrl-single,pins = <AM62X_IOPAD(0x090, PIN_INPUT, 2) /* (M24/K17) GPMC0_BE0N_CLE.MCASP1_ACLKX */AM62X_IOPAD(0x098, PIN_INPUT, 2) /* (U23/P21) GPMC0_WAIT0.MCASP1_AFSX */AM62X_IOPAD(0x08c, PIN_OUTPUT, 2) /* (L25/J17) GPMC0_WEN.MCASP1_AXR0 */AM62X_IOPAD(0x084, PIN_INPUT, 2) /* (L23/K20) GPMC0_ADVN_ALE.MCASP1_AXR2 */>;};

As you would see ACLKX , FSX are being used as PIN_INPUT (As its being provided by external codec).Please modify your DTS and let me know how it goes.

,

zhaohang lai:

After I changed the pin direction and executed speaker-test-c 2-t wav, it can now run continuously,but there is no sound at all, I have already adjusted the sound using alsamixer, I don't have much experience in this aspect. What should I do?

,

Daniel:

Hi

Can you probe the MCASP PINs on your setup to see if you are receiving the Clocks and Data when running the speaker test using logic analyzer/oscilloscope?

Other thing is to check MCASP1 registers. Check the TRM for relevant transmit related registers of MCASP1 – Section 14.8.1.1 MCASP Registers

赞(0)
未经允许不得转载:TI中文支持网 » PROCESSOR-SDK-AM62X: Some problems with codec
分享到: 更多 (0)