Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support G PRO in PlayStation/PC native mode #3

Open
skryvel opened this issue Aug 26, 2024 · 0 comments
Open

Support G PRO in PlayStation/PC native mode #3

skryvel opened this issue Aug 26, 2024 · 0 comments

Comments

@skryvel
Copy link

skryvel commented Aug 26, 2024

This is about https://www.logitechg.com/en-us/products/driving/pro-racing-wheel.html PlayStation/PC model.

The wheel already works in G923 mode (including force feedback, but no idea on TrueForce). Altering the ID from 272 to 268 in the existing Xbox-model-related code already makes it mostly work.

I'll try to get USB dumps and post them here. I'm not that sure how to go about it in the correct way. I'm only familiar with capturing a whole bus via Wireshark. I'm specially unsure if I should do something before trying to sniff traffic from a USB passhthrough to a Windows VM with G Hub.

Output in dmesg before using hid-logitech-hidpp from here:

[226345.045696] usb 5-2.1: new full-speed USB device number 120 using xhci_hcd
[226345.153461] usb 5-2.1: New USB device found, idVendor=046d, idProduct=c268, bcdDevice=33.06
[226345.153467] usb 5-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[226345.153470] usb 5-2.1: Product: PRO Racing Wheel for PlayStation/PC
[226345.153471] usb 5-2.1: Manufacturer: Logitech
[226345.295491] input: Logitech  PRO Racing Wheel for PlayStation/PC as /devices/pci0000:00/0000:00:08.1/0000:0e:00.3/usb5/5-2/5-2.1/5-2.1:1.0/0003:046D:C268.00AF/input/input268
[226345.295597] hid-generic 0003:046D:C268.00AF: input,hidraw9: USB HID v1.11 Joystick [Logitech  PRO Racing Wheel for PlayStation/PC] on usb-0000:0e:00.3-2.1/input0
[226345.301507] hid-generic 0003:046D:C268.00B0: hiddev101,hidraw10: USB HID v1.11 Device [Logitech  PRO Racing Wheel for PlayStation/PC] on usb-0000:0e:00.3-2.1/input1
[226345.308096] hid-generic 0003:046D:C268.00B1: hiddev102,hidraw11: USB HID v1.11 Device [Logitech  PRO Racing Wheel for PlayStation/PC] on usb-0000:0e:00.3-2.1/input2

And the output when using this driver after building with a changed ID for the current Xbox code:

[33811.113930] usb 5-2.1: USB disconnect, device number 24
[33833.606816] usb 5-2.1: new full-speed USB device number 25 using xhci_hcd
[33833.721493] usb 5-2.1: New USB device found, idVendor=046d, idProduct=c268, bcdDevice=33.06
[33833.721497] usb 5-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[33833.721499] usb 5-2.1: Product: PRO Racing Wheel for PlayStation/PC
[33833.721501] usb 5-2.1: Manufacturer: Logitech 
[33833.873482] logitech-hidpp-device 0003:046D:C268.0026: Setup multiaxis on the wheel
...
[33833.873527] logitech-hidpp-device 0003:046D:C268.0026: Setup multiaxis on the wheel
[33833.873529] logitech-hidpp-device 0003:046D:C268.0026: Set usage->code 0
<and many repeats>
...
[33833.873661] input: Logitech  PRO Racing Wheel for PlayStation/PC as /devices/pci0000:00/0000:00:08.1/0000:0e:00.3/usb5/5-2/5-2.1/5-2.1:1.0/0003:046D:C268.0026/input/input71
[33833.930268] logitech-hidpp-device 0003:046D:C268.0026: input,hidraw9: USB HID v1.11 Joystick [Logitech  PRO Racing Wheel for PlayStation/PC] on usb-0000:0e:00.3-2.1/input0
[33833.936570] logitech-hidpp-device 0003:046D:C268.0027: hiddev101,hidraw10: USB HID v1.11 Device [Logitech  PRO Racing Wheel for PlayStation/PC] on usb-0000:0e:00.3-2.1/input1
[33834.005564] logitech-hidpp-device 0003:046D:C268.0027: HID++ 4.2 device connected.
[33834.073618] logitech-hidpp-device 0003:046D:C268.0026: Force feedback support loaded (firmware release 6).
[33834.077760] logitech-hidpp-device 0003:046D:C268.0028: hiddev102,hidraw11: USB HID v1.11 Device [Logitech  PRO Racing Wheel for PlayStation/PC] on usb-0000:0e:00.3-2.1/input2

