https://bugs.winehq.org/show_bug.cgi?id=47123
Bug ID: 47123 Summary: Starcitizen - joystick not recognized after wine commit 085e5887 Product: Wine Version: 4.6 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-dinput Assignee: wine-bugs@winehq.org Reporter: luca_pi@yahoo.it Distribution: ---
Created attachment 64337 --> https://bugs.winehq.org/attachment.cgi?id=64337 revert commit 085e5887
Since wine commit 085e588, Starcitizen stop recognizing the attached controllers. https://github.com/wine-mirror/wine/commit/085e58878f58c8e9fd03f8b56ac5489ab...
In Joy.cpl they appear with no issues and all seems working fine, but Starcitizen does not sees them anymore. Before that commit all was working fine and building latest wine with the attached patch (which just revert that commit), SC recognize them again.
the attached is not a fix just a temporary workaround.
https://bugs.winehq.org/show_bug.cgi?id=47123
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |aeikum@codeweavers.com Regression SHA1| |085e58878f58c8e9fd03f8b56ac | |5489ab844b3e1 Keywords| |regression
https://bugs.winehq.org/show_bug.cgi?id=47123
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |leslie_alistair@hotmail.com
https://bugs.winehq.org/show_bug.cgi?id=47123
--- Comment #1 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Can you please provide a dinput log?
https://bugs.winehq.org/show_bug.cgi?id=47123
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Starcitizen - joystick not |Starcitizen - joystick not |recognized after wine |recognized |commit 085e5887 |
https://bugs.winehq.org/show_bug.cgi?id=47123
--- Comment #2 from rw74 luca_pi@yahoo.it --- Created attachment 64347 --> https://bugs.winehq.org/attachment.cgi?id=64347 logs from working commit
https://bugs.winehq.org/show_bug.cgi?id=47123
--- Comment #3 from rw74 luca_pi@yahoo.it --- Created attachment 64348 --> https://bugs.winehq.org/attachment.cgi?id=64348 logs from not working commit
https://bugs.winehq.org/show_bug.cgi?id=47123
--- Comment #4 from rw74 luca_pi@yahoo.it --- here are the logs from working and not working commit.
here is what the game shows when sees the controllers: <21:00:30> Input initialization <21:00:32> - Connected joystick0: www.vkb-sim.pro www.forum.vkb-sim.pro �� Alex Oz 2012-2017 VKBsim Black Box (event) {011F231D-0000-0000-0000-504944564944} <21:00:32> - Connected joystick1: Thustmaster Joystick - HOTAS Warthog (event) {0402044F-0000-0000-0000-504944564944} <21:00:32> Initializing Animation System
strange part is that wine (joy.cpl) in both cases sees them, but the application does not with the mentioned commit.
https://bugs.winehq.org/show_bug.cgi?id=47123
--- Comment #5 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Thanks for the logs. The question that it raises is, what value is it checking to see if it has a joystick.
If you get it in a working state, then change "lpddi->wUsage" to lpddi->wUsage = 0x05; /* Game Pad */
Does it still fail?
Is there any chance you could post the "dinput_test joystick" output running on windows? (with the joysticks attached).
https://bugs.winehq.org/show_bug.cgi?id=47123
--- Comment #6 from rw74 luca_pi@yahoo.it --- hope I got it right...
I modified the 2 lines in attached patch file from lpddi->wUsage = 0x04; /* Joystick */ into lpddi->wUsage = 0x05; /* Joystick */
and applied to a commit that was not working, the game can see the joysticks.
where do I get dinput_test for windows?
https://bugs.winehq.org/show_bug.cgi?id=47123
--- Comment #7 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Created attachment 64355 --> https://bugs.winehq.org/attachment.cgi?id=64355 Tests
Test to run on windows.
https://bugs.winehq.org/show_bug.cgi?id=47123
--- Comment #8 from Andrew Eikum aeikum@codeweavers.com --- Thanks very much for reporting and for all your testing.
This was basically predicted by Roderick: https://www.winehq.org/pipermail/wine-devel/2019-April/144064.html
We should be getting the Usage value from HID, but dinput doesn't currently use HID. We can use some heuristic for this, but it's not clear what it should be... I wonder if someplace else (the kernel, udev, systemd) has already done some heuristic for this that we could be inspired by. I'll see if I can find something.
https://bugs.winehq.org/show_bug.cgi?id=47123
--- Comment #9 from Andrew Eikum aeikum@codeweavers.com --- rw74, could you paste here the first couple lines of output from jstest for your joystick device?
For example, this is my xbox controller output:
[aeikum@aeikum ~]$ jstest /dev/input/js0 Driver version is 2.1.0. Joystick (Microsoft X-Box 360 pad) has 8 axes (X, Y, Z, Rx, Ry, Rz, Hat0X, Hat0Y) and 11 buttons (BtnA, BtnB, BtnX, BtnY, BtnTL, BtnTR, BtnSelect, BtnStart, BtnMode, BtnThumbL, BtnThumbR).
https://bugs.winehq.org/show_bug.cgi?id=47123
--- Comment #10 from rw74 luca_pi@yahoo.it --- I can give you the windows output from dinput_test in few hours.
here is the output from jstest from the 3 controllers I have:
Driver version is 2.1.0. Joystick (Thustmaster Joystick - HOTAS Warthog) has 4 axes (X, Y, Hat0X, Hat0Y) and 19 buttons (Trigger, ThumbBtn, ThumbBtn2, TopBtn, TopBtn2, PinkieBtn, BaseBtn, BaseBtn2, BaseBtn3, BaseBtn4, BaseBtn5, BaseBtn6, ?, ?, ?, BtnDead, (null), (null), (null)).
Joystick (Thrustmaster Throttle - HOTAS Warthog) has 7 axes (X, Y, Z, Rz, Throttle, Hat0X, Hat0Y) and 32 buttons (Trigger, ThumbBtn, ThumbBtn2, TopBtn, TopBtn2, PinkieBtn, BaseBtn, BaseBtn2, BaseBtn3, BaseBtn4, BaseBtn5, BaseBtn6, ?, ?, ?, BtnDead, (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null)).
Joystick (www.vkb-sim.pro www.forum.vkb-sim.pro �� Alex Oz 2012-2017 VKBsim Black Box ) has 6 axes (X, Y, Z, Rx, Ry, Rz) and 2 buttons (Trigger, ThumbBtn).
btw Starcitizen recognize also gamepad devices, but they are not showing ether as such (in case you think that was the issue)
could it be possible that the new code somehow crash the enumeration returning an empty list to the game? I have this doubt as in an initial tracing one of the thing that pointed to me was that when the working one was moving forward with dinput outputs the other showed an exception raised:
... 0097:trace:dinput:fill_joystick_dideviceinstanceW 1100 0x22d080 0097:trace:dinput:fill_joystick_dideviceinstanceA 580 0x22d570 009d:trace:seh:RtlCaptureStackBackTrace (0, 32, 0x7f5eb43c0b18, (nil)) stub! 0097:trace:dinput:joydev_enum_deviceA Enumerating the linux Joystick device: /dev/input/js1 (www.vkb-sim.pro www.forum.vkb-sim.pro �� Alex Oz 2012-2017 VKBsim Black Box (js)) 0097:trace:dinput:IDirectInputAImpl_EnumDevices - checking device 3 ('Wine Linux joystick driver') 009a:trace:seh:RtlCaptureStackBackTrace (0, 32, 0x7f5eb43c0618, (nil)) stub! 00e2:trace:seh:NtRaiseException code=406d1388 flags=0 addr=0x7b458e78 ip=7b458e78 tid=00e2 00e2:trace:seh:NtRaiseException info[0]=0000000000001000 00e2:trace:seh:NtRaiseException info[1]=00007f5648d6fd68 00e2:trace:seh:NtRaiseException info[2]=00000000000000e2 00e2:trace:seh:NtRaiseException info[3]=0000000000000000 00e2:trace:seh:NtRaiseException info[4]=00007f57493bd058 00e2:trace:seh:NtRaiseException info[5]=000000014482f9ce 00e2:trace:seh:NtRaiseException rax=00007f5548b7fc10 rbx=00007f5749359490 rcx=00007f5548b7fc10 rdx=00007f5548b7fc30 00e2:trace:seh:NtRaiseException rsi=00007f5548b7fdc0 rdi=00007f5548b7fc60 rbp=00007f5548b7fd60 rsp=00007f5548b7fbf0 00e2:trace:seh:NtRaiseException r8=0000000000000006 r9=00007f5548b7fd90 r10=0000000000000000 r11=0000000000000000 00e2:trace:seh:NtRaiseException r12=0000000000000000 r13=0000000000000000 r14=0000000000000000 r15=0000000000000000 00e2:trace:seh:dwarf_virtual_unwind function 7b458e78 base 0x7b458d90 cie 0x7b687118 len 14 id 0 version 1 aug 'zR' code_align 1 data_align -8 retaddr %rip 00e2:trace:seh:execute_cfa_instructions 7b458d90: DW_CFA_def_cfa %rsp, 8 00e2:trace:seh:execute_cfa_instructions 7b458d90: DW_CFA_offset %rip, -8 00e2:trace:seh:dwarf_virtual_unwind fde 0x7b695330 len 78 personality (nil) lsda (nil) code 7b458d90-7b458f07 00e2:trace:seh:execute_cfa_instructions 7b458d90: DW_CFA_advance_loc 1 ...
not sure if that is relevant... it was done with a wine without symbols, if you think that could be relevant I can try to replicate it with a wine with symbols if that would show more info.
https://bugs.winehq.org/show_bug.cgi?id=47123
--- Comment #11 from Andrew Eikum aeikum@codeweavers.com --- I don't see that in the not working log that you uploaded here. Also the exception code looks like it is a game exception, not a crash. So I think it is not the cause of the problem.
I'm working on a patch to report devices with a TRIGGER button as a joystick, and without as a gamepad.
https://bugs.winehq.org/show_bug.cgi?id=47123
--- Comment #12 from Andrew Eikum aeikum@codeweavers.com --- Created attachment 64357 --> https://bugs.winehq.org/attachment.cgi?id=64357 dinput: Use heuristics to guess if a device is a gamepad or a joystick
Here's a patch that does this. It doesn't break The Wolf Among Us for my xbox controller. Can you see if it fixes Star Citizen for you?
https://bugs.winehq.org/show_bug.cgi?id=47123
--- Comment #13 from rw74 luca_pi@yahoo.it --- the exception is not in the attached logs as you asked for the dinput logs, while the ones I did in the beginning was with seh and dinput.
I will be able to test your patch in few hours, but sounds promising :)
https://bugs.winehq.org/show_bug.cgi?id=47123
--- Comment #14 from rw74 luca_pi@yahoo.it --- to which commit I should be able to apply the patch?
I tried to the one that was working on and the after that one, but on both I am getting error...
https://bugs.winehq.org/show_bug.cgi?id=47123
--- Comment #15 from Andrew Eikum aeikum@codeweavers.com --- Sorry, I should have specified. It should apply on top of current wine master (10dcee21c4b28b7f1cedc9ade01c09616521b628).
https://bugs.winehq.org/show_bug.cgi?id=47123
--- Comment #16 from rw74 luca_pi@yahoo.it --- it is working, great job! :)
<23:44:32> Input initialization <23:44:34> - Connected joystick0: Thustmaster Joystick - HOTAS Warthog (event) {0402044F-0000-0000-0000-504944564944} <23:44:34> - Connected joystick1: www.vkb-sim.pro www.forum.vkb-sim.pro �� Alex Oz 2012-2017 VKBsim Black Box (event) {011F231D-0000-0000-0000-504944564944} <23:44:34> Initializing Animation System
https://bugs.winehq.org/show_bug.cgi?id=47123
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Staged patchset| |https://github.com/wine-sta | |ging/wine-staging/tree/mast | |er/patches/dinput-joy-direc | |tX3 Ever confirmed|0 |1 Keywords| |patch Status|UNCONFIRMED |STAGED
https://bugs.winehq.org/show_bug.cgi?id=47123
--- Comment #17 from Andrew Eikum aeikum@codeweavers.com --- Great, thanks again for reporting and testing. I'll send it upstream.
(BTW it's really funny to me that someone typo'd "Thustmaster". I wonder where that typo lives and if we could fix it. I didn't see it in the kernel source or in systemd source.)
https://bugs.winehq.org/show_bug.cgi?id=47123
--- Comment #18 from rw74 luca_pi@yahoo.it --- could be in the controller? I would love to find the way to change it, mostly to change the VKB one that is insanely long.
https://bugs.winehq.org/show_bug.cgi?id=47123
Andrew Eikum aeikum@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|STAGED |RESOLVED Fixed by SHA1| |ae849579161cb14aae0f71a6456 | |3ade1bc74c847 Resolution|--- |FIXED
--- Comment #19 from Andrew Eikum aeikum@codeweavers.com --- This is upstreamed now.
commit ae849579161cb14aae0f71a64563ade1bc74c847 Author: Andrew Eikum aeikum@codeweavers.com Date: Tue May 7 08:59:38 2019 -0500
dinput: Use heuristics to guess if a device is a gamepad or a joystick.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47123 Signed-off-by: Andrew Eikum aeikum@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
https://bugs.winehq.org/show_bug.cgi?id=47123
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #20 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 4.8.