Hello
I am currently working successfully with marvell SD8787 card
Wi-Fi and FM are working perfect
Bluetooth is presenting a problem:
android version : 4.2 , bluetooth stack : bluedroid
port /dev/mbtchar0 is created
I have successfully configured bluedroid to identify that port as BT port
bdt is working fine :
:: Bluedroid test app starting
Loading HAL lib + extensions
HAL library loaded (Success)
INIT BT
HAL REQUEST SUCCESS
>enable
ENABLE BT
HAL REQUEST SUCCESS
>ADAPTER STATE UPDATED : ON
however when I try to use the android "settings"--> bluetooth gui I cannot use bluetooth
logcat shows the following:
I/ActivityManager: START u0 {act=android.intent.action.MAIN cmp=com.android.settings/.SubSettings (has extras)} from pid 2609
E/BluetoothAdapter: Bluetooth binder is null
E/DeviceListPreferenceFragment: Bluetooth is not supported on this device
* I already added :
device.mk
#Bluetooth
PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.bluetooth.xml:system/etc/permissions/android.hardware.bluetooth.xml
* the process com.android.bluetooth does not exist
com.android.bluetooth is process bluedroid hosted. If it's not started properly,something wrong. Please attach the whole logcat to check why bluetooth service can't be started.
this is full logcat using bdt (which works successfully) logcat is for enable and disable the device:
I/bluedroid( 8932): init
I/bte_conf( 8932): Attempt to load stack conf from /etc/bluetooth/bt_stack.conf
I/GKI_LINUX( 8932): gki_task_entry: gki_task_entry task_id=1 [BTIF] starting
E/BTIF_CORE( 8932): ### ASSERT : external/bluetooth/bluedroid/main/../btif/src/btif_core.c line 487 Callback is NULL (0) ###
I/bluedroid( 8932): enable
I/bt_hci_bdroid( 8932): init
I/bt_vendor( 8932): init
I/bt_vnd_conf( 8932): Attempt to load conf from /etc/bluetooth/bt_vendor.conf
I/bt_hci_bdroid( 8932): bt_hc_worker_thread started
I/GKI_LINUX( 8932): gki_task_entry: gki_task_entry task_id=0 [BTU] starting
I/bt_userial_vendor( 8932): userial vendor open: opening /dev/mbtchar0
I/bt_userial_vendor( 8932): device fd = 13 open
E/bt_hwcfg( 8932): vendor lib fwcfg aborted!!!
I/ ( 8932): BTE_InitTraceLevels -- TRC_HCI
I/ ( 8932): BTE_InitTraceLevels -- TRC_L2CAP
I/ ( 8932): BTE_InitTraceLevels -- TRC_RFCOMM
I/ ( 8932): BTE_InitTraceLevels -- TRC_AVDT
I/ ( 8932): BTE_InitTraceLevels -- TRC_AVRC
I/ ( 8932): BTE_InitTraceLevels -- TRC_A2D
I/ ( 8932): BTE_InitTraceLevels -- TRC_BNEP
I/ ( 8932): BTE_InitTraceLevels -- TRC_BTM
I/ ( 8932): BTE_InitTraceLevels -- TRC_PAN
I/ ( 8932): BTE_InitTraceLevels -- TRC_SDP
I/ ( 8932): BTE_InitTraceLevels -- TRC_BTAPP
I/ ( 8932): BTE_InitTraceLevels -- TRC_BTIF
E/bt-btif ( 8932): ## btif_config_get assert section && *section && key && *key && name && *name && bytes && type failed at line:182 ##
E/bt-btif ( 8932): btif_storage_get_adapter_property service_mask:0x0
E/BTIF_CORE( 8932): ### ASSERT : external/bluetooth/bluedroid/main/../btif/src/btif_core.c line 1040 Callback is NULL (0) ###
I/bt_hwcfg( 8932): SCO PCM configure {0, 4, 0, 0, 0}
I/GKI_LINUX( 8932): gki_task_entry: gki_task_entry task_id=2 [A2DP-MEDIA] starting
E/bt-btif ( 8932): btif_enable_service: current services:0x40000
E/bt-btif ( 8932): uinput_driver_check ERROR: uinput device is not in the system
I/bte_conf( 8932): Attempt to load did conf from /etc/bluetooth/bt_did.conf
I/bte_conf( 8932): [1] primary_record=1 vendor_id=0x000F vendor_id_source=0x0001 product_id=0x1200 version=0x1436
I/bte_conf( 8932): Attempt to load did conf from /etc/bluetooth/bt_did.conf
I/bte_conf( 8932): Attempt to load did conf from /etc/bluetooth/bt_did.conf
E/bt_h4 ( 8932): vendor lib postload completed
W/bt-btif ( 8932): bta_dm_disable BTA_DISABLE_DELAY set to 200 ms
D/btif_config_util( 8932): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new
W/bt-btif ( 8932): BTA got unregistered event id 18
I/bt_hci_bdroid( 8932): bt_hc_worker_thread exiting
W/bt-btif ( 8932): BTA got unregistered event id 18
W/bt_userial( 8932): select_read return size <=0:-1, exiting userial_read_thread
I/bt_userial_vendor( 8932): device fd = 13 close
D/BTSNOOP-DISP( 8932): btsnoop_close
I/GKI_LINUX( 8932): gki_task_entry: gki_task task_id=0 [BTU] terminating
I/GKI_LINUX( 8932): GKI_exit_task: GKI_exit_task 0 done
I/GKI_LINUX( 8932): GKI_destroy_task: GKI_shutdown(): task [BTU] terminated
this is logcat for trying to start Bluetooth VIA settings which fails :
I/ActivityManager( 2284): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.settings/.Settings} from pid 2511
I/UsageStats( 2284): Deleting usage file : usage-20140801
D/mali_winsys( 2630): new_window_surface returns 0x3000
I/ActivityManager( 2284): START u0 {act=android.intent.action.MAIN cmp=com.android.settings/.SubSettings (has extras)} from pid 2630
D/dalvikvm( 2284): GC_FOR_ALLOC freed 827K, 22% free 5784K/7328K, paused 65ms, total 65ms
E/BluetoothAdapter( 2630): Bluetooth binder is null
E/DeviceListPreferenceFragment( 2630): Bluetooth is not supported on this device
D/mali_winsys( 2630): new_window_surface returns 0x3000
I/ActivityManager( 2284): Displayed com.android.settings/.SubSettings: +127ms
D/dalvikvm( 2284): GC_FOR_ALLOC freed 198K, 22% free 5774K/7328K, paused 53ms, total 53ms
D/mali_winsys( 2630): new_window_surface returns 0x3000
D/dalvikvm( 2630): GC_EXPLICIT freed 241K, 12% free 3344K/3780K, paused 2ms+3ms, total 32ms
E/StrictMode( 2630): class com.android.settings.SubSettings; instances=2; limit=1
E/StrictMode( 2630): android.os.StrictMode$InstanceCountViolation: class com.android.settings.SubSettings; instances=2; limit=1
E/StrictMode( 2630): at android.os.StrictMode.setClassInstanceLimit(StrictMode.java:1)
There are some errors your should pay attention to.
1.E/bt_hwcfg( 8932): vendor lib fwcfg aborted!!!
It seems your fwcfg callback return bad value to bluedroid.
2.
E/bt-btif ( 8932): ## btif_config_get assert section && *section && key && *key && name && *name && bytes && type failed at line:182 ##
E/bt-btif ( 8932): btif_storage_get_adapter_property service_mask:0x0
Please check source code .As I remembered, some bluetooth required proprieties sh ould be set in your rc file.
3.E/bt-btif ( 8932): uinput_driver_check ERROR: uinput device is not in the system
Check your kernel config if the kernel uinput driver feature is enabled.
I/GKI_LINUX( 8932): gki_task_entry: gki_task task_id=0 [BTU] terminating
I/GKI_LINUX( 8932): GKI_exit_task: GKI_exit_task 0 done
I/GKI_LINUX( 8932): GKI_destroy_task: GKI_shutdown(): task [BTU] terminated
These log means bluedroid not started properly.
so I made a small progress , I am using the bluedroid vendor library that you posted , bdt is working and showing less errors , however starting "settings"-->bluetooth still does nothing , also when I press on settings bluetooth gui button it goes to on state but no
activity isviewed on logcat , it seems like I need to start some service on init.rc , but I found no documantation for that
Entering "settings"-->"bluetooth"
E/BluetoothAdapter( 2630): Bluetooth binder is null
E/DeviceListPreferenceFragment( 2630): Bluetooth is not supported on this device
bdt new log (enable and disable):
I/bte_conf(11772): Attempt to load stack conf from /etc/bluetooth/bt_stack.conf
I/GKI_LINUX(11772): gki_task_entry: gki_task_entry task_id=1 [BTIF] starting
E/BTIF_CORE(11772): ### ASSERT : external/bluetooth/bluedroid/main/../btif/src/btif_core.c line 487 Callback is NULL (0) ###
I/bluedroid(11772): enable
I/bt_hci_bdroid(11772): init
I/bt_mrvl (11772): Marvell BT Vendor Lib: ver M002
D/BTSNOOP-DISP(11772): btsnoop_open
I/bt_hci_bdroid(11772): bt_hc_worker_thread started
D/bt_mrvl (11772): Power off
E/bt_mrvl (11772): connect failed, ret:-1, strerror:No such file or directory
E/bt_mrvl (11772): cli_conn error.
D/bt_mrvl (11772): Power on
E/bt_mrvl (11772): connect failed, ret:-1, strerror:No such file or directory
E/bt_mrvl (11772): cli_conn error.
D/bt_mrvl (11772): open port /dev/mbtchar0 success
I/GKI_LINUX(11772): gki_task_entry: gki_task_entry task_id=0 [BTU] starting
I/bt_mrvl (11772): Start HW config ...
I/bt_mrvl (11772): Setting bd addr to 24:0A:64:E9:2D:32
I/bt_mrvl (11772): Sending hci command 0xFC22 (write_bd_address)
I/bt_mrvl (11772): FW config succeeds!
I/ (11772): BTE_InitTraceLevels -- TRC_HCI
I/ (11772): BTE_InitTraceLevels -- TRC_L2CAP
I/ (11772): BTE_InitTraceLevels -- TRC_RFCOMM
I/ (11772): BTE_InitTraceLevels -- TRC_AVDT
I/ (11772): BTE_InitTraceLevels -- TRC_AVRC
I/ (11772): BTE_InitTraceLevels -- TRC_A2D
I/ (11772): BTE_InitTraceLevels -- TRC_BNEP
I/ (11772): BTE_InitTraceLevels -- TRC_BTM
I/ (11772): BTE_InitTraceLevels -- TRC_PAN
I/ (11772): BTE_InitTraceLevels -- TRC_SDP
I/ (11772): BTE_InitTraceLevels -- TRC_BTAPP
I/ (11772): BTE_InitTraceLevels -- TRC_BTIF
D/bt-btif (11772): btif_task: received trigger stack init event
I/bt-btif (11772): BTA got event 0x100
I/bt-btif (11772): bta_dm_sm_execute event:0x0
I/bt-btif (11772): BTA got event 0x0
I/bt-btif (11772): bta_sys_sm_execute state:0, event:0x0
I/bt-btif (11772): bta_sys_hw_api_enable for 0, active modules 0x0001
I/bt-btif (11772): BTA got event 0x1
I/bt-btif (11772): bta_sys_sm_execute state:1, event:0x1
I/bt-btif (11772): bta_sys_hw_evt_enabled for 0
D/bt-btm (11772): btm_acl_device_down
D/bt-btif (11772): HC lib lpm deassertion return -1
D/bt-btm (11772): btm_acl_reset_paging
D/bt-btm (11772): btm_acl_set_discing
I/bt-btm (11772): btm_reset_complete
I/bt-btm (11772): BTM_SetPinType: pin type 0 [variable-0, fixed-1], code , length 0
D/bt-btm (11772): Local supported ACL packet types: 0xcc18
D/bt-btm (11772): Local supported SCO packet types: 0x003d
I/bt-btm (11772): BTM_SEC_REG[1]: id 42, is_orig 0, psm 0x0003, proto_id 3, chan_id 0
I/bt-btm (11772): : sec: 0x80, service name [RFC_MUX] (up to 21 chars saved)
D/bt-btm (11772): btm_sec_dev_reset sec mode: 4
I/bt-btm (11772): BTM_SetInquiryMode
I/bt-btm (11772): BTM_SetPageScanType
I/bt-btm (11772): BTM_SetInquiryScanType
D/bt-btif (11772): bta_sys_hw_btm_cback was called with parameter: 0
I/bt-btif (11772): BTA got event 0x2
I/bt-btif (11772): bta_sys_sm_execute state:1, event:0x2
D/bt-btif (11772): bta_sys_hw_evt_stack_enabled!notify the callers
D/bt-btif (11772): bta_dm_sys_hw_cback with event: 1
I/bt-btm (11772): BTM_Sec: application registered
I/bt-btm (11772): BTM_Sec: application registered
D/bt-btm (11772): BTM_SetDefaultLinkSuperTout
I/bt-btm (11772): BTM: BTM_WritePageTimeout: Timeout: 8192.
D/bt-btm (11772): BTM_SetDefaultLinkPolicy
D/bt-btm (11772): BTM_RegBusyLevelNotif
D/bt-btif (11772): HC lib lpm deassertion return -1
D/bt-btif (11772): HC lib lpm deassertion return -1
I/bt-btif (11772): btif_dm_upstreams_cback ev: BTA_DM_ENABLE_EVT
D/bt-btif (11772): in, bd addr:, prop type:1, len:248
D/bt-btif (11772): found node is NULL
I/bt-btif (11772): btif_dm_get_adapter_property: type=0x1
I/bt-btif (11772): in add:1
D/bt-btif (11772): in add:1
I/bt-btif (11772): Remote device:ute event:0x2
D/bt-btif (11772): BTA is generating EIR
D/bt-btif (11772): BTA is generating EIR
I/bt-btm (11772): ## btif_config_get assert section && *section
E/bt-btif (11772): ## btif_config_get assert section && *section && key && *key && name && *name && bytes && type failed at line:182 ##
D/bt-btif (11772): Remote device:, no link key
D/bt-btif (11772): in, bd addr:, prop type:1, len:248
D/bt-btif (11772): found node is NULL
I/bt-btif (11772): btif_dm_get_adapter_property: type=0x1
D/bt-btif (11772): in, bd addr:, prop type:9, len:4
D/bt-btif (11772): found node is NULL
I/bt-btif (11772): btif_dm_get_adapter_property: type=0x9
E/bt-btif (11772): btif_storage_get_adapter_property service_mask:0x0
E/BTIF_CORE(11772): ### ASSERT : external/bluetooth/bluedroid/main/../btif/src/btif_core.c line 1040 Callback is NULL (0) ###
I/bt-btif (11772): btif_storage_load_bonded_devices: 0 bonded devices found
D/bt-btif (11772): btif_enable_bluetooth_evt: status 0, local bd [24:0a:64:e9:2d:32]
I/bt-btif (11772): HC lib lpm enable=1 return 0
I/bt-btif (11772): ## A2DP START MEDIA TASK ##
I/bt_mrvl (11772): Start SCO config ...
I/bt_mrvl (11772): Sending hci command 0xFC07 (write_pcm_settings)
I/bt-btif (11772): HC lpm_result_cb 1
I/GKI_LINUX(11772): gki_task_entry: gki_task_entry task_id=2 [A2DP-MEDIA] starting
D/bt-btif (11772): UIPC_Init
I/bt-btif (11772): ### uipc_main_init ###
D/bt-btif (11772): UIPC_Open : ch_id 0, p_cback 40139b39
I/bt-btif (11772): SETUP CHANNEL SERVER 0
I/bt-btif (11772): create_server_socket /data/misc/bluedroid/.a2dp_ctrl
I/bt-btif (11772): created socket fd 19
I/bt-btif (11772): ADD SERVER FD TO ACTIVE SET 19
I/bt-btif (11772): UIPC SEND WAKE UP
I/bt-btif (11772): ## A2DP MEDIA TASK STARTED ##
E/bt-btif (11772): btif_enable_service: current services:0x40000
D/bt-btif (11772): btif_rc_init
E/bt-btif (11772): uinput_driver_check ERROR: uinput device is not in the system
D/bt-btif (11772): btif_av_state_idle_handler event:BTIF_SM_ENTER_EVT flags 0
I/bt-btif (11772): ## ON A2DP IDLE ##
D/bt-btif (11772): bta_av_co_init
D/bt-btif (11772): btif_media_task_aa_st
D/bt-btif (11772): bta_av_co_audio_codec_reset
D/bt-btif (11772): bta_av_co_audio_codec_reset
D/bt-btif (11772): btsock initializing...
D/bt-btif (11772): in initialized:1
D/bt-btif (11772): in initialized:1
I/bt-btif (11772): ts[7].used:1
D/bt-btif (11772): ts[7].used:1
D/bt-btif (11772): ts[6].used:0
D/bt-btif (11772): alloc_thread_slot ret:6
D/bt-btif (11772): h:6, cmd_fdr:20, cmd_fdw:21
D/bt-btif (11772): h:6, thread id:1083943880
I/bt-btif (11772): BTA_JvEnable
D/bt-btif (11772): btsock successfully initialized
D/bt-btif (11772): jni_initialized = 0, btpan_cb.enabled:0
I/bte_conf(11772): Attempt to load did conf from /etc/bluetooth/bt_did.conf
I/bt-btif (11772): BTA got event 0x1a00
D/bt-btif (11772): jv_dm_cback: event:0, slot id:0
D/bt-btif (11772): unhandled event:0, slot id:0
I/bte_conf(11772): [1] primary_record=1 vendor_id=0x000F vendor_id_source=0x0001 product_id=0x1200 version=0x1436
D/bt-sdp (11772): SDP_CreateRecord ok, num_records:1
I/bt-btif (11772): Adding UUID=0x1200 into EIR
D/bt-btif (11772): BTA is generating EIR
I/bt-btm (11772): Write Extended Inquiry Response to controller
I/bt-btif (11772): bta_dm_eir_update_uuid UUID bit mask=0x00000080 00000000
I/bte_conf(11772): Attempt to load did conf from /etc/bluetooth/bt_did.conf
I/bte_conf(11772): Attempt to load did conf from /etc/bluetooth/bt_did.conf
D/bt-btif (11772): btif_dm_load_local_oob prop_oob = 3
I/bt-btif (11772): HAL bt_hal_cbacks->adapter_state_changed_cb
I/bt_mrvl (11772): Sending hci command 0xFC28 (write_pcm_sync_settings)
D/bt-btif (11772): HC lib lpm deassertion return 0
D/bt-btif (11772): HC lib lpm deassertion return 0
I/bt_mrvl (11772): Sending hci command 0xFC29 (write_pcm_link_settings)
I/bt_mrvl (11772): Sending hci command 0xFC1D (set_sco_data_path)
I/bt_mrvl (11772): SCO PCM config succeeds!
E/bt_h4 (11772): vendor lib postload completed
I/bt-btif (11772): HC postload_cb 0
D/bt-btif (11772): BTIF DISABLE BLUETOOTH
D/bt-btif (11772): cmd.id:2
D/bt-btif (11772): h:6, process_cmd_sock return false, exit...
D/bt-btif (11772): socket poll thread exiting, h:6
D/bt-btif (11772): leaving
I/bt-btif (11772): BTA got event 0x101
I/bt-btif (11772): bta_dm_sm_execute event:0x1
D/bt-btif (11772): bta_sys_disable: module 0
I/bt-btm (11772): BTM_SetDiscoverability
I/bt-btm (11772): BTM_SetDiscoverability: mode 0 [NonDisc-0, Lim-1, Gen-2], window 0x0012, interval 0x0800
I/bt-btm (11772): BTM_SetConnectability
I/bt-btm (11772): BTM_SetConnectability: mode 0 [NonConn-0, Conn-1], window 0x0012, interval 0x0800
I/bt-btm (11772): BTM_IsInquiryActive
I/bt-btm (11772): BTM_CancelRemoteDeviceName()
W/bt-btif (11772): bta_dm_disable BTA_DISABLE_DELAY set to 200 ms
D/btif_config_util(11772): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new
D/bt-btif (11772): HC lib lpm deassertion return 0
D/bt-btif (11772): HC lib lpm deassertion return 0
I/bt-btif (11772): BTA got event 0x3
I/bt-btif (11772): bta_sys_sm_execute state:2, event:0x3
D/bt-btif (11772): bta_sys_hw_api_disable for 0, active modules: 0x0001
D/bt-btif (11772): bta_sys_disable: module 0
I/bt-btif (11772): BTA got event 0x4
I/bt-btif (11772): bta_sys_sm_execute state:3, event:0x4
D/bt-btif (11772): bta_sys_hw_evt_disabled - module 0x0
D/bt-btif (11772): bta_dm_sys_hw_cback with event: 0
I/bt-btif (11772): btif_dm_upstreams_cback ev: BTA_DM_DISABLE_EVT
D/bt-btif (11772): btif_disable_bluetooth_evt
I/bt-btif (11772): HC lib lpm enable=0 return 0
D/bt-btif (11772): bte_main_disable
I/bt-btif (11772): bte_main_disable
W/bt-btif (11772): BTA got unregistered event id 18
I/bt-btif (11772): BTA got event 0x1200
W/bt-btif (11772): BTA got unregister
I/bt-btif (11772): BTA got unregister
I/bt_hci_bdroid(11772): bt_hc_worker_thread exiting
W/bt_userial(11772): select_read return size <=0:-1, exiting userial_read_thread
D/bt_mrvl (11772): close port /dev/mbtchar0
D/BTSNOOP-DISP(11772): btsnoop_close
D/bt_mrvl (11772): Power off
E/bt_mrvl (11772): connect failed, ret:-1, strerror:No such file or directory
E/bt_mrvl (11772): cli_conn error.
I/GKI_LINUX(11772): gki_task_entry: gki_task task_id=0 [BTU] terminating
I/GKI_LINUX(11772): GKI_exit_task: GKI_exit_task 0 done
I/GKI_LINUX(11772): GKI_destroy_task: GKI_shutdown(): task [BTU] terminated
I/bt-btif (11772): HAL bt_hal_cbacks->adapter_state_changed_cb
You can review my android source code in https://github.com/xhteam
My device is qpad. Good luck to you!
If your issue resolved, please mark it correct answer.
of course , I will also write the solution when I will solve it
currently my problem is that pressing the "on" button in "settings"-->"bluetooth" does nothing , I am trying to understand why
Hi all,
I have integrated bluetooth icon to GUI, but I am unable to load my driver when I enable bluetooth, please tell me which are the files needed to be changed.
Thanks,
Mutyalarao.
Hi all,
Plat form IMX6SL
bluedroid on adroid kitkat 4.4.3
I have 2 issues one while data transfer, the other while enabling via GUI.
1) After enabling bluetooth, while transferring file from third party mobile to IMX_6SL board, file is getting transferred(TX), but vice versa (RX) is not happening, it is giving the error message :
File not Received
File : sample.jpg
Reason : Storage issue
2) And presently I am inserting my driver via GUI, I am getting an error message while enabling bluetooth via GUI ie Operation not permitted while loading .ko (driver)Please suggest me what to do?? whether I need to install my driver at boot by adding in init.rc?? if I do it always on boot bt will be in ON State only?? OR Do i need to build my driver along with android source code???
Please suggest me how to proceed further???
Thanks and Regards,
Mutyala Rao.
it looks like a problem with init.rc , what should be defined for Bluedroid to work (for Bluez there is a lot of documentation , none that I can find relate to Bluedroid)