[RK3588-Android12] 关于ES8388 喇叭+PDM回采 4+2配置

07-12 1276阅读

问题描述:

ES8388 喇叭+PDM回采 4+2配置如下:


解决方案:

	// MIC
	pdmics: dummy-codec {
		status = "okay";
		compatible = "rockchip,dummy-codec";
		#sound-dai-cells = ;
	};
	// MIC
	pdm_mic_array: pdm-mic-array {
		status = "okay";
		compatible = "simple-audio-card";
		simple-audio-card,name = "rockchip,pdm-mic-array";
		simple-audio-card,cpu {
			sound-dai = ;
		};
		simple-audio-card,codec {
			sound-dai = ;
		};
	};
	// 声卡ES8388
	es8388_sound: es8388-sound {
		status = "okay";
		compatible = "rockchip,multicodecs-card";
		rockchip,card-name = "rockchip-es8388";
		// hp-det-gpio = ;
		io-channels = ;
		io-channel-names = "adc-detect";
		keyup-threshold-microvolt = ;
		poll-interval = ;
		// SPK_CTL_H 喇叭脚自行配置
		spk-con-gpio = ;
		// 耳机控制GPIO
		// hp-con-gpio = ;
		linein-type = ;
		rockchip,format = "i2s";
		rockchip,mclk-fs = ;
		rockchip,cpu = ;
		rockchip,codec = ;
		rockchip,audio-routing =
			"Headphone", "LOUT1",
			"Headphone", "ROUT1",
			"Speaker", "LOUT2",
			"Speaker", "ROUT2",
			"Headphone", "Headphone Power",
			"Headphone", "Headphone Power",
			"Speaker", "Speaker Power",
			"Speaker", "Speaker Power",
			"LINPUT1", "Main Mic",
			"LINPUT2", "Main Mic",
			"RINPUT1", "Headset Mic",
			"RINPUT2", "Headset Mic";
		// pinctrl-names = "default";
		// pinctrl-0 = ;
		play-pause-key {
			label = "playpause";
			linux,code = ;
			press-threshold-microvolt = ;
		};
	};
&i2c7 {
	status = "okay";
	//这里需要根据新老SDK配置 clock部分的配置不一样
	//新SDK如下
	es8388: es8388@11 {
		status = "okay";
		#sound-dai-cells = ;
		compatible = "everest,es8388", "everest,es8323";
		reg = ;
		clocks = ;
		clock-names = "mclk";
		assigned-clocks = ;
		assigned-clock-rates = ;
		pinctrl-names = "default";
		pinctrl-0 = ;
	};
	//旧SDK如下
	es8388: es8388@11 {
		status = "disabled";
		#sound-dai-cells = ;
		compatible = "everest,es8388", "everest,es8323";
		reg = ;
		clocks = ;
		clock-names = "mclk";
		assigned-clocks = ;
		assigned-clock-rates = ;
		pinctrl-names = "default";
		pinctrl-0 = ;
};
// 根据原理图自行配置clk 和sdi通路 有几路配置几路
&pdm0 {
	status = "okay";
	// 通道顺序 自行配置
	//rockchip,path-map = ;
	pinctrl-names = "default";
	pinctrl-0 = ;
};

使用查看声音命令 cat /proc/asound/cards 如下[RK3588-Android12] 关于ES8388 喇叭+PDM回采 4+2配置

如声卡未能注册成功,自行使用 dmesg | grep pdm 检查相关声音注册是否有报错,需要注意pdm的sdio脚是否有复用,如果复用需要去除。

以上声卡注册成功后,使用命令进行录音采集。因为回采使用系统的录音应用是录制不到声音的。

使用 tinycap /mnt/rec.wav -D 1 -d 0 –c 4 对声卡1进行声音录制。

使用adb pull /mnt/rec.wav E:\ 将声音转出

最后使用电脑端的Audacity软件播放声音查看声道如下:

[RK3588-Android12] 关于ES8388 喇叭+PDM回采 4+2配置

这里可以看到声音被正常录制到,左右声道正常。


VPS购买请点击我

文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。

目录[+]