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

This is mainly a cross-post from: https://github.com/gabomdq/SDL_GameControllerDB/issues/202


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 Issue #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 @icculus 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.

This is my lsusb report:

[swyter@osgiliath ~]$ lsusb -v -d0079:0006

Bus 007 Device 002: ID 0079:0006 DragonRise Inc. PC TWIN SHOCK Gamepad
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0079 DragonRise Inc.
  idProduct          0x0006 PC TWIN SHOCK Gamepad
  bcdDevice            1.07
  iManufacturer           1 DragonRise Inc.  
  iProduct                2 Generic   USB  Joystick  
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode           33 US
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     101
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)

Maybe @Daniel_Gibson can post his gamepad output and see what is different.

Damn, I somehow missed this.
Anyway, the report for my Trust CXT24:

Bus 003 Device 120: ID 0079:0006 DragonRise Inc. PC TWIN SHOCK Gamepad
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0079 DragonRise Inc.
  idProduct          0x0006 PC TWIN SHOCK Gamepad
  bcdDevice            1.07
  iManufacturer           1 DragonRise Inc.  
  iProduct                2 Generic   USB  Joystick  
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode           33 US
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     101
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
Device Status:     0x0000
  (Bus Powered)

Hello, as reported here: https://discourse.libsdl.org/t/different-game-controllers-with-the-same-guid/25773
I have two devices have the same GUID under Linux, same vendor/product id, but they’re not exactly the same. One is from Dragonrise, the other is actually from Microntek.

    Bus 002 Device 012: ID 0079:0006 DragonRise Inc. PC TWIN SHOCK Gamepad
    Device Descriptor:
    bLength 18
    bDescriptorType 1
    bcdUSB 1.00
    bDeviceClass 0 (Defined at Interface level)
    bDeviceSubClass 0
    bDeviceProtocol 0
    bMaxPacketSize0 8
    idVendor 0x0079 DragonRise Inc.
    idProduct 0x0006 PC TWIN SHOCK Gamepad
    bcdDevice 1.07
    iManufacturer 1 DragonRise Inc.
    iProduct 2 Generic USB Joystick
    iSerial 0
    bNumConfigurations 1
    Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 41
    bNumInterfaces 1
    bConfigurationValue 1
    iConfiguration 0
    bmAttributes 0x80
    (Bus Powered)
    MaxPower 500mA
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 0
    bAlternateSetting 0
    bNumEndpoints 2
    bInterfaceClass 3 Human Interface Device
    bInterfaceSubClass 0 No Subclass
    bInterfaceProtocol 0 None
    iInterface 0
    HID Device Descriptor:
    bLength 9
    bDescriptorType 33
    bcdHID 1.10
    bCountryCode 33 US
    bNumDescriptors 1
    bDescriptorType 34 Report
    wDescriptorLength 101
    Report Descriptors:
    ** UNAVAILABLE **
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x81 EP 1 IN
    bmAttributes 3
    Transfer Type Interrupt
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0008 1x 8 bytes
    bInterval 10
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x01 EP 1 OUT
    bmAttributes 3
    Transfer Type Interrupt
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0008 1x 8 bytes
    bInterval 10
    Device Status: 0x0000
    (Bus Powered)
    Bus 002 Device 013: ID 0079:0006 DragonRise Inc. PC TWIN SHOCK Gamepad
    Device Descriptor:
    bLength 18
    bDescriptorType 1
    bcdUSB 1.00
    bDeviceClass 0 (Defined at Interface level)
    bDeviceSubClass 0
    bDeviceProtocol 0
    bMaxPacketSize0 8
    idVendor 0x0079 DragonRise Inc.
    idProduct 0x0006 PC TWIN SHOCK Gamepad
    bcdDevice 1.07
    iManufacturer 1 Microntek
    iProduct 2 USB Joystick
    iSerial 0
    bNumConfigurations 1
    Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 41
    bNumInterfaces 1
    bConfigurationValue 1
    iConfiguration 0
    bmAttributes 0x80
    (Bus Powered)
    MaxPower 500mA
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 0
    bAlternateSetting 0
    bNumEndpoints 2
    bInterfaceClass 3 Human Interface Device
    bInterfaceSubClass 0 No Subclass
    bInterfaceProtocol 0 None
    iInterface 0
    HID Device Descriptor:
    bLength 9
    bDescriptorType 33
    bcdHID 1.10
    bCountryCode 33 US
    bNumDescriptors 1
    bDescriptorType 34 Report
    wDescriptorLength 107
    Report Descriptors:
    ** UNAVAILABLE **
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x81 EP 1 IN
    bmAttributes 3
    Transfer Type Interrupt
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0008 1x 8 bytes
    bInterval 10
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x01 EP 1 OUT
    bmAttributes 3
    Transfer Type Interrupt
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0008 1x 8 bytes
    bInterval 10
    Device Status: 0x0000
    (Bus Powered)

Also reported here: https://bugzilla.libsdl.org/show_bug.cgi?id=4545