Closed
Bug 1165313
Opened 10 years ago
Closed 10 years ago
[flame-l]Support Bluetooth feature
Categories
(Firefox OS Graveyard :: Bluetooth, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: shawnjohnjr, Assigned: viralwang)
References
Details
Attachments
(3 files, 2 obsolete files)
2.53 KB,
patch
|
Details | Diff | Splinter Review | |
2.80 KB,
patch
|
Details | Diff | Splinter Review | |
822 bytes,
patch
|
Details | Diff | Splinter Review |
[flame-l] Support Bluetooth feature
Reporter | ||
Updated•10 years ago
|
Assignee: nobody → shuang
Reporter | ||
Comment 1•10 years ago
|
||
Reporter | ||
Comment 2•10 years ago
|
||
Reporter | ||
Comment 3•10 years ago
|
||
Reporter | ||
Comment 4•10 years ago
|
||
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
Reporter | ||
Comment 5•10 years ago
|
||
ok, it looks like I should not use libbt-vendor.so prebuilt, maybe I should use hardware/qcom/bt to build.
Reporter | ||
Comment 6•10 years ago
|
||
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.
Reporter | ||
Comment 7•10 years ago
|
||
(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.
Reporter | ||
Comment 8•10 years ago
|
||
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;
Reporter | ||
Comment 9•10 years ago
|
||
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);
Reporter | ||
Comment 10•10 years ago
|
||
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.
Reporter | ||
Comment 11•10 years ago
|
||
(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.
Assignee | ||
Comment 12•10 years ago
|
||
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.
Reporter | ||
Updated•10 years ago
|
Attachment #8606277 -
Attachment is obsolete: true
Reporter | ||
Updated•10 years ago
|
Attachment #8606278 -
Attachment is obsolete: true
Reporter | ||
Comment 13•10 years ago
|
||
Reporter | ||
Comment 14•10 years ago
|
||
Reporter | ||
Comment 15•10 years ago
|
||
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
Reporter | ||
Updated•10 years ago
|
Flags: needinfo?(vwang)
Reporter | ||
Comment 16•10 years ago
|
||
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!
Reporter | ||
Comment 17•10 years ago
|
||
(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/
Assignee | ||
Comment 18•10 years ago
|
||
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)
Comment 19•10 years ago
|
||
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
Reporter | ||
Comment 20•10 years ago
|
||
(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.
Comment 21•10 years ago
|
||
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
Reporter | ||
Comment 22•10 years ago
|
||
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....
Reporter | ||
Comment 23•10 years ago
|
||
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.
Reporter | ||
Comment 24•10 years ago
|
||
(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
Reporter | ||
Comment 25•10 years ago
|
||
Ok, case should be able to close. Build break caused by the manifest fetched hardware/qcom/bt folder.
Reporter | ||
Comment 26•10 years ago
|
||
I tested bluedroid can be built correctly and function can work correctly. Thanks everyone!
Comment 27•10 years ago
|
||
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.
Comment 28•10 years ago
|
||
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.
Reporter | ||
Comment 29•10 years ago
|
||
Assign to :viral because i have done my part.
Assignee: shuang → vwang
Updated•10 years ago
|
Blocks: Flame_L_PVT
Updated•10 years ago
|
No longer blocks: Flame_L_PVT
Assignee | ||
Comment 30•10 years ago
|
||
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.
Description
•