nvidia nano平台麦克风I2S调试1

free-jdx 2021-08-04 17:14:53 7222

1. 前言

尝试在Jetson Nano上使用I2S麦克风(inmp441)
目前没有成功
已经使用以下引脚(J40连接器的引脚编号)连接麦克风:

(J40) (inmp441)
Pin1 = (3 v)
Pin12 = (SCK)
Pin35 = (WS)
Pin38 = (SD)
Pin39 = (GND = L/R)

已经配置了I2S4 Jetson引脚
以使用Adafruit SPH0645LM4H硬件
执行:

(1)Sudo grep dap4 /sys/kernel/debug/tegra_pinctrl_reg

Bank: 1 Reg: 0x70003144 Val: 0x00000044 → dap4_fs_pj4
Bank: 1 Reg: 0x70003148 Val: 0x00000054 → dap4_din_pj5
Bank: 1 Reg: 0x7000314c Val: 0x00000015 → dap4_dout_pj6
Bank: 1 Reg: 0x70003150 Val: 0x00000044 → dap4_sclk_pj7

(2)sudo grep “Name:|J:|BB:” /sys/kernel/debug/tegra_gpio

Name:Bank:Port CNF OE OUT IN INT_STA INT_ENB INT_LVL
J: 2:1 00 00 00 00 00 00 000000
BB: 6:3 00 00 00 00 00 00 000000

(3)amixer -c tegrasndt210ref cset name=‘ADMAIF1 Mux’

numid=518,iface=MIXER,name=‘ADMAIF1 Mux’
; type=ENUMERATED,access=rw------,values=1,items=53
; Item #0 ‘None’
; Item #1 ‘ADMAIF1’
; Item #2 ‘ADMAIF2’
; Item #3 ‘ADMAIF3’
; Item #4 ‘ADMAIF4’
; Item #5 ‘ADMAIF5’
; Item #6 ‘ADMAIF6’
; Item #7 ‘ADMAIF7’
; Item #8 ‘ADMAIF8’
; Item #9 ‘ADMAIF9’
; Item #10 ‘ADMAIF10’
; Item #11 ‘I2S1’
; Item #12 ‘I2S2’
; Item #13 ‘I2S3’
; Item #14 ‘I2S4’
; Item #15 ‘I2S5’
; Item #16 ‘SFC1’
; Item #17 ‘SFC2’
; Item #18 ‘SFC3’
; Item #19 ‘SFC4’
; Item #20 ‘MIXER1-1’
; Item #21 ‘MIXER1-2’
; Item #22 ‘MIXER1-3’
; Item #23 ‘MIXER1-4’
; Item #24 ‘MIXER1-5’
; Item #25 ‘AMX1’
; Item #26 ‘AMX2’
; Item #27 ‘AFC1’
; Item #28 ‘AFC2’
; Item #29 ‘AFC3’
; Item #30 ‘AFC4’
; Item #31 ‘AFC5’
; Item #32 ‘AFC6’
; Item #33 ‘OPE1’
; Item #34 ‘OPE2’
; Item #35 ‘SPKPROT1’
; Item #36 ‘MVC1’
; Item #37 ‘MVC2’
; Item #38 ‘IQC1-1’
; Item #39 ‘IQC1-2’
; Item #40 ‘IQC2-1’
; Item #41 ‘IQC2-2’
; Item #42 ‘DMIC1’
; Item #43 ‘DMIC2’
; Item #44 ‘DMIC3’
; Item #45 ‘ADX1-1’
; Item #46 ‘ADX1-2’
; Item #47 ‘ADX1-3’
; Item #48 ‘ADX1-4’
; Item #49 ‘ADX2-1’
; Item #50 ‘ADX2-2’
; Item #51 ‘ADX2-3’
; Item #52 ‘ADX2-4’
: values=14

(4)amixer -c tegrasndt210ref sget “ADMAIF1 Mux”

amixer: Unable to find simple control ‘“ADMAIF1’,0
2. 查看内核&dts差异

是否对内核和/或设备树做了任何更改?
不,没有

$ amixer -c tegrasndt210ref cget name=‘ADMAIF1 Mux’
amixer: Cannot find the given element from control hw:1
$ amixer scontrols
amixer: Mixer attach default error: No such device

除了设备树更改之外,还做了其他更改吗?
没有

