基于rk3568 蓝牙通话
一、播放音乐和通话使用的方式不同
1、音乐和文件传输,使用的是uart 接口。
2、hfp_client 使用的是pcm接口。
二、BT 音乐用的是uart
蓝牙能正常使用的情况下,基本没有问题。
<bool name="profile_supported_a2dp_sink">true</bool>
note:device/xxxx/xxxx/xxxx/overlay/下可能改变该值。
三、BT 通话接口使用pcm
数据传输链路如下:
上行:板载mic -> RK主控 -> BT芯片 -> AP -> 手机A -> 网络 -> 手机B
下行:手机B -> 网络 -> 手机A -> AP -> BT芯片 -> RK主控 -> 喇叭
dts:
bt-sound {
compatible = "simple-audio-card";
simple-audio-card,format = "dsp_b";
simple-audio-card,bitclock-inversion = <0>;
simple-audio-card,mclk-fs = <256>;
simple-audio-card,name = "rockchip,bt";
simple-audio-card,bitclock-master = <&sound2_master>;
simple-audio-card,frame-master = <&sound2_master>;
simple-audio-card,cpu {
sound-dai = <&i2s2_2ch>;
};
sound2_master:simple-audio-card,codec {
sound-dai = <&bt_sco>;
};
};
bt_sco: bt-sco {
compatible = "delta,dfbmcs320";
#sound-dai-cells = <0>;
status = "okay";
};
&i2s2_2ch{
pinctrl-0 = <&i2s2m0_sclktx &i2s2m0_lrcktx &i2s2m0_sdi &i2s2m0_sdo>;
rockchip,bclk-fs =<32>;//32对应PCM_CLK频率为256KHz,64对应PCM_CLK频率为512KHz。
#sound-dai-cells = <0>;
rockchip,clk-trcm = <1>;
status = "okay";
};
&rk809_codec{
status = "okay";
spk-mute-delay-ms = <10>;
hp-mute-delay-ms = <10>;
};
a、确认声卡 cat /proc/asound/cards
0 [hdmisound ]: hdmi-sound - hdmi-sound
hdmi-sound
1 [rockchiprk809co]: rockchip_rk809- - rockchip,rk809-codec
rockchip,rk809-codec
2 [rockchipbt ]: rockchip_bt - rockchip,bt
rockchip,bt
通过上面的节点可以看出多了bt 声卡
b、确认
# tinymix -D 1
Mixer name: ‘rockchip,rk809-codec’
Number of controls: 4
ctl type num name value
0 ENUM 1 Playback Path OFF
1 ENUM 1 Capture MIC Path MIC OFF
2 ENUM 1 Resume Path OFF
3 ENUM 1 Software Digital Loopback Mode Disabled
关于tinyalsa_hal 后续再继续整理