[Software build]
1: Download the alsa-lib-1.0.25 and alsa-utils-1.0.25:
http://pan.baidu.com/share/link?shareid=253494&uk=822921326
2: create the following DIR structure for build environment:
$ls -l
total 4168
drwxr-xr-x 11 eric eric 4096 2013-01-14 15:45 alsa-lib-1.0.25
-rw-r--r-- 1 eric eric 838403 2012-11-14 15:48 alsa-lib-1.0.25.tar.bz2
drwxr-xr-x 3 eric eric 4096 2013-01-14 15:46 alsa-lib-out
drwxr-xr-x 17 eric eric 4096 2013-01-14 15:47 alsa-utils-1.0.25
-rw-r--r-- 1 eric eric 1132780 2012-11-14 15:49 alsa-utils-1.0.25.tar.bz2
drwxr-xr-x 5 eric eric 4096 2013-01-14 15:48 alsa-utils-out
alsa-lib-out, alsa-utils-out is for build out files
3: compile the alsa-lib-1.0.25:
CC=/home/eric/work/cross-compiler/crosstool-ng-1.15.3/out/bin/arm-unknown-linux-gnueabi-gcc ./configure --target=arm-linux --host=arm-linux
make install DESTDIR=/home/eric/work/alsa/alsa-lib-out
cp -ar alsa-lib-out/* $DST_ROOT
4: compile the alsa-utils-1.0.25:
CC=/home/eric/work/cross-compiler/crosstool-ng-1.15.3/out/bin/arm-unknown-linux-gnueabi-gcc ./configure --host=arm-linux --target=arm-linux --disable-alsamixer --disable-xmlto --with-alsa-prefix=/home/eric/work/alsa/alsa-lib-out/usr/lib --with-alsa-inc-prefix=/home/eric/work/alsa/alsa-lib-out/usr/include
make install DESTDIR=/home/eric/work/alsa/alsa-utils-out
cp -ar alsa-utils-out/* $DST_ROOT
5: make device links in rc.local (may need)
/bin/mkdir /dev/snd
/bin/ln -s /dev/pcmC0D0c /dev/snd/pcmC0D0c
/bin/ln -s /dev/pcmC0D0p /dev/snd/pcmC0D0p
/bin/ln -s /dev/controlC0 /dev/snd/controlC0
/bin/ln -s /dev/pcmC1D0c /dev/snd/pcmC1D0c
/bin/ln -s /dev/pcmC1D0p /dev/snd/pcmC1D0p
/bin/ln -s /dev/controlC1 /dev/snd/controlC1
/bin/ln -s /dev/seq /dev/snd/seq
/bin/ln -s /dev/timer /dev/snd/timer
6: make sure librt is in the /lib directory
7: create the alsa configure
cat etc/asound.conf
pcm.!default {
type hw
card 0
}
ctl.!default {
type hw
card 0
}
[Software build]
1: use speaker-test
speaker-test -c 2
2: use aplay
aplay xxx.wave
Note that the wav file should be stereo