# 不工作
amixer -c tegrasndt210ref sget “ADMAIF1 Mux”

# 工作正常 
amixer -c tegrasndt210ref sget "ADMAIF1 Mux"
3. amixer

amixer -c tegrasndt210ref controls

numid=528,iface=MIXER,name=‘I2S1 Mux’
numid=529,iface=MIXER,name=‘I2S2 Mux’
numid=492,iface=MIXER,name=‘I2S3 BCLK Ratio’
numid=494,iface=MIXER,name=‘I2S3 Capture mono to stereo conv’
numid=493,iface=MIXER,name=‘I2S3 Capture stereo to mono conv’
numid=491,iface=MIXER,name=‘I2S3 Channels’
numid=486,iface=MIXER,name=‘I2S3 Loopback’
numid=530,iface=MIXER,name=‘I2S3 Mux’
numid=497,iface=MIXER,name=‘I2S3 Playback FIFO threshold’
numid=496,iface=MIXER,name=‘I2S3 Playback mono to stereo conv’
numid=495,iface=MIXER,name=‘I2S3 Playback stereo to mono conv’
numid=490,iface=MIXER,name=‘I2S3 Sample Rate’
numid=488,iface=MIXER,name=‘I2S3 codec bit format’
numid=620,iface=MIXER,name=‘I2S3 codec frame mode’
numid=621,iface=MIXER,name=‘I2S3 codec master mode’
numid=489,iface=MIXER,name=‘I2S3 fsync width’
numid=487,iface=MIXER,name=‘I2S3 input bit format’
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’
numid=532,iface=MIXER,name=‘I2S5 Mux’
numid=453,iface=MIXER,name=‘ADMAIF1 Capture stereo to mono conv’
numid=443,iface=MIXER,name=‘ADMAIF1 Channels’
numid=518,iface=MIXER,name=‘ADMAIF1 Mux’
numid=463,iface=MIXER,name=‘ADMAIF1 Playback mono to stereo conv’
numid=462,iface=MIXER,name=‘ADMAIF10 Capture stereo to mono conv’
numid=452,iface=MIXER,name=‘ADMAIF10 Channels’
numid=527,iface=MIXER,name=‘ADMAIF10 Mux’
numid=472,iface=MIXER,name=‘ADMAIF10 Playback mono to stereo conv’
numid=454,iface=MIXER,name=‘ADMAIF2 Capture stereo to mono conv’
numid=444,iface=MIXER,name=‘ADMAIF2 Channels’
numid=519,iface=MIXER,name=‘ADMAIF2 Mux’
numid=464,iface=MIXER,name=‘ADMAIF2 Playback mono to stereo conv’
numid=455,iface=MIXER,name=‘ADMAIF3 Capture stereo to mono conv’
numid=445,iface=MIXER,name=‘ADMAIF3 Channels’
numid=520,iface=MIXER,name=‘ADMAIF3 Mux’
numid=465,iface=MIXER,name=‘ADMAIF3 Playback mono to stereo conv’
numid=456,iface=MIXER,name=‘ADMAIF4 Capture stereo to mono conv’
numid=446,iface=MIXER,name=‘ADMAIF4 Channels’
numid=521,iface=MIXER,name=‘ADMAIF4 Mux’
numid=466,iface=MIXER,name=‘ADMAIF4 Playback mono to stereo conv’
numid=457,iface=MIXER,name=‘ADMAIF5 Capture stereo to mono conv’
numid=447,iface=MIXER,name=‘ADMAIF5 Channels’
numid=522,iface=MIXER,name=‘ADMAIF5 Mux’
....
numid=227,iface=MIXER,name=‘ADX2 Byte Map 19’
numid=210,iface=MIXER,name=‘ADX2 Byte Map 2’
numid=228,iface=MIXER,name=‘ADX2 Byte Map 20’
numid=229,iface=MIXER,name=‘ADX2 Byte Map 21’
numid=230,iface=MIXER,name=‘ADX2 Byte Map 22’
numid=231,iface=MIXER,name=‘ADX2 Byte Map 23’
numid=232,iface=MIXER,name=‘ADX2 Byte Map 24’
numid=233,iface=MIXER,name=‘ADX2 Byte Map 25’
numid=234,iface=MIXER,name=‘ADX2 Byte Map 26’
numid=235,iface=MIXER,name=‘ADX2 Byte Map 27’
numid=236,iface=MIXER,name=‘ADX2 Byte Map 28’
numid=237,iface=MIXER,name=‘ADX2 Byte Map 29’
....
numid=136,iface=MIXER,name=‘AMX2 Input2 Channels’
numid=137,iface=MIXER,name=‘AMX2 Input3 Channels’
numid=138,iface=MIXER,name=‘AMX2 Input4 Channels’
numid=134,iface=MIXER,name=‘AMX2 Output Channels’
numid=562,iface=MIXER,name=‘AMX2-1 Mux’
numid=563,iface=MIXER,name=‘AMX2-2 Mux’
numid=564,iface=MIXER,name=‘AMX2-3 Mux’
numid=565,iface=MIXER,name=‘AMX2-4 Mux’
numid=473,iface=MIXER,name=‘APE Reg Dump’
numid=568,iface=MIXER,name=‘Adder1 RX1’
numid=577,iface=MIXER,name=‘Adder1 RX10’
numid=569,iface=MIXER,name=‘Adder1 RX2’
numid=570,iface=MIXER,name=‘Adder1 RX3’
numid=571,iface=MIXER,name=‘Adder1 RX4’
numid=572,iface=MIXER,name=‘Adder1 RX5’
numid=573,iface=MIXER,name=‘Adder1 RX6’
numid=574,iface=MIXER,name=‘Adder1 RX7’
numid=575,iface=MIXER,name=‘Adder1 RX8’
numid=576,iface=MIXER,name=‘Adder1 RX9’
numid=578,iface=MIXER,name=‘Adder2 RX1’
numid=587,iface=MIXER,name=‘Adder2 RX10’
numid=579,iface=MIXER,name=‘Adder2 RX2’
numid=580,iface=MIXER,name=‘Adder2 RX3’
numid=581,iface=MIXER,name=‘Adder2 RX4’
numid=582,iface=MIXER,name=‘Adder2 RX5’
numid=583,iface=MIXER,name=‘Adder2 RX6’
numid=584,iface=MIXER,name=‘Adder2 RX7’
numid=585,iface=MIXER,name=‘Adder2 RX8’
numid=586,iface=MIXER,name=‘Adder2 RX9’
numid=588,iface=MIXER,name=‘Adder3 RX1’
numid=597,iface=MIXER,name=‘Adder3 RX10’
numid=589,iface=MIXER,name=‘Adder3 RX2’
numid=590,iface=MIXER,name=‘Adder3 RX3’
numid=591,iface=MIXER,name=‘Adder3 RX4’
numid=592,iface=MIXER,name=‘Adder3 RX5’
numid=593,iface=MIXER,name=‘Adder3 RX6’
numid=594,iface=MIXER,name=‘Adder3 RX7’
numid=595,iface=MIXER,name=‘Adder3 RX8’
numid=596,iface=MIXER,name=‘Adder3 RX9’
numid=598,iface=MIXER,name=‘Adder4 RX1’
numid=607,iface=MIXER,name=‘Adder4 RX10’
numid=599,iface=MIXER,name=‘Adder4 RX2’
numid=600,iface=MIXER,name=‘Adder4 RX3’
numid=601,iface=MIXER,name=‘Adder4 RX4’
numid=602,iface=MIXER,name=‘Adder4 RX5’
numid=603,iface=MIXER,name=‘Adder4 RX6’
numid=604,iface=MIXER,name=‘Adder4 RX7’
numid=605,iface=MIXER,name=‘Adder4 RX8’
numid=606,iface=MIXER,name=‘Adder4 RX9’
numid=608,iface=MIXER,name=‘Adder5 RX1’
numid=617,iface=MIXER,name=‘Adder5 RX10’
numid=609,iface=MIXER,name=‘Adder5 RX2’
numid=610,iface=MIXER,name=‘Adder5 RX3’
numid=611,iface=MIXER,name=‘Adder5 RX4’
numid=612,iface=MIXER,name=‘Adder5 RX5’
numid=613,iface=MIXER,name=‘Adder5 RX6’
numid=614,iface=MIXER,name=‘Adder5 RX7’
numid=615,iface=MIXER,name=‘Adder5 RX8’
numid=616,iface=MIXER,name=‘Adder5 RX9’
numid=498,iface=MIXER,name=‘DMIC1 Boost Gain’
numid=500,iface=MIXER,name=‘DMIC1 Capture mono to stereo conv’
numid=501,iface=MIXER,name=‘DMIC1 Capture stereo to mono conv’
numid=504,iface=MIXER,name=‘DMIC1 Channels’
numid=499,iface=MIXER,name=‘DMIC1 Controller Channel Select’
numid=506,iface=MIXER,name=‘DMIC1 LR Select’
numid=505,iface=MIXER,name=‘DMIC1 OSR Value’
numid=503,iface=MIXER,name=‘DMIC1 Sample Rate’
numid=502,iface=MIXER,name=‘DMIC1 output bit format’
numid=507,iface=MIXER,name=‘DMIC2 Boost Gain’
numid=509,iface=MIXER,name=‘DMIC2 Capture mono to stereo conv’
numid=510,iface=MIXER,name=‘DMIC2 Capture stereo to mono conv’
numid=513,iface=MIXER,name=‘DMIC2 Channels’
numid=508,iface=MIXER,name=‘DMIC2 Controller Channel Select’
numid=515,iface=MIXER,name=‘DMIC2 LR Select’
numid=514,iface=MIXER,name=‘DMIC2 OSR Value’
numid=512,iface=MIXER,name=‘DMIC2 Sample Rate’
numid=511,iface=MIXER,name=‘DMIC2 output bit format’
numid=537,iface=MIXER,name=‘MIXER1-1 Mux’
numid=546,iface=MIXER,name=‘MIXER1-10 Mux’
numid=538,iface=MIXER,name=‘MIXER1-2 Mux’
numid=539,iface=MIXER,name=‘MIXER1-3 Mux’
numid=540,iface=MIXER,name=‘MIXER1-4 Mux’
numid=541,iface=MIXER,name=‘MIXER1-5 Mux’
numid=542,iface=MIXER,name=‘MIXER1-6 Mux’
numid=543,iface=MIXER,name=‘MIXER1-7 Mux’
numid=544,iface=MIXER,name=‘MIXER1-8 Mux’
numid=545,iface=MIXER,name=‘MIXER1-9 Mux’
numid=348,iface=MIXER,name=‘MVC1 Bits’
numid=349,iface=MIXER,name=‘MVC1 Channels’

