Bug 197291 - Sony PlayStation 3 controller (DualShock 3 or Sixaxis) generating 2 entries under /dev/input
Summary: Sony PlayStation 3 controller (DualShock 3 or Sixaxis) generating 2 entries u...
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: 2017-10-17 08:14 UTC by Abuzer Rafey
Modified: 2018-01-10 19:37 UTC (History)
6 users (show)

See Also:
Kernel Version: 4.12.x / 4.13.x / 4.14rc5
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments

Description Abuzer Rafey 2017-10-17 08:14:52 UTC
This is a continuation of [#196617](https://bugzilla.kernel.org/show_bug.cgi?id=196617). Visit that thread to see the reason for a second thread (your browser may crash).

The PS3 controller's gamepad is treated as a second device after the motion sensor (ie. /dev/input/js0 = motion sensors and /dev/input/js1 = gamepad, #2 LED illuminated on 1st controller, etc.). This causes problems with many applications expecting the first controller to be the gamepad.

Here is dmesg output related to the problem:

[  566.837363] input: Sony PLAYSTATION(R)3 Controller Motion Sensors as /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/0003:054C:0268.0005/input/input21
[  566.891671] input: Sony PLAYSTATION(R)3 Controller as /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/0003:054C:0268.0005/input/input20
Comment 1 Dmitry Torokhov 2017-10-23 21:59:35 UTC
We will no longer attach joydev to the input device representing accelerometer on PlayStation controllers, please try 4.14-rc6.
Comment 2 Francisco Pina Martins 2017-10-24 22:57:41 UTC
Results of testing linux-4.14-rc6:
Only one entry per gamepad is created as /dev/input/jsX, however, two event entries are created, /dev/input/eventX and /dev/input/eventX+1

On linux 4.11.x, only a single "jsX" entry is created and only a single "event" entry is created per gamepad connected.

On linux 4.13.8, two "jsX" and two "eventX" entries are created per gamepad.

As of linux 4.14-rc6 I am still unable to use "xboxdrv" with the sixaxis controllers, as I am able to do using linux-4.11.
Comment 3 Dmitry Torokhov 2017-10-25 00:53:35 UTC
Yes, the PS controllers are composite devices, they will continue be represented as a collection of input devices, all tagged appropriately (i.e. one of them is tagged as INPUT_PROP_ACCELEROMETER). The reason for it is that we can not continue inventing and adding new absolute axes to the input API when manufacturers put more features into their controllers (we have devices with accelerometers, touch interfaces, next maybe they will add magnetometers into the same package), so we have to split them up and have userspace "reassemble" them.
Comment 4 Francisco Pina Martins 2017-10-25 09:23:02 UTC
Ok, so this behaviour is intentional and the kernel driver is now working as intended, correct?
The principle you describe makes full sense to me, as gamepads evolve, the input features should scale with them. This sounds like a great approach.
However, since this change is supposed to "break" userspace, could I be so bold as to suggest moving it to linux-4.15? Since linux-4.14 will be an LTS release, this should provide userspace devs some time to adjust to the new and improved paradigm.
I did not yet get the chance to test many things, but none of what I have experimented has worked thus far (but admittedly, I have yet to tweak configs for the new multiple events).
Do you think this makes any sense, or should the new features go forth full force with 4.14?

Thank you for considering this idea.
Comment 5 mirh 2017-11-19 13:05:02 UTC
(In reply to Dmitry Torokhov from comment #3)
> The reason for it is that we can not continue inventing and adding
> new absolute axes to the input API when manufacturers put more features into
> their controllers (we have devices with accelerometers, touch interfaces,
> next
> maybe they will add magnetometers into the same package), so we have to split
> them up and have userspace "reassemble" them.

That's quite a different approach than I had in mind in bug 195643, but I guess it should make more sense too. 
So, can we expect every button to be exposed again somehow someway in the foreseeable future?
Comment 6 Francisco Pina Martins 2017-12-09 01:43:15 UTC
This approach has worked surprisingly well with userspace programs such as "xboxdrv" and "Gens-GS".
The buttons had to be remapped, but other than that everything is working exactly as expected.
Since the original bug has been resolved, I would recommend closing this issue.
For discussing the "why" of this bug, I think bug 195643 is more adequate.

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