Go Back   PS3Hax - Sony Fears Us > Playstation 3 Resources > PS3 Hardware Tuning
PS3 Hardware Tuning Does Sony know that we can pull apart the PS3 and put it back together?

Reply
 
LinkBack Thread Tools

SIXAXIS Controller with Linux
  #1 (permalink)  
Old 01-14-2007, 02:30 PM
ubisoft is offline
PS3Hax Active Hacker
 
Join Date: Dec 2006
Posts: 14
Default SIXAXIS Controller with Linux

From Jim Paris

Plug the PS3 SIXAXIS controller into a Linux PC via USB and you'll get something like this:

$ 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.

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! However, things don't work right; no data is returned from the joystick. We know that the pad works in PS3 Linux, though, so the next step is to get Sony's Linux source CD (CELL-Linux-CL_20061110-SRCCD.iso). Inside is the archive linux-20061110.tar.bz2, which contains a patch:

$ diffstat patches/usb-add-ps3controller-quirk.diff
hid-core.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++-----
hid.h | 4 ++++
2 files changed, 51 insertions(+), 5 deletions(-)

This patch is against the 2.6.16 Cell kernel, but it's easy enough to apply to other kernels. It looks like it's one minor fix to remove an ordering assumping in hid_parser_local, and a quirk to send a HID_REQ_GET_REPORT packet to the pad during initialization (for whatever reason).

Here is a copy of the patch that applies cleanly to the Debian linux-source-2.6.18 package:

* sixaxis-2.6.18.patch [Please register to see this link. ]

With it, jstest now reports proper data values. Here are the axis and button assignments:

Axis Assignment
0 Left thumb X
1 Left thumb Y
2 Right thumb X
3 Right thumb Y
4-7 nothing
8 Dpad Up
9 Dpad Right
10 Dpad Down
11 Dpad Left
12 L2
13 R2
14 L1
15 R1
16 Triangle
17 Circle
18 Cross
19 Square
20-27 nothing

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

Note that analog buttons appear as both analog axes and digital buttons. 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 found what it is.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup your Blu-Ray Disc haxen PS3 & PS2 Games 11 11-03-2008 05:57 PM
How to access a USB external hard drive in Linux haxen PS3 Hardware Tuning 9 03-15-2008 02:08 PM
Ubuntu Linux - PS3 Bluetooth, Six-Axis Controller support and more! H.axen PS3 Linux News 0 01-07-2008 02:16 AM
How to Install Gentoo Linux haxen Gentoo Linux 40 09-09-2007 09:38 AM
Linux Experts please..... (PS3 Linux and ALSA) asong26 General Messages 0 01-20-2007 08:13 PM



All times are GMT -5. The time now is 08:59 AM.

vB skin by: eXtremepixels
Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
 SEO by 3.0.0
© PS3Hax.com 2007 & 2008