Bluetooth headset supported?

Hello,

I checked Bluetooth headset profile on rockpi4 android9.
Now, Bluetooth headset service not running.

Because, headset settings is disabled by overlay settings.

    device/rockchip/common/overlay/packages/apps/Bluetooth/res/values/config.xml
 <resources>
    <bool name="profile_supported_a2dp_sink">false</bool>
    <bool name="profile_supported_hdp">false</bool>
    <bool name="profile_supported_hs_hfp">false</bool>
    <bool name="profile_supported_hfpclient">false</bool>
   ...

I tried to test by custom build image with above change settings( false -> true ).
But Headset don’t work(Service is avaiable but don’t work).

Has it been disabled for some reason?

In a different thread, the Radxa Team says that the BT Headset Profile is not yet supported.

Hi
Please test the following firmware (Android10):
ROCKPI 4B
ROCKPI 4C

Open Bluetooth Sink:
enable : TunerSettings -> Bluetooth -> Bluetooth Sink.

If Wait... dialog not dismiss, you can enable bluetooth in status bar, or reboot rockpi4.
You can pair Rockpi on your phone and play music to Rockpi, which will play audio via HDMI.

1 Like

Thank you.
I’ll try it.

Hi,
I tried it.

As a result, the BT devices can be paired, but they are disconnected shortly thereafter.

I’ll share the log as well.

