The C Source, Patches and (shudder!) Bugs
Post Reply
Eliasvan
Posts: 4
Joined: 03 Apr 2016, 21:19

Add support for Logitech G920 Racing Wheel

Post by Eliasvan » 04 Apr 2016, 22:42

Although it might seem unusual to add support for a device that is not a modem,
there is technically no reason why it should not be supported by usb_modeswitch:
Logitech G920 Racing Wheel

Upon plug-in, the device has product-id 0xc261 and is in XBox mode (vendor specific USB interface class: 0xff).
After sending the magical byte-sequence, the device obtains product-id 0xc262 and enters HID mode (USB interface class: 0x03).
See below for lsusb output.

A bit of history:
Initially, the decision was to do the switch-over by the xpad kernel driver.
This initial approach was criticized by the linux-input kernel maintainer, and a new approach was born: usb_skelswitch: a tiny kernel-space driver capable of sending magical byte-sequences associated with VID/PID pairs - a very simple version of the user-space usb_modeswitch.
Finally, usb_modeswitch was mentioned as a better solution (less code in kernel), and this brings us to this post.

New usb_modeswitch config-file "046d:c261":

Code: Select all

# Logitech G920 Racing Wheel
DefaultVendor=046d
DefaultProduct=c261
MessageEndpoint=01
ResponseEndpoint=01
TargetClass=0x03
MessageContent="0f00010142"
And the corresponding lines in "40-usb_modeswitch.rules":

Code: Select all

# Logitech G920 Racing Wheel
ATTR{idVendor}=="046d", ATTR{idProduct}=="c261", RUN+="usb_modeswitch '%b/%k'"
Credit goes to Michal Malý (not me): https://lkml.org/lkml/2016/1/26/763

Here's the lsusb log before switch-over:

Code: Select all

# lsusb -v -d 046d:c261

Bus 003 Device 012: ID 046d:c261 Logitech, Inc.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass       255 Vendor Specific Subclass
  bDeviceProtocol       255 Vendor Specific Protocol
  bMaxPacketSize0        64
  idVendor           0x046d Logitech, Inc.
  idProduct          0xc261
  bcdDevice           96.02
  iManufacturer           1 Logitech
  iProduct                2 G920 Driving Force Racing Wheel for Xbox One
  iSerial                 3 000072fb6b3b9f58
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass     71
      bInterfaceProtocol    208
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               4
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               4
Device Status:     0x0002
  (Bus Powered)
  Remote Wakeup Enabled
Here's the lsusb log after switch-over:

Code: Select all

# lsusb -v -d 046d:c262

Bus 003 Device 013: ID 046d:c262 Logitech, Inc.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x046d Logitech, Inc.
  idProduct          0xc262
  bcdDevice           96.02
  iManufacturer           1 Logitech
  iProduct                2 G920 Driving Force Racing Wheel for Xbox One
  iSerial                 3 000072fb6b3b9f58
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          4 U96.02_B0048
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    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.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     168
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
Device Status:     0x0000
  (Bus Powered)
As a possibly unrelated side-note:
Previously I was using usb_modeswitch 2.2.1 (on Fedora 22) where it did not work when using cascaded USB hubs: USB path "3-1.4".
Now I'm using usb_modeswitch 2.3.0 where it does work just fine.

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Re: Add support for Logitech G920 Racing Wheel

Post by Josh » 05 Apr 2016, 08:46

There are already a number of non-modem devices in the 'data base' of usb_modeswitch, so it's not at all unusual.

I also think it's better to leave the whole mode-switching business out of the kernel.

Thanks for the data and for the testing, the device will be added to the next data package release. Meanwhile, I assume you'll spread the word about the new configuration, so people can add it to their setups themselves.
You can link to this thread of course; in time, the robots of Bing and Google find and devour it as well ...

Eliasvan
Posts: 4
Joined: 03 Apr 2016, 21:19

Re: Add support for Logitech G920 Racing Wheel

Post by Eliasvan » 05 Apr 2016, 19:23

Thanks for including this!

Eliasvan
Posts: 4
Joined: 03 Apr 2016, 21:19

Re: Add support for Logitech G920 Racing Wheel

Post by Eliasvan » 24 Jul 2016, 22:23

Josh wrote: Thanks for the data and for the testing, the device will be added to the next data package release.
According to the ChangeLog of usb-modeswitch-data package version 20160612, I see:

Code: Select all

Added devices: [046d:c261] Logitech G920 Racing Wheel, ...
But when I look in the "40-usb_modeswitch.rules" file or in the "usb_modeswitch.d/" directory, I can't see any mention of "046d:c261" :(

Am I seeing ghosts, or was this device really left out (unintentionally)?
How can we fix this as soon as possible?

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: Add support for Logitech G920 Racing Wheel

Post by LOM » 25 Jul 2016, 05:18

Eliasvan wrote: According to the ChangeLog of usb-modeswitch-data package version 20160612, I see:

Code: Select all

Added devices: [046d:c261] Logitech G920 Racing Wheel, ...
But when I look in the "40-usb_modeswitch.rules" file or in the "usb_modeswitch.d/" directory, I can't see any mention of "046d:c261" :(
The config file is present in the usb_modeswitch.d directory but was forgotten to be included in the udev rule file so you'll have to create that entry yourself for now.
Sorry about that, it will be corrected in the next data package release.

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Re: Add support for Logitech G920 Racing Wheel

Post by Josh » 25 Jul 2016, 09:01

Indeed. Sorry, I don't know how that happened since I create the rules file automatically from the config files with a script ...

