http://bugs.winehq.org/show_bug.cgi?id=31546
Bug #: 31546 Summary: PS3 gamepad analog sticks problem Product: Wine Version: 1.5.11 Platform: x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: thesource@mail.ru Classification: Unclassified
There's a problem with my PS3 gamepad when I try to use it in Windows applications. Some analog axes seem to be mapped to wrong axis numbers. For example, vertical movement (accelerometer) is mapped to left analog horizontal (X), while X itself is not mapped anywhere. Buttons seem to work fine. I tested with several windows applications (Project 64 with N-Rage plugin, QtJoystick). Native linux jstest shows that everything work as at should in native linux environment.
http://bugs.winehq.org/show_bug.cgi?id=31546
--- Comment #1 from The Source thesource@mail.ru 2012-08-26 03:53:21 CDT --- I tried manual mapping in the registry and it didn't work. X axis is still dead, accelerometer acts as X.
http://bugs.winehq.org/show_bug.cgi?id=31546
Lucas Fialho Zawacki lfzawacki@yahoo.com.br changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |lfzawacki@yahoo.com.br
http://bugs.winehq.org/show_bug.cgi?id=31546
--- Comment #2 from Austin English austinenglish@gmail.com 2012-10-29 15:01:18 CDT --- A +dinput,+joystick,+tid trace would be helpful.
http://bugs.winehq.org/show_bug.cgi?id=31546
Riccardo c10ud.dev@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |c10ud.dev@gmail.com
--- Comment #3 from Riccardo c10ud.dev@gmail.com 2012-11-01 09:37:17 CDT --- I think the issue is that the axis 0 gets overwritten by event 59 (with a value of 300 or so) which should be an accelerometer.. (hence the X axis staying stuck to value 25)
however I don't get how this can be happening
http://bugs.winehq.org/show_bug.cgi?id=31546
--- Comment #4 from The Source thesource@mail.ru 2012-11-04 04:10:30 CST --- Created attachment 42380 --> http://bugs.winehq.org/attachment.cgi?id=42380 QtJoystick wine output
Here's the log with debug options you requested. Tested with QtJoystick 0.2b.
http://bugs.winehq.org/show_bug.cgi?id=31546
--- Comment #5 from The Source thesource@mail.ru 2012-11-04 04:11:30 CST --- ...and wine 1.5.16, sorry, forgot to tell that.
http://bugs.winehq.org/show_bug.cgi?id=31546
--- Comment #6 from Riccardo c10ud.dev@gmail.com 2012-11-05 05:38:19 CST --- A simple workaround is ignoring the unwanted events (this is not a patch)
in dlls/dinput/joystick_linuxinput.c:
case EV_ABS: { + if (ie.code > 11) + break;
debugging the issue further shows that lots of event codes are mapped to 0 axis, see this debug snippet that prints values just before the switch(axis):
ie.code: 48 axis: 0 inst_id: 2 value: -25 ie.code: 49 axis: 0 inst_id: 2 value: -11 ie.code: 50 axis: 0 inst_id: 2 value: -25 ie.code: 51 axis: 0 inst_id: 2 value: -25 ie.code: 52 axis: 0 inst_id: 2 value: -25 ie.code: 53 axis: 0 inst_id: 2 value: -25 ie.code: 54 axis: 0 inst_id: 2 value: -25 ie.code: 55 axis: 0 inst_id: 2 value: -25 ie.code: 56 axis: 0 inst_id: 2 value: -25 ie.code: 57 axis: 0 inst_id: 2 value: -25 ie.code: 58 axis: 0 inst_id: 2 value: -25 ie.code: 59 axis: 0 inst_id: 2 value: 25
http://bugs.winehq.org/show_bug.cgi?id=31546
--- Comment #7 from Lucas Fialho Zawacki lfzawacki@yahoo.com.br 2012-11-05 05:50:31 CST --- (In reply to comment #6)
A simple workaround is ignoring the unwanted events (this is not a patch)
That's interesting, thanks for taking the time and digging up this information. I don't have a PS3 joystick, but when I find some time I'll borrow one from a friend and try to make this code more specific so that it treats these events right. Have you tried using the other driver (js) as a workaround?
http://bugs.winehq.org/show_bug.cgi?id=31546
--- Comment #8 from Riccardo c10ud.dev@gmail.com 2012-11-05 06:46:13 CST --- (In reply to comment #7)
(In reply to comment #6)
A simple workaround is ignoring the unwanted events (this is not a patch)
That's interesting, thanks for taking the time and digging up this information. I don't have a PS3 joystick, but when I find some time I'll borrow one from a friend and try to make this code more specific so that it treats these events right. Have you tried using the other driver (js) as a workaround?
Well, the js driver reacts slowly and feels sluggish but i don't know the cause.. I wish I could give a better patch for this issue but my knowledge of the internals of wine and evdev is near to nothing. I didn't debug further because building the dll requires me to fire up a VM since I'm on Ubuntu64 and it's a PITA, but i guess the (wrong) mapping is being done in alloc_device? Here I don't understand how newDevice->dev_axes_to_di[i] = idx; can be 0 for those event codes..
http://bugs.winehq.org/show_bug.cgi?id=31546
winebugzilla.kyoo@xoxy.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winebugzilla.kyoo@xoxy.net
--- Comment #9 from winebugzilla.kyoo@xoxy.net 2013-02-26 13:42:34 CST --- I have been noticing this recently with a PS2 controller (wine 1.5.24), especially with epsxe. When setting up the controller, the program will see a different axis being moved sometimes depending on which direction and how far I move a stick (see below.) This also seems to change sometimes when I un+replug the controller (USB adaptor). I started a game, played for a while, then paused it and unplugged the adaptor. Later, I plugged the adaptor back in and resumed the game. All joystick input except left stick up and either stick left works. This doesn't change when I restart the program.
Stick.direction - Currently - Previously (as seen by epsxe) left.left - J2_LX until halfway, then J1_LX - J2_LX left.right - J2_LX until halfway, then J1_LX - J2_LX left.up - J2_LY until halfway, then J1_LY - J2_LY left.down - J2_LY until halfway, then J1_LY until 95%, then J1_LX - J2_LY right.left - J1_LZ except for about 10% in the middle where it's J2_LZ - J2_LZ right.right - J2_LZ - J2_LZ right.up - J1_LRZ except for about 10% in the middle where it's J2_LRZ - J2_LRZ right.down - J2_LRX - J2_LRZ
With jstest, all axes seem to work fine. I'm not overriding any dlls.
http://bugs.winehq.org/show_bug.cgi?id=31546
--- Comment #10 from Lucas Fialho Zawacki lfzawacki@yahoo.com.br 2013-03-20 17:33:29 CDT --- Created attachment 43974 --> http://bugs.winehq.org/attachment.cgi?id=43974 Solution to the problem
Good news everyone! I've got my handas on a PS3 gamepad and here's a proper patch for this. I'll send it right away, but you can test it here. You can read what it does in details, the patch header. Sorry for the delay.
http://bugs.winehq.org/show_bug.cgi?id=31546
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |45a19b0c9b32b9a02be11b597a7 | |db5341b310474 Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #11 from Bruno Jesus 00cpxxx@gmail.com 2013-03-25 15:06:23 CDT --- Patch commited: http://source.winehq.org/git/wine.git/commitdiff/45a19b0c9b32b9a02be11b597a7...
Thanks Lucas.
http://bugs.winehq.org/show_bug.cgi?id=31546
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #12 from Alexandre Julliard julliard@winehq.org 2013-03-29 13:32:44 CDT --- Closing bugs fixed in 1.5.27.
https://bugs.winehq.org/show_bug.cgi?id=31546
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net Component|-unknown |directx-dinput