RK3568 开发板-安卓系统之声卡驱动调试(九)-highdefinitionaudio声卡驱动

4.6 声卡驱动调试

4.6.1 查看原理图,提取需要配置的信息

RK3568 开发板-安卓系统之声卡驱动调试(九)-highdefinitionaudio声卡驱动

4.6.2 需要配置的信息

1、耳机插入检测引脚GPIO3_C2

2、RK809是挂载在I2S1上的,需要确认I2S的配置是否正确

4.6.3 完整的dts配置信息如下

{ rk_headset: rk-headset { compatible = “rockchip_headset”; headset_gpio = <&gpio3 RK_PC2 GPIO_ACTIVE_HIGH>; pinctrl-names = “default”; pinctrl-0 = <&hp_det>; status = “okay”; }; rk809_sound: rk809-sound { status = “okay”; compatible = “simple-audio-card”; simple-audio-card,format = “i2s”; simple-audio-card,name = “rockchip,rk809-codec”; simple-audio-card,mclk-fs = <256>; simple-audio-card,cpu { sound-dai = <&i2s1_8ch>; }; simple-audio-card,codec { sound-dai = <&rk809_codec>; }; }; }; &i2c0 { status = “okay”; rk809_codec: codec { #sound-dai-cells = <0>; compatible = “rockchip,rk809-codec”, “rockchip,rk817-codec”; clocks = <&cru I2S1_MCLKOUT>; clock-names = “mclk”; assigned-clocks = <&cru I2S1_MCLKOUT>, <&cru I2S1_MCLK_TX_IOE>; assigned-clock-rates = <12288000>; assigned-clock-parents = <&cru I2S1_MCLKOUT_TX>, <&cru I2S1_MCLKOUT_TX>; pinctrl-names = “default”; pinctrl-0 = <&i2s1m0_mclk>; hp-volume = <20>; spk-volume = <3>; mic-in-differential; status = “okay”; }; }; &i2s1_8ch { status = “okay”; rockchip,clk-trcm = <1>; pinctrl-names = “default”; pinctrl-0 = <&i2s1m0_sclktx &i2s1m0_lrcktx &i2s1m0_sdi0 &i2s1m0_sdo0>; };
<

4.6.4 确认声卡是否注册成功

rk3568_aybering:/ # cat /proc/asound/cards 0 [rockchiprk809co]: rockchip_rk809- – rockchip,rk809-codec rockchip,rk809-codec 1 [rockchiphdmi ]: rockchip_hdmi – rockchip,hdmi rockchip,hdmi rk3568_aybering:/ #

可以看出, RK809声卡已经成功注册

4.6.5 测试

测试时打开“录音机”进行测试

RK3568 开发板-安卓系统之声卡驱动调试(九)-highdefinitionaudio声卡驱动

4.6.5.1 耳机插入检测测试

1、插入耳机,看看插入时状态栏是否有耳机图标显示

2、拨出耳机,看看拨出后状态栏是否无耳机图标显示

放音测试” class=”reference-link”>4.6.5.2 录音—>放音测试

1、选择带MIC的耳机,插入35mm耳机座,点击录音按钮,先录音一段时间,点击停止后再点击播放进行测试

2、准备好MIC和喇叭,并将MIC和喇叭连接好(A251板接口如下图),点击录音按钮,先录音一段时间,点击停止后再点击播放进行测试

RK3568 开发板-安卓系统之声卡驱动调试(九)-highdefinitionaudio声卡驱动

4.6.5.4 调试问题记录

无论是否插入耳机,耳机图标一直在显示?原因:DTS把耳机插入引脚配置成上拉了。

hale@thinkpad:rk3568_aybering_Android11$ rk356x_android$ git diff a3a2450a532 f398c0a317 diff –git a/kernel/arch/arm64/boot/dts/rockchip/rk3568-evb1-ddr4-v10.dtsi b/kernel/arch/arm64/boot/dts/rockchip/rk3568-evb1-ddr4-v10.dtsi index a02adea37c..29f738697b 100644 — a/kernel/arch/arm64/boot/dts/rockchip/rk3568-evb1-ddr4-v10.dtsi +++ b/kernel/arch/arm64/boot/dts/rockchip/rk3568-evb1-ddr4-v10.dtsi @@ -18,7 +18,7 @@ rk_headset: rk-headset { compatible = “rockchip_headset”; – headset_gpio = <&gpio3 RK_PC2 GPIO_ACTIVE_LOW>; + headset_gpio = <&gpio3 RK_PC2 GPIO_ACTIVE_HIGH>; pinctrl-names = “default”; pinctrl-0 = <&hp_det>; status = “okay”; @@ -540,7 +540,7 @@ headphone { hp_det: hp-det { – rockchip,pins = <3 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>; + rockchip,pins = <3 RK_PC2 RK_FUNC_GPIO &pcfg_pull_up>; }; };

免责声明:文章内容来自互联网,本站不对其真实性负责,也不承担任何法律责任,如有侵权等情况,请与本站联系删除。
转载请注明出处:RK3568 开发板-安卓系统之声卡驱动调试(九)-highdefinitionaudio声卡驱动 https://www.yhzz.com.cn/a/9740.html

上一篇 2023-04-20
下一篇 2023-04-20

相关推荐

联系云恒

在线留言: 我要留言
客服热线:400-600-0310
工作时间:周一至周六,08:30-17:30,节假日休息。