How to port the new audio driver to imax8mm Android hal?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to port the new audio driver to imax8mm Android hal?

1,203 次查看
CheLL
Contributor III

Hello  Everyone:

Currently, the codec and Platform porting on Linux has been ported according to wm8524. Codec is the new aw8838, how to add it to the hal layer of Android code, the driving method is Kconfig.

Android platform is Android9

Related to the hal layer seems to be the following file:

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


imax8_workspace/imax8_code/android_build/vendor/nxp-opensource/imx/alsa$ ls
Android.mk config_ak5558.h config_micfil.h config_sgtl5000.h config_wm8524.h config_xtor.h pcm_ext.c
audio_hardware.h config_cdnhdmi.h config_nullcard.h config_sii902x.h config_wm8958.h config_xtor_pico.h pcm_ext.h
config_ak4458.h config_cs42888.h config_rpmsg.h config_spdif.h config_wm8960.h control.c tinyalsa_hal.c
config_ak4497.h config_hdmi.h config_rt5645.h config_usbaudio.h config_wm8962.h control.h
---------------------------------------

How to modify tinyplay_hal.c?

Hope your answers

Bset wishs

0 项奖励
回复
1 回复

1,192 次查看
weidong_sun
NXP TechSupport
NXP TechSupport

Hi CheLL,

   对于android 9 BSP,audio Hal 层在 ~/android_build/vendor/nxp-opensource/imx/alsa中,你可以看到这里所有的声卡结构:

1. 每个声卡都有一个config_xxx.h文件,wm8524是config_wm8524.h文件。

那么对你的codec aw8838,应该也要创建一个config_aw8838.h文件,文件内容参考config_wm8524.h文件内容。

(前提是:你的aw8838 codec的输入输入方式与wm8524类似,比如wm8524只有三线,Bitclk / LRCLK / SDIN,只能播放,不能录音)

2. 在tinyalsa_hal.c中,把你的声卡加入进去

(1)#include "config_aw8838.h"

(2)struct audio_card *audio_card_list = { ......}

类似这样:

struct audio_card *audio_card_list[SUPPORT_CARD_NUM] = {
&wm8958_card,
&wm8962_card,
&hdmi_card,
/* &usbaudio_card, */
&spdif_card,
&cs42888_card,
&wm8960_card,
&wm8750_card,
&sii902x_card,
&rpmsg_card,
&wm8524_card,

&aw8838_card,
&cdnhdmi_card,
&xtor_card,
&ak4458_card,
&ak5558_card,
&ak4497_card,
&sgtl5000_card,
&xtor_pico_card,
&rt5645_card,
&micfil_card,
&null_card,
};

大体上需要上面的步骤,更多的一些细节,请注意查看代码,边调试边修改代码即可。

 

Have a nice day!

B.R,

Weidong

0 项奖励
回复