PS3 Sixaxis controller
#1
I have been using the PS3 controller as a remote controller for XBMC with qtsixad. and it works OK. but with limited features.

So I wanted to try the XBMC-way, with the ps3d.py event client. but I had an issue with constant rumbling. I search high and low for a solution, but all I found was that someone removed the rumble motors to solve the problem, but that wasn't really a good solution for me.
So I started looking trough the code (although I'm not a python programmer). and found where the rumbling is started, but did not figure how to not start it, So looked trough the qtsixad code and found how rumbling is started there, and added it to sixaxis.py in the xbmc source.

Since its more like a hack rather than a solution, I will not make a pull request, but I will share my code here if others have the same issue Smile
And maybe some who understands this code can create a real fix.

add this after line 223 in tools/EventClients/lib/python/ps3/sixaxis.py
Code:
bytes2 = [0x52, 0x1]
    bytes2.extend([0x00, 0xff, 0x00, 0xff, 0x00])
    bytes2.extend([0x00, 0x00, 0x00, 0x00, 0x02])
    bytes2.extend([0xff, 0x27, 0x10, 0x00, 0x32])
    bytes2.extend([0xff, 0x27, 0x10, 0x00, 0x32])
    bytes2.extend([0xff, 0x27, 0x10, 0x00, 0x32])
    bytes2.extend([0xff, 0x27, 0x10, 0x00, 0x32])
    bytes2.extend([0x00, 0x00, 0x00, 0x00, 0x32])

    control_sock.send(struct.pack("37B", *bytes2))
    data = control_sock.recv(1)

the ps3d.py is much more preferable than qtsixad, since I don't have to struggle with the key-mapping, and I can use the gyro as a mouse and disable it with the PS button is a nice feature.
Reply
#2
I solved it by changing line 203-205 (https://github.com/xbmc/xbmc/blob/master...sixaxis.py)

to

Code:
bytes = [0x52, 0x1]
    bytes.extend([0x00, 0x20, 0xF0]) //0x20 timeout, 0xF0 left force  (or viceversa, don't remember)
    bytes.extend([0x20, 0xF0]) //0x20 timeout, 0xF0 right force
this requests controller to vibrate a second or less.

I'm using it on Raspberry, but had to improve the script performance since it consumes 30% of CPU. This beacuse the accelerometers are continuosly stimulated so the script computes constantly the x y position to emulate mouse. But this only apply on raspberry due to limited resources.

Hope it helps
Reply

Logout Mark Read Team Forum Stats Members Help
PS3 Sixaxis controller0