(一)移植UDA1341声卡驱动
1)# gedit arch/arm/mach-s3c2440/mach-mini2440.c 加入以下的内容:
#include
#include
struct s3c24xx_uda134x_platform_data s3c24xx_uda134x_data = {
.l3_clk = S3C2410_GPB(4),
.l3_data = S3C2410_GPB(3),
.l3_mode = S3C2410_GPB(2),
.model = UDA134X_UDA1341,
};
static struct platform_device s3c_device_uda134x = {
.name = "s3c24xx_uda134x",
.dev = { .platform_data = &s3c24xx_uda134x_data, }
};
static struct platform_device *smdk2440_device[] __initdata = {
&s3c_device_usb,
&s3c_device_lcd,
&s3c_device_wdt,
&s3c_device_i2c0,
&s3c_device_iis,
&s3c_device_rtc,
&s3c_device_dm9000,
&s3c_device_uda134x, //加上这一句
};
2) # make menuconfig 选上以下几项:
Device Drivers --->
<*> Sound card support --->
--- Sound card support
<*> Advanced Linux Sound Architecture --->
--- Advanced Linux Sound Architecture
<*> OSS Mixer API
<*> OSS PCM (digital audio) API
[*] Verbose procfs contents
<*> ALSA for SoC audio support --->
--- ALSA for SoC audio support
<*> SoC Audio for the Samsung S3CXXXX chips
<*> SoC I2S Audio support UDA134X wired to a S3C24XX 3)
# make zImage
二)移植madplay 参考链接:http://hi.baidu.com/whs08/blog/item/00b0618f414a79f7503d920d.html 移植
madplay 所需要的关键的四个文件,这些去各自官网下就行了:
madplay-0.15.2b.tar.gz libmad-0.15.1b.tar.gz libid3tag-0.15.1b.tar.gz zlib 脚本:
#!/bin/sh
MADPLAY_DIR=/root/mini2440/codes/madplay
TARGET_DIR=$MADPLAY_DIR/target-arm mkdir $TARGET_DIR cd $MADPLAY_DIR tar xvzf ../libid3tag-0.15.1b.tar.gz tar xvzf ../libmad-0.15.1b.tar.gz tar xvzf ../madplay-0.15.2b.tar.gz tar xvzf ../zlib-1.2.5.tar.gz export CC=arm-linux-gcc cd zlib-1.2.5 ./configure --prefix=$TARGET_DIR make && make install cd .. cd libid3tag-0.15.1b ./configure --host=arm-linux --prefix=$TARGET_DIR CPPFLAGS=-I$TARGET_DIR/include LDFLAGS=-L$TARGET_DIR/lib make;make install cd .. cd libmad-0.15.1b ./configure --host=arm-linux --prefix=$TARGET_DIR make;make install cd .. cd madplay-0.15.2b ./configure --host=arm-linux --prefix=$TARGET_DIR CPPFLAGS=-I$TARGET_DIR/include LDFLAGS=-L$TARGET_DIR/lib make;make install cd .. 将执行文件:mymadplay 放在开发板的 /usr/bin/目录库文件:libid3tag.a libid3tag.la libid3tag.so libid3tag.so.0 libid3tag.so.0.3.0 libmad.a libmad.la libmad.so libmad.so.0 libmad.so.0.2.1 libz.a 放在/usr/lib目录上
(三)问题照以上的配置方法应该没有错误,可能第一次会提示说”output: ioctl(SNDCTL_DSP_SYNC): Inappropriate ioctl for device”,虽然找不到ioctl函数,但是应该内核里早已实现了,也会提示“audio: /dev/dsp: No such file or directory”,只要先在根文件系统中mknod /dev/dsp c 14 3 ,然后再重新烧写内核,多试几次就行了。 madplay是基于以前的oss建构的,所以在内核配置时要选上 <*>OSS Mixer API <*>OSS PCM (digital audio) API 美妙的“heaven days”,哈哈