Tiny ALSA

kernel和rootfs.mk保持和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

系统起来后,同样地,先加载模块驱动:

# insmod soundcore.ko
# insmod snd.ko
# insmod snd-timer.ko
# insmod snd-pcm.ko
# insmod mi_alsa.ko

运行tinyplay播放音频:

# tinyplay /media/48k16bpsMono.wav
文档更新时间: 2021-06-04 11:36   作者:Aeeditor