4.荔枝派 zero(全志V3S)-开启alsa,测试codec

荔枝派 专栏收录该内容
14 篇文章 9 订阅

上面是我的微信和QQ群,欢迎新朋友的加入。

1.buildroot配置

按照如上配置,重新编译文件系统,拷贝到设备

2.测试

查看设备

# arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: Codec [V3s Audio Codec], device 0: CDC PCM Codec-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
# 

调节音量

alsamixer

 

录音

​​​​​​​amixer -c 0 cset numid=12 2         使能mic1
arecord -D hw:0,0 -d 3 -f S16_LE -r 16000 tmp.wav   录音测试

播放

amixer -c 0 sset 'Headphone',0 100% unmute
speaker-test -twav -c2
atest
aplay  tmp.wav

3.杀死进程

测试过程中发现有时候驱动正忙,不能继续使用

Playback open error: -16,Device or resource busy

这个时候需要杀死进程

# ps aux
PID   USER     COMMAND
    1 root     init
    2 root     [kthreadd]
    3 root     [kworker/0:0]
    4 root     [kworker/0:0H]
    5 root     [kworker/u2:0]
    6 root     [ksoftirqd/0]
    7 root     [rcu_sched]
    8 root     [rcu_bh]
    9 root     [migration/0]
   10 root     [lru-add-drain]
   11 root     [cpuhp/0]
   12 root     [kdevtmpfs]
   13 root     [netns]
   14 root     [oom_reaper]
   15 root     [writeback]
   16 root     [kcompactd0]
   17 root     [crypto]
   18 root     [bioset]
   19 root     [kblockd]
   20 root     [cfg80211]
   22 root     [watchdogd]
   23 root     [rpciod]
   24 root     [xprtiod]
   25 root     [kswapd0]
   26 root     [vmstat]
   27 root     [bioset]
   28 root     [nfsiod]
   53 root     [irq/23-sunxi-mm]
   54 root     [irq/24-sunxi-mm]
   55 root     [bioset]
   56 root     [mmcqd/0]
   57 root     [kworker/0:2]
   58 root     [kworker/u2:1]
   61 root     [kworker/0:1H]
   62 root     [jbd2/mmcblk0p2-]
   63 root     [ext4-rsv-conver]
   75 root     /sbin/syslogd -n
   78 root     /sbin/klogd -n
   95 root     -sh
  118 root     speaker-test -twav -c2
  120 root     ps aux
#

首先查看正在运行的后台程序,codec的pid是118

# kill -9 118
# ps aux
PID   USER     COMMAND
    1 root     init
    2 root     [kthreadd]
    3 root     [kworker/0:0]
    4 root     [kworker/0:0H]
    5 root     [kworker/u2:0]
    6 root     [ksoftirqd/0]
    7 root     [rcu_sched]
    8 root     [rcu_bh]
    9 root     [migration/0]
   10 root     [lru-add-drain]
   11 root     [cpuhp/0]
   12 root     [kdevtmpfs]
   13 root     [netns]
   14 root     [oom_reaper]
   15 root     [writeback]
   16 root     [kcompactd0]
   17 root     [crypto]
   18 root     [bioset]
   19 root     [kblockd]
   20 root     [cfg80211]
   22 root     [watchdogd]
   23 root     [rpciod]
   24 root     [xprtiod]
   25 root     [kswapd0]
   26 root     [vmstat]
   27 root     [bioset]
   28 root     [nfsiod]
   53 root     [irq/23-sunxi-mm]
   54 root     [irq/24-sunxi-mm]
   55 root     [bioset]
   56 root     [mmcqd/0]
   57 root     [kworker/0:2]
   58 root     [kworker/u2:1]
   61 root     [kworker/0:1H]
   62 root     [jbd2/mmcblk0p2-]
   63 root     [ext4-rsv-conver]
   75 root     /sbin/syslogd -n
   78 root     /sbin/klogd -n
   95 root     -sh
  121 root     ps aux
[1]+  Killed                     speaker-test -twav -c2
# 

已杀死,现在可以正常使用

下面是KILL的等级

  • 2
    点赞
  • 3
    评论
  • 8
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值