Dear Wigros Sun,
Thank you for your reply weidong.sun and work posted on the link. It very helpful to me.
Porting BCM4330/BCM43362 WIFI to Android4.2.2
With with WiFi at my board is working absolutely fine. But while making it for BT i am facing some issue. The adb logcat of the activity is attached for your reference.
-----------------------start-of- log----------------------------------------------
01-01 00:04:22.233 2365 2382 E bt_hci : startup_timer_expired
01-01 00:04:22.234 2365 2380 E bt_core_module: module_start_up failed to start up "hci_module"
01-01 00:04:22.238 2365 2389 I bt_btu : btu_task pending for preload complete event
01-01 00:04:22.238 2365 2389 I bt_btu_task: Bluetooth chip preload is complete
01-01 00:04:22.238 2365 2389 I bt_btu : btu_task received preload complete event
01-01 00:04:22.241 2365 2382 E bt_hci : command_timed_out hci layer timeout waiting for response to a command. opcode: 0xc03
01-01 00:04:22.241 2365 2382 E bt_hci : command_timed_out restarting the bluetooth process.
01-01 00:04:22.249 2365 2389 I : BTE_InitTraceLevels -- TRC_HCI
01-01 00:04:22.249 2365 2389 I : BTE_InitTraceLevels -- TRC_L2CAP
01-01 00:04:22.249 2365 2389 I : BTE_InitTraceLevels -- TRC_RFCOMM
01-01 00:04:22.249 2365 2389 I : BTE_InitTraceLevels -- TRC_AVDT
01-01 00:04:22.249 2365 2389 I : BTE_InitTraceLevels -- TRC_AVRC
01-01 00:04:22.249 2365 2389 I : BTE_InitTraceLevels -- TRC_A2D
01-01 00:04:22.249 2365 2389 I : BTE_InitTraceLevels -- TRC_BNEP
01-01 00:04:22.249 2365 2389 I : BTE_InitTraceLevels -- TRC_BTM
01-01 00:04:22.249 2365 2389 I : BTE_InitTraceLevels -- TRC_GAP
01-01 00:04:22.249 2365 2389 I : BTE_InitTraceLevels -- TRC_PAN
01-01 00:04:22.249 2365 2389 I : BTE_InitTraceLevels -- TRC_SDP
01-01 00:04:22.249 2365 2389 I : BTE_InitTraceLevels -- TRC_GATT
01-01 00:04:22.249 2365 2389 I : BTE_InitTraceLevels -- TRC_SMP
01-01 00:04:22.249 2365 2389 I : BTE_InitTraceLevels -- TRC_BTAPP
01-01 00:04:22.249 2365 2389 I : BTE_InitTraceLevels -- TRC_BTIF
01-01 00:04:22.328 1091 1109 E BluetoothManagerService: MESSAGE_BLUETOOTH_SERVICE_DISCONNECTED: 1
01-01 00:04:22.328 1091 1109 D BluetoothManagerService: Broadcasting onBluetoothServiceDown() to 4 receivers.
01-01 00:04:22.332 1091 1102 I ActivityManager: Process com.android.bluetooth (pid 2365) has died
01-01 00:04:22.333 1091 1102 W ActivityManager: Scheduling restart of crashed service com.android.bluetooth/.btservice.AdapterService in 1000ms
01-01 00:04:22.334 1091 1102 W ActivityManager: Scheduling restart of crashed service com.android.bluetooth/.gatt.GattService in 11000ms
01-01 00:04:22.529 1091 1109 D BluetoothManagerService: MESSAGE_RESTART_BLUETOOTH_SERVICE: Restart IBluetooth service
01-01 00:04:22.573 1091 1109 I ActivityManager: Start proc 2391:com.android.bluetooth/1002 for service com.android.bluetooth/.btservice.AdapterService
01-01 00:04:22.659 2391 2391 I art : Late-enabling JIT
01-01 00:04:22.690 2391 2391 I art : JIT created with code_cache_capacity=2MB compile_threshold=1000
01-01 00:04:22.864 2391 2391 D AdapterServiceConfig: Adding HeadsetService
01-01 00:04:22.868 2391 2391 D AdapterServiceConfig: Adding A2dpService
01-01 00:04:22.873 2391 2391 D AdapterServiceConfig: Adding A2dpSinkService
01-01 00:04:22.878 2391 2391 D AdapterServiceConfig: Adding HidService
01-01 00:04:22.883 2391 2391 D AdapterServiceConfig: Adding HealthService
01-01 00:04:22.887 2391 2391 D AdapterServiceConfig: Adding PanService
01-01 00:04:22.891 2391 2391 D AdapterServiceConfig: Adding GattService
01-01 00:04:22.894 2391 2391 D AdapterServiceConfig: Adding BluetoothMapService
01-01 00:04:22.896 2391 2391 D AdapterServiceConfig: Adding AvrcpControllerService
01-01 00:04:22.940 1091 1109 D BluetoothManagerService: Added callback: android.bluetooth.IBluetoothManagerCallback$Stub$Proxy@51fc1d8:true
01-01 00:04:22.949 2391 2391 D BluetoothAdapterState: make() - Creating AdapterState
01-01 00:04:22.962 2391 2391 I bt_bluedroid: init
01-01 00:04:22.962 2391 2405 I BluetoothAdapterState: Entering OffState
01-01 00:04:22.965 2391 2406 I bt_bte_conf: bte_load_ble_conf attempt to load ble stack conf from /etc/bluetooth/ble_stack.conf
01-01 00:04:22.965 2391 2406 E bt_osi_config: config_new unable to open file '/etc/bluetooth/ble_stack.conf': No such file or directory
01-01 00:04:22.965 2391 2406 I bt_bte_conf: bte_load_ble_conf file >/etc/bluetooth/ble_stack.conf< not found
01-01 00:04:22.965 2391 2406 I bt_stack_config: init attempt to load stack conf from /etc/bluetooth/bt_stack.conf
01-01 00:04:22.966 2391 2391 I bt_bluedroid: get_profile_interface socket
01-01 00:04:22.975 2391 2409 D BluetoothAdapterProperties: Address is:22:22:A2:55:D1:2C
01-01 00:04:22.977 2391 2409 W art : Method processed more than once: void com.android.bluetooth.btservice.AdapterProperties.adapterPropertyChangedCallback(int[], byte[][])
01-01 00:04:22.978 2391 2391 I bt_bluedroid: get_profile_interface sdp
01-01 00:04:22.981 2391 2409 D BluetoothAdapterProperties: Name is: SABREAUTO-MX6Q
01-01 00:04:22.985 2391 2403 I bt_bluedroid: config_hci_snoop_log
01-01 00:04:22.988 1091 1109 D BluetoothManagerService: Broadcasting onBluetoothServiceUp() to 5 receivers.
01-01 00:04:22.993 2391 2405 D BluetoothAdapterState: Current state: OFF, message: 0
01-01 00:04:22.993 2391 2405 D BluetoothAdapterProperties: Setting state to 14
01-01 00:04:22.993 2391 2405 I BluetoothAdapterState: Bluetooth adapter state changed: 10-> 14
01-01 00:04:23.003 2391 2405 D BluetoothBondStateMachine: make
01-01 00:04:23.008 2391 2410 I BluetoothBondStateMachine: StableState(): Entering Off State
01-01 00:04:23.031 2391 2405 I BluetoothAdapterState: Entering PendingCommandState
01-01 00:04:23.065 2391 2391 I BtGatt.JNI: classInitNative(L912): classInitNative: Success!
01-01 00:04:23.079 2391 2391 D BluetoothAdapterService: getAdapterService() - returning com.android.bluetooth.btservice.AdapterService@31282f0
01-01 00:04:23.082 2391 2391 D BtGatt.DebugUtils: handleDebugAction() action=null
01-01 00:04:23.083 2391 2391 D BtGatt.GattService: Received start request. Starting profile...
01-01 00:04:23.083 2391 2391 D BtGatt.GattService: start()
01-01 00:04:23.083 2391 2391 I bt_bluedroid: get_profile_interface gatt
01-01 00:04:23.086 2391 2391 D BluetoothAdapterService: getAdapterService() - returning com.android.bluetooth.btservice.AdapterService@31282f0
01-01 00:04:23.086 2391 2391 D BtGatt.AdvertiseManager: advertise manager created
01-01 00:04:23.107 2391 2391 V BluetoothAdapterState: isTurningOff()=false
01-01 00:04:23.107 2391 2391 V BluetoothAdapterState: isTurningOn()=false
01-01 00:04:23.107 2391 2391 V BluetoothAdapterState: isBleTurningOn()=true
01-01 00:04:23.107 2391 2391 V BluetoothAdapterState: isBleTurningOff()=false
01-01 00:04:23.109 2391 2405 D BluetoothAdapterState: Current state: PENDING_COMMAND, message: 4
01-01 00:04:23.109 2391 2405 I bt_bluedroid: enable
01-01 00:04:23.109 2391 2406 D bt_stack_manager: event_start_up_stack is bringing up the stack.
01-01 00:04:23.109 2391 2406 I bt_hci : start_up
01-01 00:04:23.118 2391 2406 I bt_vendor: alloc value 0x9b2c87dd
01-01 00:04:23.118 2391 2406 I bt_vendor: init
01-01 00:04:23.118 2391 2406 I bt_vnd_conf: Attempt to load conf from /etc/bluetooth/bt_vendor.conf
01-01 00:04:23.118 2391 2406 D bt_vendor: op for 0
01-01 00:04:23.119 2391 2406 E bt_upio : init_rfkill : open(/sys/class/rfkill/rfkill2/type) failed: No such file or directory (2)
01-01 00:04:23.119 2391 2406 D bt_vendor: op for 0
01-01 00:04:23.119 2391 2406 E bt_upio : init_rfkill : open(/sys/class/rfkill/rfkill2/type) failed: No such file or directory (2)
01-01 00:04:23.120 2391 2406 D bt_hci : start_up starting async portion
01-01 00:04:23.120 2391 2413 I bt_hci : event_finish_startup
01-01 00:04:23.120 2391 2413 I bt_hci_h4: hal_open
01-01 00:04:23.120 2391 2413 D bt_vendor: op for 3
01-01 00:04:23.120 2391 2413 I bt_userial_vendor: userial vendor open: opening /dev/ttymxc2
01-01 00:04:23.123 2391 2413 I bt_userial_vendor: device fd = 53 open
01-01 00:04:23.124 2391 2413 D bt_vendor: op for 1
-----------------------End-of-log------------------------------------------------
. For your information my environment details are as follows:
1. Board iMX6Q-AI
2. OS Marshmallow 6.0.1
3. Kernel linux 3.14.52
4. WiFi H/W Murata WiFi-BT V2 adaptor
For more on this i am attaching the image of my hardware setup. Look forward for your support.
Thank you in advance.
Rohit
Solved! Go to Solution.
Hello Rohit,
I don't have detailed documents on how to porting bluetooth for you. I checked android5.1.1 source code on sabresd_mx6dq board, in BoardConfig.mk, BCM4339 BT has beed supported, see following:
---------------------------------
# Broadcom BCM4339 BT
BOARD_HAVE_BLUETOOTH_BCM := true
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/fsl/sabresd_6dq/bluetooth
USE_ION_ALLOCATOR := false
USE_GPU_ALLOCATOR := true
---------------------------------
So it is no any problem for you to refer to BT source code for sabresd_mx6dq board, check Marshmallow 6.0.1 source code for sabresd_mx6dq board, please! then move corresponding source code to your board!
Best Regards,
Weidong
Hello Rohit,
I don't have detailed documents on how to porting bluetooth for you. I checked android5.1.1 source code on sabresd_mx6dq board, in BoardConfig.mk, BCM4339 BT has beed supported, see following:
---------------------------------
# Broadcom BCM4339 BT
BOARD_HAVE_BLUETOOTH_BCM := true
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/fsl/sabresd_6dq/bluetooth
USE_ION_ALLOCATOR := false
USE_GPU_ALLOCATOR := true
---------------------------------
So it is no any problem for you to refer to BT source code for sabresd_mx6dq board, check Marshmallow 6.0.1 source code for sabresd_mx6dq board, please! then move corresponding source code to your board!
Best Regards,
Weidong
Hello Wigros San,
Thank you for your reply.
As suggested i referred the SD BT code and made the required changes for iMX6Q-AI board. One good thing is now WiFi-BT is working fine on my AI board with Marshmallow.
Currently I am able to transfer image, play media over Bluetooth on my board. But it is through the A2dpsink app (System app) given as part of Android BSP.
Now, further to this I want to achieve the functionality of HFP and A2dp for which want to develop a Android application, but while doing this I am facing below issues:
1. two class (import android.bluetooth.BluetoothA2dpSink and import android.bluetooth.BluetoothAvrcpController)files is not getting import in Android studio.
The source code of Android application i am referring is here .
Could you please guide me on this to realize the hansfree and A2dp functionality on my AI Board.
Thank you,
Rohit