rk3588调试es8388语音编解码IC小结

本次调试es8388语音编解码IC,按照以下思路(如果出现内核崩溃的问题,建议可以同步下rk原厂代码):

1、dts的配置
c 复制代码
  &i2c7 {  //i2c总线确认
      status = "okay";
      pinctrl-names = "default";
      pinctrl-0 = <&i2c7m0_xfer>;  //总线IO要配置对
 
           es8388: es8388@11 {
                   status = "okay";
                   #sound-dai-cells = <0>;
                   compatible = "everest,es8388", "everest,es8323";
                   reg = <0x11>;
                   clocks = <&cru I2S0_8CH_MCLKOUT>;
                   clock-names = "mclk";
  //               sda-gpios = <&gpio1 RK_PD1 GPIO_ACTIVE_HIGH>;
  //               scl-gpios = <&gpio1 RK_PD0 GPIO_ACTIVE_HIGH>;
                   assigned-clocks = <&cru I2S0_8CH_MCLKOUT>;
                   assigned-clock-rates = <12288000>;
                   pinctrl-names = "default";
                   pinctrl-0 = <&i2s0_mclk>;
           };
 };
c 复制代码
es8388_sound: es8388-sound {
  status = "okay";
  compatible = "rockchip,multicodecs-card";
  rockchip,card-name = "rockchip,es8388";
  hp-det-gpio = <&gpio1 2 1>;
  spk-con-gpio = <&gpio1 3 0>;
  hp-con-gpio = <&gpio0 8 0>;
  rockchip,format = "i2s";
  rockchip,mclk-fs = <256>;
  rockchip,cpu = <&i2s0_8ch>;
  rockchip,codec = <&es8388>;
  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 = <&hp_det>;
 };
c 复制代码
 &i2s0_8ch {  
         status = "okay";
         pinctrl-0 = <&i2s0_lrck  //I2S0的pin的配置,注意使用哪个就添加哪个,注意IO不要跟其他配置冲突
                      &i2s0_sclk
                      &i2s0_sdi0
                      &i2s0_sdo0>;
};
2 确认i2s0打开,对应的GPIO没有复用,可以通过以下命令确认(硬件原理方面对应原理图确认):
bash 复制代码
cat /sys/kernel/debug/pinctrl/pinctrl-rockchip-pinctrl/pinmux-pins
cat /sys/kernel/debug/gpio 
以及查找dts编译后的文件确认:.rk3588-evb3-lp5-v10-linux.dtb.dts.tmp
3、验证过程:

查看声卡设备:

root@VC-RK3588:/# cat /proc/asound/cards

0 [rockchipes8388 ]: rockchip_es8388 - rockchip,es8388

rockchip,es8388

root@VC-RK3588:/#

1、安装工具

① apt-get update

② apt install ffmpeg

③ apt install alsa-utils

ffmpeg -f alsa -i hw:0,0 out.wav //录音

aplay -D hw:0,0 out.wav //放音

如果播放单声道音频文件(mono)要加plug:

aplay -D plughw:0,0 zangyuquli.wav

hw:0,0 声卡0和设备0的确定,使用 aplay -l 查看:

root@VC-RK3588:/# aplay -l

**** List of PLAYBACK Hardware Devices ****

card 0: rockchipes8388 [rockchip,es8388], device 0: dailink-multicodecs ES8323.7-0011-0 [dailink-multicodecs ES8323.7-0011-0]

Subdevices: 1/1

Subdevice #0: subdevice #0

从上面可以看出我的audio设备是:

card 0: rockchipes8388 [rockchip,es8388], device 0: dailink-multicodecs ES8323.7-0011-0 [dailink-multicodecs ES8323.7-0011-0]

Subdevices: 1/1

Subdevice #0: subdevice #0

声卡id为0(因为是card 0),设备id为0(device 0),所以aplay -D plughw:0,0 xxx.wav 即可。

相关推荐
Cachel wood25 分钟前
Vue.js前端框架教程8:Vue消息提示ElMessage和ElMessageBox
linux·前端·javascript·vue.js·前端框架·ecmascript
小屁不止是运维3 小时前
麒麟操作系统服务架构保姆级教程(二)ssh远程连接
linux·运维·服务器·学习·架构·ssh
黑客K-ing5 小时前
网络安全防范
linux·服务器·web安全
王三三5 小时前
群晖利用acme.sh自动申请证书并且自动重载证书的问题解决
linux·自动化·证书·群晖·acme·acme.sh·lets encrypt
路飞雪吖~5 小时前
【Linux】进程控制
linux·运维·服务器
wy02_5 小时前
Linux基本命令
linux·运维
qq_459238495 小时前
Linux之压缩解压相关命令
linux
慕羽★6 小时前
详细介绍如何使用rapidjson读取json文件
linux·c++·windows·json·file·param·rapidjson
一只小爪子6 小时前
Redis 常用配置项说明
linux·运维·数据库·redis
追光天使7 小时前
Mac/Linux 快速部署TiDB
linux·macos·tidb