The online racing simulator
We're very close to submitting the complete patch to LKML. If any DFGT owner could check its USB revision number and report it here, we'd have about everything we need. Thanks.

EDIT: Never mind, from the USB descriptor I got that it should be 13.22
Hi guys,

I came across this thread in a very backwards kind of way, I've been waiting for forcefeedback to work in Wine+LFS for a long time and just discovered it's working now for me -- I can finally format my Windows partition!

Only problem I have is that with my Momo Racing, I have combined pedals. Some searching online lead me to LTWheelConf, and then I found this thread, which I was a little surprised to see is on the LFS forum!

Anyway, I've compiled LTWheelConf but it seems the Racing has no native/fallback modes:


[masonj@archie64 TripleSpeeder-LTWheelConf-665e227]$ ./ltwheelconf --wheel MR --nativemode
Momo Racing is always in native mode.
[masonj@archie64 TripleSpeeder-LTWheelConf-665e227]$

... so how do I enable separate axes? Am I missing something?

Kernel/Wine/lsusb info:


[masonj@archie64 ~]$ uname -r
2.6.39-ARCH
[masonj@archie64 ~]$ /usr/bin/wine --version
wine-1.3.25
[masonj@archie64 ~]$ lspci | grep -i logitech
[masonj@archie64 ~]$ lsusb | grep -i logitech
Bus 002 Device 004: ID 046d:ca03 Logitech, Inc. MOMO Racing
Bus 001 Device 008: ID 046d:c049 Logitech, Inc. G5 Laser Mouse
[masonj@archie64 ~]$


