Closed Bug 1165313 Opened 10 years ago Closed 10 years ago

[flame-l]Support Bluetooth feature

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: shawnjohnjr, Assigned: viralwang)

References

Details

Attachments

(3 files, 2 obsolete files)

[flame-l] Support Bluetooth feature
Assignee: nobody → shuang
After building bluedroid stack and put libbt-vendor.so. Still don't have any idea. 05-15 01:21:42.753 I/qcom-bluetooth( 1760): /system/etc/init.qcom.bt.sh: Bluetooth QSoC firmware download succeeded, /dev/ttyHS0 qualcomm 3000000 00:a0:c6:cb:ae:09 05-15 01:21:42.772 I/qcom-bluetooth( 1761): /system/etc/init.qcom.bt.sh: ** Bluedroid stack ** 05-15 01:21:42.813 I/bt_vendor( 1735): bluetooth satus is on 05-15 01:21:42.813 I/bt_vendor( 1735): bt-vendor : BT_VND_OP_USERIAL_OPEN 05-15 01:21:42.816 I/bt_vendor( 1735): Done intiailizing UART 05-15 01:21:42.818 I/bt_vendor( 1735): Done intiailizing UART 05-15 01:21:42.818 E/bt_userial( 1735): userial_open opened wrong number of ports: got 2, expected 1. 05-15 01:21:42.818 I/bt_vendor( 1735): bt-vendor : BT_VND_OP_USERIAL_CLOSE btSocType: 0 05-15 01:21:42.839 I/bt_vendor( 1735): Bluetooth Firmware and transport layer are initialized 05-15 01:21:42.839 I/bt-btu ( 1735): btu_task received preload complete event 05-15 01:21:42.843 W/bt-l2cap( 1735): L2CAP - L2CA_Register() called for PSM: 0x0001 05-15 01:21:42.843 W/bt-l2cap( 1735): L2CAP - L2CA_Register() called for PSM: 0x001f 05-15 01:21:42.851 W/bt-l2cap( 1735): L2CAP - L2CA_Register() called for PSM: 0x0003 05-15 01:21:42.851 W/bt-l2cap( 1735): L2CAP - L2CA_Register() called for PSM: 0x1487 05-15 01:21:42.854 I/ ( 1735): [bttrc] using compile default trace settings 05-15 01:21:42.857 E/bt_userial( 1735): userial_write error writing to serial port: Bad file number
ok, it looks like I should not use libbt-vendor.so prebuilt, maybe I should use hardware/qcom/bt to build.
target Generated: libbt-vendor <= hardware/qcom/bt/libbt-vendor/include/vnd_generic.txt make: *** No rule to make target `out/target/product/flame/obj/SHARED_LIBRARIES/libbtnv_intermediates/export_includes', needed by `out/target/product/flame/obj/SHARED_LIBRARIES/libbt-vendor_intermediates/import_includes'. Stop.
(In reply to Shawn Huang [:shawnjohnjr] from comment #5) > ok, it looks like I should not use libbt-vendor.so prebuilt, maybe I should > use hardware/qcom/bt to build. I was wrong. These proprietary files I probably don't need to touch. Maybe even building libbt is not correct.
bt_vendor_qcom.c case BT_VND_OP_USERIAL_OPEN: case BT_SOC_DEFAULT: if(bt_hci_init_transport(pFd) != -1){ int (*fd_array)[] = (int (*) []) param; (*fd_array)[CH_CMD] = pFd[0]; (*fd_array)[CH_EVT] = pFd[0]; (*fd_array)[CH_ACL_OUT] = pFd[1]; (*fd_array)[CH_ACL_IN] = pFd[1]; } else { retval = -1; break; } retval = 2;
Ok, damn you SOC type property!!!! /** Get Bluetooth SoC type from system setting */ static int get_bt_soc_type() { int ret = 0; char bt_soc_type[PROPERTY_VALUE_MAX]; ALOGI("bt-vendor : get_bt_soc_type"); ret = property_get("qcom.bluetooth.soc", bt_soc_type, NULL); if (ret != 0) { ALOGI("qcom.bluetooth.soc set to %s\n", bt_soc_type);
I tried to put flame-l orignal bluetooth.default.so into /system/lib/hw, it can work. But we shall be able to build bluedroid ourselves, I'm still trying to figure out why bluetooth.default.so with original prebuilt libbt-vendor.so won't work.
(In reply to Shawn Huang [:shawnjohnjr] from comment #9) > Ok, damn you SOC type property!!!! > > > /** Get Bluetooth SoC type from system setting */ > static int get_bt_soc_type() > { > int ret = 0; > char bt_soc_type[PROPERTY_VALUE_MAX]; > > ALOGI("bt-vendor : get_bt_soc_type"); > > ret = property_get("qcom.bluetooth.soc", bt_soc_type, NULL); > if (ret != 0) { > ALOGI("qcom.bluetooth.soc set to %s\n", bt_soc_type); I was wrong about this property. It doesn't cause any problem at all.
Blocks: 1153155
Just move external/bluetooth/bluedroid/ to t2m github. https://github.com/t2m-foxfone/android_platform_external_bluetooth_bluedroid Not sure what's the difference exactly but at least it included loading bt mac address in their repo.
Hi Viral, I followed your idea and switch bluetooth bluedroid stack to t2m version (as i did for Attachment 8607352 [details] [diff]). But it results the same problem. If I push the bluetooth.default.so file that you provided for Android, it can work. 05-15 01:21:42.753 I/qcom-bluetooth( 1760): /system/etc/init.qcom.bt.sh: Bluetooth QSoC firmware download succeeded, /dev/ttyHS0 qualcomm 3000000 00:a0:c6:cb:ae:09 05-15 01:21:42.772 I/qcom-bluetooth( 1761): /system/etc/init.qcom.bt.sh: ** Bluedroid stack ** 05-15 01:21:42.813 I/bt_vendor( 1735): bluetooth satus is on 05-15 01:21:42.813 I/bt_vendor( 1735): bt-vendor : BT_VND_OP_USERIAL_OPEN 05-15 01:21:42.816 I/bt_vendor( 1735): Done intiailizing UART 05-15 01:21:42.818 I/bt_vendor( 1735): Done intiailizing UART 05-15 01:21:42.818 E/bt_userial( 1735): userial_open opened wrong number of ports: got 2, expected 1. 05-15 01:21:42.818 I/bt_vendor( 1735): bt-vendor : BT_VND_OP_USERIAL_CLOSE btSocType: 0 05-15 01:21:42.839 I/bt_vendor( 1735): Bluetooth Firmware and transport layer are initialized 05-15 01:21:42.839 I/bt-btu ( 1735): btu_task received preload complete event .. 05-15 01:21:42.854 I/ ( 1735): [bttrc] using compile default trace settings 05-15 01:21:42.857 E/bt_userial( 1735): userial_write error writing to serial port: Bad file number
Flags: needinfo?(vwang)
Hi Viral Could you help to confirm with t2m that current situation we don't have any chance to build bluedroid ourselves due to libbt-vendor/libbtnv proprietary restriction? If they can confirm this restriction, i think we don't any choose. And can you emphasize that flame-kk doesn't encounter this restriction? Thanks!
(In reply to Shawn Huang [:shawnjohnjr] from comment #16) > Hi Viral > Could you help to confirm with t2m that current situation we don't have any > chance to build bluedroid ourselves due to libbt-vendor/libbtnv proprietary > restriction? If they can confirm this restriction, i think we don't any > choose. And can you emphasize that flame-kk doesn't encounter this > restriction? Thanks! typo: s/any choose/any choice/
still working with partner to see if we can build our own bluetooth.default.so before that, we may put it in extract-files.sh to enable bt first.
Flags: needinfo?(vwang)
Hi BT Hal code is in external/bluetooth/bluedroid.It's opensource. libbt-vendor.so is in hardware/qcom/bt.It's private code. Bt hal depends on libbt-vendor talking with QCOM BT driver. You shoul talk with qcom with your new feature
(In reply to shiqian.zhou from comment #19) > Hi > BT Hal code is in external/bluetooth/bluedroid.It's opensource. > libbt-vendor.so is in hardware/qcom/bt.It's private code. > Bt hal depends on libbt-vendor talking with QCOM BT driver. > You shoul talk with qcom with your new feature We don't want to touch any proprietary library. We simple want to build bluedroid opensource code ourselves. However, bluedroid seems need to reference libbt-vendor (static link), if the following flags were been enabled. ifeq ($(BOARD_HAVE_BLUETOOTH), true) # Uncomment the following flag to enable bluez # BOARD_HAVE_BLUETOOTH_BLUEZ := true ifneq ($(BOARD_HAVE_BLUETOOTH_BLUEZ), true) BOARD_HAVE_BLUETOOTH_QCOM := true QCOM_BT_USE_SMD_TTY := true BLUETOOTH_HCI_USE_MCT := true BOARD_USES_WIPOWER := false endif # BOARD_HAVE_BLUETOOTH_BLUEZ endif # BOARD_HAVE_BLUETOOTH If we don't set those flags, the bluedroid library we build won't work correctly.
in external/bluetooth/bluedroid/main/im Android.mk LOCAL_SHARED_LIBRARIES := \ libcutils \ libdl \ liblog \ libpower \ libutils \ libmedia LOCAL_STATIC_LIBRARIES := \ libbt-brcm_bta \ libbt-brcm_gki \ libbt-brcm_stack \ libbt-hci \ libbt-utils \ libbt-qcom_sbc_decoder \ libosi \ libtinyxml2 \ libbt-qcom_sbc_decoder It doesn't need libbt-vendor when compile. external/bluetooth/bluedroid/hci/src/vendor.c vendor_open will open libbt-vendor.so and inital hardware
Export includes file: external/bluetooth/bluedroid/main/Android.mk -- out/target/product/flame/obj/SHARED_LIBRARIES/bluetooth.default_intermediates/export_includes make: *** No rule to make target `out/target/product/flame/obj/SHARED_LIBRARIES/libbtnv_intermediates/export_includes', needed by `out/target/product/flame/obj/SHARED_LIBRARIES/libbt-vendor_intermediates/import_includes'. Stop. make: *** Waiting for unfinished jobs....
Strange. If I set flags in BoardConfig.mk. BOARD_HAVE_BLUETOOTH_QCOM := true QCOM_BT_USE_SMD_TTY := true BLUETOOTH_HCI_USE_MCT := true BOARD_USES_WIPOWER := false And run ./build.sh. I can see build break in Comment 22. But if i go to external/bluetooth/bliedroid and do 'mm' for partial build. The build break won't happen.
(In reply to shiqian.zhou from comment #21) > in external/bluetooth/bluedroid/main/im Android.mk > LOCAL_SHARED_LIBRARIES := \ > libcutils \ > libdl \ > liblog \ > libpower \ > libutils \ > libmedia > > LOCAL_STATIC_LIBRARIES := \ > libbt-brcm_bta \ > libbt-brcm_gki \ > libbt-brcm_stack \ > libbt-hci \ > libbt-utils \ > libbt-qcom_sbc_decoder \ > libosi \ > libtinyxml2 \ > libbt-qcom_sbc_decoder > It doesn't need libbt-vendor when compile. > external/bluetooth/bluedroid/hci/src/vendor.c vendor_open will open > libbt-vendor.so and inital hardware Well, but i can see LOCAL_REQUIRED_MODULES contains libbt-vendor. LOCAL_REQUIRED_MODULES := \ auto_pair_devlist.conf \ bt_did.conf \ bt_stack.conf \ libbt-vendor
Ok, case should be able to close. Build break caused by the manifest fetched hardware/qcom/bt folder.
I tested bluedroid can be built correctly and function can work correctly. Thanks everyone!
Set LOCAL_REQUIRED_MODULES to any number of whitespace-separated module names, like "libblah" or "Email". If this module is installed, all of the modules that it requires will be installed as well. This can be used to, e.g., ensure that necessary shared libraries or providers are installed when a given app is installed.
Set LOCAL_REQUIRED_MODULES to any number of whitespace-separated module names, like "libblah" or "Email". If this module is installed, all of the modules that it requires will be installed as well. This can be used to, e.g., ensure that necessary shared libraries or providers are installed when a given app is installed.
Assign to :viral because i have done my part.
Assignee: shuang → vwang
the fix already include in bug 1153155
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: