Fix Xbox 360 controller support

  Thread Rating:
  • 3 Votes - 4.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
shiretoko212 Offline
Team-XBMC Member
Posts: 155
Joined: Jul 2012
Reputation: 1
Post: #1
Unresolved Issues
* There are likely more unknown 360 controller device names (found only in xbmc.log, see Instructions for how to find them if your controller isn't detected). Please submit them and whether it's Linux or Windows as discovered (OS required or I won't know which section to add the name to). Don't use device manager or any other source than xbmc.log, as xbmc only uses the names there. UPDATE: https://github.com/xbmc/xbmc/pull/2370 Xinput support could make its way into XBMC soon, which may resolve the device name issue for Windows once and for all, thanks to garbear.
* Using the triggers on Linux sabotages some axes of the thumbsticks until XBMC is restarted. Does not occur with other Linux controller programs like SuperTuxKart. http://trac.xbmc.org/ticket/14130 Workaround: http://forum.xbmc.org/showthread.php?tid...pid1338855
* Panning on zoomed images doesn't work properly. Only one known panning action AnalogMove available which only moves right when mapped to axes 1 and 2 (left thumbstick) in SlideShow section.
* No Mac OS X support. OS has no built-in support for Xbox 360 controllers. http://tattiebogle.net/index.php/Project.../OsxDriver Using that driver, controller support can be added, but according to http://forum.xbmc.org/showthread.php?tid...pid1255709 the device name doesn't show up at all in xbmc.log. Driver dev hasn't responded to questions. Please see if you can test it with more success or reach the OS X driver dev.
* There is no sanity check for playlist queue actions that involve thousands of items or more, and queuing even tries to resolve video addons and web-based entries. This hangs XBMC. Too easy to accidentally crash XBMC by tapping left shoulder button on a massive menu item by accident.
* Keymap multiplier/divider speed setting for actions (triggers/thumbsticks/sometimes buttons/keys) that activate an action too fast or too slow. Also for analog controls, way to adjust the speed at which the action fires based upon how far the stick or trigger is, which currently doesn't happen for any action other than scrollup/scrolldown. Related thread: http://forum.xbmc.org/showthread.php?tid=146660 If this were fixed, I'd make the left thumbstick control all navigation while not in visualisation or fullscreenvideo.

Keymap
http://pastebin.com/a2M7iA5S (v2.0.19)
This keymap is for both Windows and Linux optimized specifically for Frodo. See instructions section below for how to add it to XBMC. Keymap is only necessary if the latest Frodo doesn't detect your controller, in which case, please share the new device name from xbmc.log only and whether it's Linux or Windows. If you want to use the Linux xboxdrv userspace driver with XBMC, which is only necessary if you want advanced features, use the --mimic-xpad argument.

Usage
Menu Navigation: http://i.imgur.com/d5kZa.jpg
Video Playback: http://i.imgur.com/yewys.jpg (Changed to http://i.imgur.com/Oo80N.jpg in v2.0.14 and newer)
The left thumbstick is for time seeking for any currently playing media on any menu or screen of xbmc globally. For menu navigation, use the D-pad in combination with the triggers, which scroll faster than the D-pad.

Instructions to Use Keymap
- Open the pastebin link in Keymap section above and click the DOWNLOAD link. Save it in the keymaps folder inside your xbmc userdata folder, which varies per OS, which can be found here: http://wiki.xbmc.org/index.php?title=Userdata
- Change the file's extension from txt to xml.
- See if your controller works in XBMC now. Compare behaviors of the controller with images in the Usage section, and report in this thread with details if something is off. If your controller isn't detected, continue to the next section. Otherwise, you are finished.

Instructions to Troubleshoot Keymap After Adding
- If your device is not detected, your device name has not been added to the keymap yet. Using a text editor, open xbmc.log located in your userdata folder, determined by http://wiki.xbmc.org/index.php?title=Userdata (possibly inside /temp folder on some systems). Don't use device manager, lsusb, or any other source for the name.
- Search for "Enabled Joystick:" without quotes. Text on same line following "Enabled Joystick: " should be your Xbox 360 controller's device name. (Your device name may be on other matching lines if you have multiple joysticks connected. You will only find joysticks that were enabled, connected, and powered on when XBMC was last opened and closed.) [Note: If the names in this file don't work when you try them, it's possible that xbmc.log is reporting the OEMname wrong, in which case, try these instructions to retrieve it from your OS directly: http://forum.xbmc.org/showthread.php?tid...pid1349106 ]
- Reopen your keymap file in the userdata keymaps folder with a text editor. In that file, if using Windows, replace all instances of "Controller (XBOX 360 For Windows)" without quotes with your device name as discovered in xbmc.log. If using Linux, replace all "Microsoft X-Box 360 pad" instances instead. Save it and close.
- Now restart XBMC, and your controller should be detected now. Compare the behavior of your controller to images in the Usage section. If it behaves in unexpected ways, please include that information in your post. Add your new device name (only from xbmc.log, no other source), operating system information, and any other details to this thread to help improve XBMC.

Keymap Changelog (Reflects all changes not yet added to latest XBMC)
v2.0.19 added new Windows device name: Wireless Gamepad F710 (Controller)
v2.0.18 in VisualisationPresetList, left shoulder (button 5) now toggles the menu off, as left shoulder is what opens the menu.
v2.0.17 in VirtualKeyboard, back button aborts the keyboard without saving changes, and start button saves the changes. Also noticed that in the Windows keymap list, button 15 and button 7 both mean the back button, and some controllers probably rely on button 15. So all sections with Windows button 7 mappings also map that action to button 15 now.
v2.0.16 in Visualisation, left stick button locks current visualisation preset; right stick button goes to a random visualisation preset; back button shows current preset.
v2.0.15 in MusicOSD and VideoOSD, enabled trigger movement left and right. in ContextMenu, enabled trigger movement up and down.
v2.0.14 in FullScreenVideo, right shoulder now toggles playlist, left stick button switches audio tracks, and right stick button toggles currently selected subtitles on/off, with power menu being removed from that section in favor of consistent playlist access.
v2.0.13 made trigger scrolling work in the following OSD submenus (OSDVideoSettings, OSDAudioSettings, VisualisationSettings, AddonSettings) by changing trigger axes actions to up and down in specific sections instead of relying on global scrollup and scrolldown, actions which didn't work at all in those sections for some reason. Now most menu lists should work with trigger scrolling. Start button now backs out of OSDVideoSettings and OSDAudioSettings instead of going back to home and losing user's folder place.
v2.0.12 now possible to switch between images with dpad left and dpad right while pictureinfo dialog is turned on via X or start while viewing any image in the Pictures section. Great for easily browsing image and exif data. Works with picture addons like Google Image Search, for example.
v2.0.11 MusicOSD now toggles off with start button instead of fruitlessly calling info
v2.0.10 three minor usability changes:
* in visualisation, moved nexttrack to dpad down instead of dpad up to match visual feel of going downward on the playlist queue.
* videoOSD now toggles off with start button instead of dumping out to home menu. (Dumping to home loses the user's folder place, and overlaps with fullscreenvideo start toggling info anyway.)
* pictureinfo action section added - picture info dialog toggles properly on slideshow now via X or start buttons.
v2.0.9 added missing closing tag
v2.0.8 added Afterglow Gamepad for Xbox 360 (Controller)
v2.0.6&7 moved invalid button id 3 to 8 in scripts section which prevented context menus from being able to be used in those sections. moved info button from 6 to 8 in other sections for consistency. restores playlist access on right shoulder in visualisation.


Device Name List: See the keymap pastebin link in the section way above. In each section, first joystick tag and altname tags within contains all known Windows device names. Second joystick tag contains all applicable Linux device names acquired from xpad.c v3.6 source: http://lxr.free-electrons.com/source/dri...ick/xpad.c lines 120-170.
Wiki article: http://wiki.xbmc.org/index.php?title=Xbo...or_Windows
Old Pre-Frodo Pitch: http://pastebin.com/SG9qwURi
(This post was last modified: 2013-03-04 13:51 by shiretoko212.)
find quote
vdrfan Offline
Team-XBMC Developer
Posts: 2,837
Joined: Jan 2008
Reputation: 8
Location: Germany
Post: #2
FYI, XBMC keymaps support altnames (see joystick.Microsoft.Xbox.Controller.S.xml eg.)

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules
For troubleshooting and bug reporting please make sure you read this first.
find quote
shiretoko212 Offline
Team-XBMC Member
Posts: 155
Joined: Jul 2012
Reputation: 1
Post: #3
(2012-07-20 20:14)vdrfan Wrote:  FYI, XBMC keymaps support altnames (see joystick.Microsoft.Xbox.Controller.S.xml eg.)
That would make it even easier. I corrected my post.
(This post was last modified: 2013-01-09 01:37 by shiretoko212.)
find quote
Shadow2808 Offline
Junior Member
Posts: 1
Joined: Jul 2012
Reputation: 0
Post: #4
GameStop Xbox 360 Controller (White)

Thank you Shiretoko212, this is exactly what I was looking for! I do have one Newbie question, how come my left Joystick does not do anything? All I did was change your controller name to mine.
Anyway, as per your request I am adding what I for the white GameStop Xbox 360 Controller.

Thank you again for your hard work.

Instructions for Others:

- Download Shiretoko212 Keymap for the XBOX 360 Controller (http://pastebin.com/3YcGRsNr (v1.4))

- Save it in C:\Users\David\AppData\Roaming\XBMC\userdata\keymaps (Windows 7)

- Rename it. ( I renamed it to “keymap_Controller (Gamepad for Xbox 360).xml”)

- Open it and replace "Controller (XBOX 360 For Windows)" with “Controller (Gamepad for Xbox 360)”

- Save it.

- Turn on XBMC and enjoy.

NOTE: The left joystick does not work for me.
find quote
shiretoko212 Offline
Team-XBMC Member
Posts: 155
Joined: Jul 2012
Reputation: 1
Post: #5
Shadow2808: Thank you for sharing. I moved volume to all of the left thumbstick and seeking to all of the right thumbstick, making volume control no longer risk losing your place on the video. Now both functions are split from one stick to two. Up and/or left increase, down and/or right decrease on each stick for each respective function, requiring less thought and precision. Feel free to update to 1.8. Also I generalized your helpful instructions to include looking for the device name and more specifics in the main post. Please omit your instructions and link to old version to avoid confusion of others in the thread. Even Gamestop Xbox 360 Controller (White) will be under multiple device names depending OS, driver, and wired vs wireless, so your post's device name may not correlate with all Gamestop Xbox 360 Controller device names. 1.8 now includes all 8 currently known xbox 360 controller device names so far as altnames, including yours. I will make a new version as new device names are discovered.
(This post was last modified: 2012-07-21 23:47 by shiretoko212.)
find quote
shiretoko212 Offline
Team-XBMC Member
Posts: 155
Joined: Jul 2012
Reputation: 1
Post: #6
So I tried my keymap on Linux Mint 13 Cinnamon. My 360 controller went by yet another device name. I tried adding it as an altname, and it successfully detected it. However, all the mappings were different. So I tried going through and fixing the mappings. However, the left and right triggers, when pressed, overload XBMC and cause it to become unresponsive and actually crash. It looks like my keymap idea is only going to be a solution for XBMC Windows users. If we want to have support for 360 controllers out of the box for all operating systems, it will need an entirely different keymap for Linux, and the triggers overload bug needs to be fixed.
find quote
SleepyP Offline
Posting Freak
Posts: 2,274
Joined: Nov 2005
Reputation: 4
Location: Portland, Oregon
Post: #7
Hey guys, just wanted to post this and maybe save someone else some time.
We have a pair of these Tournament Edition Fightsticks:

[Image: 6Urgs.jpg]

I built a simple keymap for them, which is pretty swank if you've got them hooked up for emulator play. This keymap is for Windows. I'm almost certain the device name will be different under Linux, haven't tested it. I also have not built anything special to handle the music player, this is just a quick & nice setup to make it work, and I put in some toggles to make it feel more natural, like if you hit the Info button (Y in this setup), you can then hit it again to toggle out of Info.
Code:
<!-- Tested on a Round 2 Arcade Fightstick Tournament Edition.-->
<!-- Set the joystick to DP mode.-->
<keymap>
    <global>
        <joystick name="Arcade Stick (Street Fighter IV FightStick TE)">
            <hat id="1" position="left">Left</hat>
            <hat id="1" position="right">Right</hat>
            <hat id="1" position="up">Up</hat>
            <hat id="1" position="down">Down</hat>
            <button id="1">Select</button> <!-- A -->
            <button id="2">Back</button> <!-- B -->
            <button id="3">ContextMenu</button> <!-- X -->
            <button id="4">Info</button> <!-- Y -->
            <button id="6">ScrollUp</button> <!-- RB -->
            <button id="10">ScrollDown</button> <!-- RT -->
            <button id="5">Fullscreen</button> <!-- LB -->
            <button id="9"></button> <!-- LT -->
            <button id="7">Back</button> <!-- Back -->
            <button id="8">Select</button> <!-- Start -->
        </joystick>
    </global>
    <MyFiles>
        <joystick name="Arcade Stick (Street Fighter IV FightStick TE)">
            <button id="4">Highlight</button> <!-- Y -->
        </joystick>
    </MyFiles>
    <FullscreenVideo>
        <joystick name="Arcade Stick (Street Fighter IV FightStick TE)">
            <hat id="1" position="left">StepBack</hat>
            <hat id="1" position="right">StepForward</hat>
            <hat id="1" position="up">BigStepForward</hat>
            <hat id="1" position="down">BigStepBack</hat>
            <button id="1">Pause</button> <!-- A -->
            <button id="2">Stop</button> <!-- B -->
            <button id="3">OSD</button> <!-- X -->
            <button id="4">Info</button> <!-- Y -->
            <button id="6">CodecInfo</button> <!-- RB -->
            <button id="10">ShowSubtitles</button> <!-- RT -->
            <button id="5">Fullscreen</button> <!-- LB -->
            <button id="9">SmallStepBack</button> <!-- LT -->
            <button id="7">SmallStepBack</button> <!-- Back -->
            <button id="8">OSD</button> <!-- Start -->
        </joystick>
    </FullscreenVideo>
    <FullscreenInfo>
        <joystick name="Arcade Stick (Street Fighter IV FightStick TE)">
            <button id="4">Back</button> <!-- Y -->
        </joystick>
    </FullscreenInfo>
    <MovieInformation>
        <joystick name="Arcade Stick (Street Fighter IV FightStick TE)">
            <button id="4">Back</button> <!-- Y -->
        </joystick>
    </MovieInformation>
    <MusicInformation>
        <joystick name="Arcade Stick (Street Fighter IV FightStick TE)">
            <button id="4">Back</button> <!-- Y -->
        </joystick>
    </MusicInformation>
    <PictureInfo>
        <joystick name="Arcade Stick (Street Fighter IV FightStick TE)">
            <button id="4">Back</button> <!-- Y -->
        </joystick>
    </PictureInfo>
    <VideoOSD>
        <joystick name="Arcade Stick (Street Fighter IV FightStick TE)">
            <button id="3">Back</button> <!-- X -->
            <button id="8">Back</button> <!-- Start -->
        </joystick>
    </VideoOSD>
    <FullscreenInfo>
        <joystick name="Arcade Stick (Street Fighter IV FightStick TE)">
            <button id="4">Back</button> <!-- Y -->
        </joystick>
    </FullscreenInfo>
</keymap>

Catchy Signature Here
(This post was last modified: 2012-09-03 19:38 by SleepyP.)
find quote
shiretoko212 Offline
Team-XBMC Member
Posts: 155
Joined: Jul 2012
Reputation: 1
Post: #8
I appreciate your efforts SleepyP, but this thread is about fixing Xbox 360 keymap files in the default installs of XBMC. I think your post is going to confuse people and derail the thread. Please make your own thread. It will be easier for people with that controller to find that way.
(This post was last modified: 2012-09-03 19:35 by shiretoko212.)
find quote
natethomas Offline
Team-XBMC Community Manager
Posts: 3,438
Joined: Apr 2008
Reputation: 61
Location: Kansas
Post: #9
This sure appears to actually be the fix. shiretoko212, would you like me to switch it over to the "guides" section of the forum? And also, would you consider submitting this as a PR on github?

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]
find quote
shiretoko212 Offline
Team-XBMC Member
Posts: 155
Joined: Jul 2012
Reputation: 1
Post: #10
Yes, that would be great. How do I submit it as a PR on github? I'd be happy to do it if I knew how, or you may do it if you like.

Edit: Keep in mind that I've confirmed that all the keymappings and device names for the 360 controller are different with Linux (at least with Mint). I don't know what happens on OSX either. This keymap solution is likely a windows-only solution. I tried to make a working Linux keymap file, but there was a serious bug with the triggers.
(This post was last modified: 2012-09-14 21:46 by shiretoko212.)
find quote
darwin Offline
Senior Member
Posts: 117
Joined: Feb 2009
Reputation: 0
Post: #11
My wired controller shows up as :

"XBOX 360 For Windows (Controller)"

Regarding your linux questions, it has never been 100% clear whether xboxdrv is required to get proper triggers support in XBMC. It is my understanding that some devs believe that the kernel's xbox module might be sufficient to support the 360 controller, given the correct keymaps? Here's a thread I started long, long ago with a workable xboxdrv based keymap. There's 24 pages of it, not sure how much of it might be useful to you in 2012.

http://forum.xbmc.org/showthread.php?tid=57304
find quote
shiretoko212 Offline
Team-XBMC Member
Posts: 155
Joined: Jul 2012
Reputation: 1
Post: #12
Thank you, darwin. I updated the keymap xml file with your device name in the original post.
find quote
ZefQ Offline
Junior Member
Posts: 8
Joined: Feb 2009
Reputation: 0
Post: #13
My wireless shows up as Microsoft Xbox 360 Wireless Controller

Although this config dosent work for me, this one screws everything up <axis id="3" limit="-1">. it seems like it is always pressed even though it it dosent show when i use windows "configure usb gamepad" and it works flawlessly in all my emulators.

Another thing is that the only axis that works for me is <axis id="1" limit="-1"> and <axis id="2" limit="-1"> and on my controller the triggers is'nt maped as axis 3 but rather as button 11 and 12. Anyway this might help others. im going to see if i can figure out whats wrong and if a do i'll post the solution

Update: Installed the latest xbcd from http://vba-m.com/forum/Thread-xbcd-0-2-7...osted-here and now everything works
(This post was last modified: 2012-09-21 11:14 by ZefQ.)
find quote
MonkeyRoach Offline
Junior Member
Posts: 36
Joined: Aug 2008
Reputation: 0
Post: #14
Everything works pretty good except one problem.When the wireless controller turns off it doesn't work anymore.
find quote
tweaker Offline
Junior Member
Posts: 28
Joined: May 2011
Reputation: 0
Post: #15
Excellent work. I'm using this with PS3 controller with motioninjoy.
find quote
Post Reply