XBMC does not act on input from PS3 controller
#1
I have successfully paired my original PS3 DualShock 3 controller with XBMC on OpenELEC v4.0.4. Unfortunately, XBMC does not seem to act on the output being sent by the controller after I have turned it on by pressing the "PS" button on it.

Here is a dump of dmesg after I have started the OpenELEC.: http://pastebin.com/bZyxfVcD

Here is the same dump after I have pressed the "PS" button: http://pastebin.com/UP4zcFmV

The strange thing is that the output sent by the controller is recognised by programs such as Retroarch after I have turned it on. Also, if I restart XBMC by issuing
Code:
systemctl restart xbmc
after I have turned the controller on, it works in XBMC.

Is there some way to make XBMC recognise the remote when I turn it on without issuing a "soft reboot"? I am thinking this might by some issue with EventServer.

As well, here is the output of my /storage/.xbmc/userdata/keymaps/keyboard.xml:
Code:
<keymap>
    <global>
        <joystick name="Sony PLAYSTATION(R)3 Controller">
            <altname>PS3 SIXAXIS DualShock 3 Controller</altname>
            <button id="14">Select</button>
            <button id="15">Back</button>
            <button id="16">FullScreen</button>
            <button id="13">Queue</button>
            <button id="11">PreviousMenu</button>
            <button id="8">Left</button>
            <button id="6">Right</button>
            <button id="5">Up</button>
            <button id="7">Down</button>
            <button id="2">Screenshot</button>
            <button id="3">XBMC.ActivateWindow(ShutdownMenu)</button>
            <button id="4">XBMC.ActivateWindow(PlayerControls)</button>
            <axis limit="+1" id="4">VolumeDown</axis>
            <axis limit="-1" id="4">VolumeUp</axis>
            <axis limit="+1" id="1">AnalogSeekForward</axis>
            <axis limit="-1" id="1">AnalogSeekBack</axis>
            <axis limit="+1" id="13">ScrollUp</axis>
            <axis limit="+1" id="14">ScrollDown</axis>
        </joystick>
    </global>
</keymap>

Edit: Clarity
Reply
#2
I have the same problem with a 360 controller and the steamos-xpad driver. I use a udev rule to toggle xbmcs joystick support when the 360 controller is connected which enables input from the controller. Though it doesn't seem to work if media is playing. You'll need to change it to suit the ps3 controller.

http://forum.xbmc.org/showthread.php?tid...pid1722549

Also have you tried garbears retro player builds? I know he is working on a new joystick api but I don't k ow if its included in those builds.
Reply
#3
@teeedubb - I have seen several places on the net that people enable bluetooth devices at startup using udev rules. I am very thankful that you shared your solution for the XBOX controller, but hacking that script is a little bit above my level.

Perhaps someone else with more code skills than I and the same PS3 controller problem will be able to make use of it.
Reply
#4
(2014-06-13, 08:48)solbero Wrote: @teeedubb - I have seen several places on the net that people enable bluetooth devices at startup using udev rules. I am very thankful that you shared your solution for the XBOX controller, but hacking that script is a little bit above my level.

Perhaps someone else with more code skills than I and the same PS3 controller problem will be able to make use of it.

Take a look at the reply I said on the OpenELEC forum. I think it just comes down to you knockoff controller reporting a different name, if you change the name in the keymap file it should work.

Next I have done what teeedubb (thank you very much for this) suggested and created a udev rule. It will work for you as well.

nano /storage/.config/xbmc-hotplug.sh
Code:
#!/bin/sh

curl -v -H "Content-type: application/json" -X POST -d '{"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params":{"setting":"input.enablejoystick","value":false},"id":1}' http://localhost:80/jsonrpc

sleep 1

curl -v -H "Content-type: application/json" -X POST -d '{"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params":{"setting":"input.enablejoystick","value":true},"id":1}' http://localhost:80/jsonrpc
Make sure to change you local port if it is different.

Now make it executable
Code:
chmod +x /storage/.config/xbmc-hotplug.sh

Then, create the udev rule.
nano /storage/.config/udev.rules.d/99-joystick.rules
Code:
ACTION=="add", KERNEL=="js*", SUBSYSTEM=="input", RUN+="/storage/.config/xbmc-hotplug.sh"

If for whatever reason you want to change the udev rule to only affect the ps3 controller you have to take a look at the udev information
Code:
udevadm info -q all -a /dev/input/js0
"PPC is too slow, your CPU has no balls to handle HD content." ~ Davilla
"Maybe it's a toaster. Who knows, but it has nothing to do with us." ~ Ned Scott
Reply
#5
Irusak Wrote:Take a look at the reply I said on the OpenELEC forum. I think it just comes down to you knockoff controller reporting a different name, if you change the name in the keymap file it should work.
I should have been a more precise in my original post. I am using an original PS3 DualSchock 3 controller when experiencing the problem described here. The controller is being recognised without a problem by the underlying OS (e.i. OpenELEC). I was not my intention to start mixing threads from different forums.

EDIT: I have tested the script you provided, Irusak, and it works well. However, it does assume that the default values are used by the webserver (e.g. username=XBMC, password=[blank]). What part of the script would I need to change to tell it to connect to the JSON RPC using a different username and password?

Also, is the hotplugging issue a bug know to the XBMC devs? Would there be any point in posting this issue on the bugtracker?

Terminal output when the default username and password is not used (in this case, I used XBMC:12345):
Code:
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 80 (#0)
> POST /jsonrpc HTTP/1.1
> User-Agent: curl/7.36.0
> Host: localhost
> Accept: */*
> Content-type: application/json
> Content-Length: 119
>
* upload completely sent off: 119 out of 119 bytes
< HTTP/1.1 401 Unauthorized
< Content-Length: 0
< Connection: close
< WWW-Authenticate: Basic realm=XBMC
< Date: Mon, 16 Jun 2014 11:37:07 GMT
<
* Excess found in a non pipelined read: excess = 2 url = /jsonrpc (zero-length body)
* Closing connection 0
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 80 (#0)
> POST /jsonrpc HTTP/1.1
> User-Agent: curl/7.36.0
> Host: localhost
> Accept: */*
> Content-type: application/json
> Content-Length: 118
>
* upload completely sent off: 118 out of 118 bytes
< HTTP/1.1 401 Unauthorized
< Content-Length: 0
< Connection: close
< WWW-Authenticate: Basic realm=XBMC
< Date: Mon, 16 Jun 2014 11:37:08 GMT
<
* Excess found in a non pipelined read: excess = 2 url = /jsonrpc (zero-length body)
* Closing connection 0
Reply
#6
I've also managed to pair the controller, but no buttonpresses are working if I don't run "systemctl restart xbmc", then the interface starts working. Everything but the "arrowkeys" on the sixxaxis works.
I've also noticed that everytime the controller goes to sleep, I have to restart xbmc the same way to make it work again.

I'm running the latest version of openelec stable 4.2.1 on Zotac ION2 and using a generic bluetooth dongle.

Have you found a solution?

Regards
Reply
#7
Try a helix build, Linux hotplugging has been fixed thanks to zzattack.
Reply

Logout Mark Read Team Forum Stats Members Help
XBMC does not act on input from PS3 controller0