Below is the snapshot from the schematic for hardware connections.
Codec is connected on I2C1 and SAI2.
Below are my changes in the device tree.
There is no headphone in custom board. Playback device is speaker and Capture device is MIC. both are always there , there is no jack for mic detect.
I have made related changes in device tree like pin muxing, i2c change and sai2.
But neither playback nor capture are working.
When i try to play using aplay, It gives me below error.
aplay: pcm_write:1947: write error: Input/output error <== ERROR
Codec is getting detected in i2c bus, I have tested it through i2cdetect utility.
Few more logs.
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: wm8960audio [wm8960-audio], device 0: HiFi wm8960-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: wm8960audio [wm8960-audio], device 0: HiFi wm8960-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
Am i missing anything? Any pointers or help is appreciated.
How should i proceed to debug it?
Hi jagdish
one can check mclk signal with oscilloscope and disable ECSPI3 as
its signals shared with sai2, please refer to imx7d-sdb.dts
linux-2.6-imx.git - Freescale i.MX Linux Tree
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi igorpadykov,
Thanks for your reply.
ECSPI3 is already disabled.
Below is my pinmux for SAI2 interface in device tree.
pinctrl_sai2: sai2grp {
fsl,pins = <
MX7D_PAD_SD2_RESET_B__SAI2_MCLK 0x1f
MX7D_PAD_SAI2_TX_BCLK__SAI2_TX_BCLK 0x1f
MX7D_PAD_SAI2_TX_SYNC__SAI2_TX_SYNC 0x1f
MX7D_PAD_SAI2_TX_DATA__SAI2_TX_DATA0 0x30
MX7D_PAD_SAI2_RX_DATA__SAI2_RX_DATA0 0x1f
>;
};
Is it proper?
I am getting 12MHz from the processor mclk pin when i try to run aplay command. Is it a proper behaviour?
what bsp used in the case, please try nxp bsp from
http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/?h=imx_4.1.15_1.0.0_ga
also refer to sect.15.4.2 Audio attached Linux Manual
~igor
Thanks igorpadykov,
I am already using that BSP through yocto.
Please let me know if there are any other inputs.
you can also check Toradex Colibri MX7S board (used with sgtl5000 codec) bsp
http://git.toradex.com/cgit/linux-toradex.git/tree/arch/arm/boot/dts/imx7s-colibri.dtsi?h=toradex_4....
http://git.toradex.com/cgit/linux-toradex.git/tree/arch/arm/boot/dts/imx7-colibri.dtsi?h=toradex_4.1...
https://www.toradex.com/computer-on-modules/colibri-arm-family/nxp-freescale-imx7
http://developer.toradex.com/software/linux/linux-software
~igor
Using NXP BSP, I got my MIC working. But speaker is not working yet.
While playback, I am getting below error.
aplay: pcm_write:1947: write error: Input/output error
On my board, There is no headphone. Only speaker is there. Do i need to make any changes to device tree or machine driver for it?