SDL_GameControllerDB: Duplicated/conflicting GUIDs for the DragonRise/PC TWIN SHOCK controllers

Turns out that many generic Chinese controllers based on the same PC TWIN SHOCK board from DragonRise Inc. share the same USB vendor (0x0079) and product (0x0006) identifiers, but they also use slightly different button layouts, causing conflicts because the SDL2 gamepad GUID cannot distinguish between them.

My NGS Phantom mainly conflicts with #86 in Linux, and the “G-Shark GS-GP702” in Windows. Funnily enough in macOS looks like the GUID is slightly different, for some reason.

These are the correct mappings for Linux, macOS and Windows:

03000000790000000600000010010000,NGS Phantom---LNX,a:b2,b:b3,x:b0,y:b1,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,platform:Linux,
03000000790000000600000007010000,NGS Phantom---MAC,a:b2,b:b3,x:b0,y:b1,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,platform:Mac OS X,
03000000790000000600000000000000,NGS Phantom---WIN,a:b2,b:b3,x:b0,y:b1,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:a4,lefttrigger:b6,righttrigger:b7,platform:Windows,

I ship a game with these community mappings and I’m having trouble playing with my own controller because everything is subtly broken.

PS: Maybe Ryan C. Gordon can add some additional optional bits to tell them apart. Maybe by optionally matching by VID/PID/Version/Revision/Firmware instead of only VID/PID.

imagen

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 28 (20 by maintainers)

Commits related to this issue

Most upvoted comments

We’re collecting more information on the upstream bug https://github.com/libsdl-org/SDL/issues/3197, can people please post a description of their controller and the output of this script:

#!/bin/bash
DIR=/sys/bus/usb/devices/$(ls -R /sys/bus/usb/devices/* | grep js$1 | cut -d$'\n' -f2 | cut -d: -f1 | awk -F/ '{print $NF}')
IMANUFACTURER=$(cat $DIR/manufacturer)
IPRODUCT=$(cat $DIR/product)
ISERIAL=$(cat $DIR/serial)
IVERSION=$(cat $DIR/version | xargs)
SIGNATURE="$IMANUFACTURER:$IPRODUCT:$ISERIAL:$IVERSION"
echo $SIGNATURE

If anyone here wants to give it another go and dump their DragonRise gamepad EEPROMs, please run these commands and paste their results here, together with the marketing/model name for your pad and the SDL2 button map. Mine is an NGS Phantom: sudo usbhid-dump --model 0079:0006 sudo lsusb -vvvvvd 0079:0006 sudo python3 dragonrise-pc-twin-shock-dumper.py (https://gist.github.com/Swyter/26c754c6f04b13ecb8a7cf145878d045)

CC: @DanielGibson, @Akaricchi.

Sorry, can’t do. Left mine in Ukraine as I fled from the war. Interesting find though.

I don’t want to close this issue for the moment, however this database doesn’t have any (direct) ties to SDL itself 😕 We are a community effort. As such, problems with the format have to be resolved on the SDL side of things.

@Swyter Opening a thread on the SDL forums is the right course of action.

For the db, we’ve had issues popping up about that specific controller from time to time. When it is changed, then a new issue will popup from another user complaining his mappings are broken. etc. while (true) ping_pong_issues();

Since the macOS mapping GUID is different, I will happily accept a PR with it. For the other platform mappings, the best resolution currently is to offer button remapping in your game. It isn’t ideal, but it is still a highly recommended thing to do as our mappings are provided by the community and there are probably some messed up mappings in the db.

Feel free to keep discussing in this issue thread. Sorry I can’t be of more help.