ni/usb3vision

USB device number race condition with two Basler cameras...?

Opened this issue · 0 comments

I'm trying to debug a device with two Basler cameras attached. The slightly unusual thing about the setup is that the two cameras get powered up long after the device itself has booted, which means that they power on within a few milliseconds of each other.

What happens next:

  • both camera devices get assigned to device number 2 [might this be a race condition?]
  • both then receive ioctl calls to read data (64 bytes @ 0x4, 64 bytes @ 0x44, 64 bytes @ 0x104, and 236 bytes @ 0xF2F01014), all of which execute successfully
  • both are then disconnected (though I can't see any reason why)
  • neither ever retries
[  274.907118] usb 7-1: new SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[  274.919114] usb 5-1: new SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[  274.930551] usb 7-1: New USB device found, idVendor=2676, idProduct=ba02, bcdDevice= 0.00
[  274.940094] usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  274.947543] usb 5-1: New USB device found, idVendor=2676, idProduct=ba02, bcdDevice= 0.00
[  274.948405] usb 7-1: Product: acA1920-40ucSIE
[  274.957893] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  274.962942] usb 7-1: Manufacturer: Basler
[  274.962958] usb 7-1: SerialNumber: xxxxxx61
[  274.971260] usb 5-1: Product: acA1920-40umSIR
[  274.985886] usb 5-1: Manufacturer: Basler
[  274.990574] usb 5-1: SerialNumber: xxxxxx46
[  276.902008] usb 7-1: USB3 Vision Driver: Registering device 2
[  276.917003] usb 5-1: USB3 Vision Driver: Registering device 2
[  279.736960] usb 5-1: USB disconnect, device number 2
[  279.743963] usb 5-1: u3v_disconnect: U3V device removed
[  279.744925] usb 7-1: USB disconnect, device number 2
[  279.756172] usb 7-1: u3v_disconnect: U3V device removed

If I attach just one USB camera:

  • that camera gets assigned to device number 2
  • it then fails (and gets disconnected)
  • it then retries but assigned to device number 3
  • it then succeeds
[  102.395806] usb 7-1: new SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[  102.419240] usb 7-1: New USB device found, idVendor=2676, idProduct=ba02, bcdDevice= 0.00
[  102.428777] usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  102.437075] usb 7-1: Product: acA1920-40ucSIE
[  102.442176] usb 7-1: Manufacturer: Basler
[  102.446864] usb 7-1: SerialNumber: xxxxxx61
[  104.382790] usb 7-1: USB3 Vision Driver: Registering device 2
[  116.217618] usb 7-1: USB disconnect, device number 2
[  116.223727] usb 7-1: u3v_disconnect: U3V device removed
[  126.427855] usb 7-1: new SuperSpeed Gen 1 USB device number 3 using xhci_hcd
[  126.451920] usb 7-1: New USB device found, idVendor=2676, idProduct=ba02, bcdDevice= 0.00
[  126.461444] usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  126.469749] usb 7-1: Product: acA1920-40ucSIE
[  126.474851] usb 7-1: Manufacturer: Basler
[  126.479537] usb 7-1: SerialNumber: xxxxxx61
[  128.411722] usb 7-1: USB3 Vision Driver: Registering device 3

To me, this feels like either a weird U3V error or a USB device number race condition deep inside Linux, though I could easily be wrong about both. What might be going on here? What should I be looking at?