一、s3c2410移植ALSA及相关工具使用
相关源码文件
ncurses-5.6.tar.gz
alsa-lib-1.0.17.tar.bz2
alsa-utils-1.0.17.tar.bz2
1. 设置环境变量
export MEDIA_INSTALL_DIR=/home/linux/driver/mplay/media_install
2. 编译ncurses
tar zxvf ncurses-5.6.tar.gz
cd ncurses-5.6
./configure --host=arm-linux --target=arm-linux --build=i686-linux --with-softfloat --prefix=/usr --without-ada CC=/opt/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin/arm-softfloat-linux-gnu-gcc
make
make install DESTDIR=$MEDIA_INSTALL_DIR
2. 编译alsa-lib
tar jxvf alsa-lib-1.0.17.tar.bz2
cd alsa-lib-1.0.17
./configure --host=arm-linux --target=arm-linux --build=i686-linux --with-softfloat --prefix=/usr --disable-python CC=/opt/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin/arm-softfloat-linux-gnu-gcc
修改Makefile,删除掉aserver和alsalisp所有部分(各2处 );因为运行configure设置了--with-softfloat ,不然会出错。
make
make install DESTDIR=$MEDIA_INSTALL_DIR
3.编译alsa-util
tar jxvf alsa-utils-1.0.17.tar.bz2
cd alsa-utils-1.0.17
./configure --host=arm-linux --target=arm-linux --build=i686-linux --with-softfloat --prefix=/usr --with-alsa-prefix=$MEDIA_INSTALL_DIR/usr/lib --with-alsa-inc-prefix=$MEDIA_INSTALL_DIR/usr/include CC=/opt/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin/arm-softfloat-linux-gnu-gcc
make
make install DESTDIR=$MEDIA_INSTALL_DIR
4.相关工具使用
(1)
由于alsa util工具访问音频alsa设备目录在/dev/snd下,可先创建一个脚本:create_snd_dev.sh
mkdir /dev/snd
ln -s /dev/controlC0 /dev/snd/controlC0
ln -s /dev/pcmC0D0c /dev/snd/pcmC0D0c
ln -s /dev/pcmC0D0p /dev/snd/pcmC0D0p
ln -s /dev/mixer /dev/snd/mixer
ln -s /dev/timer /dev/snd/timer
(2) 使用aplay直接播放wav文件
./aplay xxx.wav
二、s3c2410上mp3库及madplay移植
相关源码文件
zlib-1.2.3.tar.gz
libid3tag-0.15.1b.tar.gz
libmad-0.15.1b.tar.gz
madplay-0.15.2b.tar.gz
1.编译zlib-1.2.3
tar zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure --prefix=/home/linux/driver/mplay/media_install/usr
修改Makefile
CC=/opt/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin/arm-softfloat-linux-gnu-gcc
AR=/opt/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin/arm-softfloat-linux-gnu-ar rc
RANLIB=/opt/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin/arm-softfloat-linux-gnu-ranlib
make
make install
2. 编译libid3tag
tar zxvf libid3tag-0.15.1b.tar.gz
cd libid3tag-0.15.1b
./configure --prefix=/home/linux/driver/mplay/media_install/usr --host=arm-linux --disable-debugging CC=/opt/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin/arm-softfloat-linux-gnu-gcc CPPFLAGS="-I/home/linux/driver/mplay/media_install/usr/include" LDFLAGS="-L/home/linux/driver/mplay/media_install/usr/lib"
make
make install
3. 编译libmad
tar zxvf libmad-0.15.1b.tar.gz
cd libmad-0.15.1b
./configure --prefix=/home/linux/driver/mplay/media_install/usr --host=arm-linux --disable-debugging CC=/opt/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin/arm-softfloat-linux-gnu-gcc CPPFLAGS="-I/home/linux/driver/mplay/media_install/usr/include" LDFLAGS="-L/home/linux/driver/mplay/media_install/usr/lib"
make
出现:cc1: error: unrecognized command line option "-fforce-mem"
修改Makefile
在Makefile中找到包含"fforce-mem"字符串,将其删除即可;原因:gcc3.4或更高版本中,已将将该选项去除了。
再重新make即可
make install
4. 编译madplay
tar zxvf madplay-0.15.2b.tar.gz
cd madplay-0.15.2b
./configure --prefix=/home/linux/driver/mplay/media_install/usr --host=arm-linux --disable-debugging --with-alsa CC=/opt/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin/arm-softfloat-linux-gnu-gcc CPPFLAGS="-I/home/linux/driver/mplay/media_install/usr/include" LDFLAGS="-L/home/linux/driver/mplay/media_install/usr/lib"
make
编译出错:
/opt/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin/arm-softfloat-linux-gnu-gcc -Wall -O2 -fomit-frame-pointer -o madplay madplay.o getopt.o getopt1.o version.o resample.o filter.o tag.o crc.o rgain.o player.o audio.o audio_aiff.o audio_cdda.o audio_hex.o audio_null.o audio_raw.o audio_snd.o audio_wave.o audio_alsa.o -L/media/LinuxWorks/p760/multimedia/myworks/media_install/usr/lib /usr/lib/libasound.so -ldl -lpthread -lrt /media/LinuxWorks/p760/multimedia/myworks/media_install/usr/lib/libmad.so /media/LinuxWorks/p760/multimedia/myworks/media_install/usr/lib/libid3tag.so -lz -lm -Wl,--rpath -Wl,/media/LinuxWorks/p760/multimedia/myworks/media_install/usr/lib -Wl,--rpath -Wl,/media/LinuxWorks/p760/multimedia/myworks/media_install/usr/lib
直接修改最后一步:
/opt/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin/arm-softfloat-linux-gnu-gcc -Wall -O2 -fomit-frame-pointer -o madplay madplay.o getopt.o getopt1.o version.o resample.o filter.o tag.o crc.o rgain.o player.o audio.o audio_aiff.o audio_cdda.o audio_hex.o audio_null.o audio_raw.o audio_snd.o audio_wave.o audio_alsa.o -L/media/LinuxWorks/p760/multimedia/myworks/media_install/usr/lib /media/LinuxWorks/p760/multimedia/myworks/media_install/usr/lib/libasound.so -ldl -lpthread -lrt /media/LinuxWorks/p760/multimedia/myworks/media_install/usr/lib/libmad.so /media/LinuxWorks/p760/multimedia/myworks/media_install/usr/lib/libid3tag.so -lz -lm -Wl,--rpath -Wl,/media/LinuxWorks/p760/multimedia/myworks/media_install/usr/lib -Wl,--rpath -Wl,/media/LinuxWorks/p760/multimedia/myworks/media_install/usr/lib
make install
5.相关工具使用
./madplay tears.mp3
三、MPlayer在s3c2410上移植(软解码)
tar jxvf MPlayer-1.0rc2.tar.bz2
cd MPlayer-1.0rc2
./configure --cc=/opt/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin/arm-softfloat-linux-gnu-gcc --host-cc=gcc --target=armv4l-linux --prefix=/home/linux/driver/mplay/media_install/usr --disable-w32threads --disable-dvdread --disable-mencoder --disable-live --disable-mp3lib --disable-tv --disable-tv-v4l1 --disable-tv-v4l2 --disable-tv-bsdbt848 --disable-radio-v4l2 --disable-dvdnav --disable-cdparanoia --disable-bitmap-font --disable-ftp --disable-vstream --disable-ass --disable-network --enable-xv --enable-mad --enable-alsa --with-extraincdir=/home/linux/driver/mplay/media_install/usr/include --with-extralibdir=/home/linux/driver/mplay/media_install/usr/lib
make
在目录中就会生成mplayer可执行文件
mplayer软件对mpeg4解码还比较流畅;但H264的格式解码性能不够,音视频会不同步。
mplayer tears.mp3 //可以播放mp3文件
mplayer HarryPotter.avi //MPEG4格式480 x 272格式
上一篇:ARM异常处理总结
下一篇:S3C2440上移植Qt输入法
推荐阅读最新更新时间:2024-11-10 21:54