Strange USB duplicate fragment problem

I’m chasing a problem working on support for Bluetooth 4 LE (Low Energy).

I have 2 vendor’s USB bluetooth receivers.

One is a Cambridge Silicon Radio (0a12:0001) and the other is a Broadcom BCM20702A1 (0a5c:21e8). The Broadcom needs a RAM patch to behave properly, but it outside the scope of this problem. BOTH exhibit the same problem (so I seriously doubt it’s a problem with the Bluetooth receivers)

Both devices are operating in HCI mode. I’m running Ubuntu on my BeagleBone Black. I spent a significant time trying to get Bluez 5.15 to build under the standard Angstrom, but never succeeded (too many dependencies I could not satisfy) I started with the standard eMMC flash image, and have worked from there to the point I’m compiling my own kernels for debugging purposes.

I’ve also built the latest version of Bluez (5.15)

The problem is when running a lescan (hcitool lescan) with a LE device in paring mode, which is transmitting a lot of LE Advertising report packets, the HCI drivers eventually loses sync. I’ve traced it down to a duplicate USB fragment.

I’ve tested these USB receivers under Ubuntu on an Intel machine with the same Bluez 5.15, and the problem is not present.

I used usbmon to do a “sniff” of the USB traffic. Here’s a snippet of a correct HCI LE Advertising report event, followed by one where the middle fragment is repeated (frame 1300 is a repeat) (pcap for this attached)

No. Time Source Destination Protocol Length Info
1291 2014-03-07 02:40:16.942573 host 3.1 USB 64 URB_INTERRUPT in
1292 2014-03-07 02:40:16.959480 3.1 host HCI_USB 80 Rcvd Fragment

3e21020100013c30057cf9e115020105

1293 2014-03-07 02:40:16.959624 host 3.1 USB 64 URB_INTERRUPT in
1294 2014-03-07 02:40:16.960449 3.1 host HCI_USB 80 Rcvd Fragment
0d0953636f736368652050524f580319

1295 2014-03-07 02:40:16.960546 host 3.1 USB 64 URB_INTERRUPT in

1296 2014-03-07 02:40:16.961455 3.1 host HCI_EVT 67 Rcvd LE Meta (LE Advertising Report)

0002ae

1297 2014-03-07 02:40:16.961560 host 3.1 USB 64 URB_INTERRUPT in

1298 2014-03-07 02:40:16.981627 3.1 host HCI_USB 80 Rcvd Fragment

3e21020100013c30057cf9e115020105

1299 2014-03-07 02:40:16.981696 host 3.1 USB 64 URB_INTERRUPT in

1300 2014-03-07 02:40:17.002651 3.1 host HCI_USB 80 Rcvd Fragment

3e21020100013c30057cf9e115020105

1301 2014-03-07 02:40:17.002720 host 3.1 USB 64 URB_INTERRUPT in

1302 2014-03-07 02:40:17.003560 3.1 host HCI_USB 80 Rcvd Fragment

0d0953636f736368652050524f580319

1303 2014-03-07 02:40:17.003649 host 3.1 USB 64 URB_INTERRUPT in

1304 2014-03-07 02:40:17.004567 3.1 host HCI_USB 67 Rcvd Fragment

0002b5

I’m really tearing my hair out over this one. Any suggestions would be greatly appreciated.

b.pcap (196 KB)

An interesting addition - If I switch the USB 2 hub for a USB 1.1 Hub, the problem goes away.