I2S MIC on VIM3

内核不需要重新调整,你可以用tinycap命令去验证

HI:
你好,我们用的I2S麦克风是MSM261S4030H0R,用原始内核测试录音,用tinycap保存的数据发现都是0x00,硬件接的GPAOA_1,GPIOA_2和GPIOA_3(数据输入引脚)。
image
内核dmesg:
130|console:/ # dmesg | grep au[ 47.177164@2] [wlan0] wl_run_escan : LEGACY_SCAN sync ID: 1, bssidx: 0
dio
[ 4.559547] audio_dsp: [dsp]register dsp to char divece(257)
[ 4.559631] amaudio: amaudio: driver amaudio init!
[ 4.559891] amaudio: amaudio_init - amaudio: driver amaudio succuess!
[ 5.312179] usbcore: registered new interface driver snd-usb-audio
[ 5.312704] aml_codec_T9015 ff632000.t9015: aml_T9015_audio_codec_probe
[ 5.313990] asoc debug: aml_audio_controller_probe-127
[ 5.314736] snd_tdm ff642000.audiobus:tdma: lane_mask_out = 0, lane_oe_mask_out = 0
[ 5.314981] snd_tdm ff642000.audiobus:tdmb: lane_mask_out = 1, lane_oe_mask_out = 0
[ 5.315192] snd_tdm ff642000.audiobus:tdmc: lane_mask_out = 0, lane_oe_mask_out = 0
[ 5.315283] meson-g12a-pinctrl pinctrl@ff634480: pin-60 (ff642000.audiobus:tdmc) status -22
[ 5.315287] snd_tdm ff642000.audiobus:tdmc: Error applying setting, reverse things back
[ 5.315291] snd_tdm ff642000.audiobus:tdmc: aml_tdm_get_pins error!
[ 5.315790] hdmitx: audio: aout notify format CT_PCM
[ 5.316136] audio_ddr_mngr: 0, irqs toddr 47, frddr 50
[ 5.316137] audio_ddr_mngr: 1, irqs toddr 48, frddr 51
[ 5.316138] audio_ddr_mngr: 2, irqs toddr 49, frddr 52
[ 5.316298] loopback ff642000.audiobus:loopback@0: check whether to update loopback chipinfo
[ 5.316631] audiolocker_platform_probe
[ 5.524049] snd_tdm ff642000.audiobus:tdmb: ASoC: Failed to add I2SIn CLK: -16
[ 5.524055] snd_tdm ff642000.audiobus:tdmc: ASoC: Failed to add I2SIn CLK: -16
[ 5.525679] asoc-aml-card auge_sound: dummy <-> ff642000.audiobus:loopback@0 mapping ok
[ 11.237176] ff642000.audiobus:tdmb is using the pin GPIOA_4 as pinmux
[ 11.962400] audio_ddr_mngr: toddrs[0] registered by device ff642000.audiobus:spdif
[ 11.962738] audio_ddr_mngr: toddrs[0] released by device ff642000.audiobus:spdif
[ 11.965621] audio_ddr_mngr: toddrs[0] registered by device ff642000.audiobus:tdma
[ 11.965776] audio_ddr_mngr: toddrs[0] released by device ff642000.audiobus:tdma
[ 11.976255] audio_ddr_mngr: toddrs[0] registered by device ff642000.audiobus:loopback@0
[ 11.976505] audio_ddr_mngr: toddrs[0] released by device ff642000.audiobus:loopback@0
[ 11.982652] audio_ddr_mngr: toddrs[0] registered by device ff642000.audiobus:tdmb
[ 11.982884] audio_ddr_mngr: toddrs[0] released by device ff642000.audiobus:tdmb
[ 11.996255] audio_ddr_mngr: toddrs[0] registered by device ff642000.audiobus:tdmc
[ 11.997508] audio_ddr_mngr: toddrs[0] released by device ff642000.audiobus:tdmc
[ 21.782604] Not init audio effects
[ 21.783356] audio_ddr_mngr: frddrs[0] registered by device ff642000.audiobus:tdmb
[ 21.783489] audio_ddr_mngr: frddr_set_sharebuffer_enable sel:1, dst_src:3
[ 27.529047] audio_ddr_mngr: frddr_set_sharebuffer_enable sel:1, dst_src:3
[ 27.529117] audio_ddr_mngr: frddrs[0] released by device ff642000.audiobus:tdmb
[ 29.137063] audio_dsp: dts_dec_control/0x0
[ 30.723079] Not init audio effects
[ 30.724701] audio_ddr_mngr: frddrs[0] registered by device ff642000.audiobus:tdmb
[ 30.726847] audio_ddr_mngr: frddr_set_sharebuffer_enable sel:1, dst_src:3
[ 36.474798] audio_ddr_mngr: frddr_set_sharebuffer_enable sel:1, dst_src:3
[ 36.474895] audio_ddr_mngr: frddrs[0] released by device ff642000.audiobus:tdmb
用app测试:tinycap /sdcard/1.wav -d 1 -c 2 -r 16000 -p 256
打印log:
[ 59.519918@0] aml_tdm_open
[ 59.520731@0] asoc-aml-card auge_sound: tdm prepare capture
[ 59.527140@0] aml_dai_tdm_prepare Expected toddr src:TDMIN_B
[ 59.532840@0] asoc-aml-card auge_sound: tdm capture enable
我发现原始内核中tdm的dts配置是这样的
tdmout_b: tdmout_b {
mux { /* GPIOA_1, GPIOA_2, GPIOA_3 */
groups = “tdmb_sclk”,
“tdmb_fs”,
“tdmb_dout0”;
function = “tdmb_out”;
drive-strength = <2>;
};
};

tdmin_b:tdmin_b {
	mux { /* GPIOA_4 */
		groups = "tdmb_din1"
			/*,"tdmb_slv_sclk", "tdmb_slv_fs"*/;
		function = "tdmb_in";
		drive-strength = <2>;
	};
};

系统默认是配置成tdmbout,其中GPIOA_3是作为输出管脚的,我们现在需要把GPIOA_3配置成输入数据管脚使能tdmbin是不是需要修改?

你理解错了,默认GIPOA_4才是I2S IN功能脚,GPIOA_3是I2S OUT功能脚,把MIC的输出接到GPIOA_4管脚上,另外时钟那些也要接上

HI:
你的意思是GPIOA_3不能作为I2S的IN数据输入管脚只能做I2S OUT功能脚吗?

GPIOA_3可以配置为输入,但是系统目前默认配置就是GPIOA_4作为输入的,如果你要更改管脚的话,设计很多东西调整

感谢回复,我们测试GIPOA_4作为I2S IN功能脚,用tinycap可以正常录音