And then mostly works. ACC reports the wheel as another Joystick I have plugged in, but the values do come from the wheel, including those of the pedals. Force Feedback seems completely incorrect in ACC, AMS2 and R3E and probably everything else. Buttons light up in Oversteer but I'm not sure everything is correct. When the wheel clutch is configured as handbrake, acceleration axis is cut and I think becomes negative. Oversteer just shows that as an orange line. In some games the pedal axis seem inverted.

I don't know how to diagnose FFB besides starting up a race, which is quite time consuming. The test in Oversteer produces wheel effects but I don't know how correct they are.

I tried this environment variable without any result: SDL_JOYSTICK_WHEEL_DEVICES="0x046D/0xC268". It seems to me from a cursory look in SDL2 that the ID's for the PS model are already there.

Also evtest seems to work as expected.

...
/dev/input/event7:      Logitech  PRO Racing Wheel for PlayStation/PC
...
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x46d product 0xc268 version 0x111
Input device name: "Logitech  PRO Racing Wheel for PlayStation/PC"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 288 (BTN_TRIGGER)
    Event code 289 (BTN_THUMB)
    Event code 290 (BTN_THUMB2)
    Event code 291 (BTN_TOP)
    Event code 292 (BTN_TOP2)
    Event code 293 (BTN_PINKIE)
    Event code 294 (BTN_BASE)
    Event code 295 (BTN_BASE2)
    Event code 296 (BTN_BASE3)
    Event code 297 (BTN_BASE4)
    Event code 298 (BTN_BASE5)
    Event code 299 (BTN_BASE6)
    Event code 300 (?)
    Event code 301 (?)
    Event code 302 (?)
    Event code 303 (BTN_DEAD)
    Event code 704 (BTN_TRIGGER_HAPPY1)
    Event code 705 (BTN_TRIGGER_HAPPY2)
    Event code 706 (BTN_TRIGGER_HAPPY3)
    Event code 707 (BTN_TRIGGER_HAPPY4)
    Event code 708 (BTN_TRIGGER_HAPPY5)
    Event code 709 (BTN_TRIGGER_HAPPY6)
    Event code 710 (BTN_TRIGGER_HAPPY7)
    Event code 711 (BTN_TRIGGER_HAPPY8)
    Event code 712 (BTN_TRIGGER_HAPPY9)
    Event code 713 (BTN_TRIGGER_HAPPY10)
    Event code 714 (BTN_TRIGGER_HAPPY11)
    Event code 715 (BTN_TRIGGER_HAPPY12)
    Event code 716 (BTN_TRIGGER_HAPPY13)
    Event code 717 (BTN_TRIGGER_HAPPY14)
    Event code 718 (BTN_TRIGGER_HAPPY15)
    Event code 719 (BTN_TRIGGER_HAPPY16)
    Event code 720 (BTN_TRIGGER_HAPPY17)
    Event code 721 (BTN_TRIGGER_HAPPY18)
    Event code 722 (BTN_TRIGGER_HAPPY19)
    Event code 723 (BTN_TRIGGER_HAPPY20)
    Event code 724 (BTN_TRIGGER_HAPPY21)
    Event code 725 (BTN_TRIGGER_HAPPY22)
    Event code 726 (BTN_TRIGGER_HAPPY23)
    Event code 727 (BTN_TRIGGER_HAPPY24)
    Event code 728 (BTN_TRIGGER_HAPPY25)
    Event code 729 (BTN_TRIGGER_HAPPY26)
    Event code 730 (BTN_TRIGGER_HAPPY27)
    Event code 731 (BTN_TRIGGER_HAPPY28)
    Event code 732 (BTN_TRIGGER_HAPPY29)
    Event code 733 (BTN_TRIGGER_HAPPY30)
    Event code 734 (BTN_TRIGGER_HAPPY31)
    Event code 735 (BTN_TRIGGER_HAPPY32)
    Event code 736 (BTN_TRIGGER_HAPPY33)
    Event code 737 (BTN_TRIGGER_HAPPY34)
    Event code 738 (BTN_TRIGGER_HAPPY35)
    Event code 739 (BTN_TRIGGER_HAPPY36)
    Event code 740 (BTN_TRIGGER_HAPPY37)
    Event code 741 (BTN_TRIGGER_HAPPY38)
    Event code 742 (BTN_TRIGGER_HAPPY39)
    Event code 743 (BTN_TRIGGER_HAPPY40)
    Event code 744 (?)
    Event code 745 (?)
    Event code 746 (?)
    Event code 747 (?)
    Event code 748 (?)
    Event code 749 (?)
    Event code 750 (?)
    Event code 751 (?)
    Event code 752 (?)
    Event code 753 (?)
    Event code 754 (?)
    Event code 755 (?)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value  32787
      Min        0
      Max    65535
    Event code 2 (ABS_Z)
      Value      0
      Min        0
      Max    65535
    Event code 3 (ABS_RX)
      Value      0
      Min        0
      Max    65535
    Event code 4 (ABS_RY)
      Value      0
      Min        0
      Max    65535
    Event code 5 (ABS_RZ)
      Value      0
      Min        0
      Max    65535
    Event code 6 (ABS_THROTTLE)
      Value      0
      Min        0
      Max    65535
    Event code 7 (ABS_RUDDER)
      Value      0
      Min        0
      Max    65535
    Event code 8 (ABS_WHEEL)
      Value      0
      Min        0
      Max    65535
      Fuzz     255
      Flat    4095
    Event code 16 (ABS_HAT0X)
      Value      0
      Min       -1
      Max        1
    Event code 17 (ABS_HAT0Y)
      Value      0
      Min       -1
      Max        1
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
  Event type 21 (EV_FF)
    Event code 80 (FF_RUMBLE)
    Event code 81 (FF_PERIODIC)
    Event code 82 (FF_CONSTANT)
    Event code 83 (FF_SPRING)
    Event code 84 (FF_FRICTION)
    Event code 85 (FF_DAMPER)
    Event code 86 (FF_INERTIA)
    Event code 87 (FF_RAMP)
    Event code 88 (FF_SQUARE)
    Event code 89 (FF_TRIANGLE)
    Event code 90 (FF_SINE)
    Event code 91 (FF_SAW_UP)
    Event code 92 (FF_SAW_DOWN)
    Event code 96 (FF_GAIN)
    Event code 97 (FF_AUTOCENTER)