numid=295,iface=MIXER,name=‘RX9 Gain Instant’
numid=317,iface=MIXER,name=‘SFC1 Channels’
numid=533,iface=MIXER,name=‘SFC1 Mux’
numid=318,iface=MIXER,name=‘SFC1 init’
numid=315,iface=MIXER,name=‘SFC1 input bit format’
numid=313,iface=MIXER,name=‘SFC1 input rate’
numid=319,iface=MIXER,name=‘SFC1 input stereo conv’
numid=316,iface=MIXER,name=‘SFC1 output bit format’
numid=320,iface=MIXER,name=‘SFC1 output mono conv’
numid=314,iface=MIXER,name=‘SFC1 output rate’
numid=325,iface=MIXER,name=‘SFC2 Channels’
numid=534,iface=MIXER,name=‘SFC2 Mux’
numid=326,iface=MIXER,name=‘SFC2 init’
numid=323,iface=MIXER,name=‘SFC2 input bit format’
numid=321,iface=MIXER,name=‘SFC2 input rate’
numid=327,iface=MIXER,name=‘SFC2 input stereo conv’
numid=324,iface=MIXER,name=‘SFC2 output bit format’
numid=328,iface=MIXER,name=‘SFC2 output mono conv’
numid=322,iface=MIXER,name=‘SFC2 output rate’
numid=333,iface=MIXER,name=‘SFC3 Channels’
numid=535,iface=MIXER,name=‘SFC3 Mux’
numid=334,iface=MIXER,name=‘SFC3 init’
numid=331,iface=MIXER,name=‘SFC3 input bit format’
numid=329,iface=MIXER,name=‘SFC3 input rate’
numid=335,iface=MIXER,name=‘SFC3 input stereo conv’
numid=332,iface=MIXER,name=‘SFC3 output bit format’
numid=336,iface=MIXER,name=‘SFC3 output mono conv’
numid=330,iface=MIXER,name=‘SFC3 output rate’
numid=341,iface=MIXER,name=‘SFC4 Channels’
numid=536,iface=MIXER,name=‘SFC4 Mux’
numid=342,iface=MIXER,name=‘SFC4 init’
numid=339,iface=MIXER,name=‘SFC4 input bit format’
numid=337,iface=MIXER,name=‘SFC4 input rate’
numid=343,iface=MIXER,name=‘SFC4 input stereo conv’
numid=340,iface=MIXER,name=‘SFC4 output bit format’
numid=344,iface=MIXER,name=‘SFC4 output mono conv’
numid=338,iface=MIXER,name=‘SFC4 output rate’
numid=555,iface=MIXER,name=‘SPKPROT1 Mux’
numid=307,iface=MIXER,name=‘TX1 Channels’
numid=308,iface=MIXER,name=‘TX2 Channels’
numid=309,iface=MIXER,name=‘TX3 Channels’
numid=310,iface=MIXER,name=‘TX4 Channels’
numid=311,iface=MIXER,name=‘TX5 Channels’
numid=517,iface=MIXER,name=‘codec-x format’
numid=516,iface=MIXER,name=‘codec-x rate’

