ZRtmWrJqXcjbqBLIMBYMCeUw / Logitech-G923-Linux-Kernel-Driver

This project is intended to add support for the Logitech G923 steering wheel to the Linux kernel.
GNU General Public License v3.0
32 stars 0 forks source link

Most G923 input not recognized by Linux #2

Closed ZRtmWrJqXcjbqBLIMBYMCeUw closed 3 years ago

ZRtmWrJqXcjbqBLIMBYMCeUw commented 3 years ago

Input from the wheel, pedals, shifter, and certain buttons is not being recognized by Linux. I have aggregated all of the current data I have/am working with.

The following data is reported by usbhid-dump from the G923.

Report descriptors:

001:002:002:DESCRIPTOR         1602342977.929730    // interface 2 descriptor
 06 FD FF 0A 01 FD A1 01 85 01 15 00 26 FF 00 75
 08 95 3F 09 01 81 00 95 3F 09 01 91 00 C0

001:002:001:DESCRIPTOR         1602342977.932743    // interface 1 descriptor
 06 00 FF 09 01 A1 01 85 10 75 08 95 06 15 00 26
 FF 00 09 01 81 00 09 01 91 00 C0 06 00 FF 09 02
 A1 01 85 11 75 08 95 13 15 00 26 FF 00 09 02 81
 00 09 02 91 00 C0

001:002:000:DESCRIPTOR         1602342977.938742    // interface 0 descriptor
 05 01 09 05 A1 01 85 01 09 30 09 31 09 32 09 35
 15 00 26 FF 00 75 08 95 04 81 02 09 39 15 00 25
 07 35 00 46 3B 01 65 14 75 04 95 01 81 42 65 00
 05 09 19 01 29 0E 15 00 25 01 75 01 95 0E 81 02
 06 00 FF 09 20 75 06 95 01 81 02 05 01 09 33 09
 34 15 00 26 FF 00 75 08 95 02 81 02 06 00 FF 09
 21 95 36 81 02 85 05 09 22 95 1F 91 02 85 03 0A
 21 27 95 2F B1 02 C0 06 F0 FF 09 40 A1 01 85 F0
 09 47 95 3F B1 02 85 F1 09 48 95 3F B1 02 85 F2
 09 49 95 0F B1 02 85 F3 0A 01 47 95 07 B1 02 C0
 05 01 09 04 A1 01 85 30 06 01 FF 09 02 95 07 91
 02 85 31 95 7E 75 10 05 10 19 01 2A FF FF B1 40
 C0

Stream data:

001:002:000:STREAM             1604093504.474620
 01 80 80 80 80 08 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 FF FF FF FF FF
 FF FF FF 04 FF FF 00 00 00 00 00 00 00 00 00 00

Breakdown based on my tests of the wheel:

001:002:000:STREAM             1604093504.474620
 01 80 80 80 80 08 00 00 00 00 00 00 00 00 00 00
  \              \  \  \__________________________ Bit 0 = PlayStation Button
   \              \  \____________________________ Bit 0 = Left Paddle, 1 = Right Paddle, 2 = L2, 3 = R2, 4 = ? (Should be L3), 5 = Share, 6 = Options, 7 = R3
    \              \______________________________ Bit 0 = Square, 1 = X, 2 = O, 3 = Triangle, 4-7 = Hat Switch (default value = 0x08)
     \____________________________________________ Report ID (1)
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ?
 00 00 00 00 00 00 00 00 00 00 00 FF FF FF FF FF
                                  ----- ----- --
                                    \     \    \__ Brake pedal (Y)
                                     \     \______ Gas pedal (X)
                                      \___________ Wheel (Rz)
 FF FF FF 04 FF FF 00 00 00 00 00 00 00 00 00 00
 -- -----  \ -----  \_____________________________ Bit 0 = Select Button, 1 = turn dial wheel counterclockwise (1 click at a time), 2 = turn dial wheel clockwise (1 click at a time), 3 = minus button, 4 = plus button (dual clutch system)
      \     \  \__________________________________ ?
       \     \____________________________________ Shifter: Bit 0 = Gear 1, 1 = Gear 2, 2 = Gear 3, 3 = Gear 4, 4 = Gear 5, 5 = Gear 6
        \_________________________________________ Clutch Pedal (Z)

Original report descriptor (retrieved/formatted through hid-tools):

