主机平台: UBUNTU16.04
硬件平台:明远智睿MYZR-IMX8M-EVK
内核版本 :linux-4.14.98
交叉编译链:aarch64-linux-gnu
文件系统:my_rootfs=fsl-image-validation-myimx8m
下载: 我下载的为: alsa-lib-1.2.2.tar.bz2 alsa-utils-1.2.2.tar.bz2
source 交叉工具链 $ source /home/jj/my-work/03_toolchain/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.env
解压: $ cd ~/my-work/transplant/alsa $ tar xjvf alsa-lib-1.2.2.tar.bz2 $ tar xjvf alsa-lib-1.2.2.tar.bz2 $ mkdir alsa-lib $ mkdir alsa-utils
编译安装 alsa-lib $ cd alsa-lib-1.2.2/ $ ./configure --host=aarch64-linux-gnu --prefix=/home/jj/my-work/transplant/alsa/alsa64/alsa-lib --enable-shared --disable-python $ make $ make install
编译安装alsa-utils $ cd ../alsa-utils-1.2.2/ $ ./configure --host=aarch64-linux-gnu --disable-alsamix er --disable-xmlto CPPFLAGS=-I/home/jj/my-work/transplant/alsa/alsa64/alsa-lib/include LDFLAGS=-L/home/jj/my-work/transplant/alsa/alsa64/alsa-lib/lib --prefix=/home/jj/my-work/transplant/alsa/alsa64/alsa-utils $ make $ sudo make install
编写安装脚本 cd ../.. vim alsainstall.sh #!/bin/sh cp ./alsa-lib/lib/* /usr/lib/ -r cp ./alsa-utils/bin/* /usr/bin/ -r cp ./alsa-utils/sbin/* /usr/bin/ -r
chmod +x alsainstall.sh
tar cjvf alsa64-install.tar.bz2 alsa64 生成alsa64-install.tar.bz2,并且将其下载到imx8mevk开发板中 解压,并且执行脚本./alsainstall.sh
测试: 开机后vi /etc/profile在最后一行增加:
export ALSA_CONFIG_PATH=/usr/share/alsa/alsa.conf
使用耳机插入开发板接口,执行: # aplay ~/alsa-utils/share/sounds/alsa/Front_Center.wav 能够正常听到wav文件的声音,则测试成功 |