技术专栏
nvidia nano平台麦克风I2S调试2
1. 前言
2. 查看调试节点
3. 分析录音问题
4. I2S4编解码器主模式控件
1. 前言
承接上篇
https://www.ebaina.com/articles/140000012929
2. 查看调试节点
alsactl init tegrasnd210ref
=> “alsactl: init:1776: Cannot find soundcard ‘tegrasnd210ref’…”
arecord -D hw:tegrasnd210ref,0 -c 1 -r 44100 -f S16_LE -d 10 cap.wav
=> ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
arecord: main:788: audio open error: No such device
echo 0 | sudo tee /sys/kernel/debug/tracing/trace => 0
echo 0 | sudo tee /sys/kernel/debug/tracing/events/enable => 0
echo 1 | sudo tee /sys/kernel/debug/tracing/tracing_on => 1
echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_widget_power/enable => 1
arecord -D hw:tegrasnd210ref,0 -c 1 -r 44100 -f S16_LE -d 10 cap.wav
=> ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
arecord: main:788: audio open error: No such device
sudo cat /sys/kernel/debug/tracing/trace =>
tracer: nop
#
# entries-in-buffer/entries-written: 0/0 #P:4
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
之前声卡名字里漏掉了一个t
$ alsactl init tegrasndt210ref
$ arecord -D hw:tegrasndt210ref,0 -c 1 -r 44100 -f S16_LE -d 10 cap.wav
仍然得到了一些噪音
就像在Audacity的例子中一样
注意到录音的速度非常快——接近1秒,而不是正常的10秒
音频文件持续时间- 10秒
所以尝试通过直接测量来估计SCK频率-它在我的示波器上接近20MHz
(Samplerate FS = 44100hz)
命令
$arecord -D hw:tegrasndt210ref,0 -c 1 -r 8000 -f S16_LE -D 100 cap.wav
产生Fsck = 3.3Mhz,
其他类似:
FS=11025 => Fsck = 4.5MHz, FS=22050 => Fsck = 8.9-9Mhz
认为这不是正常值
3. 分析录音问题
如果在较短的时间内捕获10秒的音频,
那么它可能是以下两种情况之一……
Jetson I2S没有配置为master
音频没有按照预期从I2S接口路由,DMA将捕获样本
(1)对于#1,默认情况下Jetson是I2S主服务器
可以通过设备树或通过适当的混频器控制进行修改
可以通过…检查混频器控制
$ amixer -c tegrasndt210ref cget name="I2S4 Codec Master Mode"
(2)对于#2,可以通过查看输出
(现在已经纠正了soundcard的名称)
$ echo 0 | sudo tee /sys/kernel/debug/tracing/trace
$ echo 0 | sudo tee /sys/kernel/debug/tracing/events/enable
$ echo 1 | sudo tee /sys/kernel/debug/tracing/tracing_on
$ echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_widget_power/enable
$ arecord -D hw:tegrasnd210tref,0 -c 1 -r 44100 -f S16_LE -d 10 cap.wav
$ sudo cat /sys/kernel/debug/tracing/trace
测试结果如下:
desktop:~$ amixer -c tegrasndt210ref cget name="I2S4 Codec Master Mode"
amixer: Cannot find the given element from control hw:1
desktop:~$ echo 0 | sudo tee /sys/kernel/debug/tracing/trace
0
desktop:~$ echo 0 | sudo tee /sys/kernel/debug/tracing/events/enable
0
desktop:~$ echo 1 | sudo tee /sys/kernel/debug/tracing/tracing_on
1
desktop:~$ echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_widget_power/enable
1
desktop:~$ arecord -D hw:tegrasnd210tref,0 -c 1 -r 44100 -f S16_LE -d 10 cap.wav
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
arecord: main:788: audio open error: No such device
desktop:~$ sudo cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 0/0 #P:4
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
4. I2S4编解码器主模式控件
以下说明了什么?
amixer -c tegrasndt210ref controls | grep I2S4
如果看到
“I2S4编解码器主模式”控件
确保引号没有再次出现问题
如果有问题的话,可以打出。
请注意这里记录了所有I2S混频器控件以供参考
$ echo 0 | sudo tee /sys/kernel/debug/tracing/trace
$ echo 0 | sudo tee /sys/kernel/debug/tracing/events/enable
$ echo 1 | sudo tee /sys/kernel/debug/tracing/tracing_on
$ echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_widget_power/enable
$ arecord -D hw:tegrasndt210ref,0 -c 1 -r 44100 -f S16_LE -d 10 cap.wav
$ sudo cat /sys/kernel/debug/tracing/trace
结果如下
desktop:~$ amixer -c tegrasndt210ref controls | grep I2S4
numid=480,iface=MIXER,name='I2S4 BCLK Ratio'
numid=482,iface=MIXER,name='I2S4 Capture mono to stereo conv'
numid=481,iface=MIXER,name='I2S4 Capture stereo to mono conv'
numid=479,iface=MIXER,name='I2S4 Channels'
numid=474,iface=MIXER,name='I2S4 Loopback'
numid=531,iface=MIXER,name='I2S4 Mux'
numid=485,iface=MIXER,name='I2S4 Playback FIFO threshold'
numid=484,iface=MIXER,name='I2S4 Playback mono to stereo conv'
numid=483,iface=MIXER,name='I2S4 Playback stereo to mono conv'
numid=478,iface=MIXER,name='I2S4 Sample Rate'
numid=476,iface=MIXER,name='I2S4 codec bit format'
numid=618,iface=MIXER,name='I2S4 codec frame mode'
numid=619,iface=MIXER,name='I2S4 codec master mode'
numid=477,iface=MIXER,name='I2S4 fsync width'
numid=475,iface=MIXER,name='I2S4 input bit format'
desktop:~$ echo 0 | sudo tee /sys/kernel/debug/tracing/trace
[sudo] password for dim:
0
desktop:~$ echo 0 | sudo tee /sys/kernel/debug/tracing/events/enable
0
desktop:~$ echo 1 | sudo tee /sys/kernel/debug/tracing/tracing_on
1
desktop:~$ echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_widget_power/enable
1
desktop:~$ arecord -D hw:tegrasndt210ref,0 -c 1 -r 44100 -f S16_LE -d 10 cap.wav
Recording WAVE 'cap.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
desktop:~$ sudo cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 30/30 #P:4
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
arecord-8310 [003] .... 200.128923: snd_soc_dapm_widget_power: widget=Capture 1 val=1
arecord-8310 [003] .... 200.128928: snd_soc_dapm_widget_power: widget=ADMAIF1 Transmit val=1
arecord-8310 [003] .... 200.128930: snd_soc_dapm_widget_power: widget=ADMAIF1 TX val=1
arecord-8310 [003] .... 200.128931: snd_soc_dapm_widget_power: widget=ADMAIF1 Mux val=1
arecord-8310 [003] .... 200.128943: snd_soc_dapm_widget_power: widget=I2S4 RX val=1
arecord-8310 [003] .... 200.128945: snd_soc_dapm_widget_power: widget=I2S4 Receive val=1
arecord-8310 [003] .... 200.128946: snd_soc_dapm_widget_power: widget=I2S4 CIF Transmit-I2S4 Receive val=1
arecord-8310 [003] .... 200.128947: snd_soc_dapm_widget_power: widget=I2S4 CIF Transmit val=1
arecord-8310 [003] .... 200.128948: snd_soc_dapm_widget_power: widget=I2S4 CIF TX val=1
arecord-8310 [003] .... 200.128950: snd_soc_dapm_widget_power: widget=I2S4 DAP RX val=1
arecord-8310 [003] .... 200.128951: snd_soc_dapm_widget_power: widget=I2S4 DAP Receive val=1
arecord-8310 [003] .... 200.128952: snd_soc_dapm_widget_power: widget=x Capture-I2S4 DAP Receive val=1
arecord-8310 [003] .... 200.128954: snd_soc_dapm_widget_power: widget=x Capture val=1
arecord-8310 [003] .... 200.128955: snd_soc_dapm_widget_power: widget=x IN val=1
arecord-8310 [003] .... 200.128956: snd_soc_dapm_widget_power: widget=x Mic val=1
arecord-8310 [000] .... 200.557074: snd_soc_dapm_widget_power: widget=Capture 1 val=0
arecord-8310 [000] .... 200.557107: snd_soc_dapm_widget_power: widget=ADMAIF1 Transmit val=0
arecord-8310 [000] .... 200.557121: snd_soc_dapm_widget_power: widget=ADMAIF1 TX val=0
arecord-8310 [000] .... 200.557134: snd_soc_dapm_widget_power: widget=ADMAIF1 Mux val=0
arecord-8310 [000] .... 200.557187: snd_soc_dapm_widget_power: widget=I2S4 RX val=0
arecord-8310 [000] .... 200.557204: snd_soc_dapm_widget_power: widget=I2S4 Receive val=0
arecord-8310 [000] .... 200.557217: snd_soc_dapm_widget_power: widget=I2S4 CIF Transmit-I2S4 Receive val=0
arecord-8310 [000] .... 200.557230: snd_soc_dapm_widget_power: widget=I2S4 CIF Transmit val=0
arecord-8310 [000] .... 200.557242: snd_soc_dapm_widget_power: widget=I2S4 CIF TX val=0
arecord-8310 [000] .... 200.557253: snd_soc_dapm_widget_power: widget=I2S4 DAP RX val=0
arecord-8310 [000] .... 200.557265: snd_soc_dapm_widget_power: widget=I2S4 DAP Receive val=0
arecord-8310 [000] .... 200.557277: snd_soc_dapm_widget_power: widget=x Capture-I2S4 DAP Receive val=0
arecord-8310 [000] .... 200.557289: snd_soc_dapm_widget_power: widget=x Capture val=0
arecord-8310 [000] .... 200.557301: snd_soc_dapm_widget_power: widget=x IN val=0
arecord-8310 [000] .... 200.557311: snd_soc_dapm_widget_power: widget=x Mic val=0
声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
红包
94
收藏
评论
打赏
- 分享
- 举报
评论
0个
手气红包
暂无数据
相关专栏
-
浏览量:5327次2021-08-05 13:59:50
-
浏览量:7223次2021-08-04 17:14:53
-
浏览量:3502次2018-02-06 10:43:46
-
浏览量:4651次2021-08-04 11:20:41
-
2021-07-30 17:20:54
-
浏览量:3171次2020-09-28 17:17:18
-
浏览量:10606次2021-03-03 17:39:18
-
浏览量:10848次2021-05-06 16:22:01
-
浏览量:2439次2020-04-07 10:45:25
-
浏览量:1424次2019-10-11 10:24:44
-
浏览量:7084次2021-05-20 16:37:42
-
浏览量:5380次2021-08-04 11:09:42
-
浏览量:1930次2019-11-12 09:52:00
-
2021-07-30 17:04:37
-
浏览量:2559次2020-07-01 11:05:54
-
2020-08-05 20:23:18
-
浏览量:3859次2020-09-30 18:07:29
-
浏览量:7147次2021-07-29 14:18:58
-
浏览量:6728次2021-06-17 15:14:12
切换马甲
上一页
下一页
打赏用户
共 1 位
我要创作
分享技术经验,可获取创作收益
分类专栏
-
178篇
热门专栏
- NVIDIA GPU让Adobe Creative Cloud效率大幅提升
- nvidia xavier nx平台SPI接口调试记录
- nvidia xavier nx平台GStreamer pipeline挂起问题调试1
- 【全新玩法】使用NVIDIA SHIELD玩笔记本里面的游戏大作
- Nfan专属盛宴!GAME 24英伟达游戏节精彩回顾
- Xavier-Nx模块上使GPIO7和GPIO14为PWM8和PWM7
- 看皮克斯如何利用NVIDIA GPU来为艺术家提供施展本领的空间
- NVIDIA官方文字冒险游戏《Ultimate Quest》上线
- 让战斗更爽快!《泰坦天降:远征》全新地图预览
- 50亿美元!国内互联网大厂抢购英伟达芯片
置顶时间设置
结束时间
删除原因
-
广告/SPAM
-
恶意灌水
-
违规内容
-
文不对题
-
重复发帖
打赏作者
free-jdx
您的支持将鼓励我继续创作!
打赏金额:
¥1
¥5
¥10
¥50
¥100
支付方式:
微信支付
打赏成功!
感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
审核成功
发布时间设置
发布时间:
请选择发布时间设置
是否关联周任务-专栏模块
审核失败
失败原因
请选择失败原因
备注
请输入备注