a.编译zlib
cd ~/MP3/src_source
tar zxvf zlib-1.2.3.tar.gz -C ./
./configure --prefix=/home/linyn/MP3/src_target
vim Makefile
修改和增加:
AR=arm-poky-linux-gnueabi-ar rcs
CFLAGS += -fPIC
保存
make
make install
b.编译libid3tag
cd ~/MP3/src_source
tar zxvf libid3tag-0.15.1b.tar.gz -C ./
cd libid3tag-0.15.1b/
./configure --host=arm-poky-linux-gnueabi --prefix=/home/linyn/MP3/src_target/ --disable-debugging --enable-static CPPFLAGS=-I/home/linyn/MP3/src_target/include LDFLAGS=-L/home/linyn/MP3/src_target/lib
make
make install
c.编译libmad
cd ~/MP3/src_source
tar zxvf libmad-0.15.1b.tar.gz -C ./
cd libmad-0.15.1b/
./configure --host=arm-poky-linux-gnueabi --prefix=/home/linyn/MP3/src_target/ --disable-debugging --enable-static CPPFLAGS=-I/home/linyn/MP3/src_target/include LDFLAGS=-L/home/linyn/MP3/src_target/lib
vim Makefile
删掉全部-fforce-mem
保存
make
make install
d.编译madplay
cd ~/MP3/src_source
tar zxvf madplay-0.15.2b.tar.gz -C ./
cd madplay-0.15.2b/
./configure --host=arm-poky-linux-gnueabi --prefix=/home/linyn/MP3/src_target/ --disable-debugging --enable-static CPPFLAGS=-I/home/linyn/MP3/src_target/include LDFLAGS=-L/home/linyn/MP3/src_target/lib
make
make install
e.打包应用
cd home/linyn/MP3/src_target/
tar jcvf ../madplay.tar.bz2 *
3.测试
启动板子,传送到板子上,解压
tar jxvf madplay.tar.bz2 -C /usr/
自己网上下载一个123.mp3,传送到板子上,播放mp3文件,如
madplay 123.mp3
注意:使用madplay需要配置/dev/dsp的驱动
同时需要修改一下
vim sound/soc/codecs/wm8960.c
vim sound/soc/soc-pcm.c