All of lore.kernel.org
 help / color / mirror / Atom feed
* Bug: HID-Sony: DS4 touch-pad corrupts Axis0
@ 2014-04-21 16:49 simon
  2014-04-21 17:18 ` simon
  2014-04-21 17:30 ` Frank Praznik
  0 siblings, 2 replies; 7+ messages in thread
From: simon @ 2014-04-21 16:49 UTC (permalink / raw)
  To: Frank Praznik, Frank Praznik, HID CORE LAYER, Jiri Kosina

Hi,
I've noticed a glitch with the Dualshock4 on 3.15rc1 (plus LEDs patch, if
that makes a difference).

Sometimes everything works as expected, the thumbsticks work OK and the
touch-pad changes axis 15 & 16 (as reported by jstest). Other times axis
15 and 16 do not report changes, instead axis 0 is corrupted/changed when
the touch-pad is 'swiped'.

Evtest appears to report correctly all the time.

It seems that the controller works first time it is plugged in (after
boot), but then fails subsequent times. I think that the first time I
don't get the pop-up message about battery being charged, which occurs on
other times.

I have not found a trigger yet, but was wondering whether others are
seeing this. I am using a USB connected DS4 (no BT on this machine). OS is
Xubuntu 13.10 with patched kernel,
Simon.

