imx6dl平台使用cs4344 codec

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

imx6dl平台使用cs4344 codec

Jump to solution
3,770 Views
luoyaojun
Contributor II

内核版本3.14.52, 是否有成功案例在imx6dl的iis输出上直接接cs4344进行dac到耳机?

pastedImage_1.pngpastedImage_2.png

在低版本内核中发现cs4344代码,但在高版本内核中去掉了该芯片的驱动,在device tree中如何配置cs4344或可以参考哪个芯片进行配置? 

Labels (4)
0 Kudos
1 Solution
3,306 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi

  I will send a detailed document on how to port audio driver to i.MX6, check your email, please!

Br,

weidong

View solution in original post

0 Kudos
10 Replies
3,306 Views
unameping
Contributor I

hi,yaojun ,imx6 cs4344 解决方案能共享吗?我刚刚也遇到这样的问题,无法正常播放音频。

0 Kudos
3,306 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Yaojun,

   你使用的audio code与WM8962的接口非常接近,所以您可以参考开发板上WM8962的驱动编写方法。它比WM8962还要更简单一些。

The audio code you use is very close to the interface of WM8962, so you can refer to the driver writing method of WM8962 on the development board. It's simpler than WM8962.

Have a nice day!

BR,

Weidong

0 Kudos
3,306 Views
luoyaojun
Contributor II

pastedImage_1.png

pastedImage_2.png

是否需要在dtb中添加“audio-codec”的node? 因为cs4344没有外部控制引脚,所以在dtb中不知道如何添加?

以上probe可时系统能够识别cs4344 但在aplay执行后内核崩溃

0 Kudos
3,306 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi,

   Before playing files, you'd better measure MCLK sigal to check if it output from CPU, the clock should be 24MHz, if there is no output, you audio codec can't work.

weidong

0 Kudos
3,306 Views
luoyaojun
Contributor II

你好,

cs4344芯片因为没有iic或spi的配置引脚,这个芯片只是需要MCLK BCLK LRCLK DATA即可使用,wm8962是iic控制的,所以在dtb中需要添加iic codec的device,在驱动中添加codec driver。 

不知道这种情况的芯片在dtb中是否也需要添加codec 的device,类似于 :

sound{

   ...

audio-codec = <&codec>;

...

}

我想应该没必要?

另外,为了方便调试,我把codec driver和machine driver都放在imx-cs4344.c中编译,这个应该没问题,只是不符合标准。

0 Kudos
3,307 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi

  I will send a detailed document on how to port audio driver to i.MX6, check your email, please!

Br,

weidong

0 Kudos
3,306 Views
alekseysuhovey
Contributor I

Wigros Sun, please send me such the document too!

0 Kudos
3,306 Views
luoyaojun
Contributor II

另外, 驱动加载时出现:

no source widget found for playback, 这个是否可以忽略?

0 Kudos
3,306 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi yaojun,

>>Playing WAVE '1k.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay: pcm_write:1947: write error: Invalid argument

  Yes, the error should be caused by drivers. 

>>no source widget found for playback

no, you can't igore the error.  playback path consists of some widgets, the error indicates that the configuration of audio-routing node in device tree is not correct.

You will have to spend some time to understand Linux SoC ALSA driver.

ALSA driver consists of 3 parts:

-platform driver:  i.MX6 SSI side, has been supported by BSP

-codec driver:  CS4344 side, should be provide by manufacture.

-machine driver: DAI LINK. It is responsible for connetions between CPU DAI and CODEC DAI.

 Generally speaking, you should write Machine driver by yourself, for example, you write imx-cs4344.c for you application.  Then configure sound card in your device tree to load machine driver.

   According to above error messages, they are caused by machine driver and device tree.

Have a nice day!
BR,

Weidong

0 Kudos
3,306 Views
luoyaojun
Contributor II

你好,感谢你的回复,目前我已把声卡驱动成功,但是在aplay的时候出现错误,是否和驱动有关?

root@imx6qsabresd:/home# aplay -Dhw:cs4344 1k.wav
Playing WAVE '1k.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay: pcm_write:1947: write error: Invalid argument

0 Kudos