Fix Xbox 360 controller support

  Thread Rating:
  • 4 Votes - 4.75 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
N3MIS15 Offline
Donor
Posts: 503
Joined: Jul 2010
Reputation: 13
Location: Melbourne, VIC
Post: #226
My gitfu is also weak. You could try: git checkout retroplayer3

[Image: all-fanart.jpg]
find quote
shiretoko212 Offline
Team-Kodi Member
Posts: 155
Joined: Jul 2012
Reputation: 1
Post: #227
Code:
shiretoko212@ubuntu:~/prj/xbmc$ git checkout retroplayer3
Already on 'retroplayer3'

So that's the version I'm actually running. Maybe the xbmc.log in the pastebin link I shared might be helpful to garbear. retroplayer3 includes the new linux controller code, yes?

edit:
Disabling and then re-enabling the joystick support in xbmc settings makes it work if I do it each time I start xbmc.

This is via the built-in xpad driver:
Code:
19:38:40 T:3037243136  NOTICE: CLinuxJoystick::Initialize: opening joystick /dev/input/js1
19:38:40 T:3037243136  NOTICE: CLinuxJoystick::Initialize: Enabled Joystick: "Microsoft X-Box 360 pad" (Linux Joystick API)
19:38:40 T:3037243136  NOTICE: CLinuxJoystick::Initialize: driver version is 2.1.0
19:38:40 T:3037243136  NOTICE: Buttons: BtnX, BtnY, BtnTL, BtnTR, BtnTR2, BtnSelect, BtnThumbL, BtnThumbR, ?, ?, ?
19:38:40 T:3037243136  NOTICE: Axes: X, Y, Z, Rx, Ry, Rz, Hat0X, Hat0Y
Code:
19:38:40 T:3037243136  NOTICE: CLinuxJoystick::Initialize: opening joystick /dev/input/js0
19:38:40 T:3037243136  NOTICE: CLinuxJoystick::Initialize: Enabled Joystick: "VMware VMware Virtual USB Mouse" (Linux Joystick API)
19:38:40 T:3037243136  NOTICE: CLinuxJoystick::Initialize: driver version is 2.1.0
19:38:40 T:3037243136  NOTICE: Buttons: LeftBtn, RightBtn, MiddleBtn, SideBtn, ExtraBtn, ForwardBtn, BackBtn, TaskBtn, ?, ?, ?, ?, ?, ?, ?, ?
19:38:40 T:3037243136  NOTICE: Axes: X, Y

One interesting thing to note in my testing environment of Ubuntu 12.10 in the latest windows VMware Player 5.0.2 with VMware tools installed, having the new Linux controller support enabled messes with the virtual USB mouse input, as it detects it as a joystick. The mouse cursor is hidden for the duration, but it still functions invisibly. Perhaps that VMware device needs to be added to some kind of exclusion list.

edit:
I played with it for a bit. I can't get the dpad to map at all. No events show up for it in xbmc.log, and axis 1 through 8 both limits don't apply to it. hat 0 and 1 don't apply either. Most of the default mappings still work, though the trigger malfunction bug is the same as before. Until I hear from garbear regarding why dpad events aren't showing up in xbmc.log, I won't attempt to adjust and polish the keymap for the new system.

Furthermore, I think this new system uses the same xpad device names, as both mine and N3MIS15's show up as names in the list, and mine hasn't changed. I suspect that collecting new names won't be necessary.

edit:
This is via the xboxdrv driver:
Code:
20:22:04 T:3037464320  NOTICE: CLinuxJoystick::Initialize: opening joystick /dev/input/js1
20:22:04 T:3037464320  NOTICE: CLinuxJoystick::Initialize: Enabled Joystick: "Xbox Gamepad (userspace driver)" (Linux Joystick API)
20:22:04 T:3037464320  NOTICE: CLinuxJoystick::Initialize: driver version is 2.1.0
20:22:04 T:3037464320  NOTICE: Buttons: BtnX, BtnY, BtnTL, BtnTR, BtnTR2, BtnSelect, BtnThumbL, BtnThumbR, ?, ?, ?
20:22:04 T:3037464320  NOTICE: Axes: X, Y, Rx, Ry, Gas, Brake, Hat0X, Hat0Y
xboxdrv shows up using the exact same device name as before. It isn't in the keymap yet though, as without the mimic-xpad argument, it requires an entire custom keymap section devoted to it. Its mappings are unlike xpad.

edit:
N3MIS15: are you sure the dpad is working in your keymap? Those are the former button ids, unmodified.
(This post was last modified: 2013-03-13 02:34 by shiretoko212.)
find quote
N3MIS15 Offline
Donor
Posts: 503
Joined: Jul 2010
Reputation: 13
Location: Melbourne, VIC
Post: #228
the keymap i posted was for ingame only, but yea it works. Every button tested and works..
For UI it would just be Left, Right and so on, not JoypadLeft, JoypadRight....
Also my reviever keymap for whatever reason is different than the default.

