蓝牙bug总结(未完待续)

1)关闭/打开手机端蓝牙, 之前连接的设备(包括headset&HID etc)可以自动重连。

问题,不重连。

原因:

--关闭蓝牙时候手机端资源清理不干净,还有链路保持连接

--headset发起自动重连,但是被手机拒绝,  fix 方法:手机在蓝牙起来之后,尝试连接之前连接的设备。

IO Capability Request Reply (0x01|0x002b) ncmd 1
    status 0x00 bdaddr 00:0D:FD:71:53:02
2010-10-07 17:47:12.782403 > HCI Event: Simple Pairing Complete (0x36) plen 7
    status 0x05 bdaddr 00:0D:FD:71:53:02
    Error: Authentication Failure
2010-10-07 17:47:12.782434 > HCI Event: Auth Complete (0x06) plen 3
    status 0x05 handle 12
    Error: Authentication Failure
2010-10-07 17:47:12.782438 > HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 12 reason 0x08
    Reason: Connection Timeout

其他原因,待补充

2)2个基于L2CAP的profile同时使用,可能会有延迟。

比如在A2DP听音乐时候,敲击HID键盘,或者传送大文件,都可能使音乐卡,一般是跟蓝牙带宽有关系,需要bluetooth firmware更新


3)某些蓝牙耳机在听歌时候,来了电话,这时候蓝牙断开。

原因:

看不到LMP_detach 或者L2CAP disconnect ,而是libaudio.so的crash,导致bluetoothd crash,连接断开。

发现是因为这些耳机本身的bug,the timing of switching between SCO and A2DP; slowing that process tends to reduce the rate of occurrence.

SCO和A2DP切换慢些,可以避免这些问题发生。



4)out of range, and reconnection issue.

out of range时候,手机收到

 > HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 12 reason 0x08
    Reason: Connection Timeout



2011-02-05 15:36:55.456681 < HCI Command: Delete Stored Link Key (0x03|0x0012) p
len 7
    bdaddr 00:1F:20:01:C9:B8 all 0
2011-02-05 15:36:55.465888 > HCI Event: Command Complete (0x0e) plen 6
    Delete Stored Link Key (0x03|0x0012) ncmd 1
    status 0x00 deleted 0
2011-02-05 15:37:00.665401 > HCI Event: Connect Request (0x04) plen 10
    bdaddr 00:1F:20:01:C9:B8 class 0x002580 type ACL
2011-02-05 15:37:00.665547 < HCI Command: Accept Connection Request (0x01|0x0009
) plen 7
    bdaddr 00:1F:20:01:C9:B8 role 0x00
    Role: Master
2011-02-05 15:37:00.675457 > HCI Event: Command Status (0x0f) plen 4
    Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
2011-02-05 15:37:00.835340 > HCI Event: Role Change (0x12) plen 8
    status 0x00 bdaddr 00:1F:20:01:C9:B8 role 0x00
    Role: Master
2011-02-05 15:37:00.985466 > HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 11 bdaddr 00:1F:20:01:C9:B8 type ACL encrypt 0x00
2011-02-05 15:37:00.985564 < HCI Command: Read Remote Supported Features (0x01|0
x001b) plen 2
    handle 11
2011-02-05 15:37:00.999921 > HCI Event: Command Status (0x0f) plen 4
    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
2011-02-05 15:37:00.999931 > HCI Event: Read Remote Supported Features (0x0b) pl
en 11
    status 0x00 handle 11
    Features: 0xbc 0x02 0x04 0x38 0x08 0x00 0x00 0x00
2011-02-05 15:37:01.015228 > ACL data: handle 11 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 17 scid 0x0057
2011-02-05 15:37:01.015292 < ACL data: handle 11 flags 0x00 dlen 16
    0000: 0c 00 01 00 03 1e 08 00  40 00 57 00 01 00 00 00  [email protected].....
2011-02-05 15:37:01.015356 < ACL data: handle 11 flags 0x00 dlen 10
    0000: 06 00 01 00 0a 01 02 00  02 00                    ..........
2011-02-05 15:37:01.025413 > HCI Event: Number of Completed Packets (0x13) plen
5
    handle 11 packets 2
