View previous topic :: View next topic |
Author |
Message |
Waninkoko Guru
Joined: 13 May 2005 Posts: 549
|
Posted: Fri Dec 30, 2005 2:33 pm Post subject: HOWTO: Xbox 360 controller on Linux |
|
|
Introduction
This HOWTO explains how to get working the Xbox 360 controller on Linux. Wireless controller doesn't work on PC at the moment.
Compiling xpad module
We have to compile the xpad module and install it. For that, we are going to prepare a new kernel and compile it.
Getting kernel sources
It's time to get lastest kernel sources (skip this step if you don't want to get lastest sources). So, we emerge gentoo-sources.
Code: | # emerge gentoo-sources |
Preparing kernel
Now we're going to apply a small patch to our kernel tree to modify the current xpad driver.
Download the patch from
Code: | http://kamikaze.waninkoko.info/misc/xpad-360-support-2.6.21.patch |
And apply it
Code: | # cd /usr/src/linux
# cat xpad-360-support-2.6.21.patch | patch -p1 |
That's all!
Compiling kernel
It's time to compile kernel but at first we have to change configuration.
To get the controller working we have to compile as module (or compile into the kernel) the options from below:
Kernel options
Code: | Device Drivers -> Input device support -> Joystick interface
Device Drivers -> USB support -> USB Human Interface Device (full HID) support
Device Drivers -> USB support -> USB Human Interface Device (full HID) support -> HID input layer support (this cannot be compiled as a module)
Device Drivers -> USB support -> X-Box gamepad support |
Save config and compile kernel!
Code: | # make && make modules_install |
Loading modules
We're going to load needed modules. We have to load this modules: joydev, usbhid, xpad
Code: | # modprobe joydev usbhid xpad |
Connect the controller. If all is working correctly dmesg will say something like:
dmesg
Code: | input: Microsoft Xbox 360 Controller as /class/input/input6 |
Testing the controller
Well, now it's time to test the controller. Run:
Code: | # cat /dev/input/js0 |
and press any button. If appear some kind of symbols means that the controller is working. Congratulations!
Further information
This method has been tested on a x86 machine, with 2.6.14-gentoo-r5 kernel. Controller has been tested with TuxRacer and works perfectly.
Last edited by Waninkoko on Thu May 03, 2007 9:19 pm; edited 2 times in total |
|
Back to top |
|
|
thoffmeyer Apprentice
Joined: 11 Apr 2004 Posts: 208 Location: GMT -5 Hours
|
Posted: Fri Dec 30, 2005 5:33 pm Post subject: |
|
|
This is pretty nifty... _________________ Conrad Guide, Current Maintainer
Join us on IRC
Server: irc.freenode.net
Channel: #conrad |
|
Back to top |
|
|
mitch Apprentice
Joined: 30 Sep 2003 Posts: 221 Location: Chambéry
|
Posted: Tue Jan 03, 2006 8:11 am Post subject: |
|
|
Thank You so Much
Really Good How to _________________ Linux? Il y a moins bien, mais c'est plus cher ! |
|
Back to top |
|
|
flazz Guru
Joined: 22 Nov 2003 Posts: 496 Location: Florida
|
Posted: Tue Jan 03, 2006 8:21 pm Post subject: |
|
|
thanks, from as a sucker who made a usb/xpad-s an found out it didn't work for shit.
also a must have especially for xpad owners: qjoypad. it lets you map joystick axi and buttons to keyboard and mouse events.
this howto should go in the wiki |
|
Back to top |
|
|
simmete n00b
Joined: 05 Sep 2005 Posts: 18
|
Posted: Sun Apr 30, 2006 7:19 am Post subject: |
|
|
Hi, can I use also a NON 360 joypad?
I have a "normal" xbox, can I use it?
Have you any suggestion about the hardware adapter?
Thanks in advance |
|
Back to top |
|
|
dob Apprentice
Joined: 04 Oct 2002 Posts: 199 Location: S.L.P.
|
|
Back to top |
|
|
dogshu Apprentice
Joined: 22 Jun 2003 Posts: 173 Location: New Haven, CT, USA
|
Posted: Mon Feb 05, 2007 11:06 pm Post subject: |
|
|
OK, I guess 2.6.20 *really* broke the driver, I have it compiled (replacing "SLAB_ATOMIC" with "GFP_KERNEL") and installed, but it doesn't recognize the controllers. Anybody have this working with 2.6.20? |
|
Back to top |
|
|
darklegion Guru
Joined: 14 Nov 2004 Posts: 468
|
Posted: Sun Feb 18, 2007 4:52 am Post subject: |
|
|
dogshu wrote: | OK, I guess 2.6.20 *really* broke the driver, I have it compiled (replacing "SLAB_ATOMIC" with "GFP_KERNEL") and installed, but it doesn't recognize the controllers. Anybody have this working with 2.6.20? |
I don't use the X360 version but the 2.6.20 version of the regular xpad driver uses GFP_ATOMIC instead of GFP_KERNEL, so changing SLAB_ATOMIC to GFP_ATOMIC should fix it for you. |
|
Back to top |
|
|
ll4e n00b
Joined: 14 Dec 2006 Posts: 28
|
Posted: Sun Feb 18, 2007 7:47 pm Post subject: |
|
|
Quote: |
Hi, can I use also a NON 360 joypad?
I have a "normal" xbox, can I use it?
Have you any suggestion about the hardware adapter?
Thanks in advance
|
Yes, you can. After all, there's a Gentoo port for the Xbox (GentooX). The controller is USB-compatible (you need a converter-cable).. http://gentoo-wiki.com/HOWTO_Gentoo_for_Xbox#Getting_Xbox_Hardware_to_Work -> have a look at the kernel configuration, think you'll find it there |
|
Back to top |
|
|
weaksauce Apprentice
Joined: 17 Nov 2005 Posts: 204 Location: NYC
|
Posted: Sun Feb 18, 2007 9:06 pm Post subject: |
|
|
Good call darklegion, thanks for that. That fixed the compile error for both this driver and for my remote's driver in lirc. Now if only ivtv worked with 2.6.20.... |
|
Back to top |
|
|
nex_tym Apprentice
Joined: 29 Jul 2003 Posts: 211
|
Posted: Sun Feb 25, 2007 1:47 am Post subject: |
|
|
Did anyone get it to work in 2.6.20.1? I did get it to work in 2.6.17.13 by following those directions. One thing I did have to do is add my controllers product id, and vendor info in the xpad.c file. Works perfect in 2.6.17.13. In 2.6.20.1 I did the following steps.
#include <linux/usb_input.h> >>>>> #include <linux/usb/input.h>
#include <linux/config.h> >>>>> /* #include <linux/config.h> */
input_regs(dev, regs); >>>> /* input_regs(dev, regs); */
SLAB_ATOMIC >>>> GFP_ATOMIC
Also had to add my controller info to the xpad.c file. It does compile, but I get this
Code: | drivers/usb/input/xpad.c: In function 'xpad_probe':
drivers/usb/input/xpad.c:452: warning: passing argument 6 of 'usb_fill_int_urb' from incompatible pointer type |
I am guessing this is the problem since its not loading the controller up. Same problem as dogshu.
Any help would be appreciated. Thanks |
|
Back to top |
|
|
brian33x51 Tux's lil' helper
Joined: 16 Jun 2002 Posts: 118
|
Posted: Fri Mar 30, 2007 10:23 pm Post subject: |
|
|
Answer here is:
struct pt_regs *regs
pretty much wherever you see this in an argument list or see "regs" getting passed around needs to be commented out.
the USB interface changed some.
Start looking and commenting starting at function "xpad_irq_in"
I may test this later on tonight. |
|
Back to top |
|
|
soonland n00b
Joined: 03 Feb 2004 Posts: 4
|
Posted: Wed Apr 11, 2007 1:18 am Post subject: |
|
|
for those who dont know, there is a wireless usb receiver for xbox 360 controller you can plug on you pc |
|
Back to top |
|
|
Waninkoko Guru
Joined: 13 May 2005 Posts: 549
|
Posted: Thu May 03, 2007 9:21 pm Post subject: |
|
|
Howto updated!! Driver working with kernel 2.6.21 |
|
Back to top |
|
|
nullkey n00b
Joined: 09 Oct 2005 Posts: 37
|
Posted: Sun May 13, 2007 8:40 am Post subject: |
|
|
I added a very experimental support for XBox 360 Wireless controller, please see Gentoo-Wiki: HOWTO Xbox 360 controller on Linux. Could someone please test the new driver and report back whether it works?
I'm not planning to maintain wireless controller support since I don't own one (I just borrowed one to add basic support). There are lots of information about xbox 360 controllers and even an open-source OS X driver for both wireless and wired, so someone with more experience about driver development can easily develop the linux driver further. |
|
Back to top |
|
|
apanloco n00b
Joined: 19 Dec 2005 Posts: 20
|
Posted: Wed Jul 04, 2007 4:10 pm Post subject: |
|
|
Can someone who has access to a Xbox 360 Wireless Gaming Adapter for PC and a controller please give me the dmesg output. I need to know whether it is USB1.1 or USB2.0 before I go and buy this. (For anyone who wonders, I have extended USB inside my wall 15 meters, and it does not work for USB 2.0... but most gamepads are 1.1. However, this thing seems to support high-speed devices like cameras but I need to know for sure)
Would really appreciate it!
Apan |
|
Back to top |
|
|
|