OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 715|回复: 0

学习ALSA时,使用arecord通过板载MIC录制没有声音

[复制链接]

1

主题

1

帖子

0

精华

初级会员

Rank: 2

积分
67
金钱
67
注册时间
2023-10-30
在线时间
7 小时
发表于 2023-10-30 21:40:31 | 显示全部楼层 |阅读模式
1金钱
最近在学习音频应用,自己已经移植了alsa-lib和alsa-utils,使用aplay可以播放音乐,使用arecord可以通过板子上的line-in接口录制电脑传来的声音,但是却没法通过板载的MIC录制声音。
声卡的设置是使用《【正点原子】I.MX6U嵌入式Linux驱动开发指南V1.81》里第六十五章示例代码 65.5.3.1 mic_in_config.sh 脚本的内容
  1. 1  #!/bin/sh
  2. 2  #正点原子[url=home.php?mod=space&uid=5358]@alientek[/url]
  3. 3  #设置捕获的音量
  4. 4  amixer cset name='Capture Volume' 90,90
  5. 5   
  6. 6  #PCM
  7. 7  amixer sset 'PCM Playback' on
  8. 8  amixer sset 'Playback' 256
  9. 9  amixer sset 'Right Output Mixer PCM' on
  10. 10 amixer sset 'Left Output Mixer PCM' on
  11. 11  
  12. 12 #ADC PCM
  13. 13 amixer sset 'ADC PCM' 200
  14. 14  
  15. 15 #耳机/喇叭(扬声器)设置播放音量,直流/交流
  16. 16 #Turn on Headphone
  17. 17 amixer sset 'Headphone Playback ZC' on
  18. 18 #Set the volume of your headphones(98% volume,127 is the MaxVolume)
  19. 19 amixer sset Headphone 125,125
  20. 20 #Turn on the speaker
  21. 21 amixer sset 'Speaker Playback ZC' on
  22. 22 #Set the volume of your Speaker(98% volume,127 is the MaxVolume)
  23. 23 amixer sset Speaker 125,125
  24. 24 #Set the volume of your Speaker AC(80% volume,100 is the MaxVolume)
  25. 25 amixer sset 'Speaker AC' 4
  26. 26 #Set the volume of your Speaker AC(80% volume,5 is the MaxVolume)
  27. 27 amixer sset 'Speaker DC' 4
  28. 28  
  29. 29 #音频输入,左声道管理
  30. 30 #Turn on Left Input Mixer Boost
  31. 31 amixer sset 'Left Input Mixer Boost' off
  32. 32 amixer sset 'Left Boost Mixer LINPUT1' off
  33. 33 amixer sset 'Left Input Boost Mixer LINPUT1' 0
  34. 34 amixer sset 'Left Boost Mixer LINPUT2' off
  35. 35 amixer sset 'Left Input Boost Mixer LINPUT2' 0
  36. 36 #Turn off Left Boost Mixer LINPUT3
  37. 37 amixer sset 'Left Boost Mixer LINPUT3' off
  38. 38 amixer sset 'Left Input Boost Mixer LINPUT3' 0
  39. 39  
  40. 40 #音频输入,右声道管理,全部关闭
  41. 41 #Turn on Right Input Mixer Boost
  42. 42 amixer sset 'Right Input Mixer Boost' on
  43. 43 amixer sset 'Right Boost Mixer RINPUT1' off
  44. 44 amixer sset 'Right Input Boost Mixer RINPUT2' 0
  45. 45 amixer sset 'Right Boost Mixer RINPUT2' on
  46. 46 amixer sset 'Right Input Boost Mixer RINPUT2' 127
  47. 47 amixer sset 'Right Boost Mixer RINPUT3' off
  48. 48 amixer sset 'Right Input Boost Mixer RINPUT3' 0
复制代码
使用该脚本设置声卡后录制出来的声音是空白的,没有任何声音。请教论坛里的各位,帮忙分析下是什么原因?
同时自己有个疑惑也一起请教一下:
该脚本里把左声道输入全部关闭了,只开启了右声道输入,而且是RINPUT2,但是电路图中板载的MIC不是接到LINPUT1和LINPUT2吗?脚本为什么这么设置呢?





微信截图_20231030130518.png
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2024-5-29 15:57

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表