Haptic broken (for sixad)

Haptic is not making force feedback happen, at least on sixad controllers.

$ ./testhaptic
INFO: 1 Haptic devices detected.
INFO: Device: PLAYSTATION®3 Controller (00:07:04:5B:62:61)
INFO: Supported effects [16 effects, 16 playing]:
INFO: sine
INFO: triangle
INFO: left/right
INFO: Supported capabilities:
INFO:
Uploading effects
INFO: effect 0: Sine Wave
INFO: effect 1: Left/Right
INFO:
Now playing effects for 5 seconds each with 1 second delay between
INFO: Playing effect 0
INFO: Playing effect 1
$ ./testrumble
INFO: 1 Haptic devices detected.
INFO: Device: PLAYSTATION®3 Controller (00:07:04:5B:62:61)
INFO: Playing 2 second rumble at 0.5 magnitude.
INFO: Stopping rumble.
INFO: Playing 2 second rumble at 0.3 magnitude.

I’ve tested with a few controllers; no force feedback actually happens.

The controllers are working and can get force feedback through FF_RUMBLE.

fftest succeeds on effects 4 (strong rumble) and 5 (weak rumble).

Hello! This is my first post in the SDL forum; sorry to say it’s a bug report :confused:

I noticed this while doing tests for broken force feedback in pcsxr (https://pcsxr.codeplex.com/workitem/11811). I suspect the same bug affects Dolphin (https://code.google.com/p/dolphin-emu/issues/detail?id=6510) and mupen64plus (unreported, but I cannot get force feedback there either, despite a lack of error messages).

Haptic is not making force feedback happen, at least on sixad controllers.
Code:
$ ./testhaptic
INFO: 1 Haptic devices detected.
INFO: Device: PLAYSTATION®3 Controller (00:07:04:5B:62:61)
INFO: Supported effects [16 effects, 16 playing]:
INFO: sine
INFO: triangle
INFO: left/right
INFO: Supported capabilities:
INFO:
Uploading effects
INFO: effect 0: Sine Wave
INFO: effect 1: Left/Right
INFO:
Now playing effects for 5 seconds each with 1 second delay between
INFO: Playing effect 0
INFO: Playing effect 1

Code:
$ ./testrumble
INFO: 1 Haptic devices detected.
INFO: Device: PLAYSTATION®3 Controller (00:07:04:5B:62:61)
INFO: Playing 2 second rumble at 0.5 magnitude.
INFO: Stopping rumble.
INFO: Playing 2 second rumble at 0.3 magnitude.

I’ve tested with a few controllers; no force feedback actually happens.

The controllers are working and can get force feedback through FF_RUMBLE.

fftest succeeds on effects 4 (strong rumble) and 5 (weak rumble).

I’ve also sent this in to the mailing list, but I’m not a member so it’s going to take a while.[/url]

SDL detects my DS3 and DS4 controllers as non haptic.

I know using xboxdrv can be used to trick SDL into thinking it is an Xinput 360 controller.
Haptic will then work, though uploading effects seems to fail saying not enough space.

You can play a simple effect using SDL_HapticRumblePlay though.

It seems that Wireless and Haptic support for DS3 and DS4 are not fully supported by SDL currently, even though other gamepad utilities on linux seem to have no issue.
I’ll do some more poking around in the joystick and haptic source, but I doubt I’ll be able to find or fix the issue myself.

I could really use some input from someone who knows about the Haptic code.

This should not be particular to the sixad driver, as it is using the same FF_RUMBLE as any other joystick would.

Furthermore, the controllers are working and configured correctly (as is the kernel and all necessary packages are installed).

Why doesn’t SLD force feedback work for my dualshock 3 controllers?

Hi,

  • So both “testhaptic” and “testrumble” don’t work on your controllers?
  • Did you test with SDL2.0.3, or latest SDL mercurial?
  • What kernel version are you using, and can you provide the productId (use
    "lsusb")?
  • Where did you get “fftest” from, and what version? (there are some
    different versions out there in the wild)

Regards,
EliasOn Fri, Aug 8, 2014 at 7:34 PM, Que Quotion wrote:

Haptic is not making force feedback happen, at least on sixad controllers.

$ ./testhaptic
INFO: 1 Haptic devices detected.
INFO: Device: PLAYSTATION®3 Controller (00:07:04:5B:62:61)
INFO: Supported effects [16 effects, 16 playing]:
INFO: sine
INFO: triangle
INFO: left/right
INFO: Supported capabilities:
INFO:
Uploading effects
INFO: effect 0: Sine Wave
INFO: effect 1: Left/Right
INFO:
Now playing effects for 5 seconds each with 1 second delay between
INFO: Playing effect 0
INFO: Playing effect 1
$ ./testrumble
INFO: 1 Haptic devices detected.
INFO: Device: PLAYSTATION®3 Controller (00:07:04:5B:62:61)
INFO: Playing 2 second rumble at 0.5 magnitude.
INFO: Stopping rumble.
INFO: Playing 2 second rumble at 0.3 magnitude.

I’ve tested with a few controllers; no force feedback actually happens.

The controllers are working and can get force feedback through FF_RUMBLE.

fftest succeeds on effects 4 (strong rumble) and 5 (weak rumble).


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I heard there are 2 versions of the DualShock3 controller:
- the first one, and
- the second one with the additional “SIXAXIS” text in blue letters:

The fist one doesn’t support force-feedback/haptic by hardware,
while the second one does support it (that’s why “fftest” works in that
case).
Maybe SDL mistakenly thinks that every DualShock3 controller doesn’t
support haptic,
and therefore forces to report it as “non-haptic”.

EliasOn Wed, Aug 13, 2014 at 11:13 PM, JayneHJKL wrote:

SDL detects my DS3 and DS4 controllers as non haptic.

I know using xboxdrv can be used to trick SDL into thinking it is an
Xinput 360 controller.
Haptic will then work, though uploading effects seems to fail saying not
enough space.

You can play a simple effect using SDL_HapticRumblePlay though.

It seems that Wireless and Haptic support for DS3 and DS4 are not fully
supported by SDL currently, even though other gamepad utilities on linux
seem to have no issue.
I’ll do some more poking around in the joystick and haptic source, but I
doubt I’ll be able to find or fix the issue myself.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

  • What kernel version are you using, and can you provide the productId
    (use “lsusb”)?

I think that the kernel version is going to be important, there was quite
some work done to refactor/fix things for the Dualshock4.

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/drivers/hid/hid-sony.c

$ ./testhaptic
INFO: 1 Haptic devices detected.
INFO: Device: PLAYSTATION®3 Controller (00:07:04:5B:62:61)
INFO: Supported effects [16 effects, 16 playing]:
INFO: sine
INFO: triangle
INFO: left/right

The dualshock gamepads don’t natively support these effects, I believe
that there is some emulation going on here - probably by Xpad driver
(kernel?) or xboxdrv (userland).

I remember having some issues with gamepads reporting these effects,
although not really having them - I wanted to be able to detect between a
gaming wheel and a gamepad.

I’d suggest that you ensure that you are using the correct (look for
’hid-sony’ in ‘lsmod’ output) driver and test again.
Simon.

I think this Sine->Rumble emulation is done in “ff-memless.c”.

EliasOn Thu, Aug 14, 2014 at 6:16 PM, wrote:

$ ./testhaptic
INFO: 1 Haptic devices detected.
INFO: Device: PLAYSTATION®3 Controller (00:07:04:5B:62:61)
INFO: Supported effects [16 effects, 16 playing]:
INFO: sine
INFO: triangle
INFO: left/right

The dualshock gamepads don’t natively support these effects, I believe
that there is some emulation going on here - probably by Xpad driver
(kernel?) or xboxdrv (userland).

I am using the linux kernel 3.15. I did install the hid-sony driver, but I am not using it: this driver remains incomplete (it was abandoned for years) and last I checked does not support force feedback. As I said, I am using the sixad (userland) driver which does support force feedback.

As for the controllers themselves, I’ll be back with some specific data later but I assure you they are force-feedback capable Dualshock 3 units.

I don’t know anything about the Xpad or Xbox drivers.

I am using the linux kernel 3.15. I did install the hid-sony driver, but I
am not using it: this driver remains incomplete (it was abandoned for
years) and last I checked does not support force feedback.

Seems pretty ‘active’ for an abandoned driver… you might want to try it
:wink:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/drivers/hid/hid-sony.c

If you don’t want to build a kernel yourself your distro’s kernel-team
probably has daily builds,
Simon

mungewell wrote:

Seems pretty ‘active’ for an abandoned driver… you might want to try it
I saw some updates on phoronix for 3.17; I’m going to upgrade to 3.16 soon but maybe I can backport the patches.

If you don’t want to build a kernel yourself
-march=native -Ofast, customized -ck (+BFQ, removed debugging, LZO compression, etc) here. I stay a bit behind mainline for the -ck patches.

Well, there doesn’t seem to be any way to get SDL’s Haptic working with sixad.

sixad is a userland driver that overrides the bluez4 stack.

SDL’s Haptic only seems to work with the bluez5 stack and it’s new sixaxis plugin.

This is a non-trivial upgrade:

The bluez5 sixaxis plugin is non-configurable:
The accelerometers cannot be disabled, making controller configurations all but impossible (this can be worked around by setting them to an impossible range with jstest-gtk)

bluez5 is incomplete (support for HSP/HFP was omitted: no skype, teamspeak or other telephony applications can be used with bluetooth devices. there are no plans to ever restore this functionality in bluez.)

Those are some serious sacrifices for me, but I’ll find a way to overcome them I suppose.

I have run testrumble with the bluez5 stack and the new plugin; it works. Force feedback in mupen64plus was restored. Force feedback is still broken in PCSXR and PCSX2. PCSXR’s problem may or may not be internal (apparently valid code is throwing errors). PCSX2’s SDL2 support seems quite broken, still looking into it.

Long story short: SDL2 does not support force feedback on sixad. This is not documented. The only workaround is to upgrade to bluez5 and the new plugin, which may significantly change how your system works, including the permanent removal of important functionality.