BT hciattach daemon fails with VARIANT=userdebug

RESOLVED WONTFIX

Status

RESOLVED WONTFIX
4 years ago
9 months ago

People

(Reporter: tzimmermann, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

When I build with VARAINT=userdebug and switch on BT, I see

> D/BTSNOOP-DISP( 1512): btsnoop_init
> D/BTSNOOP-DISP( 1512): Time GMT offset 0
> D/bt_userial_mct( 1512): userial_init
> I/bt_vendor( 1512): bt-vendor : BT_VND_OP_POWER_CTRL: Off
> I/bt_vendor( 1512): Starting hciattach daemon
> I/bt_vendor( 1512): try to set false
> I/bt_hci_bdroid( 1512): bt_hc_worker_thread started
> I/bt_vendor( 1512): bt-vendor : BT_VND_OP_POWER_CTRL: On
> I/bt_vendor( 1512): Starting hciattach daemon
> I/bt_vendor( 1512): try to set true
> D/BTSNOOP-DISP( 1512): ext_parser_thread
> D/BTSNOOP-DISP( 1512): waiting for connection on port 4330
> E/BTSNOOP-DISP( 1512): listener not created: listen fd -1
> D/BTSNOOP-DISP( 1512): ext parser attached on fd -1
> D/BTSNOOP-DISP( 1512): Read returned -1
> D/BTSNOOP-DISP( 1512): Error :Bad file number
> D/BTSNOOP-DISP( 1512): ext parser detached
> D/BTSNOOP-DISP( 1512): waiting for connection on port 4330
> E/BTSNOOP-DISP( 1512): listener not created: listen fd -1
> D/BTSNOOP-DISP( 1512): ext parser attached on fd -1
> D/BTSNOOP-DISP( 1512): Read returned -1

in the logcat. The log then gets flooded with these error messages. It looks like a problem in init.qcom.bt.rc or one of its helpers.
Michael,

this looks like a problem in the upstream code. Can you help, please?
Flags: needinfo?(mvines)
You're getting stuck in this loop:
  https://www.codeaurora.org/cgit/quic/la/platform/external/bluetooth/bluedroid/tree/hci/src/btsnoop.c?h=b2g_kk_3.5#n605

as bluetoothd can't open the socket that this code expects, and it doesn't fail gracefully.   This wasn't an issue before as bluedroid was running as root in the b2g process.

This only manifests on KK from what I've seen and the code is gone from L.

A couple ways to fix:
1. Remove "-DBTSNOOP_EXT_PARSER_INCLUDED=TRUE" from 
https://www.codeaurora.org/cgit/quic/la/platform/external/bluetooth/bluedroid/tree/hci/Android.mk?h=b2g_kk_3.5#n19
2. Bail from ext_parser_thread() if the socket creation fails

I did #2 recently but in retrospect #1 seems a little cleaner.
Flags: needinfo?(mvines)
I think that the proper solution is to leave the loop if this error happens. Can you fix that upstream? 

If we need the functionality, we can than see how to configure bluetoothd accordingly.
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #3)
> I think that the proper solution is to leave the loop if this error happens.
> Can you fix that upstream? 

https://www.codeaurora.org/cgit/quic/la/platform/external/bluetooth/bluedroid/commit/hci/src/btsnoop.c?h=b2g_kk_3.5

> If we need the functionality, we can than see how to configure bluetoothd
> accordingly.

I don't know of anybody at the moment who would need this.

Comment 5

9 months ago
Firefox OS is not being worked on
Status: NEW → RESOLVED
Last Resolved: 9 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.