with wheel movement

Event: time 1724677244.222398, type 3 (EV_ABS), code 0 (ABS_X), value 32689
Event: time 1724677244.222398, -------------- SYN_REPORT ------------

right clutch acting as handbrake (as configured in the wheel) - values go to 65536.

Event: time 1724677296.092975, type 3 (EV_ABS), code 2 (ABS_Z), value 0
Event: time 1724677296.092975, -------------- SYN_REPORT ------------

Here is ffbwrap.log the output of ffbwrap --throttling --logger=/tmp/ffbwrap.log /dev/input/by-id/usb-Logitech_PRO_Racing_Wheel_for_PlayStation_PC_...-event-joystick. It's a few seconds of starting a test race and driving a few meters to the right out of the garage. Then the wheel starts turning unexpectedly and sometimes persists for a few seconds after opening up the menu.

The gpro-ffb-axis-6.5 branch seems to give less incorrect FFB but still it seems broken.

I get a bunch of this in the kernel log, which probably explains why FFB continues after the menu is open for a bit.

[37037.473066] logitech-hidpp-device 0003:046D:C268.002A: Force feedback command queue contains 2700 commands, causing substantial delays!
❯ ./hidapitester --vidpid 046D/C268 --list-detail
046D/C268: Logitech  - PRO Racing Wheel for PlayStation/PC
  vendorId:      0x046D
  productId:     0xC268
  usagePage:     0x0001
  usage:         0x0004
  interface:     0 
  path: /dev/hidraw9

046D/C268: Logitech  - PRO Racing Wheel for PlayStation/PC
  vendorId:      0x046D
  productId:     0xC268
  usagePage:     0xFF43
  usage:         0x0701
  interface:     1 
  path: /dev/hidraw10

046D/C268: Logitech  - PRO Racing Wheel for PlayStation/PC
  vendorId:      0x046D
  productId:     0xC268
  usagePage:     0xFF43
  usage:         0x0702
  interface:     1 
  path: /dev/hidraw10

046D/C268: Logitech  - PRO Racing Wheel for PlayStation/PC
  vendorId:      0x046D
  productId:     0xC268
  usagePage:     0xFF43
  usage:         0x0704
  interface:     1 
  path: /dev/hidraw10

046D/C268: Logitech  - PRO Racing Wheel for PlayStation/PC
  vendorId:      0x046D
  productId:     0xC268
  usagePage:     0xFFFD
  usage:         0xFD01
  interface:     2 
  path: /dev/hidraw11

❯ ./hidapitester --vidpid 046D/C268 --list-usages
046D/C268 / 0001/0004  Logitech  - PRO Racing Wheel for PlayStation/PC
046D/C268 / FF43/0701  Logitech  - PRO Racing Wheel for PlayStation/PC
046D/C268 / FF43/0702  Logitech  - PRO Racing Wheel for PlayStation/PC
046D/C268 / FF43/0704  Logitech  - PRO Racing Wheel for PlayStation/PC
046D/C268 / FFFD/FD01  Logitech  - PRO Racing Wheel for PlayStation/PC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant