SIXAXIS (or TWENTYEIGHTAXIS?)

Update: This is out of date.

Try checking other pages like:

"Old" info:

The PS3 SIXAXIS controller follows the USB HID class specification and should automatically be detected as a joystick by any Linux kernel:
$ dmesg | tail -4
usb 1-3: new full speed USB device using ohci_hcd and address 16
usb 1-3: configuration #1 chosen from 1 choice
input: Sony PLAYSTATION(R)3 Controller as /class/input/input14
input: USB HID v1.11 Joystick [Sony PLAYSTATION(R)3 Controller] on usb-0000:00:03.0-3
$ lsusb | grep Sony
Bus 001 Device 016: ID 054c:0268 Sony Corp. 
Full lsusb output (with the usbhid module detached) is here.

However, the controller will still not report any events unless the mode is changed to "operational" using a specific HID_REQ_GET_REPORT command. This patch adds a quirk to the Linux HID driver to automatically switch the controller to operational mode. The patch is already present in Linux >= 2.6.21, but is applicable to earlier kernels. No other changes should be necessary. [1]

Now, using the jstest program (in the joystick Debian package), we can get the joystick info:

Joystick (Sony PLAYSTATION(R)3 Controller) has 28 axes (X, Y, Z, Rz, ...)
and 19 buttons (Trigger, ThumbBtn, ThumbBtn2, ...)
So the joystick seems to provide 28 analog axes — a lot more than the advertised 6! Remember that nearly all buttons on the controller are actually pressure-sensitive, so they are treated as both a digital button and an analog axis. Here are the axis and button assignments:

AxisAssignment
0Left thumb X
1Left thumb Y
2Right thumb X
3Right thumb Y
4-7nothing
8Dpad Up
9Dpad Right
10Dpad Down
11Dpad Left
12L2
13R2
14L1
15R1
16Triangle
17Circle
18Cross
19Square
20-27nothing
ButtonAssignment
0Select
1L3
2R3
3Start
4Dpad Up
5Dpad Right
6Dpad Down
7Dpad Left
8L2
9R2
10L1
11R1
12Triangle
13Circle
14Cross
15Square
16PS Button
17-18nothing

Unfortunately, a number of axes appear to do nothing, and the motion sensing axes are nowhere to be seen. There is probably some way to enable them (some HID_REQ_SET_REPORT command, perhaps?), but I haven't yet found what it is. More info will be posted here if I come across it.


Todo:
Notes:

[1] Pre-production controllers had a bug that required a change in the Linux HID parser code. This patch includes that change. Retail controllers don't need this. Thanks to Geoff Levand for pointing that out.


Jim Paris <jim@jtan.com>
$Id: index.html 3626 2009-06-02 21:41:32Z jim $