lmoss30
Posts: 66
Joined: Mon May 28, 2012 11:45 am

Xbox360 USB control pad

Wed Jun 27, 2012 5:37 pm

Has anyone managing t get a 360 controller working on the pi as yet, seen a few drivers for it on the Debian package list but can't seem to make it work

xevil
Posts: 4
Joined: Thu Jun 14, 2012 5:06 pm

Re: Xbox360 USB control pad

Wed Jun 27, 2012 7:34 pm

i tryed to ask about it, but instead of wired 360 pad i asked about 360 wireless adapter...they tryed but no results because of some kind of lack of drivers/compatibility

stevepdp
Posts: 285
Joined: Fri Oct 28, 2011 7:41 am

Re: Xbox360 USB control pad

Wed Jun 27, 2012 8:39 pm

The 360 pad works very well with Linux generally. I've been using one recently for example to play Super Meat Boy under Ubuntu :-)

With regards to getting the 360 pad to work with the Pi though, I understand that it requires 5v 450mA which is too much for the Pi's USB ports.

Without some heavy modification such as drawing the power from a separate source, I very much doubt it will work.

jasjeet
Posts: 90
Joined: Thu May 31, 2012 6:00 pm

Re: Xbox360 USB control pad

Wed Jun 27, 2012 10:40 pm

We can get around the power issue with an externally powered USB hub.

I hope there will be support for Xbox pads considering we are using XBMC.

tba
Posts: 4
Joined: Thu Jun 28, 2012 11:00 am

Re: Xbox360 USB control pad

Thu Jun 28, 2012 11:19 am

Hej,

I got a Xbox 360 Wireless Pad working yesterday without too much effort with xboxdrv (http://pingus.seul.org/~grumbel/xboxdrv/), raspbmc RC3 (http://www.raspbmc.com/) and a USB-Hub.

Just download the source code and follow the, for a change understandable ;) , instructions in the readme to compile. I will probably post a step by step "guide" tomorrow.
I had no time to test it with any program, but got controller output for all axes and buttons in the terminal.

jasjeet
Posts: 90
Joined: Thu May 31, 2012 6:00 pm

Re: Xbox360 USB control pad

Thu Jun 28, 2012 5:07 pm

tba wrote:Hej,

I got a Xbox 360 Wireless Pad working yesterday without too much effort with xboxdrv (http://pingus.seul.org/~grumbel/xboxdrv/), raspbmc RC3 (http://www.raspbmc.com/) and a USB-Hub.

Just download the source code and follow the, for a change understandable ;) , instructions in the readme to compile. I will probably post a step by step "guide" tomorrow.
I had no time to test it with any program, but got controller output for all axes and buttons in the terminal.
WOW thats seriously epic, im going to try this out right now! A setp by step guide would be so useful for us newbies.

Would it be possible to get it to work with OpenELEC? That would be amazing.

Edit
Already a problem, trying to compile, but cannot apt-get libboost 1.42, what do i do?

jasjeet
Posts: 90
Joined: Thu May 31, 2012 6:00 pm

Re: Xbox360 USB control pad

Thu Jun 28, 2012 5:46 pm

I fixed that with apt-get install libboost

Then i ran scons to compile.

Ok now what do i do? Which files do i put on the Pi and what locations?

tba
Posts: 4
Joined: Thu Jun 28, 2012 11:00 am

Re: Xbox360 USB control pad

Fri Jun 29, 2012 2:15 am