2020-10-13 17:45:25.808 616-1169/com.android.bluetooth D/a2dp_codec: init
2020-10-13 17:45:25.808 616-1169/com.android.bluetooth D/a2dp_codec: createCodec: codec SBC
2020-10-13 17:45:25.808 616-1169/com.android.bluetooth D/a2dp_codec: createCodec: codec AAC
2020-10-13 17:45:25.808 616-1169/com.android.bluetooth D/a2dp_codec: createCodec: codec aptX
2020-10-13 17:45:25.810 616-1169/com.android.bluetooth E/a2dp_vendor_aptx_encoder: A2DP_VendorLoadEncoderAptx: cannot open aptX encoder library libaptX_encoder.so: dlopen failed: library "libaptX_encoder.so" not found
2020-10-13 17:45:25.810 616-1169/com.android.bluetooth E/a2dp_vendor_aptx: init: cannot load the encoder
2020-10-13 17:45:25.811 616-1169/com.android.bluetooth D/a2dp_codec: createCodec: codec aptX-HD
2020-10-13 17:45:25.812 616-1169/com.android.bluetooth E/a2dp_vendor_aptx_hd_encoder: A2DP_VendorLoadEncoderAptxHd: cannot open aptX-HD encoder library libaptXHD_encoder.so: dlopen failed: library "libaptXHD_encoder.so" not found
2020-10-13 17:45:25.812 616-1169/com.android.bluetooth E/a2dp_vendor_aptx_hd: init: cannot load the encoder
2020-10-13 17:45:25.812 616-1169/com.android.bluetooth D/a2dp_codec: createCodec: codec LDAC
2020-10-13 17:45:25.812 616-1169/com.android.bluetooth D/a2dp_codec: createCodec: codec SBC SINK
2020-10-13 17:45:25.812 616-1169/com.android.bluetooth D/a2dp_codec: createCodec: codec AAC SINK
2020-10-13 17:45:25.812 616-1169/com.android.bluetooth D/a2dp_codec: createCodec: codec LDAC SINK
2020-10-13 17:45:25.814 616-1169/com.android.bluetooth E/a2dp_vendor_ldac_decoder: A2DP_VendorLoadDecoderLdac: cannot open LDAC decoder library libldacBT_dec.so: dlopen failed: library "libldacBT_dec.so" not found
2020-10-13 17:45:25.814 616-1169/com.android.bluetooth E/a2dp_vendor_ldac: init: cannot load the decoder
2020-10-13 17:45:25.814 616-1169/com.android.bluetooth I/a2dp_codec: init: initialized Source codec LDAC
2020-10-13 17:45:25.814 616-1169/com.android.bluetooth I/a2dp_codec: init: initialized Source codec AAC
2020-10-13 17:45:25.814 616-1169/com.android.bluetooth I/a2dp_codec: init: initialized Source codec SBC
2020-10-13 17:45:25.814 616-1169/com.android.bluetooth I/a2dp_codec: init: initialized Sink codec AAC SINK
2020-10-13 17:45:25.814 616-1169/com.android.bluetooth I/a2dp_codec: init: initialized Sink codec SBC SINK
2020-10-13 17:45:25.814 616-1169/com.android.bluetooth W/bt_avp: AVDT_DisconnectReq: address=50:1a:a5:bf:5a:1c
2020-10-13 17:45:25.870 616-1169/com.android.bluetooth I/bt_stack: [INFO:btsnoop.cc(323)] clear_l2cap_whitelist: Clearing whitelist from l2cap channel. conn_handle=11 cid=66:5696
2020-10-13 17:45:25.871 616-1169/com.android.bluetooth I/bt_bta_av: bta_av_conn_cback: conn_cback bd_addr: 50:1a:a5:bf:5a:1c
2020-10-13 17:45:25.871 616-1169/com.android.bluetooth W/bt_btif: bta_av_str_closed: peer 50:1a:a5:bf:5a:1c handle:65 open_status:3 chnl:64 co_started:0
2020-10-13 17:45:25.871 616-1169/com.android.bluetooth W/bt_btif: bta_dm_rm_cback:0, status:1
2020-10-13 17:45:25.872 616-1169/com.android.bluetooth I/bt_bta_av: bta_av_cleanup peer 50:1a:a5:bf:5a:1c
2020-10-13 17:45:25.872 616-1169/com.android.bluetooth D/bt_bta_av: SetAvdtpVersion: AVDTP version for 50:1a:a5:bf:5a:1c set to 0x0
2020-10-13 17:45:25.872 616-1169/com.android.bluetooth D/bt_bta_av: SetAvdtpVersion: AVDTP version for 00:00:00:00:00:00 set to 0x0
2020-10-13 17:45:25.872 616-1169/com.android.bluetooth W/bt_btif: bta_av_rc_create: Skipping RC creation for the old AVRCP profile
2020-10-13 17:45:25.872 616-1169/com.android.bluetooth I/btif_av: virtual bool BtifAvStateMachine::StateOpening::ProcessEvent(uint32_t, void *): Peer 50:1a:a5:bf:5a:1c : event=BTA_AV_OPEN_EVT(0x2) flags=0x0(None) status=3(FAILED) edr=0x62
2020-10-13 17:45:25.872 616-1169/com.android.bluetooth E/bt_btif: get_connected_device: returning NULL
2020-10-13 17:45:25.872 616-1169/com.android.bluetooth I/chatty: uid=1002(bluetooth) bt_main_thread identical 4 lines
2020-10-13 17:45:25.872 616-1169/com.android.bluetooth E/bt_btif: get_connected_device: returning NULL
2020-10-13 17:45:25.873 616-1169/com.android.bluetooth I/btif_av: btif_report_connection_state: peer_address=50:1a:a5:bf:5a:1c state=0
2020-10-13 17:45:25.873 616-1169/com.android.bluetooth I/bt_btif_a2dp: btif_a2dp_on_idle: ## ON A2DP IDLE ## peer_sep = 0
2020-10-13 17:45:25.873 616-1169/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_on_idle
2020-10-13 17:45:25.873 616-1169/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_audio_handle_stop_decoding
2020-10-13 17:45:25.873 616-1169/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_audio_rx_flush_req
2020-10-13 17:45:25.873 616-1169/com.android.bluetooth D/bt_btif_avrcp_audio_track: BtifAvrcpAudioTrackPause handle is null.
2020-10-13 17:45:25.873 616-1169/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_clear_track_event_req
2020-10-13 17:45:25.873 616-1169/com.android.bluetooth I/bt_stack: [INFO:btif_av.cc(598)] bool BtifAvSink::SetActivePeer(const RawAddress &, std::promise<void>): peer: 00:00:00:00:00:00
2020-10-13 17:45:25.873 616-1240/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_clear_track_event
2020-10-13 17:45:25.873 616-1169/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_end_session: peer_address=50:1a:a5:bf:5a:1c
2020-10-13 17:45:25.873 616-1240/com.android.bluetooth D/bt_btif_avrcp_audio_track: BtifAvrcpAudioTrackStop handle is null.
2020-10-13 17:45:25.873 616-1169/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_shutdown
2020-10-13 17:45:25.873 616-1240/com.android.bluetooth D/bt_btif_avrcp_audio_track: BtifAvrcpAudioTrackDelete handle is null.
2020-10-13 17:45:25.874 616-1240/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_end_session_delayed
2020-10-13 17:45:25.874 616-1169/com.android.bluetooth I/btif_av: DeleteIdlePeers: Deleting idle peer: 50:1a:a5:bf:5a:1c bta_handle=0x41
2020-10-13 17:45:25.874 616-1240/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_shutdown_delayed
2020-10-13 17:45:25.876 616-817/com.android.bluetooth I/BluetoothA2dpSinkServiceJni: bta2dp_connection_state_callback
2020-10-13 17:45:25.880 616-616/com.android.bluetooth D/AdapterProperties: PROFILE_CONNECTION_STATE_CHANGE: profile=11, device=50:1A:A5:BF:5A:1C, 1 -> 0
2020-10-13 17:45:25.881 636-932/com.android.systemui I/LocalBluetoothProfileManager: Failed to connect A2DPSink device
2020-10-13 17:45:25.881 636-932/com.android.systemui D/CachedBluetoothDevice: onProfileStateChanged: profile A2DPSink, device=50:1A:A5:BF:5A:1C, newProfileState 0
2020-10-13 17:45:25.882 616-616/com.android.bluetooth D/AdapterProperties: ADAPTER_CONNECTION_STATE_CHANGE: 50:1A:A5:BF:5A:1C: 1 -> 0
2020-10-13 17:45:25.883 781-781/com.android.settings I/LocalBluetoothProfileManager: Failed to connect A2DPSink device
2020-10-13 17:45:25.883 781-781/com.android.settings D/CachedBluetoothDevice: onProfileStateChanged: profile A2DPSink, device=50:1A:A5:BF:5A:1C, newProfileState 0
2020-10-13 17:45:25.891 781-781/com.android.settings D/AdaptiveHomepageIcon: Setting background color -1453315
2020-10-13 17:45:27.950 616-1169/com.android.bluetooth I/bt_btm_sec: btm_sec_disconnected clearing pending flag handle:11 reason:19
2020-10-13 17:45:27.950 616-817/com.android.bluetooth I/btif_av: btif_av_acl_disconnected: Peer 50:1a:a5:bf:5a:1c : ACL Disconnected
2020-10-13 17:45:27.950 616-1169/com.android.bluetooth I/btif_av: BtifAvPeer *BtifAvSink::FindOrCreatePeer(const RawAddress &, tBTA_AV_HNDL): Create peer: peer_address=50:1a:a5:bf:5a:1c bta_handle=0x41 peer_id=0
2020-10-13 17:45:27.951 616-1169/com.android.bluetooth W/bt_btif: btif_av_get_peer_sep: No active peer found
2020-10-13 17:45:27.951 616-1169/com.android.bluetooth I/bt_btif_a2dp: btif_a2dp_on_idle: ## ON A2DP IDLE ## peer_sep = 1
2020-10-13 17:45:27.951 616-1169/com.android.bluetooth W/bt_btif: btif_av_get_peer_sep: No active peer found
2020-10-13 17:45:27.951 616-1169/com.android.bluetooth I/bt_btif_a2dp_source: btif_a2dp_source_on_idle: state=STATE_OFF
2020-10-13 17:45:27.951 616-1169/com.android.bluetooth I/bt_btif_a2dp: btif_a2dp_on_idle: ## ON A2DP IDLE ## peer_sep = 0
2020-10-13 17:45:27.951 616-1169/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_on_idle
2020-10-13 17:45:27.951 616-1169/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_audio_handle_stop_decoding
2020-10-13 17:45:27.951 616-1169/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_audio_rx_flush_req
2020-10-13 17:45:27.951 616-1169/com.android.bluetooth D/bt_btif_avrcp_audio_track: BtifAvrcpAudioTrackPause handle is null.
2020-10-13 17:45:27.951 616-1169/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_clear_track_event_req
2020-10-13 17:45:27.951 616-1240/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_clear_track_event
2020-10-13 17:45:27.951 616-1169/com.android.bluetooth I/bt_stack: [INFO:btif_av.cc(598)] bool BtifAvSink::SetActivePeer(const RawAddress &, std::promise<void>): peer: 00:00:00:00:00:00
2020-10-13 17:45:27.951 616-1240/com.android.bluetooth D/bt_btif_avrcp_audio_track: BtifAvrcpAudioTrackStop handle is null.
2020-10-13 17:45:27.951 616-1240/com.android.bluetooth D/bt_btif_avrcp_audio_track: BtifAvrcpAudioTrackDelete handle is null.
2020-10-13 17:45:27.951 616-1169/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_end_session: peer_address=50:1a:a5:bf:5a:1c
2020-10-13 17:45:27.952 616-1169/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_shutdown
2020-10-13 17:45:27.952 616-1240/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_end_session_delayed
2020-10-13 17:45:27.952 616-1169/com.android.bluetooth I/btif_av: DeleteIdlePeers: Deleting idle peer: 50:1a:a5:bf:5a:1c bta_handle=0x41
2020-10-13 17:45:27.952 616-1240/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_shutdown_delayed