# Logitech G923 Racing Wheel for PlayStation 4 and PC
# 0x05, 0x01,                    // Usage Page (Generic Desktop)        0
# 0x09, 0x05,                    // Usage (Game Pad)                    2
# 0xa1, 0x01,                    // Collection (Application)            4
# 0x85, 0x01,                    //  Report ID (1)                      6
# 0x09, 0x30,                    //  Usage (X)                          8
# 0x09, 0x31,                    //  Usage (Y)                          10
# 0x09, 0x32,                    //  Usage (Z)                          12
# 0x09, 0x35,                    //  Usage (Rz)                         14
# 0x15, 0x00,                    //  Logical Minimum (0)                16
# 0x26, 0xff, 0x00,              //  Logical Maximum (255)              18
# 0x75, 0x08,                    //  Report Size (8)                    21
# 0x95, 0x04,                    //  Report Count (4)                   23
# 0x81, 0x02,                    //  Input (Data,Var,Abs)               25
# 0x09, 0x39,                    //  Usage (Hat switch)                 27
# 0x15, 0x00,                    //  Logical Minimum (0)                29
# 0x25, 0x07,                    //  Logical Maximum (7)                31
# 0x35, 0x00,                    //  Physical Minimum (0)               33
# 0x46, 0x3b, 0x01,              //  Physical Maximum (315)             35
# 0x65, 0x14,                    //  Unit (Degrees,EngRotation)         38
# 0x75, 0x04,                    //  Report Size (4)                    40
# 0x95, 0x01,                    //  Report Count (1)                   42
# 0x81, 0x42,                    //  Input (Data,Var,Abs,Null)          44
# 0x65, 0x00,                    //  Unit (None)                        46
# 0x05, 0x09,                    //  Usage Page (Button)                48
# 0x19, 0x01,                    //  Usage Minimum (1)                  50
# 0x29, 0x0e,                    //  Usage Maximum (14)                 52
# 0x15, 0x00,                    //  Logical Minimum (0)                54
# 0x25, 0x01,                    //  Logical Maximum (1)                56
# 0x75, 0x01,                    //  Report Size (1)                    58
# 0x95, 0x0e,                    //  Report Count (14)                  60
# 0x81, 0x02,                    //  Input (Data,Var,Abs)               62
# 0x06, 0x00, 0xff,              //  Usage Page (Vendor Defined Page 1) 64
# 0x09, 0x20,                    //  Usage (Vendor Usage 0x20)          67
# 0x75, 0x06,                    //  Report Size (6)                    69
# 0x95, 0x01,                    //  Report Count (1)                   71
# 0x81, 0x02,                    //  Input (Data,Var,Abs)               73
# 0x05, 0x01,                    //  Usage Page (Generic Desktop)       75
# 0x09, 0x33,                    //  Usage (Rx)                         77
# 0x09, 0x34,                    //  Usage (Ry)                         79
# 0x15, 0x00,                    //  Logical Minimum (0)                81
# 0x26, 0xff, 0x00,              //  Logical Maximum (255)              83
# 0x75, 0x08,                    //  Report Size (8)                    86
# 0x95, 0x02,                    //  Report Count (2)                   88
# 0x81, 0x02,                    //  Input (Data,Var,Abs)               90
# 0x06, 0x00, 0xff,              //  Usage Page (Vendor Defined Page 1) 92
# 0x09, 0x21,                    //  Usage (Vendor Usage 0x21)          95
# 0x95, 0x36,                    //  Report Count (54)                  97
# 0x81, 0x02,                    //  Input (Data,Var,Abs)               99
# 0x85, 0x05,                    //  Report ID (5)                      101
# 0x09, 0x22,                    //  Usage (Vendor Usage 0x22)          103
# 0x95, 0x1f,                    //  Report Count (31)                  105
# 0x91, 0x02,                    //  Output (Data,Var,Abs)              107
# 0x85, 0x03,                    //  Report ID (3)                      109
# 0x0a, 0x21, 0x27,              //  Usage (Vendor Usage 0x2721)        111
# 0x95, 0x2f,                    //  Report Count (47)                  114
# 0xb1, 0x02,                    //  Feature (Data,Var,Abs)             116
# 0xc0,                          // End Collection                      118
# 0x06, 0xf0, 0xff,              // Usage Page (Vendor Usage Page 0xfff0) 119
# 0x09, 0x40,                    // Usage (Vendor Usage 0x40)           122
# 0xa1, 0x01,                    // Collection (Application)            124
# 0x85, 0xf0,                    //  Report ID (240)                    126
# 0x09, 0x47,                    //  Usage (Vendor Usage 0x47)          128
# 0x95, 0x3f,                    //  Report Count (63)                  130
# 0xb1, 0x02,                    //  Feature (Data,Var,Abs)             132
# 0x85, 0xf1,                    //  Report ID (241)                    134
# 0x09, 0x48,                    //  Usage (Vendor Usage 0x48)          136
# 0x95, 0x3f,                    //  Report Count (63)                  138
# 0xb1, 0x02,                    //  Feature (Data,Var,Abs)             140
# 0x85, 0xf2,                    //  Report ID (242)                    142
# 0x09, 0x49,                    //  Usage (Vendor Usage 0x49)          144
# 0x95, 0x0f,                    //  Report Count (15)                  146
# 0xb1, 0x02,                    //  Feature (Data,Var,Abs)             148
# 0x85, 0xf3,                    //  Report ID (243)                    150
# 0x0a, 0x01, 0x47,              //  Usage (Vendor Usage 0x4701)        152
# 0x95, 0x07,                    //  Report Count (7)                   155
# 0xb1, 0x02,                    //  Feature (Data,Var,Abs)             157
# 0xc0,                          // End Collection                      159
# 0x05, 0x01,                    // Usage Page (Generic Desktop)        160
# 0x09, 0x04,                    // Usage (Joystick)                    162
# 0xa1, 0x01,                    // Collection (Application)            164
# 0x85, 0x30,                    //  Report ID (48)                     166
# 0x06, 0x01, 0xff,              //  Usage Page (Vendor Usage Page 0xff01) 168
# 0x09, 0x02,                    //  Usage (Vendor Usage 0x02)          171
# 0x95, 0x07,                    //  Report Count (7)                   173
# 0x91, 0x02,                    //  Output (Data,Var,Abs)              175
# 0x85, 0x31,                    //  Report ID (49)                     177
# 0x95, 0x7e,                    //  Report Count (126)                 179
# 0x75, 0x10,                    //  Report Size (16)                   181
# 0x05, 0x10,                    //  Usage Page (Unicode)               183
# 0x19, 0x01,                    //  Usage Minimum (1)                  185
# 0x2a, 0xff, 0xff,              //  Usage Maximum (65535)              187
# 0xb1, 0x40,                    //  Feature (Data,Arr,Abs,Null)        190
# 0xc0,                          // End Collection                      192

