Closed
Bug 944299
Opened 11 years ago
Closed 10 years ago
B2G Emulator: support bluedroid
Categories
(Firefox OS Graveyard :: Emulator, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
2.0 S4 (20june)
People
(Reporter: vicamo, Assigned: shawnjohnjr)
References
Details
Attachments
(5 files, 3 obsolete files)
No description provided.
Reporter | ||
Comment 1•11 years ago
|
||
https://wiki.mozilla.org/B2G/Bluetooth-bluedroid
We need:
1) include module "bluetooth.default" to build list
ALL_DEFAULT_INSTALLED_MODULES or PRODUCT_PACKAGES
2) goldfish specific libbt-vendor.so
https://android.googlesource.com/platform/hardware/qcom/bt/+/android-4.3_r2.1
https://android.googlesource.com/platform/hardware/broadcom/libbt/+/android-4.3_r2.1
3) merge kernel changes for bluetooth support
https://github.com/mozilla-b2g/platform_prebuilts_qemu-kernel/commit/1c1aedebe8b5c854df5fa3bd3690b67859e44388
Reporter | ||
Comment 2•11 years ago
|
||
Reporter | ||
Comment 3•11 years ago
|
||
Current status: enabling BT in Settings app hangs Gaia, bt-vendor closes opened fd.
Reporter | ||
Comment 4•11 years ago
|
||
https://wiki.mozilla.org/B2G/Bluetooth-bluedroid from Shawn Huang [:shuang] [:shawnjohnjr].
Reporter | ||
Comment 5•11 years ago
|
||
Disable HCISU_H4_INCLUDED in bdroid_buildcfg.h, still failed with:
E/bt-btif ( 45): ...preload_wait_timeout (retried:0/max-retry:0)...
Attachment #8360355 -
Attachment is obsolete: true
Reporter | ||
Comment 6•11 years ago
|
||
Added bt_config.xml. Still fails with preload_wait_timeout.
Attachment #8361600 -
Attachment is obsolete: true
Reporter | ||
Updated•11 years ago
|
Blocks: b2g-emulator, emulator-NFC
Assignee | ||
Comment 7•11 years ago
|
||
The error message looks like libbt-vendor.so (libbt-hci) does not complete stack preload process.(In reply to Vicamo Yang [:vicamo][:vyang] from comment #5)
> Created attachment 8361600 [details]
> Disable HCISU_H4_INCLUDED in bdroid_buildcfg.h, still failed with:
>
> E/bt-btif ( 45): ...preload_wait_timeout (retried:0/max-retry:0)...
The error message looks like libbt-vendor.so (libbt-hci) does not complete stack preload process. I guess something wrong in libbt/src/hardware.c, libbt is all based on brcm chipset implementation.
Assignee | ||
Comment 8•11 years ago
|
||
04-08 08:25:59.405 45 45 I bt_vendor: init
04-08 08:25:59.405 45 45 I bt_vnd_conf: Attempt to load conf from /etc/bluetooth/bt_vendor.conf
04-08 08:25:59.405 45 45 E bt_h4 : hci_h4_init
04-08 08:25:59.405 45 45 E bt_userial: userial_init
04-08 08:25:59.415 45 45 E bt_hci_bdroid: set_power 0
04-08 08:25:59.415 45 45 D bt_upio : is_emulator_context : 1
04-08 08:25:59.415 45 45 E bt_hci_bdroid: set_power 1
04-08 08:25:59.415 45 45 D bt_upio : is_emulator_context : 1
04-08 08:25:59.415 45 45 D bt_upio : set_bluetooth_power [emul] 1
04-08 08:25:59.415 45 45 E bt_hci_bdroid: preload
04-08 08:25:59.484 45 545 I bt_hci_bdroid: bt_hc_worker_thread started
04-08 08:25:59.484 45 545 E bt_userial: userial_open(port:0)
04-08 08:25:59.484 45 545 I bt_userial_vendor: userial vendor open: opening /dev/ttyS2
04-08 08:25:59.494 45 545 I bt_userial_vendor: device fd = 127 open
04-08 08:25:59.494 45 545 E bt_userial: fd = 127
04-08 08:25:59.494 45 548 E bt_userial: Entering userial_read_thread()
04-08 08:25:59.564 45 546 I GKI_LINUX: gki_task_entry: gki_task_entry task_id=0 [BTU] starting
04-08 08:25:59.584 45 546 W bt-hci : No command in queue matching opcode 0
04-08 08:25:59.594 45 546 W bt-hci : No command in queue matching opcode 0
04-08 08:26:02.408 45 544 E bt-btif : ...preload_wait_timeout (retried:0/max-retry:0)...
It looks like stuck in the middle of executing vendor specific commands.
Assignee | ||
Comment 9•11 years ago
|
||
Assignee | ||
Comment 10•11 years ago
|
||
This looks like after sending HCI_RESET command to /dev/ttyS2 and we got opcode 0 HCI command status event. In stack/btu/btu_hcif.c, we saw strong event return from /dev/ttyS2.
04-09 03:34:58.535 D/bt_vendor( 45): BT_VND_OP_POWER_CTRL ON
04-09 03:34:58.545 D/bt_upio ( 45): is_rfkill_disabled ? [0]
04-09 03:34:58.545 E/bt_hci_bdroid( 45): preload
04-09 03:34:58.675 I/bt_hci_bdroid( 45): bt_hc_worker_thread started
04-09 03:34:58.675 E/bt_userial( 45): userial_open(port:0)
04-09 03:34:58.675 D/bt_vendor( 45): op for 3
04-09 03:34:58.675 D/bt_vendor( 45): BT_VND_OP_USERIAL_OPEN
04-09 03:34:58.675 I/bt_userial_vendor( 45): userial vendor open: opening /dev/ttyS2
04-09 03:34:58.685 I/bt_userial_vendor( 45): device fd = 136 open
04-09 03:34:58.685 E/bt_userial( 45): fd = 136
04-09 03:34:58.685 D/bt_vendor( 45): op for 1
04-09 03:34:58.685 D/bt_vendor( 45): BT_VND_OP_FW_CFG
04-09 03:34:58.685 D/bt_hwcfg( 45): ---- hw_config_start HCI_RESET ----
04-09 03:34:58.685 E/bt_userial( 45): Entering userial_read_thread()
04-09 03:34:58.705 I/GKI_LINUX( 45): gki_task_entry: gki_task_entry task_id=0 [BTU] starting
04-09 03:34:58.755 E/BTLD ( 45): btu_hcif_command_status_evt, controller id: 0, opcode: 0, opcode cmd: 1143967164 ,status: 0
04-09 03:34:58.755 W/bt-hci ( 45): No command in queue matching opcode 0
04-09 03:34:58.765 E/BTLD ( 45): btu_hcif_command_status_evt, controller id: 0, opcode: 0, opcode cmd: 1143967164 ,status: 0
04-09 03:34:58.765 W/bt-hci ( 45): No command in queue matching opcode 0
Assignee | ||
Comment 11•11 years ago
|
||
I dumped hci packet and found HCI event (Command Status) is incorrect from QEMU.
hcidump -r btsnoop_hci.log
HCI sniffer - Bluetooth packet analyzer ver 2.5
btsnoop version: 1 datalink type: 1002
< HCI Command: Reset (0x03|0x0003) plen 0
> HCI Event: Command Status (0x0f) plen 4
Unknown (0x00|0x0000) status 0x00 ncmd 1
Normal Reset hci event should be:
> HCI Event: Command Complete (0x0e) plen 4
Reset (0x03|0x0003) ncmd 1
status 0x00
In Bluetooth core spec, HCI commands and Events, HCI_Reset:
"When the reset has been performed, a Command Complete event shall be
generated."
In external/qemu/hw/bt-hci.c,
case cmd_opcode_pack(OGF_HOST_CTL, OCF_RESET):
bt_hci_reset(hci);
- bt_hci_event_status(hci, HCI_SUCCESS);
+ bt_hci_event_complete_status(hci, HCI_SUCCESS);
Assignee | ||
Comment 12•11 years ago
|
||
Even changing bt_hci_event_complete_status, I found the last hci command was not included into command complete event.
< HCI Command: Reset (0x03|0x0003) plen 0
> HCI Event: Command Complete (0x0e) plen 4
Unknown (0x00|0x0000) ncmd 1
It still did not fix preload error problem.
Assignee | ||
Comment 13•11 years ago
|
||
I tried to use libbt-vendor of qct version (bcm version gotta many chipset related to operation), and managed to call |bt_vendor_cbacks->fwcfg_cb(BT_VND_OP_RESULT_SUCCESS)| directly so preload firmware can be ignored and pass but now it stucked at different level -- processing HCI reset.
Reporter | ||
Updated•11 years ago
|
Assignee: vyang → shuang
Assignee | ||
Updated•11 years ago
|
Blocks: devices-backlog
Reporter | ||
Updated•10 years ago
|
No longer blocks: emulator-NFC
Assignee | ||
Comment 14•10 years ago
|
||
(In reply to Shawn Huang [:shuang] [:shawnjohnjr] from comment #11)
> I dumped hci packet and found HCI event (Command Status) is incorrect from
> QEMU.
>
> hcidump -r btsnoop_hci.log
> HCI sniffer - Bluetooth packet analyzer ver 2.5
> btsnoop version: 1 datalink type: 1002
> < HCI Command: Reset (0x03|0x0003) plen 0
> > HCI Event: Command Status (0x0f) plen 4
> Unknown (0x00|0x0000) status 0x00 ncmd 1
>
>
> Normal Reset hci event should be:
> > HCI Event: Command Complete (0x0e) plen 4
> Reset (0x03|0x0003) ncmd 1
> status 0x00
>
> In Bluetooth core spec, HCI commands and Events, HCI_Reset:
> "When the reset has been performed, a Command Complete event shall be
> generated."
>
> In external/qemu/hw/bt-hci.c,
> case cmd_opcode_pack(OGF_HOST_CTL, OCF_RESET):
> bt_hci_reset(hci);
> - bt_hci_event_status(hci, HCI_SUCCESS);
> + bt_hci_event_complete_status(hci, HCI_SUCCESS);
Because opcode is missing in HCI event complete, this CommandComplete event will be thrown away.
external/bluetooth/bluedroid/stack/./btu/btu_hcif.c, btu_hcif_command_complete_evt
Assignee | ||
Comment 15•10 years ago
|
||
Ok, so the problem in Comment 14 had been fixed, in 2012.
http://patchwork.ozlabs.org/patch/163634/
Assignee | ||
Comment 16•10 years ago
|
||
Attachment #8434052 -
Flags: review?(vyang)
Assignee | ||
Comment 17•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Attachment #8434080 -
Flags: review?(vyang)
Reporter | ||
Updated•10 years ago
|
Attachment #8434052 -
Flags: review?(vyang) → review+
Reporter | ||
Comment 18•10 years ago
|
||
Comment on attachment 8434080 [details] [review]
Bug 944299 - B2G Emulator: support bluedroid
Could you also help correct all the commit summaries "Bug 944299 - M/N" to "Bug 944299 - M/6"? Thank you.
Attachment #8434080 -
Flags: review?(vyang) → review+
Assignee | ||
Comment 19•10 years ago
|
||
(In reply to Vicamo Yang [:vicamo][:vyang] from comment #18)
> Comment on attachment 8434080 [details] [review]
> Bug 944299 - B2G Emulator: support bluedroid
>
> Could you also help correct all the commit summaries "Bug 944299 - M/N" to
> "Bug 944299 - M/6"? Thank you.
Sure. I've updated the commit summaries.
Reporter | ||
Comment 20•10 years ago
|
||
Comment on attachment 8434080 [details] [review]
Bug 944299 - B2G Emulator: support bluedroid
That's a wrong branch. Please send pull request to https://github.com/mozilla-b2g/device_generic_goldfish/tree/b2g-4.3_r2.1
Attachment #8434080 -
Flags: review+ → review-
Assignee | ||
Updated•10 years ago
|
Attachment #8434080 -
Attachment is obsolete: true
Assignee | ||
Comment 21•10 years ago
|
||
Attachment #8435628 -
Flags: review?(vyang)
Reporter | ||
Updated•10 years ago
|
Attachment #8435628 -
Flags: review?(vyang) → review+
Reporter | ||
Comment 22•10 years ago
|
||
[external/qemu]
master: https://github.com/mozilla-b2g/platform_external_qemu/commit/a819a94a572c7b32556435491ed8eaab841a95ff
b2g-jellybean: https://github.com/mozilla-b2g/platform_external_qemu/commit/cba8ebe395652e62a911d885cd6ac1bb4ad3ed57
[device/generic/goldfish]
b2g-4.3_r2.1:
https://github.com/mozilla-b2g/device_generic_goldfish/commit/0e31f35a2a77301e91baa8a237aa9e9fa4076084
Assignee | ||
Comment 23•10 years ago
|
||
Thanks, Vicamo.
Reporter | ||
Comment 24•10 years ago
|
||
Attachment #8435696 -
Flags: review?(shuang)
Assignee | ||
Updated•10 years ago
|
Attachment #8435696 -
Flags: review?(shuang) → review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 25•10 years ago
|
||
b2g-4.3_r2.1: https://github.com/mozilla-b2g/platform_build/commit/cc67f31dc638c0b7edba3cf7e3d87cadf0ed52bf
Status: NEW → RESOLVED
Closed: 10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 2.0 S4 (20june)
Updated•10 years ago
|
See Also: → qemu-bt-test
You need to log in
before you can comment on or make changes to this bug.
Description
•