Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Xbox 360 Gamepad
06-29-2012, 05:37 PM (This post was last modified: 06-29-2012 05:47 PM by Jasjeet.)
Post: #1
Xbox 360 Gamepad
I got something working today:
Quote:Ok this is what i did to get it to work

Download source from: http://pingus.seul.org/~grumbel/xboxdrv/
ssh to RaspBMC
Code:
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:
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 XBMC 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%2...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.

Heres the output through SSH after running xboxdrv and syncing the pad.
[Image: IMG_0381.PNG]

Just need to get some sort of mapping so that RaspBMC can use the inputs to do something useful.

Has anyone got ideas?
Find all posts by this user
Quote this message in a reply
06-29-2012, 06:01 PM
Post: #2
RE: Xbox 360 Gamepad
1. Put xbmc in debug mode
2. tail -F /home/pi/.xbmc/temp/xbmc.log
3. press buttons on remote/controller and note if and what xbmc recognizes
4. cp /opt/xbmc-bcm/xbmc-bin/share/xbmc/system/keymaps/keyboard.xml /home/pi/.xbmc/userdata/keymaps/
5. nano /home/pi/.xbmc/userdata/keymaps/keyboard.xml
6. change or add mappings to work with your controller

If XBMC doesn't see the keypresses, research lirc and irw

Pi problems?? Start here http://forum.stmlabs.com/showthread.php?tid=3918
http://elinux.org/R-Pi_Troubleshooting
http://elinux.org/RPi_config.txt
Find all posts by this user
Quote this message in a reply
06-29-2012, 06:30 PM (This post was last modified: 06-29-2012 09:44 PM by Jasjeet.)
Post: #3
RE: Xbox 360 Gamepad
I have a feeling i can maybe setup a config file that converts the Xbox Buttons presses into Keyboard Buttons. Then i could use the keymap.xml to convert the Keyboard buttons to XBMC actions?

See config file section here
xboxdrv config file

I did what you posted, what am i looking for in keyboard.xml, because it looks generic to me, got lots of stuff inside it.

yeah nothing appears in my terminal when running
tail -F /home/pi/.xbmc/temp/xbmc.log
and pressing buttons, i think its because itll only work using SDLJoystick, which isnt included in RaspBMC compilation.
Find all posts by this user
Quote this message in a reply
06-29-2012, 10:02 PM (This post was last modified: 06-29-2012 10:04 PM by Jasjeet.)
Post: #4
RE: Xbox 360 Gamepad
This is what im trying, using this mapping file, converting the inputs for D-Pad to Keyboard Up,Down,Left,Right.
Run the command: ./xboxdrv --config ./xboxmap
'xboxmap' contains the following mappings:
Code:
[xboxdrv]
ui-clear = true
device-name = "Xbox 360 Wireless Receiver"

[ui-buttonmap]
dl = KEY_LEFT
dr = KEY_RIGHT
du = KEY_UP
dd = KEY_DOWN

Then ive put Keyboard.xml in /home/pi/.xbmc/userdata/keymaps/
I think this is just standard
Code:
<keymap>
  <global>
    <keyboard>
      <p>Play</p>
      <q>Queue</q>
      <f>FastForward</f>
      <r>Rewind</r>
      <left>Left</left>
      <right>Right</right>
      <up>Up</up>
      <down>Down</down>

etc

So when you press D-Pad left, xboxdrv should change that to KEY_LEFT, then keyboard.xml should tell XBMC to do the action: LEFT.

Not working though, ideas?
Find all posts by this user
Quote this message in a reply
06-29-2012, 11:29 PM
Post: #5
RE: Xbox 360 Gamepad
Is it possible to run the command: xboxdrv --config xboxmap
at startup?
Find all posts by this user
Quote this message in a reply
06-30-2012, 03:53 PM (This post was last modified: 06-30-2012 07:42 PM by Jasjeet.)
Post: #6
RE: Xbox 360 Gamepad
Bit more progress i ran apt-get install joystick.
Then i ran the following
./xboxdrv --config xboxmap

Where xboxmap contains mapping for button A = Enter and button B = Backspace, D-PAD as directions.

Then i checked the event (event number given by xboxdrv)
Code:
root@raspbmc:/home/pi# evtest /dev/input/event4
Input driver version is 1.0.1
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
Input device name: "Xbox 360 Wireless Receiver - Keyboard Emulation - Keyboard Emulation"
Supported events:
  Event type 0 (Sync)
  Event type 1 (Key)
    Event code 14 (Backspace)
    Event code 28 (Enter)
    Event code 103 (Up)
    Event code 105 (Left)
    Event code 106 (Right)
    Event code 108 (Down)
