ps3 controller not working with latest 2.6.28 kernel

Investigation into how Linux on the PS3 might lead to homebrew development.

Moderators: cheriff, emoon

Post Reply
ps3fanboy
Posts: 66
Joined: Sun Jul 06, 2008 2:03 am

ps3 controller not working with latest 2.6.28 kernel

Post by ps3fanboy »

Code: Select all

input: Sony PLAYSTATION(R)3 Controller as /class/input/input5
sony 0003:054C:0268.0006: input: USB HID v1.11 Joystick [Sony PLAYSTATION(R)3 Controller] on usb-sb_05-2.2/input0
sony: probe of 0003:054C:0268.0006 failed with error 17
is there a patch available to fix this?
User avatar
tolysz
Posts: 7
Joined: Fri Jan 02, 2009 12:40 am

Post by tolysz »

Will work in the next release :)
for now here is a patch for it:

http://www.tolysz.net/dualshock.diff

Edit: please to use this new superior patch :)
And post feedback

The more people will try it the faster it will go into official mainstream.
Last edited by tolysz on Mon Jan 05, 2009 2:35 am, edited 1 time in total.
ps3fanboy
Posts: 66
Joined: Sun Jul 06, 2008 2:03 am

Post by ps3fanboy »

thanks a lot.
that's the result when return codes are handled inconsistently ;-)
User avatar
tolysz
Posts: 7
Joined: Fri Jan 02, 2009 12:40 am

Post by tolysz »

[UPDATE!]

http://www.tolysz.net/dualshock.diff
After looong night it is working :P
as for now over USB and possibly BT [?]

Every thing handled by professional drivers, I just have added a wrapper to them. Hence if you got 2 BT dongles then have a go with 14 DS3 :).

THIS DOES NOT SUPPORT LEDs [yet?]
THIS DOES NOT SUPPORT RUMBLE [yet?]
THIS DOES NOT SUPPORT DYNAMIC RECONFIGURATIONS [yet?]

How to apply this patch

Code: Select all

cd vanila-2.6.28
wget http://www.tolysz.net/dualshock.diff
patch -p1 < dualshock.diff
BTW. 2.6.28 is buggy :), however I do not tested it with previous versions.

and test it with jscalibrator, but after you compile it, and reboot :).

Actually, this was the first patch I ever made, it was so cool to add "less than zero" to Linux kernel :).

However, this just made me started :), I wanted to write an USB driver for DualShock, but I looked at what is already done. and decided not to.

DualShock works fine with Linux as a HID device,
modulo "reporting" [done] not by me :)
[0] modulo "broken report descriptor in DS3" [done] by me :)
+[1] some minor patches to be able to change this descriptor to arbitrary one. [done]
+[2]some minor patches to fix other drivers broken by [1] [done]
+[3]some changes to HID to allow values > 255 as inputs: needed for accelerometers as they have range 0-1024 [done] no change needed :) fixed in [0]
-----------

+[4] to allow reconfiguration on runtime :) [possible] just need someone who knows "firmware" class as I need to be able load files into kernel on runtime.
+[5] a nice tool to be able to modify HID device report description easily [possible] this will allow to tweak all HID devices so it would be extra cool.

USB works just fine :) time to start testing BT I need to recompile my kernel :P

oops: take2 recompile again :) I have missed to patch hidp :P
more issues with BT.

And as I can change this descriptor (and is already made working) my question is how shall I assign buttons and axes and motions for you?


http://ps3.jim.sh/sixaxis/usb/ btw. I axed nothings as it was bogus hid description

to description from:
http://www.usb.org/developers/hidpage/
Some possibilities:

Code: Select all

30 X 
31 Y 
32 Z 
33 Rx 
34 Ry 
35 Rz 
36 Slider
37 Dial 
38 Wheel
39 Hat switch 
3A Counted Buffer 
3B Byte Count 
3C Motion Wakeup 
3D Start 
3E Select 

40 Vx
41 Vy 
42 Vz 
43 Vbrx 
44 Vbry 
45 Vbrz 
46 Vno 
90 D-pad Up 
91 D-pad Down 
92 D-pad Right 
93 D-pad Left 
And if someone could post report description for SIXAXIS :) That I could check if stock DUALSHOCK got the same?
[UPDATE] I have checked are the same :)

So far:
OK, I made few decisions:

Code: Select all

Button 00 = Cross
Button 01 = Circle
Button 03 = Square
Button 04 = Triangle

Button 04 = R1
Button 05 = L1
Button 06 = R2
Button 07 = L2

Kayboard keys
&#91;a&#93; = Left
&#91;s&#93; = Down
&#91;d&#93; = Right
&#91;w&#93; = Up

Button 08 = R3
Button 09 = L3
Button 10 = Start
Button 11 = Select
Button 12 = Sixaxis
Analog:?

Code: Select all

Analog 00 = Joy Left X
Analog 01 = Joy Left Y

Analog 02 = Joy Right X
Analog 03 = Joy Right Y

Analog 04 = Roll &#40; -X / +X &#41;
Analog 05 = Pitch &#40; -Y / +Y &#41;
Analog 06 = Gyro &#40; -Z / +Z &#41;
Analog 07 = Gyro ?

&#40;+1&#41;.reverse&#58;&#123;
Analog 07 = Square
Analog 08 = Cross
Analog 09 = Circle
Analog 10 = Triangle
Analog 11 = R1
Analog 12 = L1
Analog 13 = R2
Analog 14 = L2
Analog 15 = Left
Analog 16 = Down
Analog 17 = Right
Analog 18 = Up
&#125;
Last edited by tolysz on Sun Jan 04, 2009 11:31 pm, edited 6 times in total.
Themaister
Posts: 2
Joined: Sun Jan 04, 2009 11:10 am

Post by Themaister »

Hey! Nice one. Thought my ps3-controller was broke or something.

Although, I couldn't quite follow that patch.

static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) and no ; after? anyways. I got the ps3-controller to work by simply changing:

if (ret) with if (ret < 0) manually :) and rebuilding the driver. I'm a patching nub, so^^ Used vanilla 2.6.28 sources.
User avatar
tolysz
Posts: 7
Joined: Fri Jan 02, 2009 12:40 am

Post by tolysz »

Just to say,

PLEASE TEST!!!!

It works :) I need some regression tests come on people :)

And Please post feedback, as it is really important!

Happy Hacking
ps3fanboy
Posts: 66
Joined: Sun Jul 06, 2008 2:03 am

Post by ps3fanboy »

haven't had time to test... but hopefully soon... does the controller work with bluetooth yet?
Themaister
Posts: 2
Joined: Sun Jan 04, 2009 11:10 am

Post by Themaister »

Hi :) Nice patch you have there now, however, is it possible to disable the gyro stuff, it's impossible to configurate games when the game only accepts the changing gyro values all the time? Maybe comment out stuff in the source, etc? Also, for some reason, hal hotplugging wanted the ps3-controller to be a mouse also :S
Post Reply