monitor freezes after < 1sec with "Thrustmaster USB Joystick"
Hi folks, i wanted to try this amazing project with a "Thrustmaster USB Joystick" (https://www.thrustmaster.com/en-us/products/usb-joystick/) - unfortunately the remapper is stopping to process the joysticks input after some 0.5-1 seconds in the monitor (running in 'single pico configuration'). When testing to run a mouse emulation the virtual mouse was still 'pushing' after the 'freeze' and the remapper was still programmable. So it seems to me that the receiving side just hangs/crashed.
How to debug it further? Please see the attached dumped descriptors and the full output of lsusb (after an unbind).
Thanks a lot for help!
> lsusb
Bus 001 Device 118: ID 07b5:0316 Mega World International, Ltd USB Game Controllers
> dmesg
[138598.674511] usb 1-2: new low-speed USB device number 118 using xhci_hcd
[138598.823189] usb 1-2: New USB device found, idVendor=07b5, idProduct=0316, bcdDevice= 1.01
[138598.823204] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[138598.823211] usb 1-2: Product: USB Game Controllers
[138598.823217] usb 1-2: Manufacturer: Mega World
[138598.844030] input: Mega World USB Game Controllers as /devices/pci0000:00/0000:00:08.1/0000:06:00.3/usb1/1-2/1-2:1.0/0003:07B5:0316.006F/input/input113
[138598.844389] hid-generic 0003:07B5:0316.006F: input,hidraw1: USB HID v1.10 Joystick [Mega World USB Game Controllers] on usb-0000:06:00.3-2/input0
lsusb_full.txt descriptors.txt
i want to add some observations:
- in general the remapper works with, e.g. a mouse when testing. so it does not seem to be a HW issue
- when unplugging and replugging the joystick to the remapper i can make it 'work again' for a fragment of a second, so it's not necessary to unplug/restart the remapper.
- i tried mouse and gamepad modes as input - the input is parsed differently, but the problem the same
- the joystick itself works flawlessly when testing in linux with
jstest --normal /dev/input/js0
I'm not sure to be honest. If it works for even a second then the descriptor and the reports are parsed correctly. It could still be some hardware issue, though it typically either works or doesn't, I don't think I've seen it stop working like this.
Before giving up i want to share a pcap of the normal joystick operation. In the recording at first the plugging in is recorded, after several seconds i launched jstest and started moving the joysticks rudder, moving the stick and pressing some buttons.
The only thing which is a little out-of-the-ordinary is the 'reserved data'. It changes when i move the rudder, but it is not equal to the rudders values. When running the monitor of remapper i always saw a "D-Pad up" registered as "1", although not pressing any buttons.
I investigated a bit further.
The problem is not specific to hid-remapper.
I changed the example host_hid_to_device_cdc from Pico-PIO-USB (which itself depends on tinyusb) to process and display HID reports from the joystick.
The first reports, as with the remapper, work. After a short time the very same report repeats over and over, identical to the behavior of hid-remapper.
i always saw a "D-Pad up" registered as "1", although not pressing any buttons.
0x09, 0x39, // Usage (Hat switch)
0x15, 0x01, // Logical Minimum (1)
0x25, 0x08, // Logical Maximum (8)
hid-remapper assumes hat switches use 0-7. There is a work around but I doubt it will fix the freezing problem. See https://github.com/jfedor2/hid-remapper/issues/209 for the workaround.
i retried the whole single pico configuration with another pico, but the bug remained - so i'd say it's no hardware issue.
Then i wired a dual pico configuration - and voila - it works. No more 'freezes'. It seems that it's the host side USB-emulation of Pico-PIO-USB which causes the problem.