Legends gamer pro controller to keyboard

I’m trying to map my legend gamer pro arcade controller (should be a standard usb gamepad) to keyboard presses with hid remapper.

My arcade controller is successfully connected to my computer

https://imgur.com/a/6SKHDsb

But when I plug it into my Feather RP2040 with USB Host (without the arcade stick) it connects and works

when I connect the arcade stick the RP2040 nothing seems to work, I get an error “NotAllowedError: Failed to write the feature report.” when trying to monitor and none of the arcade stick to keyboard mappings do anything.

Not sure where to begin troubleshooting.

I don’t know what’s going on. Can you try dumping the report descriptor and some traffic from the controller as shown in this video?

thanks for replying so fast!!!

I didn’t see anything in the video about “report descriptor” but I have the wireshark capture (as per the video I did not have hid remapper plugged in, this is just the straight arcade stick)

let me know if you want this uploaded somewhere else.

thanks again!

Link doesn’t work for me.

lets see if this link works

Yeah, that works.

So the device is doing something weird. The first time it’s asked for the report descriptor it just returns a single zero (buffer length=1). And it does this for every interface so it’s not a one time fluke.

Your PC then retries and gets the actual descriptor. HID Remapper doesn’t (or rather TinyUSB, the library we use, doesn’t) so it never gets the proper descriptor.

If that was all we’d just get the empty descriptor and the device just wouldn’t work. I think what happens is TinyUSB gives us a buffer with the single zero but says there’s as many bytes in the buffer as there should be (as many as the actual report descriptor has) and we end up trying to parse some garbage memory (previous contents of the buffer) and end up in some weird state. (This by itself would mean that our descriptor parser is not as robust as it should be but that’s a separate issue.)

Of course we can only guess what Windows does by what we see, but it seems Linux does retry as well. So it’s possible your device is not the only one that behaves like this. Perhaps we (TinyUSB) should retry as well. At the very least it should zero the rest of the buffer before returning it.

I can install wireshark on a different windows machine and capture if you think it would help at all.

No, I think we have a grasp on the situation.