Way to late for a reply but I will try anyways ;) (everything from memory, names could be slightly different)
trying to compile, but cannot apt-get libboost 1.42, what do i do
I fixed that with apt-get install libboost
I don't really know what I'm doing but this covers it somehow. I try to compile, it puts out some "xyz is missing" error messages than I search for the package and install it.
I don't use "apt-get" but "aptitude" (if not pre-installed "apt-get install aptitude") as it gives you feedback in the search if you've already installed a package, with the prefix "i" for installed.
So, if libboost 1.42 is missing, I search for libboost with "aptitude search libboost". It may give results for several version numbers and, thats the important thing, packages with a "-dev" at the end. If you try to compile something you usually need the developers ("-dev") packages, so go through this process until all dependencies are installed and than the compilation process should get through without any error messages.
If finished successfully, you will end up with an executable file, a so called binary, either in the folder you started the process or in the /src folder. The executable file is often green when you look into your directory with "ls" (ls = list) or if you use "ls -l" (ls -l = list -long) it is marked with an x prefix (i.e. rwx--x--x).
So, in this case you end up with a xboxdr executable in the main directory. Just execute it with "./xboxdrv" and you should get the controller output.

Hope this helps, the rest will come if I figure it out ;)

by the way, it should work for most linux versions

jasjeet
Posts: 90
Joined: Thu May 31, 2012 6:00 pm

Re: Xbox360 USB control pad

Fri Jun 29, 2012 9:09 am

Oh I didn't use the dev version of libboost, it made an executable that compiled, it runs ok on my Linux virtual machine, but it wont run on the Pi. It comes up with a C error like: error line 1 expected a '(' ....

I'll try with aptitude now.

Ive assumed you are compiling on a Linux machine then running the xboxdrv on the Pi?

Also why not use the binary he provides on the site?

tba
Posts: 4
Joined: Thu Jun 28, 2012 11:00 am

Re: Xbox360 USB control pad

Fri Jun 29, 2012 9:22 am

Hej,
Ive assumed you are compiling on a Linux machine then running the xboxdrv on the Pi?
I compiled on the pi what took quite some time.
Also why not use the binary he provides on the site?
They where build for "normal" Desktop Ubuntu, not for the ARM architecture the pi has and therefore shouldn't work.
I might add that almost everything I say is rather good guessing than really knowing ;)

jasjeet
Posts: 90
Joined: Thu May 31, 2012 6:00 pm

Re: Xbox360 USB control pad

Fri Jun 29, 2012 10:06 am

Ok yeah i started compilin gon Pi, and it as taking a while, so i cancelled and did it on the PC. Then i got this error
[email protected]:/etc/xbox/xboxdrv-linux-0.8.4# sudo ./xboxdrv
./xboxdrv: 1: Syntax error: "(" unexpect

So now i just installed all packages on the Pi (RaspBMC) and am compiling it. Ill let you know how it goes.

jasjeet
Posts: 90
Joined: Thu May 31, 2012 6:00 pm

Re: Xbox360 USB control pad

Fri Jun 29, 2012 3:27 pm

Ok this is what i did to get it to work
ssh to RaspBMC

Code: Select all

sudo su
apt-get install \
     g++ \
     libboost1.42-dev \
     scons \
     pkg-config \
     libusb-1.0-0-dev \
     git-core \
     libx11-dev \
     libudev-dev \
     x11proto-core-dev \
     libdbus-glib-1-dev
mkdir xbox
WinSCP in and put the source files in xbox folder you made

Code: Select all

cd xbox
scons
./xboxdrv
(After scons command wait about 1.5hours for it to compile)
Now sync the controller up to the wireless dongle and you should get output on terminal.

Now we need a way to take this output and create something like a map.xml that XBMX understands and can respond to our input. No idea how to do this?

Any one got ideas?

I have uploaded xboxdrv to save time:
https://dl.dropbox.com/u/70711577/xbox% ... ver.tar.gz

Run the apt-get commands then just extract it to somewhere on the SD through wget or winscp. Then cd to the folder and run ./xboxdrv, sync controller and test.

jasjeet
Posts: 90
Joined: Thu May 31, 2012 6:00 pm

Re: Xbox360 USB control pad

Sat Jun 30, 2012 2:58 pm

Ive done some more testing and am close i think, i just cant get XBMC to acknowledge the keyboard input and use the Keymap.xml to do actions.

Heres my thread at raspbmc forums
http://forum.stmlabs.com/showthread.php?tid=886

jasjeet
Posts: 90
Joined: Thu May 31, 2012 6:00 pm

Re: Xbox360 USB control pad