Please provide a more detailed logcat

2020-10-13 17:45:25.880 616-616/com.android.bluetooth D/AdapterProperties: PROFILE_CONNECTION_STATE_CHANGE: profile=11, device=50:1A:A5:BF:5A:1C, 1 -> 0
2020-10-13 17:45:25.881 636-932/com.android.systemui I/LocalBluetoothProfileManager: Failed to connect A2DPSink device
2020-10-13 17:45:25.881 636-932/com.android.systemui D/CachedBluetoothDevice: onProfileStateChanged: profile A2DPSink, device=50:1A:A5:BF:5A:1C, newProfileState 0
2020-10-13 17:45:25.882 616-616/com.android.bluetooth D/AdapterProperties: ADAPTER_CONNECTION_STATE_CHANGE: 50:1A:A5:BF:5A:1C: 1 -> 0
2020-10-13 17:45:25.883 781-781/com.android.settings I/LocalBluetoothProfileManager: Failed to connect A2DPSink device
2020-10-13 17:45:25.883 781-781/com.android.settings D/CachedBluetoothDevice: onProfileStateChanged: profile A2DPSink, device=50:1A:A5:BF:5A:1C, newProfileState 0

I’m more inclined to say your phone can’t connect.

I’ll try again and take the logcat.

I have re-filed the log.
The situation is that the Headset device has been deleted once, paired again, and then connected and disconnected repeatedly.
Just to be sure, I launched the recording app and ran it.

