Fix Xbox 360 controller support - Printable Version
+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Development (/forumdisplay.php?fid=93)
+--- Thread: Fix Xbox 360 controller support (/showthread.php?tid=135871)
Fix Xbox 360 controller support - shiretoko212 - 2012-07-11 21:39
* 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=135871&pid=1338855#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/ProjectRoot/Xbox360Controller/OsxDriver Using that driver, controller support can be added, but according to http://forum.xbmc.org/showthread.php?tid=135871&pid=1255709#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.
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.
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=135871&pid=1349106#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/drivers/input/joystick/xpad.c lines 120-170.
Wiki article: http://wiki.xbmc.org/index.php?title=Xbox_360_Wireless_Controller_for_Windows
Old Pre-Frodo Pitch: http://pastebin.com/SG9qwURi
RE: Fix Xbox 360 controller support (xml file enclosed, call for device names) - vdrfan - 2012-07-20 20:14
FYI, XBMC keymaps support altnames (see joystick.Microsoft.Xbox.Controller.S.xml eg.)
RE: Fix Xbox 360 controller support (xml file enclosed, call for device names) - shiretoko212 - 2012-07-21 07:17
(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.
RE: Fix Xbox 360 controller support (xml file enclosed, call for device names) - Shadow2808 - 2012-07-21 19:49
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.
RE: Fix Xbox 360 controller support (xml file enclosed, call for device names) - shiretoko212 - 2012-07-21 19:57
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.
RE: Fix Xbox 360 controller support (xml file enclosed, call for device names) - shiretoko212 - 2012-08-03 08:28
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.
RE: Fix Xbox 360 controller support (xml file enclosed, call for device names) - SleepyP - 2012-09-03 19:30
Hey guys, just wanted to post this and maybe save someone else some time.
We have a pair of these Tournament Edition Fightsticks:
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.
RE: Fix Xbox 360 controller support (xml file enclosed, call for device names) - shiretoko212 - 2012-09-03 19:34
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.
RE: Fix Xbox 360 controller support (xml file enclosed, call for device names) - natethomas - 2012-09-14 14:53
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?
RE: Fix Xbox 360 controller support (xml file enclosed, call for device names) - shiretoko212 - 2012-09-14 14:57
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.
RE: Fix Xbox 360 controller support (xml file enclosed, call for device names) - darwin - 2012-09-19 10:47
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.
RE: Fix Xbox 360 controller support (xml file enclosed, call for device names) - shiretoko212 - 2012-09-19 10:58
Thank you, darwin. I updated the keymap xml file with your device name in the original post.
RE: Fix Xbox 360 controller support (xml file enclosed, call for device names) - ZefQ - 2012-09-20 10: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-release-info-updates-will-be-posted-here and now everything works
RE: Fix Xbox 360 controller support (xml file enclosed, call for device names) - MonkeyRoach - 2012-09-22 05:56
Everything works pretty good except one problem.When the wireless controller turns off it doesn't work anymore.
RE: Fix Xbox 360 controller support (xml file enclosed, call for device names) - tweaker - 2012-09-24 10:22
Excellent work. I'm using this with PS3 controller with motioninjoy.