imx6q上移植wm8960,没有声音

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx6q上移植wm8960,没有声音

3,174 Views
wrxw
Contributor I

源代码是Yocto 4.1.15 ,codec是wm8960,移植后,可以正确识别wm8960

QQ截图20181026153039.png

QQ截图20181026153001.png

aplay -L也显示识别出wm8960,

但是使用aplay test.wav时报错:

ASoC: HiFi startup failed: -16
aplay: main:828: audio open error: Device or resource busy

然后源代码里加打印,报错是sound/soc/fsl/imx-wm8960.c里的imx_hifi_startup()返回-16QQ截图20181026151208.png

这里判断条件里的话,猜测是ssi总线上数据不对

然后示波器量了MCLK确实没有信号,AUD3_TCK,TFS,TXD,RTX均为低电平

查看设备树

QQ截图20181026152512.png

QQ截图20181026152519.png

采用默认的配置,引脚和实际电路图对应也是对的

QQ截图20181026151649.png

QQ截图20181026152631.png

查看codec的代码,clocks使用的是默认的169,换了201和别的值,还是一样

QQ截图20181026152057.png

最后参考别的板子的,imx7d和imx6ul上的wm8960使用的都是sai总线,

而imx6qdl.dtsi里面只有ssi总线,设备树是从wm8962改的,8962使用ssi,是不是这里不对?

恳请有经验的大佬指导下下,谢谢

Labels (5)
0 Kudos
4 Replies

2,173 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi,

 

you can enable clock in clk-imx6q.c ( drivers/clk/imx/clk-imx6q.c) at first, then measure it to see if it is 24MHz

drivers/clk/imx/clk-imx6q.c

static void __init imx6q_clocks_init(struct device_node *ccm_node)

{

......

 

                imx_clk_set_parent(clk[IMX6QDL_CLK_CKO2_SEL], clk[IMX6QDL_CLK_OSC]);

                imx_clk_set_parent(clk[IMX6QDL_CLK_CKO], clk[IMX6QDL_CLK_CKO2]);

                clk_set_rate(clk[IMX6QDL_CLK_CKO], 24000000);

                imx_clk_prepare_enable(clk[IMX6QDL_CLK_CKO]);

... ...

}

 

Have a nice day!

NXP TIC weidong sun

0 Kudos

2,173 Views
ericyang
Contributor I

Hi Wigros,

I have the same problem on platform 6q. I found these things(below), but not  be solved.

WM8960 driver with SSI2 on Kernel 4.1.15 

https://community.nxp.com/message/642991?commentID=642991#comment-642991 

is there a patch for WM8960 that uses SSI?

Thanks.

0 Kudos

2,173 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Eric,

   You can't use imx-wm8960.c directly,  the best way is that you should refer to imx-wm8962.c and write a new machine driver for your application. Because imx-wm8960.c is used to connect SAI DAI to CODEC DAI.

-----------Chinese------

你最好不要直接使用imx-wm8960.c,因为这个machine driver是把SAI DAI和WM8960 DAI连接在一起的。最好的办法是在imx-wm8962.c的基础上,写一个自己的machine driver,你可以把它叫做imx6u-wm8960.c。定义方式和imx-wm8962.c基本一致。

-------------------------

Have a nice day!

NXP TIC weidong

0 Kudos

2,173 Views
wrxw
Contributor I

Hi

   Thanks ,  I modified it according to your steps and recompiled the kernel into the board.The MCLK pin successfully generated 24MHZ waveform.

   But run commond "aplay test.wav",system still error:

root@ubuntu:~# aplay test.wav
ASoC: HiFi startup failed: -16
aplay: main:828: audio open error: Device or resource busy

I measured the I2S pin:

AUD3_TCK AUD3_TFS AUD3_RXD is low

AUD3_TXD is high

Is wm8962 driver compatible with wm8960?

Thanks

0 Kudos