Sat Jun 30, 2012 9:26 pm

Check the link in last post, its working =D

Xbox 1 pads, Xbox 360 wired and wireless, PS3 Wired should work.

normal
Posts: 61
Joined: Sun May 27, 2012 9:50 pm

Re: Xbox360 USB control pad

Sun Jul 01, 2012 4:18 pm

Is there a libboost for wheezy? I tried to get it but it says


Package libboost1.42-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

sventunus
Posts: 2
Joined: Mon Jul 02, 2012 10:52 am

Re: Xbox360 USB control pad

Mon Jul 02, 2012 10:54 am

Hey jasjeet,

Any chance you're willing to share your mapping files too? Would save me some time, thanks! :-)

Sven

jasjeet
Posts: 90
Joined: Thu May 31, 2012 6:00 pm

Re: Xbox360 USB control pad

Mon Jul 02, 2012 3:19 pm

I cant acces my files as i am away from home, but i can give a run through of how to make it work.

First you need RaspBMC installed. Next follow the instructions to get the required packages with apt-get install.

Then use WinSCP to ssh into the Pi, user: pi, pass:raspberry.
Run: sudo su
Browse to the /home/pi/ directory. Create a folder called xbox, inside put the files that i have linked that include xboxdrv. If you run 'ls' from /home/pi/xbox youll see xboxdrv listed as one of the files and a bunch of folders (src, examples...etc).

Now create a keymap.xml and keyboard.xml at the location /home/pi/.xbmc/userdata/keymaps/
Inside both files paste in the standard keyboard.xml data from the wiki page.

Going back to /home/pi/xbox create a new script file, eg: load.sh
Inside the file you need something like so:

Code: Select all

#!/bin/bash
/home/pi/xbox/xboxdrv --config /home/pi/xbox/mapping --silent
Create the file mapping in folder /home/pi/xbox/
In this file make something like shown here:

Code: Select all

[xboxdrv]
silent=true
deadzone=6000
dpad-as-button=true
trigger-as-button=true

[ui-axismap]
x2=REL_X:10
y2=REL_Y:-10
x1=KEY_A:KEY_D
y1=KEY_W:KEY_S

[ui-buttonmap]
a=KEY_LEFTSHIFT
b=BTN_C
x=BTN_EXTRA
y=KEY_C

[ui-buttonmap]
lb=BTN_RIGHT
rb=KEY_SPACE

[ui-buttonmap]
lt=KEY_Z
rt=BTN_LEFT

[ui-buttonmap]
dl=KEY_4
dr=KEY_2
du=REL_WHEEL:-1:150
dd=REL_WHEEL:1:150

[ui-buttonmap]
back=KEY_TAB
start=KEY_ESC

# EOF #
As you can see if you want a button to press a keyboard key, use Key_what.ever.key.

Next cd to /home/pi/xbox
Run chdmo 777 *

Lastly run: nano /etc/rc.local

Above exit 0, paste: /home/pi/xbox/xboxdrv

Reboot, it should work, you can add some more commands to the script for your liking, such as deadzones etc.

sventunus
Posts: 2
Joined: Mon Jul 02, 2012 10:52 am

Re: Xbox360 USB control pad

Mon Jul 02, 2012 6:49 pm

I'm quite familiar with Linux jasjeet, just wanted to save me the step of checking the output from each button to create the key mapping files.
But thank you very much for clarifying it so elaborately! :-)
It's of good help to me and many others too surely. Thank you! :-)

ShortBus
Posts: 1
Joined: Sun Sep 16, 2012 3:46 pm

Re: Xbox360 USB control pad

Sun Sep 16, 2012 6:55 pm

Hey there,

another guy joining the discussion about getting those xbox controllers to work on the pi. I'm trying to get the wireless controller to work and I did have some success yet. Compiling xboxdrv for the pi was not very hard. I used my desktop machine for the building process (following the surprisingly easy setup steps described >>here<<), which obviously sped up the build process up to around 20 minutes. The README in the xboxdrv repo was very straight forward and the driver is well documented.

