藍牙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



本質上還是有些資源沒有釋放。。。。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章