04-08-2009, 09:12 AM,
|
|
tof8pool
Junior Member
|
Posts: 22
Threads: 4
Joined: Apr 2008
|
|
Ubuntu 8.10 64 bits enable force feedback G25
Here is how I enable force feedback on my Ubuntu 8.10 64 bits kernel:
First create a patch file named G25.patch for the kernel ( Tested on 2.6.27 ) :
Code: diff -Naur linux-source-2.6.27/drivers/hid/usbhid/hid-ff.c linux-source-2.6.27.orig/drivers/hid/usbhid/hid-ff.c
--- linux-source-2.6.27/drivers/hid/usbhid/hid-ff.c 2008-10-10 00:13:53.000000000 +0200
+++ linux-source-2.6.27.orig/drivers/hid/usbhid/hid-ff.c 2009-02-23 22:21:27.000000000 +0100
@@ -57,6 +57,7 @@
{ 0x46d, 0xc286, hid_lgff_init }, /* Logitech Force 3D Pro Joystick */
{ 0x46d, 0xc294, hid_lgff_init }, /* Logitech Formula Force EX */
{ 0x46d, 0xc295, hid_lgff_init }, /* Logitech MOMO force wheel */
+ { 0x46d, 0xc299, hid_lgff_init }, /* Logitech G25 wheel */
{ 0x46d, 0xca03, hid_lgff_init }, /* Logitech MOMO force wheel */
#endif
#ifdef CONFIG_LOGIRUMBLEPAD2_FF
diff -Naur linux-source-2.6.27/drivers/hid/usbhid/hid-lgff.c linux-source-2.6.27.orig/drivers/hid/usbhid/hid-lgff.c
--- linux-source-2.6.27/drivers/hid/usbhid/hid-lgff.c 2008-10-10 00:13:53.000000000 +0200
+++ linux-source-2.6.27.orig/drivers/hid/usbhid/hid-lgff.c 2009-02-23 22:23:22.000000000 +0100
@@ -55,6 +55,7 @@
{ 0x046d, 0xc286, ff_joystick },
{ 0x046d, 0xc294, ff_joystick },
{ 0x046d, 0xc295, ff_joystick },
+ { 0x046d, 0xc299, ff_joystick },
{ 0x046d, 0xca03, ff_joystick },
};
diff -Naur linux-source-2.6.27/drivers/hid/usbhid/hid-quirks.c linux-source-2.6.27.orig/drivers/hid/usbhid/hid-quirks.c
--- linux-source-2.6.27/drivers/hid/usbhid/hid-quirks.c 2009-03-13 18:54:14.000000000 +0100
+++ linux-source-2.6.27.orig/drivers/hid/usbhid/hid-quirks.c 2009-02-23 22:25:45.000000000 +0100
@@ -316,6 +316,7 @@
#define USB_DEVICE_ID_LOGITECH_HARMONY_64 0xc14f
#define USB_DEVICE_ID_LOGITECH_EXTREME_3D 0xc215
#define USB_DEVICE_ID_LOGITECH_WHEEL 0xc294
+#define USB_DEVICE_ID_LOGITECH_WHEELG25 0xc299
#define USB_DEVICE_ID_LOGITECH_ELITE_KBD 0xc30a
#define USB_DEVICE_ID_LOGITECH_KBD 0xc311
#define USB_DEVICE_ID_S510_RECEIVER 0xc50c
@@ -625,6 +626,7 @@
{ USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_EXTREME_3D, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WHEEL, HID_QUIRK_NOGET },
+ { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WHEELG25, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET },
make sure U have everything needed to compile your kernel :
Code: sudo apt-get install fakeroot build-essential makedumpfile libncurses5 libncurses5-dev
sudo apt-get build-dep linux
Get the kernel source code :
Code: sudo apt-get install linux-source
Now we are ready to start :
Prepare your environment:
Code: mkdir ~/src
cd ~/src
tar xjvf /usr/src/linux-source-<version>.tar.bz2
cd linux-source-<version>
copy the G25.patch file into the source directory and
Code: patch -p1 <G25.patch
the output should be something like that:
Code: patching file drivers/hid/usbhid/hid-ff.c
patching file drivers/hid/usbhid/hid-lgff.c
patching file drivers/hid/usbhid/hid-quirks.c
get the running kernel configuration:
Code: cp -vi /boot/config-`uname -r` .config
Adjust the kernel configuration:
Code: make oldconfig
make menuconfig
go to Device Drivers , and HID Devices
and enable the following options
Code: Force feedback support (EXPERIMENTAL)
PID device support
Logitech devices support
Logitech Rumblepad 2 support
PantherLord/GreenAsia based device support
ThrustMaster devices support
Zeroplus based game controller support
I have to disable paravirtualized guest support otherwise the kernel cleaning fail:
go to Processor type and features and disable the following:
Code: Paravirtualized guest support
Compile and package the new kernel:
Code: make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-ff kernel-image kernel-headers
you now have 2 new package files in ~/src.
install those packages :
Code: cbo@cbobox:~/src$ sudo dpkg -i linux-image-2.6.27.18-ff_2.6.27.18-ff-10.00.Custom_amd64.deb linux-headers-2.6.27.18-ff_2.6.27.18-ff-10.00.Custom_amd64.deb
|
|
04-08-2009, 10:29 AM,
|
|
tof8pool
Junior Member
|
Posts: 22
Threads: 4
Joined: Apr 2008
|
|
I just registered a wiki account, but I'm not familiar with wiki so I need to learn a little bit before posting ;-)
|
|
04-08-2009, 11:24 AM,
|
|
tof8pool
Junior Member
|
Posts: 22
Threads: 4
Joined: Apr 2008
|
|
|
|
07-08-2009, 08:30 AM,
|
|
rmcooke
Junior Member
|
Posts: 3
Threads: 0
Joined: Jul 2009
|
|
Thanks for this contribution. Now if only I could get it working..
I am trying to patch kernel 2.6.28 (Ubuntu Jaunty 64).
Code: richard@ubuntu:~/src/linux-source-2.6.28$ uname -a
Linux ubuntu 2.6.28-13-generic #45-Ubuntu SMP Tue Jun 30 22:12:12 UTC 2009 x86_64 GNU/Linux
I have followed the instructions in http://wiki.vdrift.net/Enabling_force_fe..._in_kernel
When I try to patch the kernel, I get the following:
Code: richard@ubuntu:~/src/linux-source-2.6.28$ patch -p1 <G25.patch
patching file drivers/hid/hid-core.c
Hunk #1 FAILED at 1290.
1 out of 1 hunk FAILED -- saving rejects to file drivers/hid/hid-core.c.rej
patching file drivers/hid/hid-ids.h
Hunk #1 FAILED at 291.
1 out of 1 hunk FAILED -- saving rejects to file drivers/hid/hid-ids.h.rej
patching file drivers/hid/hid-lg.c
Hunk #1 FAILED at 304.
1 out of 1 hunk FAILED -- saving rejects to file drivers/hid/hid-lg.c.rej
I have never patched the kernel before and am now stuck. Hopefully someone can help me out.
Thanks,
Richard
|
|
07-08-2009, 02:23 PM,
|
|
tof8pool
Junior Member
|
Posts: 22
Threads: 4
Joined: Apr 2008
|
|
I 've been able to reproduce your problem
Do not copy the G25.patch into ~/src/linux-source-2.6.28 but into ~/src
Go into ~/src/linux-source-2.6.28 and then:
patch -p1 <../G25.patch
I will change the wiki article
|
|
07-09-2009, 09:08 AM,
|
|
DrP
Junior Member
|
Posts: 3
Threads: 0
Joined: Jul 2009
|
|
patch errors failed hunk
Hi I too am having trouble patching the kernel just as rmcooke did with the same errors
Code: drp@P5QPro:~/src/linux-source-2.6.28$ patch -p1 <../G25.patch
patching file drivers/hid/hid-core.c
Hunk #1 FAILED at 1290.
1 out of 1 hunk FAILED -- saving rejects to file drivers/hid/hid-core.c.rej
patching file drivers/hid/hid-ids.h
Hunk #1 FAILED at 291.
1 out of 1 hunk FAILED -- saving rejects to file drivers/hid/hid-ids.h.rej
patching file drivers/hid/hid-lg.c
Hunk #1 FAILED at 304.
1 out of 1 hunk FAILED -- saving rejects to file drivers/hid/hid-lg.c.rej
however I have my G25.patch file in the ~/src directory. And I change to the linux-source-2.6.28 directory and perform the correct patch command (patch -p1 <../G25.patch) but get eh above error.
I am running Ubuntu 9.04 (Jaunty) 64bit , kernel 2.6.28-13
Can any one help me with this please? :o
|
|
07-10-2009, 01:51 AM,
|
|
tof8pool
Junior Member
|
Posts: 22
Threads: 4
Joined: Apr 2008
|
|
did you change anything in the G25.patch file ?
|
|
07-10-2009, 04:21 AM,
|
|
DrP
Junior Member
|
Posts: 3
Threads: 0
Joined: Jul 2009
|
|
no, I just cut n paste the patch file for version 2.6.28. Strange. Here is what I have.
Code: diff -Naur linux-source-2.6.28/drivers/hid/hid-core.c linux-source-2.6.28.patched/drivers/hid/hid-core.c
--- linux-source-2.6.28/drivers/hid/hid-core.c 2009-04-08 06:38:33.000000000 +0200
+++ linux-source-2.6.28.patched/drivers/hid/hid-core.c 2009-04-10 14:15:27.000000000 +0200
@@ -1290,6 +1290,7 @@
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_FORCE3D_PRO) },
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL) },
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL) },
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2) },
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV) },
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_NE4K) },
diff -Naur linux-source-2.6.28/drivers/hid/hid-ids.h linux-source-2.6.28.patched/drivers/hid/hid-ids.h
--- linux-source-2.6.28/drivers/hid/hid-ids.h 2008-12-25 00:26:37.000000000 +0100
+++ linux-source-2.6.28.patched/drivers/hid/hid-ids.h 2009-04-10 14:12:44.000000000 +0200
@@ -291,6 +291,7 @@
#define USB_DEVICE_ID_LOGITECH_FORCE3D_PRO 0xc286
#define USB_DEVICE_ID_LOGITECH_WHEEL 0xc294
#define USB_DEVICE_ID_LOGITECH_MOMO_WHEEL 0xc295
+#define USB_DEVICE_ID_LOGITECH_G25_WHEEL 0xc299
#define USB_DEVICE_ID_LOGITECH_ELITE_KBD 0xc30a
#define USB_DEVICE_ID_LOGITECH_KBD 0xc311
#define USB_DEVICE_ID_S510_RECEIVER 0xc50c
diff -Naur linux-source-2.6.28/drivers/hid/hid-lg.c linux-source-2.6.28.patched/drivers/hid/hid-lg.c
--- linux-source-2.6.28/drivers/hid/hid-lg.c 2008-12-25 00:26:37.000000000 +0100
+++ linux-source-2.6.28.patched/drivers/hid/hid-lg.c 2009-04-10 14:14:17.000000000 +0200
@@ -304,6 +304,8 @@
.driver_data = LG_FF },
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2),
.driver_data = LG_FF },
+ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL),
+ .driver_data = LG_FF },
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2),
.driver_data = LG_FF2 },
{ }
I tried manually adding the G25 entries to the 3x files mentioned in the patch file, but after compiling and rebooting I did not managed to get FF happening. But I also found that the menu config for the kernel is different and is not like suggested below;
Quote:Go to Device Drivers , and HID Devices and enable the following options
Force feedback support (EXPERIMENTAL)
PID device support
Logitech devices support
Logitech Rumblepad 2 support
PantherLord/GreenAsia based device support
ThrustMaster devices support
Zeroplus based game controller support
In the device drivers -> HID Devices there is another menu "special special HID drivers" and in there there is;
Quote: â â < > DragonRise Inc. force feedback support â â
â â -*- Logitech â â
â â [*] Logitech force feedback â â
â â [*] Logitech Rumblepad 2 force feedback â â
â â -*- Pantherlord devices support â â
â â [*] Pantherlord force feedback support â â
â â < > GreenAsia (Product ID 0x12) force feedback support â â
â â <M> ThrustMaster devices support â â
â â <M> Zeroplus based game controller support
plus in the menu above i have PID support enabled.
Do I still need to do this from what I found in another post?
Quote:KERNEL=="event*", MODE="660", GROUP="games"
BUS=="usb", SYSFS{product}=="G25 Racing Wheel", SYSFS{idVendor}=="046d", ACTION=="remove", RUN+="/etc/init.d/usbhid restart"
BUS=="usb", SYSFS{product}=="G25 Racing Wheel", SYSFS{idVendor}=="046d", ACTION=="add", RUN+="/etc/init.d/usbhid start"
Quote:#!/bin/sh
#
start() {
/sbin/modprobe usbhid
}
stop() {
/sbin/modprobe -r joydev usbhid
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: /etc/init.d/usbhid {start|stop|restart}"
exit 1
esac
Cheers![/code]
|
|
07-10-2009, 07:06 AM,
|
|
rmcooke
Junior Member
|
Posts: 3
Threads: 0
Joined: Jul 2009
|
|
I eventually got mine working by upgrading the kernel to 2.6.30 where this patch has been adopted. Good work! IOt was also necessary to upgrade nvidia video drivers to get this kernel up and running. Otherwise all seems fine.
|
|
07-10-2009, 08:53 AM,
|
|
DrP
Junior Member
|
Posts: 3
Threads: 0
Joined: Jul 2009
|
|
Oh, ok. Thanks. I had tried kernel 2.6.31 today as I saw the G25 was already supported in the HID files in question. However when I installed the kernel there was an error. Cant remember exactly what it was at the moment but it was Nvidia related.
Dont suppose I could trouble you on how to upgrade the nvidia kernel as well with the new kernel? I see ubuntu has already downloaded the 180.44 version in the /usr/src dir.
|
|
07-10-2009, 09:01 AM,
|
|
rmcooke
Junior Member
|
Posts: 3
Threads: 0
Joined: Jul 2009
|
|
I installed the 185.18 drivers using the instructions here:
http://ubuntuforums.org/archive/index.ph...25400.html
|
|
|