ALSA
- rootfs.mk的配置
# vi project/image/configs/i2m/rootfs.mk
添加如下:
+ echo pcm.* 0:0 0660 =snd/ >> ${OUTPUTDIR}/rootfs/etc/mdev.conf
+ echo control.* 0:0 0660 =snd/ >> ${OUTPUTDIR}/rootfs/etc/mdev.conf
+ echo timer 0:0 0660 =snd/ >> ${OUTPUTDIR}/rootfs/etc/mdev.conf
+ echo '$$DEVNAME=bus/usb/([0-9]+)/([0-9]+) 0:0 0660 =bus/usb/%1/%2'>> ${OUTPUTDIR}/rootfs/etc/mdev.conf
- Kernel config配置
# cd kernel
# ARCH=arm make menuconfig
每次修改配置后,更新一下defconfig:
# cp .config ./arch/arm/configs/infinity2m_spinand_ssc011a_s01a_minigui_defconfig -f
重新编译固件:
# ./Release_to_customer.sh -f nand -p ssd201 -o 2D07
将生成:
kernel/sound/soundcore.ko
kernel/sound/core/snd.ko
kernel/sound/core/snd-timer.ko
kernel/sound/core/snd-pcm.ko
kernel/sound/core/oss/snd-pcm-oss.ko
开发板更新固件,系统起来后,将以上5个ko文件拷贝到开发板上:
- 验证
通过buildroot移植ALSA
建议在网盘中获取一下buildroot ss20x的配置make ssd20x_defconfig
,防止编译新的buildroot生成的rootfs导致之前能用的功能用不了。
# cd buildroot-2020.05/
# ARCH=arm make menuconfig
# make BR2_JLEVEL=4
将output/images/rootfs.tar替换../project/image/rootfs/rootfs.tar.gz
# mkdir ../project/image/rootfs/rootfs
# tar -xvf output/images/rootfs.tar -C ../project/image/rootfs/rootfs
# cd ../project/image/rootfs
# tar -cvf rootfs.tar.gz ./rootfs
重新编译并更新固件:
# cd ../../../
# ./Release_to_customer.sh -f nand -p ssd201 -o 2D07
把mi_ai.ko拷贝并覆盖开发板/config/modules/4.9.84/mi_ai.ko,把mi_alsa.ko拷贝到开发板根目录下:
然后重启开发板,并加载我们刚才拷贝的ko:
# insmod soundcore.ko
# insmod snd.ko
# insmod snd-timer.ko
# insmod snd-pcm.ko
# insmod mi_alsa.ko
运行alsamixer调节音量:
# alsamixer
运行aplay播放wav音频:
# aplay /media/48k16bpsMono.wav
文档更新时间: 2021-06-04 11:08 作者:Aeeditor