Thanks in advance (and sorry if this has already been answered but it wasn't obvious to me in the thread)
Could you post the output of

cat /sys/kernel/debug/hid/000x:046D:CA03.000y/rdesc

? (the x and y are numbers which vary machine by machine).
You might need to mount debugfs like this first

mount -t debugfs none /sys/kernel/debug

My guess is that MOMO2 needs a replaced HID descriptor just like DFP. This'd have to be fixed in the kernel itself, userspace tools unfortunately can't work around this.
@MadCatX

Here it is:


[masonj@archie64 ~]$ cat /sys/kernel/debug/hid/0003\:046D\:CA03.0001/rdesc
05 01 09 04 a1 01 a1 02 95 01 75 0a 15 00 26 ff 03 35 00 46 ff 03 09 30 81 02 95 0a 75 01 25 01 45 01 05 09 19 01 29 0a 81 02 06 00 ff 09 00 95 04 81 02 95 01 75 08 26 ff 00 46 ff 00 05 01 09 31 81 02 95 03 06 00 ff 09 01 81 02 c0 a1 02 09 02 95 07 91 02 c0 c0

INPUT[INPUT]
Field(0)
Usage(1)
GenericDesktop.X
Logical Minimum(0)
Logical Maximum(1023)
Physical Minimum(0)
Physical Maximum(1023)
Report Size(10)
Report Count(1)
Report Offset(0)
Flags( Variable Absolute )
Field(1)
Usage(10)
Button.0001
Button.0002
Button.0003
Button.0004
Button.0005
Button.0006
Button.0007
Button.0008
Button.0009
Button.000a
Logical Minimum(0)
Logical Maximum(1)
Physical Minimum(0)
Physical Maximum(1)
Report Size(1)
Report Count(10)
Report Offset(10)
Flags( Variable Absolute )
Field(2)
Usage(4)
ff00.0000
ff00.0000
ff00.0000
ff00.0000
Logical Minimum(0)
Logical Maximum(1)
Physical Minimum(0)
Physical Maximum(1)
Report Size(1)
Report Count(4)
Report Offset(20)
Flags( Variable Absolute )
Field(3)
Usage(1)
GenericDesktop.Y
Logical Minimum(0)
Logical Maximum(255)
Physical Minimum(0)
Physical Maximum(255)
Report Size(8)
Report Count(1)
Report Offset(24)
Flags( Variable Absolute )
Field(4)
Usage(3)
ff00.0001
ff00.0001
ff00.0001
Logical Minimum(0)
Logical Maximum(255)
Physical Minimum(0)
Physical Maximum(255)
Report Size(8)
Report Count(3)
Report Offset(32)
Flags( Variable Absolute )
OUTPUT[OUTPUT]
Field(0)
Usage(7)
ff00.0002
ff00.0002
ff00.0002
ff00.0002
ff00.0002
ff00.0002
ff00.0002
Logical Minimum(0)
Logical Maximum(255)
Physical Minimum(0)
Physical Maximum(255)
Report Size(8)
Report Count(7)
Report Offset(0)
Flags( Variable Absolute )

GenericDesktop.X ---> Absolute.X
Button.0001 ---> Key.Trigger
Button.0002 ---> Key.ThumbBtn
Button.0003 ---> Key.ThumbBtn2
Button.0004 ---> Key.TopBtn
Button.0005 ---> Key.TopBtn2
Button.0006 ---> Key.PinkieBtn
Button.0007 ---> Key.BaseBtn
Button.0008 ---> Key.BaseBtn2
Button.0009 ---> Key.BaseBtn3
Button.000a ---> Key.BaseBtn4
ff00.0000 ---> Sync.Report
ff00.0000 ---> Sync.Report
ff00.0000 ---> Sync.Report
ff00.0000 ---> Sync.Report
GenericDesktop.Y ---> Absolute.Y
ff00.0001 ---> Sync.Report
ff00.0001 ---> Sync.Report
ff00.0001 ---> Sync.Report
ff00.0002 ---> Sync.Report
ff00.0002 ---> Sync.Report
ff00.0002 ---> Sync.Report
ff00.0002 ---> Sync.Report
ff00.0002 ---> Sync.Report
ff00.0002 ---> Sync.Report
ff00.0002 ---> Sync.Report
[masonj@archie64 ~]$

I take it MOMO2 = Momo Racing?

Thanks!
Could you follow the instructions here to check which raw input value is the brake and throttle position? I suppose I could then create a replacement HID descriptor to hack around this problem before a better fix is found. It would require patching and rebuilding the kernel, if you're OK with that, let me know and I'll see what I can do.
Thanks, I'd be willing to give it a try

I compiled the code from the post you linked, and the brake is being reported on the throttle axis, with a range of 0..255, and the throttle is showing in the "combined" axis, with the same range. Does that tell you what you need to know?
I suppose it does, it's gonna be slightly awkward to write a replacement descriptor for hardware I don't have but I guess there's no harm trying...
Well, if I can help in any way, let me know. If I knew what code to look at maybe I could do it myself.
That'd be great. You could take a look at MikeB's replacement descriptor patch for DFP (here) - it should give you an idea what to do. The idea is to change the first two anonymous fields ff00.0001 to report as axes Y and Z. It's also smart not to report the original combined Y axis. It's not that hard to do if you know some C. The HID descriptor documentation is all freely available online.
I'd be glad to help you out but it'd be much easier to do if you can write the code yourself as I have no means of testing anything I come up with.

EDIT: I attached the original DFP descriptor so you could compare the changes
Attached files
dfp_origdesc.txt - 3.7 KB - 308 views
What's the best way for a complete Ubuntu and Linux noob like me to set this up for my DFGT?

I've downloaded the source code, installed libusb-dev (via "sudo apt-get install libusb-dev").

When I try to build the source I get the following errors:
povilas@povilas-desktop:~/LTWheelConf$ make
gcc -Wall -c main.c
In file included from main.c:30:
wheelfunctions.h:24:31: error: libusb-1.0/libusb.h: No such file or directory
In file included from main.c:30:
wheelfunctions.h:61: error: expected ‘)’ before ‘*’ token
main.c: In function ‘main’:
main.c:197: warning: implicit declaration of function ‘libusb_init’
main.c:199: warning: implicit declaration of function ‘libusb_set_debug’
main.c:216: warning: assignment discards qualifiers from pointer target type
main.c:286: warning: implicit declaration of function ‘libusb_exit’
make: *** [main.o] Error 1

Thanks in advance! Hopefully I can get things sorted.
I think that libusb package in Ubuntu refers to legacy libusb version. To build LTWC you need libusb-1.0 and libusb-1.0-dev packages.
Thanks for the reply!

I've downloaded the libusb-1.0-0-dev package.

I got a warning when building, but I think that shouldn't be a problem

povilas@povilas-desktop:~/LTWheelConf$ make
gcc -Wall -c main.c
main.c: In function ‘main’:
main.c:216: warning: assignment discards qualifiers from pointer target type
gcc -Wall -c wheelfunctions.c
gcc -Wall -c wheels.c
gcc -Wall -lusb-1.0 -g3 -o ltwheelconf main.o wheelfunctions.o wheels.o
povilas@povilas-desktop:~/LTWheelConf$

What do I have to do next? Or can I just plug in my wheel now?
To switch the wheel to the native mode run

sudo ./ltwheelconf -w DFGT -n

That should allow the 900 deg mode and stuff.

However there is a problem with DFGT at the moment. The Linux kernel doesn't know its PID yet so you will have no force feedback in the native mode. Separate throttle and brake axes might not work too.
There are patches available that should fix some of these issues, but that would require rebuilding the kernel.
And how difficult would it be to fix those issues?

Are there any guides or anything?

Really sad now that I can't have full support The throttle seperation isn't a problem, but the fact that the FFB doesn't work (well it works in-game, but all it does is turn the wheel to the left??).

Another thing I noticed it runs on 180 degrees when I use the command that you supplied to me. I know there's a button combo to force 900 degrees though, so that's not really a problem
Building a custom kernel in Ubuntu is a little bit obnoxious, but it can be done. I'm not an Ubuntu user so I'm kind of extrapolating from what I've read on WiKis and forums, but it should go like this.

1) Grab the kernel source for your Ubuntu version from git (see this)
2) Make sure you have installed all of there

sudo apt-get install fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge
sudo apt-get build-dep linux
sudo apt-get install git-core libncurses5 libncurses5-dev libelf-dev asciidoc binutils-dev

(Copied from here)
3) Open the directory with the kernel source and copy contents of the attached archive to drivers/hid (overwrite everything)
4) On terminal, cd to the directory with the source and
4a) run
zcat /proc/config.gz > .config

This grabs the config of currently running kernel and saves it as .config file.
4b) Run
make oldconfig

You should be asked if you want to build LOGIWHEELS_FF - say Y. If you're not, something is wrong with the patches. Either you haven't copied them to the proper directory or there is some incompatibility between them and the 2.6.38 kernel.
5) Run

make-kpkg --rootcmd fakeroot --initrd --append_to_version -custom --revision 1 kernel_image kernel_headers

Get a cup of coffee and wait till the kernel builds. If you get any errors during build, please let me know; the patches were targeted for 3.0 kernel and they might not work with older ones.
When that's done, you should see kernel-image and kernel-headers packages in the directory. Install those by running

sudo dpkg -i *.deb

This will install all .deb packages in the current directory
6) Run

sudo update-grub2

If everything went well, you should be in the new kernel after reboot. You can check the kernel version with "uname -r" in terminal.
Now when you plug in your DFGT, it should automatically switch to the native mode and 900 deg range. The range can be adjusted like this

echo <range> > /sys/module/hid_logitech/drivers/hid:logitech/<device>/range

Where <range> is a number between 40 and 900 and <device> is the device ID assigned by the kernel. For DFGT it should look like 000x:046D:C29A:000y ("x" and "y" will vary).

EDIT: Forgot to attach the patch. The .zip extension's got to be removed before opening the archive.
Attached files
lgw-patch.tar.gz.zip - 19.3 KB - 588 views
i tested Jiri's logitech branch (with patch applied), and it works so far
edit: a bit more information: I removed all prior stuff (mainly udev rules) and i can play with FF and range automagicly set to 900 deg.; autocenter gets disabled, too.

My only problem is, that i don't find any /sys/module/hid_logitech for my wheel (which i can live with, but odd anyway)
edit: support for sysfs is enabled in my kernelcfg.
Really waiting forward that my Windows 7 will be upgraded to Ubuntu. LFS+G27+Ubuntu sounds like a dream.
Quote from slim.one :
My only problem is, that i don't find any /sys/module/hid_logitech for my wheel (which i can live with, but odd anyway)
edit: support for sysfs is enabled in my kernelcfg.

