Howto Setup Xbox360 Controller in Edgy Elft
Getting the Xbox360 Controller Working Edgy
This guide is meant to be really easy; giving you reasons why you're doing things and explaining how to do them in simple language. Don't be afraid it almost impossible to mess up your system. READ the directions.
You need to have automake1.9 & kernel-headers for your kernel
Code:
sudo apt-get install linux-headers-'uname -r' build-essential
sudo apt-get install automake1.9
First you need to download two files:
Use these links (right click save as)
Then your going to make a folder in your home directory called .xpad360 (the dot is to make it hidden)
Now you are going to place the two files you downloaded (xpad.c & xpad.x) into the folder (.xpad360) you just created.
1. Go to places->home
2. Once in your home folder either press Ctrl H (control key & h at the same time) or go to view-> show hidden files
3. Paste the two files you downloaded into the folder the folder you created, .xpad360
Now your going to make a Makefile:
Code:
gedit ~/.xpad360/Makefile
And add this to that file and save:
Code:
KERNEL_DIR?=/usr/src/linux-headers-2.6.17-10-generic
obj-m := xpad.o
EXTRA_CFLAGS= -I$(shell pwd)
all:
$(MAKE) modules -C $(KERNEL_DIR) SUBDIRS=$(shell pwd)
*It is import that there is an indentation (Tab) before $(Make) in the above file. It will not work without it.
*Note the first line of the make file: KERNEL_DIR?=/usr/src/linux-headers-2.6.17-10-generic is my kernel and about 90% of everyone else's. If you followed all these steps and still can't get the file to make. You want to check your folder /usr/src/ and see what kernel your are using and amend the script accordingly.
Now your going to run the Makefile you just made: (YOUR NAME should be replaced with your login name)
Code:
cd /home/<YOUR NAME>/.xpad360
sudo make
Now Your going to add the xpad360 "driver" into the /usb/inputs
Code:
sudo cp xpad.ko /lib/modules/$(uname -r)/kernel/drivers/usb/input
Now to finish up:
Code:
sudo depmod -a
sudo modprobe xpad
And to reboot:
Code:
sudo shutdown -r now
Enjoy!
Re: Howto Setup Xbox360 Controller in Edgy Elft
Thanks! Great guide! :KS
Only thing to add is where to find the device location thing whatever...
anyway, you can find the controller device in /dev/input/js0
Re: Howto Setup Xbox360 Controller in Edgy Elft
Does this driver work for multiple controllers? I can't seem to get it to work with more than one. Also, permissions are not set properly for the gamepads. When I connect an XBOX 360 controller to the PC, it is assigned to the "plugdev" group with no read/write permissions for others. I can reassign the permissions, but they reset when the computer reboots. How can I change the default permissions?
Thanks!
Re: Howto Setup Xbox360 Controller in Edgy Elft
ebs16,
I don't know about the multiple controller issue you are having (I only own one right now), but the easiest way to solve your other problem would be to add any users you want to be able to read the device to the plugdev group:
Code:
$ sudo gpasswd -a <user> plugdev
Note that you'll have to logout and re-login for the changes to take effect.
There is another solution, but it requires writing your own udev rules. This solution is definitely more involved, but it is actually easy.
Re: Howto Setup Xbox360 Controller in Edgy Elft
Hope someone can help me ... when I entered the command :-
sudo modprobe xpad
I got this error message :-
FATAL: Error inserting xpad (/lib/modules/2.6.17-11-386/kernel/drivers/usb/input/xpad.ko): Invalid module format
Can anyone tell me what went wrong?
Many Thanks
Re: Howto Setup Xbox360 Controller in Edgy Elft
dabsan,
Can you post the output of the following command?
[EDIT]
Are you having any other kernel troubles? People have been having problems with 2.6.17-11-* kernels. Have you tried this with 2.6.17-10-*?
Re: Howto Setup Xbox360 Controller in Edgy Elft
Hi thanks for your message ...
The output was :-
2.6.17-11-386
Re: Howto Setup Xbox360 Controller in Edgy Elft
when i execute this command :-
sudo apt-get install linux-headers-'uname -r' build-essential
I get this error :-
E: Couldn't find package linux-headers-uname -r
Hope someone can help.
Many Thanks
Re: Howto Setup Xbox360 Controller in Edgy Elft
dabsan,
Those are backticks, not single quotes. On a QWERTY keyboard, the backtick is to the left of the 1 (the key you press with shift to get a tilde ~).
You could also just install linux-headers-2.6.17-11-386 since you know that's what kernel version you are running.
Re: Howto Setup Xbox360 Controller in Edgy Elft
I followed these instructions and everything seemed to work correctly. After the reboot, however, not much is happening. I plugged the controller in, turned it on, and fired up snes9express (the frontend for SNES9X emulator.) I browed to the configure input section but the system doesn't seem to find any joysticks. I tried both /dev/js0 (the program's default) and /dev/input/js0 as mentioned earlier in this thread. Neither seem to exist. What gives?
By the way, is there any particular USB cable that is necessary for this? I have one that I bought as a charger for the controller that looked like just a standard USB connection, and it was. Is this adequate?
edit: By the way, upon browsing to my /dev/input directory, the only things listed are:
event0 event1 event2 mice mouse0 and ts0
not sure if that's meaningful, seems like there is definitely no joystick detected.
edit 2: Read a few more things online. I didn't realize that there is an entirely separate wired controller available designed to be used with a PC. Perhaps my USB charger attachment isn't going to cut it.