[Image: all-fanart.jpg]
find quote
shiretoko212 Offline
Team-Kodi Member
Posts: 155
Joined: Jul 2012
Reputation: 1
Post: #229
Is that with xpad or xboxdrv? I'm mainly concerned with xpad. If it's with xboxdrv, see if you can map it with the built in xpad kernel support.
(This post was last modified: 2013-03-13 07:07 by shiretoko212.)
find quote
N3MIS15 Offline
Donor
Posts: 503
Joined: Jul 2010
Reputation: 13
Location: Melbourne, VIC
Post: #230
i have xboxdrv. never tried xpad will look into it..

[Image: all-fanart.jpg]
find quote
digzz Offline
Senior Member
Posts: 101
Joined: Nov 2009
Reputation: 0
Post: #231
Is there Xbox 360 controller support for XBMCbuntu ?

[Image: all-clearlogo.jpg]
find quote
shiretoko212 Offline
Team-Kodi Member
Posts: 155
Joined: Jul 2012
Reputation: 1
Post: #232
Yes, the 360 controller works on XBMCbuntu in my testing of the Frodo image. The only thing that doesn't work properly are the triggers, but that's true for normal Linux as well. It can be used easily without the triggers, though.
(This post was last modified: 2013-03-19 14:29 by shiretoko212.)
find quote
garbear Offline
Team-Kodi Developer
Posts: 744
Joined: Dec 2010
Reputation: 37
Location: gangsta's paradise
Post: #233
a noteworthy update, koying found my disabled-on-startup bug in PR2370
(This post was last modified: 2013-03-21 06:52 by garbear.)
find quote
digzz Offline
Senior Member
Posts: 101
Joined: Nov 2009
Reputation: 0
Post: #234
(2013-03-19 14:22)shiretoko212 Wrote:  Yes, the 360 controller works on XBMCbuntu in my testing of the Frodo image. The only thing that doesn't work properly are the triggers, but that's true for normal Linux as well. It can be used easily without the triggers, though.

Thank for the reply... So it works out the box with the Xbox controller receiver ? And I don't have to install anything ? Also does this work with the ROM games on XBMC ?

[Image: all-clearlogo.jpg]
find quote
shiretoko212 Offline
Team-Kodi Member
Posts: 155
Joined: Jul 2012
Reputation: 1
Post: #235
Should work out of the box without installing anything. As far as ROM games, retroplayer is still in the works. Setting that up right now is a little complicated, I think.
find quote
Necromas Offline
Junior Member
Posts: 2
Joined: Apr 2013
Reputation: 0
Post: #236
Had to use "Controller (Batarang wired controller (XBOX))" to get my batarang controller to work.
find quote
garbear Offline
Team-Kodi Developer
Posts: 744
Joined: Dec 2010
Reputation: 37
Location: gangsta's paradise
Post: #237
Hi Necromas, just to confirm, you're on windows and you put that in joystick.Microsoft.Xbox.360.Controller.xml? I'll add the keymap entryso it shows up xbmc 12.2. Thanks for reporting it!
find quote
Necromas Offline
Junior Member
Posts: 2
Joined: Apr 2013
Reputation: 0
Post: #238
Yup (windows 7 64 bit) and yup.
find quote
xbmc17 Offline
Senior Member
Posts: 153
Joined: Jul 2010
Reputation: 0
Post: #239
(2013-03-19 14:22)shiretoko212 Wrote:  Yes, the 360 controller works on XBMCbuntu in my testing of the Frodo image. The only thing that doesn't work properly are the triggers, but that's true for normal Linux as well. It can be used easily without the triggers, though.

I use Linux and the triggers have always worked perfectly using xboxdrv. I don't find the "new way" of support for the controllers as intuitive, smooth, and the triggers don't work. I use a standard .xml file that someone wrote that maps the buttons exactly as the old xbox controller did when xbmc was made for xbox. It works perfectly. This is my command line.

xboxdrv --wid 0 -s --dpad-as-button --deadzone 12000 --trigger-as-zaxis
(This post was last modified: 2013-05-03 18:26 by xbmc17.)
find quote
garbear Offline
Team-Kodi Developer
Posts: 744
Joined: Dec 2010
Reputation: 37
Location: gangsta's paradise
Post: #240
Hey Necromas, xbmc17's bump reminded me about your controller, 432377209feecdfea2717cb112826bf1e2cf9b3a adds the keymap entry so when 13.0 comes out it'll support the controller, until then you can download joystick.Microsoft.Xbox.360.Controller.xml from our git repository and stick it in the appropriate folder (looks like you've already done that). Thanks for the addition!
find quote
Post Reply