Current, work-in-progress report (based on above data breakdown. Shifter and dual clutch system buttons do not work):

0x05, 0x01,                    /* Usage Page (Generic Desktop)        */
0x09, 0x05,                    /* Usage (Game Pad)                    */
0xA1, 0x01,                    /* Collection (Application)            */
0x85, 0x01,                    /*  Report ID (1)                      */
0x06, 0x00, 0xFF,              /*  Usage Page (Vendor Usage Page 1)   */
0x09, 0x20,                    /*  Usage (Vendor Usage 20)            */
0x15, 0x00,                    /*  Logical Minimum (0)                */
0x26, 0xFF, 0x00,              /*  Logical Maximum (255)              */
0x75, 0x08,                    /*  Report Size (8)                    */
0x95, 0x04,                    /*  Report Count (4)                   */
0x81, 0x02,                    /*  Input (Data,Var,Abs)               */
0x05, 0x01,                    /*  Usage Page (Generic Desktop)       */
0x09, 0x39,                    /*  Usage (Hat switch)                 */
0x15, 0x00,                    /*  Logical Minimum (0)                */
0x25, 0x07,                    /*  Logical Maximum (7)                */
0x35, 0x00,                    /*  Physical Minimum (0)               */
0x46, 0x3B, 0x01,              /*  Physical Maximum (315)             */
0x65, 0x14,                    /*  Unit (Degrees,EngRotation)         */
0x75, 0x04,                    /*  Report Size (4)                    */
0x95, 0x01,                    /*  Report Count (1)                   */
0x81, 0x42,                    /*  Input (Data,Var,Abs,Null)          */
0x65, 0x00,                    /*  Unit (None)                        */
0x05, 0x09,                    /*  Usage Page (Button)                */
0x19, 0x01,                    /*  Usage Minimum (1)                  */
0x29, 0x0E,                    /*  Usage Maximum (14)                 */
0x15, 0x00,                    /*  Logical Minimum (0)                */
0x25, 0x01,                    /*  Logical Maximum (1)                */
0x75, 0x01,                    /*  Report Size (1)                    */
0x95, 0x0E,                    /*  Report Count (14)                  */
0x81, 0x02,                    /*  Input (Data,Var,Abs)               */
0x06, 0x00, 0xFF,              /*  Usage Page (Vendor Defined Page 1) */
0x09, 0x20,                    /*  Usage (Vendor Usage 0x20)          */
0x75, 0x06,                    /*  Report Size (6)                    */
0x95, 0x01,                    /*  Report Count (1)                   */
0x81, 0x02,                    /*  Input (Data,Var,Abs)               */
0x09, 0x21,                    /*  Usage (Vendor Usage 0x21)          */
0x75, 0x08,                    /*  Report Size (8)                    */
0x95, 0x23,                    /*  Report Count (35)                  */
0x81, 0x02,                    /*  Input (Data,Var,Abs)               */
0x05, 0x01,                    /*  Usage Page (Generic Desktop)       */
0x09, 0x30,                    /*  Usage (X)                          */
0x26, 0xFF, 0xFF,              /*  Logical Maximum (65535)            */
0x46, 0xFF, 0xFF,              /*  Physical Maximum (65535)           */
0x75, 0x10,                    /*  Report Size (16)                   */
0x95, 0x01,                    /*  Report Count (1)                   */
0x81, 0x02,                    /*  Input (Data,Var,Abs)               */
0x09, 0x31,                    /*  Usage (Y)                          */
0x09, 0x32,                    /*  Usage (Z)                          */
0x09, 0x35,                    /*  Usage (Rz)                         */
0x95, 0x03,                    /*  Report Count (3)                   */
0x81, 0x02,                    /*  Input (Data,Var,Abs)               */
0x05, 0x09,                    /*  Usage Page (Button)                */
0x15, 0x00,                    /*  Logical Minimum (0)                */
0x25, 0x01,                    /*  Logical Maximum (1)                */
0x75, 0x06,                    /*  Report Size (6)                    */
0x95, 0x01,                    /*  Report Count (1)                   */
0x81, 0x02,                    /*  Input (Data,Var,Abs)               */
0x06, 0x00, 0xFF,              /*  Usage Page (Vendor Defined Page 1) */
0x09, 0x21,                    /*  Usage (Vendor Usage 0x21)          */
0x75, 0x02,                    /*  Report Size (2)                    */
0x95, 0x01,                    /*  Report Count (1)                   */
0x81, 0x02,                    /*  Input (Data,Var,Abs)               */
0x09, 0x22,                    /*  Usage (Vendor Usage 0x22)          */
0x75, 0x08,                    /*  Report Size (8)                    */
0x95, 0x02,                    /*  Report Count (2)                   */
0x81, 0x02,                    /*  Input (Data,Var,Abs)               */
0x05, 0x09,                    /*  Usage Page (Button)                */
0x19, 0x01,                    /*  Usage Minimum (1)                  */
0x29, 0x05,                    /*  Usage Maximum (5)                  */
0x15, 0x00,                    /*  Logical Minimum (0)                */
0x25, 0x01,                    /*  Logical Maximum (1)                */
0x75, 0x01,                    /*  Report Size (1)                    */
0x95, 0x05,                    /*  Report Count (5)                   */
0x81, 0x02,                    /*  Input (Data,Var,Abs)               */
0x06, 0x00, 0xFF,              /*  Usage Page (Vendor Defined Page 1) */
0x09, 0x23,                    /*  Usage (Vendor Usage 0x23)          */
0x95, 0x03,                    /*  Report Count (3)                   */
0x81, 0x02,                    /*  Input (Data,Var,Abs)               */
0x09, 0x24,                    /*  Usage (Vendor Usage 0x24)          */
0x75, 0x08,                    /*  Report Size (8)                    */
0x95, 0x09,                    /*  Report Count (9)                   */
0x81, 0x02,                    /*  Input (Data,Var,Abs)               */
0xC0                           /* End Collection                      */
ZRtmWrJqXcjbqBLIMBYMCeUw commented 3 years ago

