Axis 5 (Rz) is disabled on PS4 DS4 controller (pegagame-P4016)

Questions about Wine on Linux
Locked
axis6404
Level 2
Level 2
Posts: 14
Joined: Sun Apr 23, 2023 5:13 am

Axis 5 (Rz) is disabled on PS4 DS4 controller (pegagame-P4016)

Post by axis6404 »

Problem: Axis 5 (Rz) is always disabled.
Wine: wine-staging 8.5~bullseye-1
Linux: Debian bullseye
Controller: PS4 DS4 controller (pegagame-P4016 / ipega-P4016) https://www.pegagame.com/products/pg-p4016
Test Program: C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Samples\C++\DirectInput\Joystick (https://www.microsoft.com/ja-JP/downloa ... px?id=6812)
Test Program2: jstest-gtk 0.1.1~git20160825-4

Screenshots (Joystick.exe on Win8.1) Rz is enabled: Image

Screenshots2 (Joystick.exe on Wine8.5[Debian] with default reg) Rz is disabled. Rz is grayed out.: Image
Screenshots3 (Joystick.exe on Wine8.5[Debian] with Axe reg) Rz is disabled. Rz is grayed out.: Image
Screenshots4 (jstest-gtk on Debian bullseye) Rz is enabled: Image

log(WINEDEBUG=+dinput wine Joystick.exe): https://pastebin.com/cY48jchr
note: I ran Joystick.exe after restarting regedit to make the changes to the registry take effect.

Axis 0: Left and right of left stick
Axis 1: Left stick up/down
Axis 2: Left and right of right stick
Axis 3: L2
Axis 4: R2
Axis 5: Right stick up/down
Axis 6: Left and right of PAD
Axis 7: PAD up/down

How can I enable axis 5?
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: Axis 5 (Rz) is disabled on PS4 DS4 controller (pegagame-P4016)

Post by jkfloris »

Does the controller work with the Wine control panel?

Code: Select all

wine control joy.cpl
axis6404
Level 2
Level 2
Posts: 14
Joined: Sun Apr 23, 2023 5:13 am

Re: Axis 5 (Rz) is disabled on PS4 DS4 controller (pegagame-P4016)

Post by axis6404 »

Controllers do not work with joy.cpl.
Axis5(Rz) is unresponsive.
Axis2(Z) moves strangely. It responds to both up/down and left/right of the right stick.
When I move the right stick, Axis2(Z) has the following values. The values are approximate values measured by my eyes.
At 0: 0.75
1.5 o'clock: 0.875
3 o'clock: 0.75
4.5 o'clock: 0
6 o'clock: 0.25
7 o'clock: 0.125
9 o'clock: 0.25
10.5 o'clock: 0

Other axes (X, Y, Rx, Ry) are OK.
jkfloris wrote: Sun Apr 23, 2023 11:36 am Does the controller work with the Wine control panel?

Code: Select all

wine control joy.cpl
axis6404
Level 2
Level 2
Posts: 14
Joined: Sun Apr 23, 2023 5:13 am

Re: Axis 5 (Rz) is disabled on PS4 DS4 controller (pegagame-P4016)

Post by axis6404 »

The value was incorrect. The correct value is shown below.

Right stick angle: Horizontal bar value for Axis2 (Z-axis) [0 - 0.5 - 1.0]
0 o'clock: 0.75
1.5 o'clock: 0.875
3 o'clock: 0.75
4.5 o'clock: 0.5
6 o'clock: 0.25
7 o'clock: 0.125
9 o'clock: 0.25
10.5 o'clock: 0.5

On Joy.cpl(wine) and on Joystick.exe(wine), Axis2(Z) values are wrong and Axis5(Rz) values do not respond.
On Joystick.exe (Win8.1) and jstest-gtk (Debian), both Axis2(Z) and Axis5(Rz) are correct. Axis2(Z) is linked to the left and right of the right stick, and Axis5(Rz) is linked to the up and down of the right stick.
Last edited by axis6404 on Tue Apr 25, 2023 11:33 am, edited 2 times in total.
axis6404
Level 2
Level 2
Posts: 14
Joined: Sun Apr 23, 2023 5:13 am

Re: Axis 5 (Rz) is disabled on PS4 DS4 controller (pegagame-P4016)

Post by axis6404 »

Tried with other controllers.
Axis 5 is disabled. Is this a bug?

Controller: Sony's PS3 DualShock3 controller
https://en.wikipedia.org/wiki/Sixaxis
Test Program: C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Samples\C++\DirectInput\Joystick (https://www.microsoft.com/ja-JP/downloa ... px?id=6812)
Test Program2: jstest-gtk 0.1.1~git20160825-4

Screenshots (Joystick.exe on Win8.1) Axis 5 is enabled:
Image
Screenshots2-Left (Joystick.exe on Wine8.5[Debian] with default reg) Axis 5 is disabled. Axis 5 is grayed out.:
Screenshots2-Right (jstest-gtk on Debian bullseye) Axis 5 is enabled:
Image

Wine's dinput only recognizes up to 5 Axis.
The sixth and later Axis (Axis 5+n) will be disabled.
Last edited by axis6404 on Wed May 10, 2023 12:02 pm, edited 1 time in total.
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: Axis 5 (Rz) is disabled on PS4 DS4 controller (pegagame-P4016)

Post by jkfloris »

If I am correct, Wine does not use the old /dev/input/js0 but the new /dev/input/event# to access the joystick.
Which axes are visible when you approach the joystick with evdev-joystick?

Code: Select all

# find the joystick
evdev-joystick --l

# show joystick information
evdev-joystick --s <output of evdev-joystick --l>
axis6404
Level 2
Level 2
Posts: 14
Joined: Sun Apr 23, 2023 5:13 am

Re: Axis 5 (Rz) is disabled on PS4 DS4 controller (pegagame-P4016)

Post by axis6404 »

I have tried evdev-joystick with two controllers.

PS4 DS4 controller (pegagame-P4016 / ipega-P4016)

Code: Select all

$ evdev-joystick --l
/dev/input/by-id/usb-QIXIONG_Wire_PS4_Controller-if03-event-joystick
$ evdev-joystick --s /dev/input/by-id/usb-QIXIONG_Wire_PS4_Controller-if03-event-joystick
Supported Absolute axes:
  Absolute axis 0x00 (0) (X Axis) (value: 128, min: 0, max: 255, flatness: 15 (=5.88%), fuzz: 0)
  Absolute axis 0x01 (1) (Y Axis) (value: 128, min: 0, max: 255, flatness: 15 (=5.88%), fuzz: 0)
  Absolute axis 0x02 (2) (Z Axis) (value: 128, min: 0, max: 255, flatness: 15 (=5.88%), fuzz: 0)
  Absolute axis 0x03 (3) (X Rate Axis) (value: 0, min: 0, max: 255, flatness: 15 (=5.88%), fuzz: 0)
  Absolute axis 0x04 (4) (Y Rate Axis) (value: 0, min: 0, max: 255, flatness: 15 (=5.88%), fuzz: 0)
  Absolute axis 0x05 (5) (Z Rate Axis) (value: 128, min: 0, max: 255, flatness: 15 (=5.88%), fuzz: 0)
  Absolute axis 0x10 (16) (Hat zero, x axis) (value: 0, min: -1, max: 1, flatness: 0 (=0.00%), fuzz: 0)
  Absolute axis 0x11 (17) (Hat zero, y axis) (value: 0, min: -1, max: 1, flatness: 0 (=0.00%), fuzz: 0)
Sony's PS3 DualShock3 controller

Code: Select all

$ evdev-joystick --l
/dev/input/by-id/usb-Sony_PLAYSTATION_R_3_Controller-event-joystick
$ evdev-joystick --s /dev/input/by-id/usb-Sony_PLAYSTATION_R_3_Controller-event-joystick
Supported Absolute axes:
  Absolute axis 0x00 (0) (X Axis) (value: 132, min: 0, max: 255, flatness: 15 (=5.88%), fuzz: 0)
  Absolute axis 0x01 (1) (Y Axis) (value: 128, min: 0, max: 255, flatness: 15 (=5.88%), fuzz: 0)
  Absolute axis 0x02 (2) (Z Axis) (value: 0, min: 0, max: 255, flatness: 15 (=5.88%), fuzz: 0)
  Absolute axis 0x03 (3) (X Rate Axis) (value: 123, min: 0, max: 255, flatness: 15 (=5.88%), fuzz: 0)
  Absolute axis 0x04 (4) (Y Rate Axis) (value: 128, min: 0, max: 255, flatness: 15 (=5.88%), fuzz: 0)
  Absolute axis 0x05 (5) (Z Rate Axis) (value: 0, min: 0, max: 255, flatness: 15 (=5.88%), fuzz: 0)
Axis5 is also recognized by evdev-joystick.
It is not recognized only by the dinput of wine.
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: Axis 5 (Rz) is disabled on PS4 DS4 controller (pegagame-P4016)

Post by jkfloris »

You can try to run Joystick.exe with the LC_ALL=C variabele.

Code: Select all

LC_ALL=C wine Joystick.exe
If that doesn't help either, create a bug report.
axis6404
Level 2
Level 2
Posts: 14
Joined: Sun Apr 23, 2023 5:13 am

Re: Axis 5 (Rz) is disabled on PS4 DS4 controller (pegagame-P4016)

Post by axis6404 »

I tried LC_ALL=C. The situation did not change.

I have reported it to Bugzilla. (https://bugs.winehq.org/show_bug.cgi?id=54947)
Thank you for your help.
jkfloris wrote: Mon May 15, 2023 3:36 pm You can try to run Joystick.exe with the LC_ALL=C variabele.

Code: Select all

LC_ALL=C wine Joystick.exe
If that doesn't help either, create a bug report.
Locked