| Summary: | Different game controllers, different mappings, same GUID | ||
|---|---|---|---|
| Product: | SDL | Reporter: | landeel <cleberdemattoscasali-public> |
| Component: | joystick | Assignee: | Sam Lantinga <slouken> |
| Status: | WAITING --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | cleberdemattoscasali-public, gajdusek.petr, swyterzone+sdl |
| Version: | 2.0.5 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: | ngs-phantom-usb-descriptor-dump.zip | ||
|
Description
landeel
2019-03-12 18:22:36 UTC
Maybe you could allow something like that: "03000000790000000600000010010000,DragonRise Inc. Generic USB Joystick,platform:Linux,iManufacturer:DragonRise Inc.,iProduct:Generic USB Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0," See also this bug with more information about conflicting gamepads and their lsusb dumps: https://github.com/gabomdq/SDL_GameControllerDB/issues/202 Matching SDL2 Discourse thread: https://discourse.libsdl.org/t/duplicated-conflicting-guids-for-the-dragonrise-pc-twin-shock-controllers/24112/5 I guess we could add some extra discriminators other than VID and PID, these cheap no-name Chinese DirectShow gamepads are everywhere. Unfortunately the USB descriptor reports are almost *completely* identical in most of the cases. At least they should have used different strings or descriptor sizes so that we could checksum them, but they even botched that. Let me know if you need more data dumps from my controller. Funny fact: retroarch can tell my gamepads apart using the udev driver. I think I have compared the lsusb dumps for five or six controllers and most of them are seemingly identical (minus their physical button layout), your controller is a bit of an outlier and a bit easier to make out, I think. Maybe there's a different way of finding an universal discriminator that someone that knows more about HID or USB internals can help with. Those are the mappings: 03000000790000000600000010010000,Microntek 0079:0006,platform:Linux,a:b2,b:b1,x:b3,y:b0,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7, 03000000790000000600000010010000,DragonRise 0079:0006,platform:Linux,a:b2,b:b1,x:b3,y:b0,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b6,righttrigger:b7, Another difference, the Dragonrise one has 7 axes and the Microntek one has 6 axes. Other possible solution would be specifying axes in the reverse order, from last to first. Maybe something like that: ...,dpup:-a-0,dpdown:+a-0,dpleft:-a-1,dpright:+a-1,rightx:a-3,righty:a-2,... This way the same mapping would work for both. @Ismael Ferreras Morezuelas (Swyter), do the different devices you have all have the same name as well? If so, is there any other way to differentiate them? Created attachment 3822 [details]
ngs-phantom-usb-descriptor-dump.zip
Used Thesycon's USB Descriptor Dumper (File > Save to file, and File > Save config descriptor as binary file) and attached it here. Download the tool: https://www.thesycon.de/eng/usb_descriptordumper.shtml I only own this NGS Phantom gamepad (https://www.ngs.eu/images/productos/G300/NGS_phantom.jpg), the other lsusb reports were provided by other SDL2 community members in the linked GitHub reports and forum threads. I will try to get a HID report dump from Linux soon-ish, to see if there's something interesting in there that can be check-summed. As you can see, my gamepad seems to have extra spaces in the name, but the Trust CXT24 from @DanielGibson and the Topway faux-dualshock and Defender Cobra R4 from @Akaricchi are also like that. My lsusb report for the same NGS Phantom is here, you can also see all the other lsusb reports I mentioned after that: https://github.com/gabomdq/SDL_GameControllerDB/issues/202#issuecomment-376948500 Let me know what you think. Also, notice the messed up physical button layout of this gamepad when compared to most of the others from the same chipset family. 2 SELECT START LB RB -NGS Phantom 1 4 9 10 5 6 http://web.archive.org/web/20190612172739if_/https://images-na.ssl-images-amazon.com/images/I/41WaDx-kLYL.jpg 3 7 8 http://web.archive.org/web/20190612172723if_/https://images-na.ssl-images-amazon.com/images/I/71042nE1UpL._SL1500_.jpg 1 SELECT START LB RB -Topway faux-dualshock models 4 2 9 10 ? ? and Trust CXT24 (?) 3 ? ? |