Bug 40812 - Sony SixAxis DualShock3 gamepad controller support is buggy/incomplete
Summary: Sony SixAxis DualShock3 gamepad controller support is buggy/incomplete
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Input Devices (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_input-devices
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-10 08:39 UTC by Sergey Kondakov
Modified: 2012-08-30 09:41 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.0.0
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Sergey Kondakov 2011-08-10 08:39:57 UTC
i recently have got myself a Sony SixAxis DuaslShock3 gamepad and decided to use it on PC but found several deficiencies in its work:
1) there are a lot of axises registered but there is no reading from gyro and accelerometer
2) there is no pressure data from "left" D-Pad button even though pressed/unpressed status registered correctly (maybe a hardware fault. anyone can confirm such behaviour for their hardware ?)
3) apparently force feedback/rumble support non-existent yet
4) you need to use hacky utility to write your BT adapter's MAC address into gamepad's memory to initiate pairing
5) even after that it just starting to ask authorization from bluetooth stack which if i grant it will be revoked after few seconds. gamepad disappears from visible devices list for a second and then process is repeated until it shuts itself off. and so, pairing is impossible.
6) there is no way to check battery status.
7) all leds are just blinking constantly instead of doing something useful like showing its number in system, battery status, make funny flickering in tact with possible rumble effect or button pressing or something.

there are some hacked old bluez version on net with crutches designed to solve/mitigate most of those but they are obsolete, ugly and never worked for me.

my current system have kernel-3.0.0, bluez-4.96, xf86-input-evdev-2.6.0, xf86-input-joystick-1.6.0.
Comment 1 Antonio Ospite 2011-08-10 09:54:56 UTC
(In reply to comment #0)

Hi Sergey

> i recently have got myself a Sony SixAxis DuaslShock3 gamepad and decided to
> use it on PC but found several deficiencies in its work:
> 1) there are a lot of axises registered but there is no reading from gyro and
> accelerometer

With 3.1-rc1 accelerometers are working on the event device, gyro maybe needs
some initialization and it is not working yet.

> 2) there is no pressure data from "left" D-Pad button even though
> pressed/unpressed status registered correctly (maybe a hardware fault. anyone
> can confirm such behaviour for their hardware ?)

This is known, it is not a hardware issue, but rather a HID or kernel one. I
posted a quick hack, but haven't had the time to start a discussion about
it with linux-input people, see the hack here:
https://patchwork.kernel.org/patch/855712/

> 3) apparently force feedback/rumble support non-existent yet

True, I've only got an old Sixaxis with no rumble, so I haven't started any
work on that.

> 4) you need to use hacky utility to write your BT adapter's MAC address into
> gamepad's memory to initiate pairing
> 5) even after that it just starting to ask authorization from bluetooth stack
> which if i grant it will be revoked after few seconds. gamepad disappears
> from
> visible devices list for a second and then process is repeated until it shuts
> itself off. and so, pairing is impossible.

I am working on a BlueZ plugin for that, look at the latest version I posted
on linux-bluetooth/linux-input mailing lists:
http://thread.gmane.org/gmane.linux.bluez.kernel/15308

In order to get the patches go to the "Direct link" at the bottom of the page
and add "/raw" to the target address; and then use "git am" to apply them to
bluez from here:
git://git.kernel.org/pub/scm/bluetooth/bluez.git

> 6) there is no way to check battery status.

Maybe this could be added to the BlueZ plugin, but I don't plan on working on it in
the near future.

> 7) all leds are just blinking constantly instead of doing something useful
> like
> showing its number in system, battery status, make funny flickering in tact
> with possible rumble effect or button pressing or something.
>

This is handles by the aforementioned BlueZ plugin above.

> there are some hacked old bluez version on net with crutches designed to
> solve/mitigate most of those but they are obsolete, ugly and never worked for
> me.
>

Please try to apply the patches from above and remember to cleanup
/var/lib/bluetooth (make a backup, just in case) if you have problems.

> my current system have kernel-3.0.0, bluez-4.96, xf86-input-evdev-2.6.0,
> xf86-input-joystick-1.6.0.

I'll add you to the CC list for any further work on the Sixaxis if you like.

Regards,
   Antonio Ospite
   http://ao2.it