amixer -c tegrasndt210ref sget “ADMAIF1 Mux”

Simple mixer control ‘ADMAIF1 Mux’,0
Capabilities: enum
Items: ‘None’ ‘ADMAIF1’ ‘ADMAIF2’ ‘ADMAIF3’ ‘ADMAIF4’ ‘ADMAIF5’ ‘ADMAIF6’ ‘ADMAIF7’ ‘ADMAIF8’ ‘ADMAIF9’ ‘ADMAIF10’ ‘I2S1’ ‘I2S2’ ‘I2S3’ ‘I2S4’ ‘I2S5’ ‘SFC1’ ‘SFC2’ ‘SFC3’ ‘SFC4’ ‘MIXER1-1’ ‘MIXER1-2’ ‘MIXER1-3’ ‘MIXER1-4’ ‘MIXER1-5’ ‘AMX1’ ‘AMX2’ ‘AFC1’ ‘AFC2’ ‘AFC3’ ‘AFC4’ ‘AFC5’ ‘AFC6’ ‘OPE1’ ‘OPE2’ ‘SPKPROT1’ ‘MVC1’ ‘MVC2’ ‘IQC1-1’ ‘IQC1-2’ ‘IQC2-1’ ‘IQC2-2’ ‘DMIC1’ ‘DMIC2’ ‘DMIC3’ ‘ADX1-1’ ‘ADX1-2’ ‘ADX1-3’ ‘ADX1-4’ ‘ADX2-1’ ‘ADX2-2’ ‘ADX2-3’ ‘ADX2-4’
Item0: ‘I2S4’
4. 采集音频
arecord -D hw:tegrasnd210ref,0 -c <num-channels> 
-r <sample-rate> -f <sample-size> -d 10 cap.wav