I couldn’t find any useful information, I tested phones from all three brands that could play music properly. What device do you use.

Is it a Headset Profile?

Sure, Headset Profile

I’m connecting a generic Headset, not a mobile phone.
I’m trying it out by connecting my Jabra Talk v2.

https://www.jabra.com/bluetooth-headsets/jabra-talk2

Note that when I paired the handset, I could hear the sound on the phone with the RockPi4C.
(Banana20 is test phone’s name)

On the other hand, with Jabra’s Headset, when paired, the profile shows nothing like the one below and is immediately disconnected.

If you use a mobile phone to connect to Bluetooth, please turn on the A2DP function, otherwise please turn off the A2DP function.
A2DP: TunerSettings -> Bluetooth -> Bluetooth A2DP.

@Shine Hello,
Android10’s image updated?
The headset status didn’t change.
A2DP function turn off by default.

I installed Android 9.0 with pi4b board
And amend as follows

===================================================================
--- overlay/frameworks/base/core/res/res/values/config.xml	(revision b64418c270db379a69db046164e098aa9be003cb)
+++ overlay/frameworks/base/core/res/res/values/config.xml	(revision c53fef84ac9f532b52323f4b3aad750cc4e01392)
@@ -181,4 +181,6 @@
     <!--网络同步时间的地址-->
     <string translatable="false" name="config_ntpServer">cn.pool.ntp.org</string>
 