--
simon@slipstream:~$ jstest /dev/input/js0
Driver version is 2.1.0.
Joystick (Sony Computer Entertainment Wireless Controller) has 14 axes (X,
Y, Z,
and 14 buttons (BtnX, BtnY, BtnZ, BtnTL, BtnTR, BtnTL2, BtnTR2, BtnSelect,
BtnSt
Testing ... (interrupt to exit)
--
Apr 21 10:21:01 slipstream kernel: [  818.052095] usb 5-1: USB disconnect,
devic
Apr 21 10:21:33 slipstream kernel: [  849.684027] usb 5-1: new full-speed
USB de
Apr 21 10:21:33 slipstream kernel: [  849.855036] usb 5-1: New USB device
found,
Apr 21 10:21:33 slipstream kernel: [  849.855041] usb 5-1: New USB device
string
Apr 21 10:21:33 slipstream kernel: [  849.855045] usb 5-1: Product:
Wireless Con
Apr 21 10:21:33 slipstream kernel: [  849.855049] usb 5-1: Manufacturer:
Sony Co
Apr 21 10:21:33 slipstream kernel: [  849.861096] sony
0003:054C:05C4.0005: Usin
Apr 21 10:21:33 slipstream kernel: [  849.906141] input: Sony Computer
Entertain
Apr 21 10:21:33 slipstream kernel: [  849.906344] sony
0003:054C:05C4.0005: inpu
--



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug: HID-Sony: DS4 touch-pad corrupts Axis0
  2014-04-21 16:49 Bug: HID-Sony: DS4 touch-pad corrupts Axis0 simon
@ 2014-04-21 17:18 ` simon
  2014-04-21 17:30 ` Frank Praznik
  1 sibling, 0 replies; 7+ messages in thread
From: simon @ 2014-04-21 17:18 UTC (permalink / raw)
  To: simon; +Cc: Frank Praznik, Frank Praznik, HID CORE LAYER, Jiri Kosina

> Hi,
> I've noticed a glitch with the Dualshock4 on 3.15rc1 (plus LEDs patch, if
> that makes a difference).

Seems only to work on the the first time the device is connected (with
USB), even in 'repair' mode (with no GUI). Subsequent plug-ins shows axis
0 being corrupted.

Checking through the kernels I have available on this machine, mostly
patched in one way or the other.
--
linux-image-3.11.0-12-generic           - works (no gyros)
linux-image-3.13.0-ds4blink+            - fails
linux-image-3.14.0-ff-memless-next+     - fails
linux-image-3.15.0-rc1-ds4leds+         - fails
--

Booting into a LiveCD of Xubuntu 14.04 (kernel 3.13.0-24) does not show
problem, but it is not using hid-sony for this device. Just shows 8 axis
available.

Simon.

Simon.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug: HID-Sony: DS4 touch-pad corrupts Axis0
  2014-04-21 16:49 Bug: HID-Sony: DS4 touch-pad corrupts Axis0 simon
  2014-04-21 17:18 ` simon
@ 2014-04-21 17:30 ` Frank Praznik
  2014-04-21 20:16   ` Frank Praznik
  1 sibling, 1 reply; 7+ messages in thread
From: Frank Praznik @ 2014-04-21 17:30 UTC (permalink / raw)
  To: simon, Frank Praznik, HID CORE LAYER, Jiri Kosina

On 4/21/2014 12:49, simon@mungewell.org wrote:
> Hi,
> I've noticed a glitch with the Dualshock4 on 3.15rc1 (plus LEDs patch, if
> that makes a difference).
>
> Sometimes everything works as expected, the thumbsticks work OK and the
> touch-pad changes axis 15 & 16 (as reported by jstest). Other times axis
> 15 and 16 do not report changes, instead axis 0 is corrupted/changed when
> the touch-pad is 'swiped'.
>
> Evtest appears to report correctly all the time.
>
> It seems that the controller works first time it is plugged in (after
> boot), but then fails subsequent times. I think that the first time I
> don't get the pop-up message about battery being charged, which occurs on
> other times.
>
> I have not found a trigger yet, but was wondering whether others are
> seeing this. I am using a USB connected DS4 (no BT on this machine). OS is
> Xubuntu 13.10 with patched kernel,
> Simon.
>
> --
> simon@slipstream:~$ jstest /dev/input/js0
> Driver version is 2.1.0.
> Joystick (Sony Computer Entertainment Wireless Controller) has 14 axes (X,
> Y, Z,
> and 14 buttons (BtnX, BtnY, BtnZ, BtnTL, BtnTR, BtnTL2, BtnTR2, BtnSelect,
> BtnSt
> Testing ... (interrupt to exit)
> --
> Apr 21 10:21:01 slipstream kernel: [  818.052095] usb 5-1: USB disconnect,
> devic
> Apr 21 10:21:33 slipstream kernel: [  849.684027] usb 5-1: new full-speed
> USB de
> Apr 21 10:21:33 slipstream kernel: [  849.855036] usb 5-1: New USB device
> found,
> Apr 21 10:21:33 slipstream kernel: [  849.855041] usb 5-1: New USB device
> string
> Apr 21 10:21:33 slipstream kernel: [  849.855045] usb 5-1: Product:
> Wireless Con
> Apr 21 10:21:33 slipstream kernel: [  849.855049] usb 5-1: Manufacturer:
> Sony Co
> Apr 21 10:21:33 slipstream kernel: [  849.861096] sony
> 0003:054C:05C4.0005: Usin
> Apr 21 10:21:33 slipstream kernel: [  849.906141] input: Sony Computer
> Entertain
> Apr 21 10:21:33 slipstream kernel: [  849.906344] sony
> 0003:054C:05C4.0005: inpu
> --
>
>

I've seen this before and it's a bug in jstest and jstest-gtk, not the 
driver or event system.  These programs do their own internal axis 
mapping and don't properly handle axes above ABS_MISC which is where the 
touch axes are.  jstest-gtk just default maps these to 0 and the old 
jstest just doesn't look like it does any bounds checking at all.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug: HID-Sony: DS4 touch-pad corrupts Axis0
  2014-04-21 17:30 ` Frank Praznik
@ 2014-04-21 20:16   ` Frank Praznik
  2014-04-22 16:50     ` simon
  0 siblings, 1 reply; 7+ messages in thread
From: Frank Praznik @ 2014-04-21 20:16 UTC (permalink / raw)
  To: simon, Frank Praznik, HID CORE LAYER, Jiri Kosina

On 4/21/2014 13:30, Frank Praznik wrote:
> On 4/21/2014 12:49, simon@mungewell.org wrote:
>> Hi,
>> I've noticed a glitch with the Dualshock4 on 3.15rc1 (plus LEDs 
>> patch, if
>> that makes a difference).
>>
>> Sometimes everything works as expected, the thumbsticks work OK and the
>> touch-pad changes axis 15 & 16 (as reported by jstest). Other times axis
>> 15 and 16 do not report changes, instead axis 0 is corrupted/changed 
>> when
>> the touch-pad is 'swiped'.
>>
>> Evtest appears to report correctly all the time.
>>
>> It seems that the controller works first time it is plugged in (after
>> boot), but then fails subsequent times. I think that the first time I
>> don't get the pop-up message about battery being charged, which 
>> occurs on
>> other times.
>>
>> I have not found a trigger yet, but was wondering whether others are
>> seeing this. I am using a USB connected DS4 (no BT on this machine). 
>> OS is
>> Xubuntu 13.10 with patched kernel,
>> Simon.
>>
>> -- 
>> simon@slipstream:~$ jstest /dev/input/js0
>> Driver version is 2.1.0.
>> Joystick (Sony Computer Entertainment Wireless Controller) has 14 
>> axes (X,
>> Y, Z,
>> and 14 buttons (BtnX, BtnY, BtnZ, BtnTL, BtnTR, BtnTL2, BtnTR2, 
>> BtnSelect,
>> BtnSt
>> Testing ... (interrupt to exit)
>> -- 
>> Apr 21 10:21:01 slipstream kernel: [  818.052095] usb 5-1: USB 
>> disconnect,
>> devic
>> Apr 21 10:21:33 slipstream kernel: [  849.684027] usb 5-1: new 
>> full-speed
>> USB de
>> Apr 21 10:21:33 slipstream kernel: [  849.855036] usb 5-1: New USB 
>> device
>> found,
>> Apr 21 10:21:33 slipstream kernel: [  849.855041] usb 5-1: New USB 
>> device
>> string
>> Apr 21 10:21:33 slipstream kernel: [  849.855045] usb 5-1: Product:
>> Wireless Con
>> Apr 21 10:21:33 slipstream kernel: [  849.855049] usb 5-1: Manufacturer:
>> Sony Co
>> Apr 21 10:21:33 slipstream kernel: [  849.861096] sony
>> 0003:054C:05C4.0005: Usin
>> Apr 21 10:21:33 slipstream kernel: [  849.906141] input: Sony Computer
>> Entertain
>> Apr 21 10:21:33 slipstream kernel: [  849.906344] sony
>> 0003:054C:05C4.0005: inpu
>> -- 
>>
>>
>
> I've seen this before and it's a bug in jstest and jstest-gtk, not the 
> driver or event system.  These programs do their own internal axis 
> mapping and don't properly handle axes above ABS_MISC which is where 
> the touch axes are.  jstest-gtk just default maps these to 0 and the 
> old jstest just doesn't look like it does any bounds checking at all.

Sorry, it seems that I spoke too soon (jstest-gtk has an internal bug 
that causes this exact problem, but the old jstest doesn't).

The joydev device *is* missing the mappings for the touchpad axes for 
some reason (JSIOCGAXES returns 14 instead of 17 like it should).  I'm 
not sure why though.  In the Sony driver the touchpad axis bits are set 
in the probe function and work correctly via the evdev interface and 
looking in the joydev module it should properly handle and map all axes 
up to ABS_MAX so the problem probably lies somewhere else.  If I had to 
guess, it seems like the joydev device is being created after the HID 
descriptor is parsed, but before the device probe function is called.

Can anyone more familiar with the general input system comment on why 
this might be happening?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug: HID-Sony: DS4 touch-pad corrupts Axis0
  2014-04-21 20:16   ` Frank Praznik
@ 2014-04-22 16:50     ` simon
  2014-04-22 17:31       ` Frank Praznik
  0 siblings, 1 reply; 7+ messages in thread
From: simon @ 2014-04-22 16:50 UTC (permalink / raw)
  To: Frank Praznik; +Cc: simon, Frank Praznik, HID CORE LAYER, Jiri Kosina


> The joydev device *is* missing the mappings for the touchpad axes for
> some reason (JSIOCGAXES returns 14 instead of 17 like it should).  I'm
> not sure why though.  In the Sony driver the touchpad axis bits are set
> in the probe function and work correctly via the evdev interface and
> looking in the joydev module it should properly handle and map all axes
> up to ABS_MAX so the problem probably lies somewhere else.  If I had to
> guess, it seems like the joydev device is being created after the HID
> descriptor is parsed, but before the device probe function is called.
>
> Can anyone more familiar with the general input system comment on why
> this might be happening?

I find it suspicious that it doesn't happen the first time (after boot)
that the controller is plugged in, but then does every subsequent time...
maybe some un-init memory somewhere.

Is this kernel behaviour, or down to the controller state (ie alive after
first plug)? We see that the DS3 behaves differently wrt leds depending on
whether it is asleep or alive when plugged in.

I'll dig a little deeper tonight to see if I can track the problem down.
Simon.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug: HID-Sony: DS4 touch-pad corrupts Axis0
  2014-04-22 16:50     ` simon
@ 2014-04-22 17:31       ` Frank Praznik
  2014-04-23  3:21         ` simon
  0 siblings, 1 reply; 7+ messages in thread
From: Frank Praznik @ 2014-04-22 17:31 UTC (permalink / raw)
  To: simon; +Cc: Frank Praznik, HID CORE LAYER, Jiri Kosina

On 4/22/2014 12:50, simon@mungewell.org wrote:
>> The joydev device *is* missing the mappings for the touchpad axes for
>> some reason (JSIOCGAXES returns 14 instead of 17 like it should).  I'm
>> not sure why though.  In the Sony driver the touchpad axis bits are set
>> in the probe function and work correctly via the evdev interface and
>> looking in the joydev module it should properly handle and map all axes
>> up to ABS_MAX so the problem probably lies somewhere else.  If I had to
>> guess, it seems like the joydev device is being created after the HID
>> descriptor is parsed, but before the device probe function is called.
>>
>> Can anyone more familiar with the general input system comment on why
>> this might be happening?
> I find it suspicious that it doesn't happen the first time (after boot)
> that the controller is plugged in, but then does every subsequent time...
> maybe some un-init memory somewhere.
>
> Is this kernel behaviour, or down to the controller state (ie alive after
> first plug)? We see that the DS3 behaves differently wrt leds depending on
> whether it is asleep or alive when plugged in.
>
> I'll dig a little deeper tonight to see if I can track the problem down.
> Simon.
>

It might be a matter of the joydev module not being loaded into memory 
the first time thus allowing the probe function to complete and set the 
proper axis bits before the js* device is created.  On subsequent 
connects the module would already be loaded so the js* device would be 
created before the extra axis bits are set, assuming that my earlier 
hypothesis is correct and the joystick device is being created before 
the probe function returns.

The joydev system also zero initializes the mapping arrays and doesn't 
filter out unmapped axis or button events, which is why the unmapped 
axes always effect axis 0.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug: HID-Sony: DS4 touch-pad corrupts Axis0
  2014-04-22 17:31       ` Frank Praznik
@ 2014-04-23  3:21         ` simon
  0 siblings, 0 replies; 7+ messages in thread
From: simon @ 2014-04-23  3:21 UTC (permalink / raw)
  To: Frank Praznik; +Cc: simon, Frank Praznik, HID CORE LAYER, Jiri Kosina

[-- Attachment #1: Type: text/plain, Size: 1931 bytes --]

> It might be a matter of the joydev module not being loaded into memory
> the first time thus allowing the probe function to complete and set the
> proper axis bits before the js* device is created.  On subsequent
> connects the module would already be loaded so the js* device would be
> created before the extra axis bits are set, assuming that my earlier
> hypothesis is correct and the joystick device is being created before
> the probe function returns.

You are correct... I did some quick testing and it appears that 'joydev'
and 'hid-sony' are remaining loaded after the controller is unplugged.

In this state when the DS4 is reconnected (2nd time) jstest shows 14 axes.
--
Driver version is 2.1.0.
Joystick (Sony Computer Entertainment Wireless Controller) has 14 axes (X,
Y, Z, Rx, Ry, Rz, Hat0X, Hat0Y, (null), (null), (null), (null), (null),
(null))
and 14 buttons (BtnX, BtnY, BtnZ, BtnTL, BtnTR, BtnTL2, BtnTR2, BtnSelect,
BtnStart, BtnMode, BtnThumbL, BtnThumbR, ?, ?).
Testing ... (interrupt to exit)
--

If I 'sudo rmmod joydev' after removing the DS4 and then plug it back in
(3rd time), we get 18 axis (as we should)
--
Driver version is 2.1.0.
Joystick (Sony Computer Entertainment Wireless Controller) has 18 axes (X,
Y, Z, Rx, Ry, Rz, Hat0X, Hat0Y, (null), (null), (null), (null), (null),
(null), (null), (null), (null), (null))
and 14 buttons (BtnX, BtnY, BtnZ, BtnTL, BtnTR, BtnTL2, BtnTR2, BtnSelect,
BtnStart, BtnMode, BtnThumbL, BtnThumbR, ?, ?).
Testing ... (interrupt to exit)
--

Also when in the 'faulty/14 axis' state, I can 'sudo rmmod joydev' and
'sudo modprobe joydev' to return it to the 'correct/18 axes' state without
unplugging the DS4.

The HID report descriptors (from /sys/bus/hid/...) are identical on all
plug in cycles, as is the 'syslog' text.

If I blacklist hid-sony I do not get a 'js0' to check and no report
descriptor is present.


Anything else I can test for you guys?
Simon

[-- Attachment #2: syslog_2nd.txt --]
[-- Type: text/plain, Size: 1285 bytes --]

Apr 22 20:48:07 bigbox kernel: [ 2529.236727] usb 5-2: USB disconnect, device number 3
Apr 22 20:49:10 bigbox kernel: [ 2592.524323] usb 5-2: new full-speed USB device number 4 using uhci_hcd
Apr 22 20:49:11 bigbox kernel: [ 2592.900863] usb 5-2: New USB device found, idVendor=054c, idProduct=05c4
Apr 22 20:49:11 bigbox kernel: [ 2592.900870] usb 5-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Apr 22 20:49:11 bigbox kernel: [ 2592.900873] usb 5-2: Product: Wireless Controller
Apr 22 20:49:11 bigbox kernel: [ 2592.900875] usb 5-2: Manufacturer: Sony Computer Entertainment
Apr 22 20:49:11 bigbox kernel: [ 2592.907030] sony 0003:054C:05C4.0003: Using modified Dualshock 4 report descriptor with gyroscope axes
Apr 22 20:49:11 bigbox kernel: [ 2592.952084] input: Sony Computer Entertainment Wireless Controller as /devices/pci0000:00/0000:00:1d.3/usb5/5-2/5-2:1.0/0003:054C:05C4.0003/input/input6
Apr 22 20:49:11 bigbox kernel: [ 2592.952404] sony 0003:054C:05C4.0003: input,hidraw1: USB HID v1.11 Gamepad [Sony Computer Entertainment Wireless Controller] on usb-0000:00:1d.3-2/input0
Apr 22 20:49:11 bigbox mtp-probe: checking bus 5, device 4: "/sys/devices/pci0000:00/0000:00:1d.3/usb5/5-2"
Apr 22 20:49:11 bigbox mtp-probe: bus: 5, device: 4 was not an MTP device

[-- Attachment #3: syslog_3rd.txt --]
[-- Type: text/plain, Size: 1285 bytes --]

Apr 22 20:50:40 bigbox kernel: [ 2682.258150] usb 5-2: USB disconnect, device number 4
Apr 22 20:51:45 bigbox kernel: [ 2747.112424] usb 5-2: new full-speed USB device number 5 using uhci_hcd
Apr 22 20:51:45 bigbox kernel: [ 2747.284439] usb 5-2: New USB device found, idVendor=054c, idProduct=05c4
Apr 22 20:51:45 bigbox kernel: [ 2747.284446] usb 5-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Apr 22 20:51:45 bigbox kernel: [ 2747.284450] usb 5-2: Product: Wireless Controller
Apr 22 20:51:45 bigbox kernel: [ 2747.284452] usb 5-2: Manufacturer: Sony Computer Entertainment
Apr 22 20:51:45 bigbox kernel: [ 2747.290508] sony 0003:054C:05C4.0004: Using modified Dualshock 4 report descriptor with gyroscope axes
Apr 22 20:51:45 bigbox kernel: [ 2747.335577] input: Sony Computer Entertainment Wireless Controller as /devices/pci0000:00/0000:00:1d.3/usb5/5-2/5-2:1.0/0003:054C:05C4.0004/input/input7
Apr 22 20:51:45 bigbox kernel: [ 2747.335881] sony 0003:054C:05C4.0004: input,hidraw1: USB HID v1.11 Gamepad [Sony Computer Entertainment Wireless Controller] on usb-0000:00:1d.3-2/input0
Apr 22 20:51:45 bigbox mtp-probe: checking bus 5, device 5: "/sys/devices/pci0000:00/0000:00:1d.3/usb5/5-2"
Apr 22 20:51:45 bigbox mtp-probe: bus: 5, device: 5 was not an MTP device

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-04-23  3:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-21 16:49 Bug: HID-Sony: DS4 touch-pad corrupts Axis0 simon
2014-04-21 17:18 ` simon
2014-04-21 17:30 ` Frank Praznik
2014-04-21 20:16   ` Frank Praznik
2014-04-22 16:50     ` simon
2014-04-22 17:31       ` Frank Praznik
2014-04-23  3:21         ` simon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.