Comment 2 Sergey Kondakov 2011-08-10 15:46:38 UTC
(In reply to comment #1)

> With 3.1-rc1 accelerometers are working on the event device, gyro maybe needs
> some initialization and it is not working yet.

that's nice.

> This is known, it is not a hardware issue, but rather a HID or kernel one. I
> posted a quick hack, but haven't had the time to start a discussion about
> it with linux-input people, see the hack here:
> https://patchwork.kernel.org/patch/855712/

really relieving to know that hardware is ok, thanks.
i tried to apply that to my 3.0.0 kernel but it failed. not a big problem, i will wait for proper solution.

> True, I've only got an old Sixaxis with no rumble, so I haven't started any
> work on that.

i've got mine from ebay, used but in pristine condition for half of "recommended" price. that was rare deal but you can get one by 0.5-1.0 of MSRP, international shipping included, easily if you're going to get one for yourself. just beware counterfeit.
but you know all that probably.

> I am working on a BlueZ plugin for that, look at the latest version I posted
> on linux-bluetooth/linux-input mailing lists:
> http://thread.gmane.org/gmane.linux.bluez.kernel/15308
> 
> In order to get the patches go to the "Direct link" at the bottom of the page
> and add "/raw" to the target address; and then use "git am" to apply them to
> bluez from here:
> git://git.kernel.org/pub/scm/bluetooth/bluez.git

i made ebuild for bluez 4.96 with those patches and installed it. gamepad can be paired now and joystick device is added even while disconnected from USB but it does not provide any data (tested with jstest and KDE's joystick systemsettings menu) and if i try to remove and add it again in KDE, KDE's bluetooth service hangs.
i will wait for next kernel and bluez releases and try again.

> Maybe this could be added to the BlueZ plugin, but I don't plan on working on
> it in
> the near future.
> This is handles by the aforementioned BlueZ plugin above.

LED works with those patches if connected via USB.
but battery and statuses look like things that are not tied to BT at all and are better handled inside kernel driver (like hid_sony). sysfs interface for those would be nice too and DEs could then provide status notifications, applets and info areas in apps like bluedevil and blueman how they see fit. also commonality with other similar input devices like wiimote could be achieved.
this is not criticism, however. whatever is easier for you to work is good enough.

> I'll add you to the CC list for any further work on the Sixaxis if you like.
yes, please do. probably only in GNU/Linux proper support for this advanced piece of input hardware is possible on PC. i would like to be on top of any news about it.

and thank you for your work and a great answer.
Comment 3 Sergey Kondakov 2011-08-13 15:18:48 UTC
about not getting any data over bluetooth even when successfully paired: i just managed to pair it under Windows® and it resulted in same behaviour - it registers on system correctly but no input data is received nor transfered (like force feedback commands and LED status change).

maybe it has something to do with BT-adapter on that system being crap. i will try it on laptop later.
Comment 4 Sergey Kondakov 2011-08-14 13:25:10 UTC
indeed the culprit was adapter.
on laptop with "0b05:1712 ASUSTek Computer, Inc. BT-183 Bluetooth 2.0+EDR adapter" with patched bluez-4.96 it works exactly as via USB. i suspect that crappy adapter from desktop does not support BT 2.0. it's not very good however that such adapter and controller just silently ignore each other after pairing.
is it known deficiency too ?
Comment 5 Sergey Kondakov 2011-08-18 14:07:34 UTC
i just have applied patch from https://patchwork.kernel.org/patch/1075972/ on kernel 3.0.3 and it fixed issue with axis11/left-DPad.
so, #2,#4,#5 and #7 are down now.
Comment 6 Antonio Ospite 2011-08-18 14:19:10 UTC
Thanks for keeping track of the progress Sergey, so The missing pieces are:

1) no gyro
3) no force feedback/rumble
6) no way to check battery status

I am working on getting the other pieces merged upstream to linux and BlueZ so I am not going to spend time on those issues in the near future.

Regards,
   Antonio
Comment 7 Sergey Kondakov 2011-08-18 15:52:47 UTC
and thanks for your work again. even with those missing 3 pieces it's now qualifies as a gamepad for day-to-day play.

Note You need to log in before you can comment on or make changes to this bug.