Testing ... (interrupt to exit)
Event: time 1341067635.405868, type 1 (Key), code 14 (Backspace), value 1
Event: time 1341067635.406063, -------------- Report Sync ------------
Event: time 1341067635.543985, type 1 (Key), code 14 (Backspace), value 0
Event: time 1341067635.406063, -------------- Report Sync ------------
Event: time 1341067643.044048, type 1 (Key), code 28 (Enter), value 1
Event: time 1341067643.044359, -------------- Report Sync ------------
Event: time 1341067643.403950, type 1 (Key), code 28 (Enter), value 0
Event: time 1341068100.700529, -------------- Report Sync ------------
Event: time 1341068103.116772, type 1 (Key), code 103 (Up), value 1
Event: time 1341068103.117253, -------------- Report Sync ------------
Event: time 1341068103.252512, type 1 (Key), code 103 (Up), value 0
Event: time 1341068103.252672, -------------- Report Sync ------------
Event: time 1341068103.548412, type 1 (Key), code 108 (Down), value 1
Event: time 1341068103.548806, -------------- Report Sync ------------
Event: time 1341068103.692273, type 1 (Key), code 108 (Down), value 0
Event: time 1341068103.692423, -------------- Report Sync ------------
Event: time 1341068103.932221, type 1 (Key), code 105 (Left), value 1
Event: time 1341068103.932623, -------------- Report Sync ------------
Event: time 1341068104.046834, type 1 (Key), code 105 (Left), value 0
Event: time 1341068104.046984, -------------- Report Sync ------------
Event: time 1341068104.444323, type 1 (Key), code 106 (Right), value 1
Event: time 1341068104.444712, -------------- Report Sync ------------
Event: time 1341068104.580810, type 1 (Key), code 106 (Right), value 0
Event: time 1341068104.580957, -------------- Report Sync ------------

So this means that the A and B buttons are being translated to Enter and Backspace correctly. And D-Pad is doing arrow keys.
I still cant get Keymap.xml or Keyboard.xml to take these inputs and make XBMC do something.

Not sure why it wont work, reading up on LIRC, it essectially converts the IR commands to Keyboard commands, which i assume that Keyboard.xml then converts to XBMC actions.
So why are these keyboard commands not being captured by Keyboard.xml?

Could it be because i am starting the xboxdrv after XBMC has booted? How can i get it to launch the driver just before XBMC starts?
Find all posts by this user
Quote this message in a reply
06-30-2012, 08:50 PM (This post was last modified: 06-30-2012 09:39 PM by Jasjeet.)
Post: #7
RE: Xbox 360 Gamepad
Some progress, i have left analogue stick controlling mouse (very sensitive) and i got D-Pad left doing Back function. Need to figure out how its doing that lol.
Using stock keyboard.xml and using the XBMC example mapping file found in examples folder of xboxdrv source.

Ive just been messing with the Mapping files and finally found a way to launch it on startup by following this:
http://forum.xbmc.org/showthread.php?tid=98824

Good news i got rest of buttons now working with the normal mapping using Key_ENETR, Key_BACKSPACE etc.

Still testing, dont know how in-depth the control scheme is for video playback etc currently. Only tested navigation so far.
Find all posts by this user
Quote this message in a reply
07-06-2012, 03:51 PM (This post was last modified: 07-06-2012 03:56 PM by FlemGrem.)
Post: #8
RE: Xbox 360 Gamepad
This any good for you?: http://pastebin.com/7pvLb9RY
from here: http://forum.xbmc.org/showthread.php?tid=100939
Find all posts by this user
Quote this message in a reply
07-07-2012, 09:41 PM (This post was last modified: 07-07-2012 09:42 PM by Jasjeet.)
Post: #9
RE: Xbox 360 Gamepad
Using info from my previous posts its all fixed and working.
Thanks for the links though FlemGrem.

The main problem was getting the driver to start before XBMC process, once that was done, then it was a matter of making the mapping file.
Due to initial tests being done by starting the driver manually after XBMC bootup process, nothing worked. Because USB hot plug isnt yet working i assume.
Find all posts by this user
Quote this message in a reply
07-13-2012, 08:51 PM
Post: #10
RE: Xbox 360 Gamepad
With the risk of beeing called lazy, but is there now somewhere a ready-to-download package of the compiled driver + mapping file?
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Sponsored Advertisement