示例:

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 

当尝试通过Audacity (Recording device = default)记录时
得到的结果是噪音

5. 查看调试信息
$ 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:tegrasnd210ref,0 -c 1 -r 44100 -f S16_LE -d 10 cap.wav
$ sudo cat /sys/kernel/debug/tracing/trace
声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
free-jdx
红包 92 收藏 评论 打赏
评论
0个
内容存在敏感词
手气红包
    易百纳技术社区暂无数据
相关专栏
置顶时间设置
结束时间
删除原因
  • 广告/SPAM
  • 恶意灌水
  • 违规内容
  • 文不对题
  • 重复发帖
打赏作者
易百纳技术社区
free-jdx
您的支持将鼓励我继续创作!
打赏金额:
¥1易百纳技术社区
¥5易百纳技术社区
¥10易百纳技术社区
¥50易百纳技术社区
¥100易百纳技术社区
支付方式:
微信支付
支付宝支付
易百纳技术社区微信支付
易百纳技术社区
打赏成功!

感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~

举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

审核成功

发布时间设置
发布时间:
是否关联周任务-专栏模块

审核失败

失败原因
备注
拼手气红包 红包规则
祝福语
恭喜发财,大吉大利!
红包金额
红包最小金额不能低于5元
红包数量
红包数量范围10~50个
余额支付
当前余额:
可前往问答、专栏板块获取收益 去获取
取 消 确 定

小包子的红包

恭喜发财,大吉大利

已领取20/40,共1.6元 红包规则

    易百纳技术社区