+    <!--蓝牙使用Pbap mUsePbapPce-->
+    <bool name="enable_pbap_pce_profile">true</bool>
 </resources>
Index: overlay/packages/apps/Bluetooth/res/values/config.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- overlay/packages/apps/Bluetooth/res/values/config.xml	(revision b64418c270db379a69db046164e098aa9be003cb)
+++ overlay/packages/apps/Bluetooth/res/values/config.xml	(revision c53fef84ac9f532b52323f4b3aad750cc4e01392)
@@ -17,22 +17,29 @@
  */
 -->
 <resources>
-    <bool name="profile_supported_a2dp">true</bool>
-    <bool name="profile_supported_a2dp_sink">false</bool>
+    <bool name="profile_supported_a2dp">false</bool>
+    <bool name="profile_supported_a2dp_sink">true</bool>
     <bool name="profile_supported_hdp">false</bool>
     <bool name="profile_supported_hs_hfp">false</bool>
-    <bool name="profile_supported_hfpclient">false</bool>
-    <bool name="profile_supported_hid">true</bool>
-    <bool name="profile_supported_opp">true</bool>
-    <bool name="profile_supported_pan">true</bool>
+    <bool name="profile_supported_hfpclient">true</bool>
+    <bool name="profile_supported_hid">false</bool>
+    <bool name="profile_supported_opp">false</bool>
+    <bool name="profile_supported_pan">false</bool>
     <bool name="profile_supported_pbap">false</bool>
     <bool name="profile_supported_gatt">true</bool>
     <bool name="pbap_include_photos_in_vcard">false</bool>
     <bool name="pbap_use_profile_for_owner_vcard">false</bool>
     <bool name="profile_supported_map">false</bool>
-    <bool name="profile_supported_avrcp_controller">false</bool>
+    <bool name="profile_supported_avrcp_controller">true</bool>
     <bool name="profile_supported_sap">false</bool>
-    <bool name="profile_supported_pbapclient">false</bool>
+    <bool name="profile_supported_pbapclient">true</bool>
     <bool name="profile_supported_mapmce">false</bool>
     <bool name="profile_supported_hidd">false</bool>
+
+    <bool name="profile_supported_hid_host">false</bool>
+    <bool name="profile_supported_avrcp_target">false</bool>
+    <bool name="profile_supported_hid_device">false</bool>
+
+    <bool name="enable_phone_policy">false</bool>
+    <bool name="hfp_client_connection_service_enabled">true</bool>
 </resources>

However, when you connect your mobile phone to make a call, the board has no sound and does not download the phone books

The Bluetooth logo displayed on the mobile phone is computer

As far as I know, ROCK Pi 4 doesn’t support the BT call feature because of the hardware limitation. The I2S is not routed to the wifi/bt module. BT speaker is supported.

I modified the configuration

project device/rockchip/common/ 
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index 175e845..70439b2 100644
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -20,7 +20,7 @@
 <resources>
 
     <!-- This device is not "voice capable"; it's data-only. -->
-    <bool name="config_voice_capable">false</bool>
+    <bool name="config_voice_capable">true</bool>

At present, the interface for making calls from mobile phones can be displayed.
I don’t know how to modify it so that the sound can be output from rockpi4