USB prober: Devices with multiple interfaces
The Razer Hydra is "interesting" in a number of ways. One of them is that it has two USB-HID interfaces, and you must use both of them to successfully interact with it (interface 0 is for data, interface 1 is for commands).
I can see in the "spew" execution of the prober that something (udev hidraw?) has identified two interfaces on the device (1532:0300
): (full log attached prober-log.txt )
p_udev_probe - hidraw
ptr: 0x555555617e08 (0)
sysfs_path: '/sys/devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-1/3-1.2/3-1.2.4/3-1.2.4:1.0/0003:1532:0300.0011/hidraw/hidraw11'
dev_path: '/dev/hidraw11'
bus_type: 3
vender_id: 1532
product_id: 0300
interface: 0
usb_bus: 3
usb_addr: 21
bluetooth_id: 000000000000
p_udev_probe - hidraw
ptr: 0x555555617e08 (0)
sysfs_path: '/sys/devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-1/3-1.2/3-1.2.4/3-1.2.4:1.1/0003:1532:0300.0012/hidraw/hidraw12'
dev_path: '/dev/hidraw12'
bus_type: 3
vender_id: 1532
product_id: 0300
interface: 1
usb_bus: 3
usb_addr: 21
bluetooth_id: 000000000000
and further, "dumping" also reveals this, for one of the corresponding entries:
10: 0x1532:0x0300
ptr: 0x55555560b840
usb.bus: 3
usb.addr: 15
libusb: 0x5555555f2d40
ports: 1.2.4
(SNIP)
19: 0x1532:0x0300
ptr: 0x55555560bac8
usb.bus: 3
usb.addr: 21
interface: 0
path: '/dev/hidraw11'
interface: 1
path: '/dev/hidraw12'
If I have the probe function return 0 unconditionally, and break in it, I can actually get to a point where pdev shows both interfaces. However, with the current code (see https://gitlab.freedesktop.org/monado/monado/blob/91feb348b006dde9277010b07d8bd76e71f4f7c4/src/xrt/drivers/hydra/hydra_driver.c#L121 ) it fails to open a different interface using libusb (OK) but never gets to the point of seeing the later udev/hidraw version that it could succeed at.