xboxdrv itself seems to work flawless, but I haven't been able to use more than one controller at a time yet. This is what I've done:

- started "xboxdrv -w 0" which worked pretty much right out of the box. However, no 2nd controller and the program is blocking my session, which is not what I wanted it to be.

- so i read the manpages and found out about the daemon and detach flags, which again is very much what i expected. i ended up with some arguments like this: "xboxdrv --daemon --detach -w 0 -s --next-controller -w 1 -s". still not sure if the -s (silent) flag is meant to be passed for each controller or global.

- however, i tested this and nothing worked, pads won't sync with the controller. i then noticed the warnings during startup of the daemon (something like 'unable to detect vendor:product'). an open issue in the github tracker mentioned that un- and replugging of the usb connection would fix that and it did in my case. but still no sync.

- next thing i did was to inspect the other flags that can be passed to xboxdrv. i came over --dbus and noticed that it could be disabled with this switch (--dbus disable). however, the controllers did sync properly then and i already thought i got it, but sadly did not. even though both controllers leds were assigned correctly, it was nearly impossible to assign buttons in EmulationStation or RetroArch (or any other software i figure) because of a very bad and random responsiveness of the buttons (the axis did work pretty well by the way).

- i guess there must be something wrong with the daemon mode, because when starting the non-daemonized version in a second shell (or by passing an "&" right behind), everything worked pretty well. so i thought that maybe forget about the daemon and call xboxdrv twice would be a good idea. it was even suggested somewhere as a simple alternative, but in my case both of the controllers were always assigned to port #0, which is obviously not what anyone would mean by "getting multiple controllers to work".

from this point on i'm a little bit lost here. i expected some more information about the pi and the xbox controllers on the net, but i haven't been very successful in finding it. has anyone some ideas how i could get my pi to let me use more than one controller?

jasjeet
Posts: 90
Joined: Thu May 31, 2012 6:00 pm

Re: Xbox360 USB control pad

Mon Sep 17, 2012 7:33 am


teeth_03
Posts: 284
Joined: Sat Sep 08, 2012 12:02 am

Re: Xbox360 USB control pad

Wed Sep 26, 2012 12:03 am

is it possible to get a precompiled driver from someone for the Wireless adapter instead of having to compile it? I'm kind of a n00b here....

jasjeet
Posts: 90
Joined: Thu May 31, 2012 6:00 pm

Re: Xbox360 USB control pad

Wed Sep 26, 2012 7:04 pm

Yh here
https://dl.dropbox.com/u/70711577/xbox% ... ver.tar.gz

You still need to run the apt-get install commands though otherwise the driver won't run properly.

teeth_03
Posts: 284
Joined: Sat Sep 08, 2012 12:02 am

Re: Xbox360 USB control pad

Wed Sep 26, 2012 9:40 pm

And what commands would those be?

jasjeet
Posts: 90
Joined: Thu May 31, 2012 6:00 pm

Re: Xbox360 USB control pad

Wed Sep 26, 2012 9:54 pm

All info required is here:
http://forum.stmlabs.com/showthread.php?tid=886&page=3

To repeat you need to run this:
apt-get install \
aptitude \
g++ \
scons \
pkg-config \
libusb-1.0-0-dev \
git-core \
libx11-dev \
libudev-dev \
x11proto-core-dev \
libdbus-glib-1-dev \
libudev-dev \
joystick

aptitude install \
libboost1.48-all-dev \
libglib2.0-dev

Sometimes the libboost version changes (when a newer one is out) so you can run aptitude search command to get the right one if that command fails.
Also some of the apt-get commands fail, i would run each one separately, then disregard any that fail as i think they are already incorporated into RaspBMC.

teeth_03
Posts: 284
Joined: Sat Sep 08, 2012 12:02 am

Re: Xbox360 USB control pad

Thu Sep 27, 2012 11:04 pm

I'm going to double check the libraries I installed,but when I go to run sudo xboxdrv,it tell me the command is not found...

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 8 guests