Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Documentation, Tips & Tricks
  • Search

HOWTO: Xbox 360 controller on Linux

Unofficial documentation for various parts of Gentoo Linux. Note: This is not a support forum.
Post Reply
Advanced search
16 posts • Page 1 of 1
Author
Message
Waninkoko
Guru
Guru
User avatar
Posts: 549
Joined: Fri May 13, 2005 10:21 pm

HOWTO: Xbox 360 controller on Linux

  • Quote

Post by Waninkoko » Fri Dec 30, 2005 2:33 pm

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: Select all

# 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: Select all

http://kamikaze.waninkoko.info/misc/xpad-360-support-2.6.21.patch
And apply it

Code: Select all

# 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: Select all

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: Select all

# make && make modules_install

Loading modules

We're going to load needed modules. We have to load this modules: joydev, usbhid, xpad

Code: Select all

# modprobe joydev usbhid xpad
Connect the controller. If all is working correctly dmesg will say something like:

dmesg

Code: Select all

input: Microsoft Xbox 360 Controller as /class/input/input6

Testing the controller

Well, now it's time to test the controller. Run:

Code: Select all

# 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.
Top
thoffmeyer
Apprentice
Apprentice
User avatar
Posts: 208
Joined: Sun Apr 11, 2004 3:46 am
Location: GMT -5 Hours

  • Quote

Post by thoffmeyer » Fri Dec 30, 2005 5:33 pm

This is pretty nifty...
Conrad Guide, Current Maintainer

Join us on IRC
Server: irc.freenode.net
Channel: #conrad
Top
mitch
Apprentice
Apprentice
User avatar
Posts: 221
Joined: Tue Sep 30, 2003 6:44 am
Location: Chambéry

  • Quote

Post by mitch » Tue Jan 03, 2006 8:11 am

Thank You so Much

Really Good How to :)
Linux? Il y a moins bien, mais c'est plus cher !
Top
flazz
Guru
Guru
User avatar
Posts: 496
Joined: Sat Nov 22, 2003 6:03 am
Location: Florida
Contact:
Contact flazz
Website

  • Quote

Post by flazz » Tue Jan 03, 2006 8:21 pm

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 :!:
Top
simmete
n00b
n00b
Posts: 18
Joined: Mon Sep 05, 2005 4:57 pm

  • Quote

Post by simmete » Sun Apr 30, 2006 7:19 am

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
Top
dob
Apprentice
Apprentice
User avatar
Posts: 199
Joined: Fri Oct 04, 2002 2:41 am
Location: S.L.P.

  • Quote

Post by dob » Sat Dec 30, 2006 6:25 pm

http://gentoo-wiki.com/HOWTO_Xbox_360_c ... r_on_Linux


As 2.6.19 broke the driver, I was wondering why it had not been integrated into the mainline kernel sources
After all:
a) this is GPL code
b) it works!

So, why not?
Top
dogshu
Apprentice
Apprentice
User avatar
Posts: 173
Joined: Sun Jun 22, 2003 5:51 pm
Location: New Haven, CT, USA

  • Quote

Post by dogshu » Mon Feb 05, 2007 11:06 pm

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?
Top
darklegion
Guru
Guru
Posts: 468
Joined: Sun Nov 14, 2004 1:47 am

  • Quote

Post by darklegion » Sun Feb 18, 2007 4:52 am

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.
Top
ll4e
n00b
n00b
User avatar
Posts: 28
Joined: Thu Dec 14, 2006 10:59 am

  • Quote

Post by ll4e » Sun Feb 18, 2007 7:47 pm

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 ... re_to_Work -> have a look at the kernel configuration, think you'll find it there :)
Top
weaksauce
Apprentice
Apprentice
User avatar
Posts: 204
Joined: Thu Nov 17, 2005 2:31 am
Location: NYC

  • Quote

Post by weaksauce » Sun Feb 18, 2007 9:06 pm

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....
Top
nex_tym
Apprentice
Apprentice
Posts: 211
Joined: Tue Jul 29, 2003 5:49 pm

  • Quote

Post by nex_tym » Sun Feb 25, 2007 1:47 am

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: Select all

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
Top
brian33x51
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 118
Joined: Sun Jun 16, 2002 7:25 am

  • Quote

Post by brian33x51 » Fri Mar 30, 2007 10:23 pm

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.
Top
soonland
n00b
n00b
Posts: 4
Joined: Tue Feb 03, 2004 7:48 pm

  • Quote

Post by soonland » Wed Apr 11, 2007 1:18 am

for those who dont know, there is a wireless usb receiver for xbox 360 controller you can plug on you pc
Top
Waninkoko
Guru
Guru
User avatar
Posts: 549
Joined: Fri May 13, 2005 10:21 pm

  • Quote

Post by Waninkoko » Thu May 03, 2007 9:21 pm

Howto updated!! Driver working with kernel 2.6.21
Top
nullkey
n00b
n00b
Posts: 37
Joined: Sun Oct 09, 2005 11:56 am

  • Quote

Post by nullkey » Sun May 13, 2007 8:40 am

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.
Top
apanloco
n00b
n00b
Posts: 20
Joined: Mon Dec 19, 2005 6:52 pm

  • Quote

Post by apanloco » Wed Jul 04, 2007 4:10 pm

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
Top
Post Reply

16 posts • Page 1 of 1

Return to “Documentation, Tips & Tricks”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic