Other Parts Discussed in Thread: PCM5102A
Tool/software: Linux
Hi, I'm Roy.
I need to transfer PCM formatted data (8kHz samplerate / 16bit per sample / stereo) via McASP0 on BBB.
I found some articles and apply to my system like below:
- delete McASP0 pinmuxing and related things in am335x-boneblack-common.dtsi.
- add McASP0 pinmuxing and PCM5102a codec binding to am335x-boneblack-pcm5102a-int_clk.dtsi:
&am33xx_pinmux { mcasp0_pins: mcasp0_pins { pinctrl-single,pins = < AM33XX_IOPAD(0x990, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mcasp0_aclkx.mcasp0_aclkx */ AM33XX_IOPAD(0x994, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mcasp0_fsx.mcasp0_fsx */ AM33XX_IOPAD(0x998, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_axr0.mcasp0_axr0 */ AM33XX_IOPAD(0x99c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mcasp0_ahclkr.mcasp0_axr2*/ >; }; mcasp0_pins_sleep: mcasp0_pins_sleep { pinctrl-single,pins = < AM33XX_IOPAD(0x990, PIN_INPUT_PULLDOWN | MUX_MODE7) AM33XX_IOPAD(0x994, PIN_INPUT_PULLDOWN | MUX_MODE7) AM33XX_IOPAD(0x998, PIN_INPUT_PULLDOWN | MUX_MODE7) AM33XX_IOPAD(0x99c, PIN_INPUT_PULLDOWN | MUX_MODE7) >; }; }; &mcasp0 { #sound-dai-cells = <0>; pinctrl-names = "default"; pinctrl-0 = <&mcasp0_pins>; pinctrl-1 = <&mcasp0_pins_sleep>; status = "okay"; op-mode = <0>; /* MCASP_IIS_MODE */ tdm-slots = <2>; /* 4 serializers */ serial-dir = < /* 1 TX 2 RX 0 unused */ 2 0 1 0 >; rx-num-evt = <32>; tx-num-evt = <32>; }; / { pcm5102a: pcm5102a { compatible = "ti,pcm5102a"; }; clk_mcasp0_fixed: clk_mcasp0_fixed { #clock-cells = <0>; compatible = "fixed-clock"; clock-frequency = <4096000>; }; clk_mcasp0: clk_mcasp0 { #clock-cells = <0>; clocks = <&clk_mcasp0_fixed>; }; sound { compatible = "ti,pcm5102a-evm-audio"; ti,model = "TI PCM5102A"; ti,audio-codec = <&pcm5102a>; ti,mcasp-controller = <&mcasp0>; ti,codec-clock-rate = <4096000>; sound1_master: simple-audio-card,cpu { sound-dai = <&mcasp0>; clocks = <&clk_mcasp0>; }; simple-audio-card,codec { sound-dai = <&pcm5102a>; }; }; };
- And include this dts to am335x-boneblack.dts
The PCM5102A codec is detected on my BBB with above and I execute below command:
# aplay ~/1kHz_sinewave_8000_16.wav
I expect FSX is 8kHz but the FSX is 24kHz (three times). When I try with 16kHz sampled, FSX is 48kHz (three times). Is it okay?
Can I get your opinion about this issue?
Thanks,
Roy.