2010年3月14日 星期日

Madplay Music Player

Madplay Music Player

The madplay is a mp3 player, it is a command line music player without any fancy user front-end, but serve the purpose if we want an easy way to install and test our machine to listen on music.

First download a copy of libmad and libid3tag which is a dependant libraries for mpeg decoding and song's idtag access require by madplay.

unzip the file and configure the libmad, then install it into a temporary install directory.

./configure --host=arm-linux --prefix=/usr --sysconfdir=/etc --libdir=/lib --datadir=/usr/share LDFLAGS="-L/rootfs/lib" CPPFLAGS="-I/rootfs/usr/include"
make
make install DESTDIR=/install/libmad



Note, if there's a -fforce-mem compile error, just remove the CFLAGS option from the Makefile.

Two directories are created lib and usr, copy all the files from the lib directory and usr include header files to our corresponding root filesystem layout.

Now, configure and compile the libid3tag.

./configure --host=arm-linux --prefix=/usr --sysconfdir=/etc --libdir=/lib --datadir=/usr/share LDFLAGS="-L/rootfs/lib" CPPFLAGS="-I/rootfs/usr/include"
make
make install DESTDIR=/install/libid3tag



Two directories also created lib and usr.

Similarly, copy all the files from the lib directory and usr include header files to our corresponding root filesystem layout.

Configure and compile madplay.

./configure --host=arm-linux --prefix=/usr --sysconfdir=/etc --libdir=/lib --datadir=/usr/share LDFLAGS="-L/rootfs/lib" CPPFLAGS="-I/rootfs/usr/include"
make
make install DESTDIR=/install/madplay


Only usr directory is created, copy the 'madplay' bin file in usr/bin directory to our root filesystem bin directory.

Also copy a mp3 music files over.

Restart the board to test the program.

madplay music.mp3

For the Mini2440 i need a audio jack and a speaker to plug into the device in order to listen to the music.

Note, if no music coming out from the player then the kernel may not configure with the correct sound module properly.

Go to the kernel directory and start the menuconfig screen.

ARCH=arm make menuconfig

Need to configure the UDA1341 chipset which Mini2440 is equip with to enable the sound support.

Go to Device Drivers --> Sound card support --> Advance Linux Sound Architecture --> ALSO for SoC Audio support --> Select the UDA134X audio support.


--- ALSA for SoC audio support
<*> SoC Audio for the Samsung S3CXXXX chips
< > SoC AC97 Audio support for LN2440SBC - ALC650
<*> SoC I2S Audio support UDA134X wired to a S3C24XX
< > SoC I2S Audio support for TLV320AIC23 on Simtec boards
< > SoC I2S Audio support for Simtec Hermes board
< > Build all ASoC CODEC drivers


Once finished, compile the kernel and there should be a dsp and mixer device files create in the dev directory.

沒有留言:

張貼留言