After some work, I was able to create a report descriptor that makes use of the data from the G923 to get the advice to at least work. However, after doing so, and after reading through some of the patches submitted for the G920 on the Linux input mailing, I think this is not the way to go.

I believe the wheel to be stuck in auto-centering mode, which gives a partial feeling of force feedback, but along with the approximately 10 degrees of dead zone on either side when turning, this is likely the issue that should be focused on. All of the details can be found in issue #1 but I now believe solving that issue might actually solve this issue as the original report descriptor of the G923 is correct and switching out of auto-centering mode might be the way to get the wheel to report the correct data according to the original report descriptor.

sebsonjura commented 3 years ago

Heya. Even if this is a dead end: thanks for getting the info around it is not working. After digging throught half the internet and learning more about drivers and usb than I wanted, this was a good thing to read that it is just not implemented. Maybe time to bag my wheel and wait until support is done? Anything I can help with?

ZRtmWrJqXcjbqBLIMBYMCeUw commented 3 years ago

That is I would suggest. I am no USB/HID wizard so I cannot promise I will get this even somewhat working any time soon. Getting one of the many wheels that do work with Linux, particularly with @berarma's new-lg4ff module, is probably the most sane thing to do.

Unless you work for Logitech and know how the wheel's internals work, there is not much you can help with, unfortunately. Thanks for the offer, though.

ZRtmWrJqXcjbqBLIMBYMCeUw commented 3 years ago

Closing this issue as more information has emerged detailing how the G923 operates. See #3.