I'll release a bugfix follow-up, no problem.

Eliasvan
Posts: 4
Joined: 03 Apr 2016, 21:19

Re: Add support for Logitech G920 Racing Wheel

Post by Eliasvan » 03 Aug 2016, 00:11

LOM wrote:
Eliasvan wrote: According to the ChangeLog of usb-modeswitch-data package version 20160612, I see:

Code: Select all

Added devices: [046d:c261] Logitech G920 Racing Wheel, ...
But when I look in the "40-usb_modeswitch.rules" file or in the "usb_modeswitch.d/" directory, I can't see any mention of "046d:c261" :(
The config file is present in the usb_modeswitch.d directory but was forgotten to be included in the udev rule file so you'll have to create that entry yourself for now.
Sorry about that, it will be corrected in the next data package release.
Josh wrote:Indeed. Sorry, I don't know how that happened since I create the rules file automatically from the config files with a script ...

I'll release a bugfix follow-up, no problem.
It turns out that after having run "make clean" and "make" for the data package, the rules file becomes correct, containing the G920 entry.
This approach was used in the latest ubuntu package: https://launchpad.net/ubuntu/yakkety/am ... 20160612-1

For Fedora, the rules file was fixed manually, so is now correct as well: https://www.rpmfind.net/linux/RPM/fedor ... oarch.html
(thanks to @lkundrak)

So at least these two distributions should have the G920 working out of the box. :D

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Re: Add support for Logitech G920 Racing Wheel

Post by Josh » 03 Aug 2016, 18:29

There is a script in the source package which will re-generate the rules file from the config files that are present in the "usb_modeswitch.d" subfolder.
It was the pre-generated rules file included with the last data package that was incomplete.

JeyP4
Posts: 1
Joined: 08 Dec 2018, 16:50

Re: Add support for Logitech G920 Racing Wheel

Post by JeyP4 » 08 Dec 2018, 16:56

Hi Thanks for drivers
My Logitech G920 is now connected with ubuntu 16.04
But I am facing 2 problems:

1. Every time I replug usb, I have to run the following command
'sudo usb_modeswitch -c /etc/usb_modeswitch.d/046d:c261'

2. As soon as I run above command. Self-centering properties of wheel gets disabled automatically.
I require force-feedback feature also.

Could you help in solving these problems.
Thank you
Last edited by JeyP4 on 12 Apr 2019, 13:59, edited 1 time in total.

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: Add support for Logitech G920 Racing Wheel

Post by LOM » 10 Dec 2018, 16:39

JeyP4 wrote:Hi Thanks for drivers
My Logitech G920 is now connected with ubuntu 16.04
But I am facing 2 problems:

1. Every time I replus usb, I have to run the following command
'sudo usb_modeswitch -c /etc/usb_modeswitch.d/046d:c261'

2. As soon as I run above command. Self-centering properties of wheel gets disabled automatically.
I require force-feedback feature also.

Could you help in solving these problems.
Thank you
Ubuntu is always way behind in updating usb_modeswitch in their distro and that is the reason for your first problem.

usb_modeswitch is not the driver for your wheel, it is only a tool to switch the mode of the device into a working mode.
The wheel driver is part of the linux kernel and you'll need to be at kernel 4.6 or later in order to have force-feedback working.

You can fix both of these problems simply by updating Ubuntu. 16.04 is old.

Bonnette
Posts: 1
Joined: 19 Oct 2019, 09:21

Re: Add support for Logitech G920 Racing Wheel

Post by Bonnette » 19 Oct 2019, 09:37

Eliasvan wrote: It turns out that after having run "make clean" and "make" for the data package, the rules file becomes correct, containing the G920 entry.
This approach was used in the latest ubuntu package: https://launchpad.net/ubuntu/usb-modeswitch-data/2012-1/reviewed-write my paper in 2 hours

For Fedora, the rules file was fixed manually, so is now correct as well: https://www.rpmfind.net/linux/RPM/fedor ... oarch.html
(thanks to @lkundrak)

So at least these two distributions should have the G920 working out of the box. :D
Hi there,

Could you please resend the updated page for Fedora (the mentioned reference is not working)? I'm trying to make some progress, recently got a G29.

Best,
Randy

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Re: Add support for Logitech G920 Racing Wheel

Post by Josh » 10 Nov 2019, 12:29

There are many sources. You should be able to use any newer release.

https://fr2.rpmfind.net/linux/rpm2html/ ... witch-data

juankax
Posts: 1
Joined: 01 Jun 2021, 14:27

Re: Add support for Logitech G920 Racing Wheel

Post by juankax » 01 Jun 2021, 14:30

Hi Josh,

I have the same problem but the link doesn't work.

Thank you,

porno gratis sex filmy webcams porno webcam amateur
Last edited by juankax on 07 Jun 2021, 19:42, edited 1 time in total.

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: Add support for Logitech G920 Racing Wheel

Post by LOM » 01 Jun 2021, 15:40

juankax wrote: 01 Jun 2021, 14:30
I have the same problem but the link doesn't work.
Nothing wrong with the link in Josh post above yours, it works for me.

ssstik11
Posts: 1
Joined: 10 Jan 2024, 09:31
Contact:

Re: Add support for Logitech G920 Racing Wheel

Post by ssstik11 » 10 Jan 2024, 09:33

Users have embraced sss tiktok watermark as a source of inspiration and learning, turning to the platform for quick doses of knowledge during their daily routines. The diverse range of content ensures that there is something for everyone, encouraging a sense of curiosity and continuous learning.

Post Reply