It's buried a bit deeper in the sysfs structure, it's in /sys/module/hid_logitech/drivers/hid:logitech/<wheel's kobj name>
Quote from MadCatX :It's buried a bit deeper in the sysfs structure, it's in /sys/module/hid_logitech/drivers/hid:logitech/<wheel's kobj name>

i have no /sys/module/hid_logitech in the first place :P
Interesting, perhaps there's another problem in Jiří's branch that causes this. Can you boot with hid.debug=1 kernel parameter? If you have USB debugging enabled in the kernel, you should see "lg4ff: sysfs interface created" in dmesg (it's possible the message is printed even without the CONFIG_USB_DEBUG enabled, I honestly haven't tried )
so i actually found the right folder; in my /sys, its
/sys/devices/pci0000\:00/0000\:00\:16.0/usb7/7-4/7-4\:1.0/0003\:046D\:C29B.0007/
pretty obvious, i have to admit

Folder contents are as follows: (tho i guess you won't have dealt with sysfs that much)
l /sys/devices/pci0000\:00/0000\:00\:16.0/usb7/7-4/7-4\:1.0/0003\:046D\:C29B.0007/
total 0
drwxr-xr-x 4 root root 0 Aug 18 17:20 .
drwxr-xr-x 7 root root 0 Aug 18 17:20 ..
lrwxrwxrwx 1 root root 0 Aug 18 17:20 driver -> ../../../../../../../bus/hid/drivers/logitech
drwxr-xr-x 3 root root 0 Aug 18 17:20 hidraw
drwxr-xr-x 2 root root 0 Aug 18 17:22 power
-rwxrwxrwx 1 root root 4096 Aug 18 17:24 range
-r--r--r-- 1 root root 4096 Aug 18 17:23 report_descriptor
lrwxrwxrwx 1 root root 0 Aug 18 17:20 subsystem -> ../../../../../../../bus/hid
-rw-r--r-- 1 root root 4096 Aug 18 17:20 uevent

setting range works.
That's interesting, what distro have you tested it with? The entry in /sys/module/hid_logitech/drivers... is just a symlink to /sys/devices/... I have no idea why it's not created on your machine.
Thanks a lot for testing, it's good to know that things are fine...
Guys, would like to thank MadCatX for helping me set-up my DFGT. As a token of respect for everyone's hard work, I've just put up a tutorial on my site, on how to use ltwheelconf to set-up Logitech wheels.

See here.

Again! thanks for the help MadCat.

-BkS.

EDIT: Would someone be able to help me, I want to use FFB but I've no idea on how to patch my kernel to do that. Could someone show me?
Actually it depends which distribution you use. The patches aren't big (actually G25/G27 only need a few lines), but you need to install the kernel sources, patch the sources, compile the kernel, build modules etc. pp.

Best way is usually to google for 'custom kernel {insert distroname}' and follow the given procedure step by step. If you use current (stable) kernel sources (get them from www.kernel.org), support for newer logitechwheels is included, so there's no need to patch these sources. But as everyone will tell you, be aware that you can easily get your system in an unusable state if you don't know what you're doing.

If you want to get to know what you're doing, best way is to try to install a distribution which uses a more basic installation process like gentoo on a spare hard disc. You'll learn much about basics of operating systems, but prepare for a more or less long time of frustration

GL&HF
Quote from slim.one :
If you use current (stable) kernel sources (get them from www.kernel.org), support for newer logitechwheels is included, so there's no need to patch these sources.

Unfortunately it is. The patchset that adds proper(ish) force feedback and support for setting range without LTWC is yet to be merged to the mainline. Since it's been accepted to the linux-next tree, I hope it'll be included in kernel 3.2.
The patchset was targeted to 3.0/3.1 series kernels and it doesn't apply clearly to any older kernel. I suppose I could manually build a patched 2.6.38 kernel for Ubuntu as that's the distro a Linux BFUs mostly use.

FGED GREDG RDFGDR GSFDG