2011-02-05 15:37:01.039257 < HCI Command: Remote Name Request (0x01|0x0019) plen
 10
    bdaddr 00:1F:20:01:C9:B8 mode 2 clkoffset 0x0000
2011-02-05 15:37:01.045429 > HCI Event: Command Status (0x0f) plen 4
    Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
2011-02-05 15:37:01.045436 > ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x0004
        Bi-directional QoS
2011-02-05 15:37:01.045752 < ACL data: handle 11 flags 0x00 dlen 16
    0000: 0c 00 01 00 03 1e 08 00  40 00 57 00 00 00 00 00  [email protected].....
2011-02-05 15:37:01.095183 > ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
      MTU 185
2011-02-05 15:37:01.095233 < ACL data: handle 11 flags 0x00 dlen 18
    0000: 0e 00 01 00 05 1f 0a 00  57 00 00 00 00 00 01 02  ........W.......
    0010: b9 00                                             ?
2011-02-05 15:37:01.095286 < ACL data: handle 11 flags 0x00 dlen 12
    0000: 08 00 01 00 04 02 04 00  57 00 00 00              ........W...
2011-02-05 15:37:01.105263 > HCI Event: Number of Completed Packets (0x13) plen
5
    handle 11 packets 2
2011-02-05 15:37:01.105271 > HCI Event: Remote Name Req Complete (0x07) plen 255


    status 0x00 bdaddr 00:1F:20:01:C9:B8 name 'Bluetooth Laser Travel Mouse'
2011-02-05 15:37:01.135268 > ACL data: handle 11 flags 0x02 dlen 18
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
      MTU 185
2011-02-05 15:37:01.135280 > ACL data: handle 11 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 19 scid 0x0058
2011-02-05 15:37:01.135357 < ACL data: handle 11 flags 0x00 dlen 16
    0000: 0c 00 01 00 03 20 08 00  41 00 58 00 01 00 02 00  ..... ..A.X.....
2011-02-05 15:37:01.136721 < ACL data: handle 11 flags 0x00 dlen 12
    0000: 08 00 01 00 06 03 04 00  57 00 40 00              ........W.@.
2011-02-05 15:37:01.145269 > HCI Event: Number of Completed Packets (0x13) plen
5
    handle 11 packets 2
2011-02-05 15:37:01.146256 < ACL data: handle 11 flags 0x00 dlen 16
    0000: 0c 00 01 00 03 20 08 00  41 00 58 00 03 00 00 00  ..... ..A.X.....
2011-02-05 15:37:01.155415 > ACL data: handle 11 flags 0x02 dlen 12
    L2CAP(s): Disconn rsp: dcid 0x0057 scid 0x0040
2011-02-05 15:37:01.155426 > HCI Event: Number of Completed Packets (0x13) plen
5
    handle 11 packets 2
2011-02-05 15:37:08.446384 < HCI Command: Authentication Requested (0x01|0x0011)
 plen 2
    handle 11
2011-02-05 15:37:08.459101 > HCI Event: Command Status (0x0f) plen 4
    Authentication Requested (0x01|0x0011) status 0x00 ncmd 1
2011-02-05 15:37:08.459117 > HCI Event: Link Key Request (0x17) plen 6
    bdaddr 00:1F:20:01:C9:B8
2011-02-05 15:37:08.465568 < HCI Command: Link Key Request Negative Reply (0x01|
0x000c) plen 6
    bdaddr 00:1F:20:01:C9:B8
2011-02-05 15:37:08.475370 > HCI Event: Command Complete (0x0e) plen 10
    Link Key Request Negative Reply (0x01|0x000c) ncmd 1
    status 0x00 bdaddr 00:1F:20:01:C9:B8
2011-02-05 15:37:08.475382 > HCI Event: PIN Code Request (0x16) plen 6
    bdaddr 00:1F:20:01:C9:B8
2011-02-05 15:37:13.785296 > HCI Event: Auth Complete (0x06) plen 3
    status 0x16 handle 11
    Error: Connection Terminated by Local Host
2011-02-05 15:37:13.785316 > HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 11 reason 0x16
    Reason: Connection Terminated by Local Host



本质上还是有些资源没有释放。。。。

你可能感兴趣的:(蓝牙bug总结(未完待续))