Frogging-Family / wine-tkg-git

The wine-tkg build systems, to create custom Wine and Proton builds
883 stars 159 forks source link

No controller recognized for some games when _sdl_joy_support is on. #454

Closed CartoonFan closed 3 years ago

CartoonFan commented 3 years ago

Hey there, everyone. In light of the recent changes from 3979b1902ed218b209bbd215e643b035b5c9f2d8, I decided to try some games with it on to see if there were any improvements. However, I ran into a weird issue where some games will not recognize my controller if _sdl_joy_support is enabled. I used the list of games from https://github.com/Frogging-Family/wine-tkg-git/issues/386 to test the behavior. Also, for other (maybe helpful) info: Steam Input is off, the proton-tkg version is proton_tkg_6.12.1.r4.g092f3b1e, the controller is an 8bitdo Pro 2 controller, and I tested with steam-native. Thanks!

Doesn't work with SDL:

Works with SDL:

Tk-Glitch commented 3 years ago

Yeah I have noticed it as well. Since it seems to be required for wheels I'll just disable it by default as it should affect the most users, and add a note regarding wheels in the comment.

CartoonFan commented 3 years ago

Thanks for the prompt reply! It's unfortunate that it was a source of issues, but I'm glad you caught it.

logos128 commented 3 years ago

Maybe this is the best solution for now. I didn't have a controller to test it properly, so it is tested thoroughly only with a FFB steering wheel and various other "hid" devices (pedals, H-shifter, etc., some of which require user-space HIDRAW access).

For FFB wheels it fixes the issue with some games sending FFB commands on the Y axis, while the steering wheels support FFB only on the X axis. The result is no FFB on linux, since the FFB wheels are treated as joysticks on linux (i.e. if the driver sees FFB commands on an unavailable axis, it just mutes it). There is no such problems on Windows, since the drivers translate all the FFB commands to the only available X axis for FFB wheels. This issue is fixed on wine (dinput) level by this patchset. It affects Project Cars 2/3, Automobilista 2, etc. The patchset also fixes some other issues with Codemasters games and SMS games.

Another big advantage with this patchset is that it properly handles user-space HIDRAW access (for the devices that allow it). This is particularly useful for all kinds of devices (rev leds, led panels, etc.), which can be controlled directly from the user-space Windows (wine) apps/games (through HidP and HidD calls), without any kernel drivers.

To do such thing on upstream wine, first their SDL implementation should be disabled through the registry, since it doesn't support hidraw access. Then the linuxinput should be disabled as well, since it doesn't prioritize hidraw access properly (this worked fine around wine 5.x IMO, but then something was changed which broke it). With linuxinput disabled, though, all devices without user-space hidraw access aren't available, so it's basically not usable. One can use a wine prefix with linuxinput disabled just for the controlling app, but when the games directly use HidP, HidD calls you just need both linuxinput and hidraw working for everything to function properly. This is solved nicely by this patchset which implements both SDL and hidraw. IIRC Valve is using hidraw direct access for some controllers (Nintendo maybe).

@CartoonFan did you try with Steam input on. As far as I know this is one of the features the patchset implements, so maybe this could improve compatibility. Upstream have changed a lot of things in dinput and xinput between 6.9 and 6.11, so probably Valve will have to catch-up for everything to function properly again. :)

CartoonFan commented 3 years ago

@logos128 I briefly tried Steam input with it, but the controller still wasn't recognized, IIRC. I can give it another try, though, if you think it might work.

CartoonFan commented 3 years ago

@logos128 Hmm, it seems that Steam input is still a bigger input blocker than SDL. For example, Mega Man Legacy Collection works with SDL, but not with Steam input (even when both are enabled). Conversely, games that do not work with SDL will not work with Steam input enabled, so it really only brings out the weaknesses of both😄. I tested with and without the Steam runtime, if that makes a difference.

logos128 commented 3 years ago

Seems we'll have to wait for Valve to catch-up. Anyway, if the upstream controller support is good enough, there is no point to use proton's version.

Would be good if proton's devs decide to push their joystick sdl implementation (without the steam specifics) to upstream, since it's much more complete and more thoroughly tested with all kinds of devices.