batocera-linux / batocera.linux

batocera.linux
https://batocera.org
Other
1.96k stars 513 forks source link

[v37][Controllers with no analog sticks] Windows games key ghosting (not happening in v36) #9131

Open gsrodelgo opened 1 year ago

gsrodelgo commented 1 year ago

Hi, I was excited about v37 because of ligth guns support for PCSX2, two players support for supermodel and many new things, but my surprise has been that all my windows games now has key ghosting, if you press one direction, that direction is repeated indefinetly so menu options are moving like crazy and it is not playable at all.

All my windows setup is working perfectly fine in v36 without the described problem. I have rolledback to v36 because of that, but I would like to move forward. Has anyone any advice or workaround?

My guess is that the upgraded proton version has any problem with my arcade sticks controllers (Dragonrise zerodelay). So probably in new versions this is not happening but in the meantime... any suggestions?

Thank you very much!

dmanlfc commented 1 year ago

i updated proton in v38 - https://drive.google.com/drive/folders/1_bqmR7CoZ78i7DolYt5b-RRqB5c-LPyN?usp=drive_link

you may want to test to see if it's resolved otherwise you need to report this to the proton devs - https://github.com/ValveSoftware/wine

Biomecanoid commented 1 year ago

Do you have a similar issue in also in DosBox ? key ghosting or keys not working at all ? I am asking cause I do

gsrodelgo commented 1 year ago

@dmanlfc Thank you! But I have tried to flash a pen drive with the image to test but it does not boot, maybe I have made some mistake. When is this change going to be present on dev branch to update via ES?. The last dev build is from 24/06 so I suppose it does not come with your change of proton at all.

@Biomecanoid I dont use Dosbox in my system so I cannot confirm that. I only have key ghosting on proton, not in mame or any other emulators I have on my system

dmanlfc commented 1 year ago

@gsrodelgo you need to upgrade or if booting off the USB, disconnect the internal HDD.

gsrodelgo commented 1 year ago

@dmanlfc ok, let me try. I will report back, thank you!

gsrodelgo commented 1 year ago

@dmanlfc finally I have been able to test your dev image unpluging the hdd and expanding de data partition on usb stick. But unfortunately the problem is not solved with this version of proton.

Let me share a video with the results. That is what happens after hitting right direction once.

Maybe is not related with proton version and there are more changes on v37 that can make this happen? Drivers, or whatever? Something related to windows games because its not happening on other emulators of my system.

Thank you for your support!

https://github.com/batocera-linux/batocera.linux/assets/61735565/4ce7d629-8ab2-4b08-be07-37ddb60ebdc2

dmanlfc commented 1 year ago

I've seen this before it's a wine stack regression. You have to report it upstream as previously suggested.

gsrodelgo commented 1 year ago

What would be great to have in batocera is an ES option for windows games to choose from a variety of wine proton and lutris versions. So in my actual situation I could change the proton version and test with different versions, for example the last well working shiped with batocera 36, the last dev branch, the ge version, etc...

How that sounds? Is it technically possible?

By the way this is the issue opened on proton repo: https://github.com/ValveSoftware/wine/issues/193

gsrodelgo commented 1 year ago

Ok so I have hot news with this... I had and old ssd with batocera 35 so I have put it on my arcade machine and updated to batocera 37. And you know what? there are no key ghosting. So there is no proton bug. It is something related to batocera. Im thinking about any configuration introduced in batocera 36 or some custom configuration of mine or something bios related. In this ssd I have the v35 bios pack and not v37.

I want to test the following:

  1. Update bios pack to see if this has any effect (I suppose it will not).
  2. Downgrade to v35 and update to v37 from there?
  3. Search for differences in configurations that I could have done along the way...

@dmanlfc any thoughs?

gsrodelgo commented 1 year ago

Hi again, finally I went for the point three of my last post. I have upgraded my system to v37 and key ghosting was there but after doing a factory reset (mv system system.old) and reboot, there were no key ghosting.

Slowly I have added my old mame configs, batocera.conf, and no key ghosting. But continuing the process I have seen that wii light gun games were not working with my sindens. So I have unpluged and plugend my sinden guns again and calibrated holding left direction on gun pad. And after that I have tested hotd3 on wii and worked perfectly. And after that went to windows game again to test if works but BOOM key ghosting there again.

And now no matter what (unplug sinden or whatever) key ghosting continues. Maybe after calibrating there are some new cfg file somewhere.

Does this give you any clues on how to address the problem?. I think I need some help from batocera devs to understand what is happening here.

Thank you!

dmanlfc commented 1 year ago

@nadenislamarre

gsrodelgo commented 1 year ago

Hello, I have continue my research and found something. It seems that the problem is generated in configs/emulationstation/es_input.cfg, and is not related in any way with sinden light guns. Let me share my last procedure:

ssh root@ip /etc/init.d/S31emulationstation stop cd emulationstation rm es_input.cfg es_last_input.cfg reboot

After that pluged the sinden lightguns, everything recognized by default. Arcade sticks works in menus and in windows games without key ghosting. Also sinden lightguns without calibration worked like a charm in wii emulator as before.

But (and here is the thing), when I try to play a mame (libretro mame) game there is no direction (I have the option to map snes pad enabled in mame menu, I dont know if this is relevant or not). So I exit the game and go in emulation station to main menu -> controller and bluetooth settings -> controller mapping and then map the dragonrise controller arcade stick.

Now mame works as expected but surprise, key ghosting in windows games are there again.

My next step is to get es_input.cfg file before controller mapping and after and make a diff to see what the fuck is changing that is breaking windows games.

gsrodelgo commented 1 year ago

Here is the diff on es_input.cfg

Before controller mapping: (no key ghosting in windows games, but libretro:mame directions dont work). I want to point out that mame is not working in this case because I have mame config enabled true, because I usually map keys with mame menu in batocera 36. Deactivating this option, this configuration without manual mapping works.

<inputConfig type="joystick" deviceName="DragonRise Inc.   Generic   USB  Joystick  " deviceGUID="03000000790000000600000010010000">
        <input name="a" type="button" id="1" value="1" code="289" />
        <input name="b" type="button" id="2" value="1" code="290" />
        <input name="down" type="hat" id="0" value="4" code="16" />
        <input name="hotkey" type="button" id="10" value="1" code="298" />
        <input name="joystick1left" type="axis" id="0" value="-1" code="0" />
        <input name="joystick1up" type="axis" id="1" value="-1" code="1" />
        <input name="joystick2left" type="axis" id="3" value="-1" code="3" />
        <input name="joystick2up" type="axis" id="4" value="-1" code="5" />
        <input name="l2" type="button" id="6" value="1" code="294" />
        <input name="l3" type="button" id="10" value="1" code="298" />
        <input name="left" type="hat" id="0" value="8" code="16" />
        <input name="pagedown" type="button" id="5" value="1" code="293" />
        <input name="pageup" type="button" id="4" value="1" code="292" />
        <input name="r2" type="button" id="7" value="1" code="295" />
        <input name="r3" type="button" id="11" value="1" code="299" />
        <input name="right" type="hat" id="0" value="2" code="16" />
        <input name="select" type="button" id="8" value="1" code="296" />
        <input name="start" type="button" id="9" value="1" code="297" />
        <input name="up" type="hat" id="0" value="1" code="16" />
        <input name="x" type="button" id="0" value="1" code="288" />
        <input name="y" type="button" id="3" value="1" code="291" />
    </inputConfig>

After controller mapping: (key ghosting in windows games and libretro:mame directions working fine)

    <inputConfig type="joystick" deviceName="DragonRise Inc.   Generic   USB  Joystick  " deviceGUID="03000000790000000600000010010000">
        <input name="a" type="button" id="1" value="1" code="289" />
        <input name="b" type="button" id="2" value="1" code="290" />
        <input name="down" type="axis" id="1" value="1" code="1" />
        <input name="hotkey" type="button" id="8" value="1" code="296" />
        <input name="l2" type="button" id="6" value="1" code="294" />
        <input name="left" type="axis" id="0" value="-1" code="0" />
        <input name="pagedown" type="button" id="5" value="1" code="293" />
        <input name="pageup" type="button" id="4" value="1" code="292" />
        <input name="r2" type="button" id="7" value="1" code="295" />
        <input name="right" type="axis" id="0" value="1" code="0" />
        <input name="select" type="button" id="8" value="1" code="296" />
        <input name="start" type="button" id="9" value="1" code="297" />
        <input name="up" type="axis" id="1" value="-1" code="1" />
        <input name="x" type="button" id="0" value="1" code="288" />
        <input name="y" type="button" id="3" value="1" code="291" />
    </inputConfig>
liberodark commented 1 year ago

Hi, You can probably try to set this :

In Proton v8

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\winebus\DisableHidraw=1
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\winebus\Enable SDL=1

Proton v7 & v8 have some changes also i think your issue is not really proton issue but probably controller issue. You can try to use other controller for test that something like that : https://www.amazon.fr/gp/product/B0882V8R74/ref=ox_sc_saved_image_8?smid=A1X6FK5RDHNB96&psc=1 But when you try other controller you need to remove keyboard & other controller if is possible.

Best Regards

gsrodelgo commented 1 year ago

Hi, I have finally narrowed the problem to its root: controllers with no analog sticks. When you map a controller with only pad directions and no analog sticks then there is key ghosting on windows games. If you dont map the controller and left defaults there is no key ghosting.

I have tested with the following:

So that is the problem, nothing to do with DragonRise or wine I think. Maybe there are some changes in some emulation station script before launching a windows game or whatever. After this analysis I think this is not a hw specific issue so for me its a batocera bug.

Could anyone test this with a controller with no analog sticks and manual mapping on ES controllers configuration screen?

@liberodark thanks for your suggestion, I havent tested it yet but after my analysis do you think that workarround still applies? I persnally prefer to avoid workarrounds and to have this fixed for the next batocera release. But depends on what they think this is a bug or not I could end up needing it.

potatowaffles commented 1 year ago

I have had the same problem - on my arcade machine, no analogue sticks... since upgrading from 36 to 37.

I can work around it by using the version of Wine/Proton from v36 in v37 (I downgrade to 36, copy the entire wine/proton folder, upgrade to 37 etc...) but this isn't ideal. - but maybe this helps work out where the problem is?

potatowaffles commented 1 year ago

only affects directions, not buttons - so feels to me that perhaps it's 'coz there's no analogue stick, instead of doing nothing for analogue stick like it did before, it's acting as if the stick there but with made up/blank information (so always going in one direction diagonally).

dmanlfc commented 1 year ago

@potatowaffles @gsrodelgo I still think this needs reporting upstream.

1 The older version of Wine / Proton apparently works

2 Controllers configs with no analog directional inputs fail which suggests a root cause.

If you can run emulators using Lutris wine bottles like BigPemu & Xenia without ghosting then it points towards a Proton regression.

gsrodelgo commented 1 year ago

@dmanlfc probably you are right, but they already said that do not support running proton outside valve platforms. And I still think that there is something we can do from emulationstation. es_input.cfg seems relevant to me, but I have no knowledge on how to trick proton on start controllers. Whats the difference between axis and hat, Why it works when joystick1left and all analog sticks are defined even if they are not present physically?

Maybe in batocera you can set default fake values or something when directions has axis values and no analog mapped to trick proton or something like that?

Mapping with xinput could be a solution? I have already ordered a new xinput controller to replace zero delay (too laggy), I will post back results when mounted.

potatowaffles commented 1 year ago

sorry forgot to reply to this - yes, definitely seems like the bug is located upstream... but I haven't been able to reproduce it in "actual Steam + Proton" on my PC, so haven't been able to report it.

for the time being I've just mapped my arcade stick to analogue sticks instead of dpad in batocera. this works fine for me. - all other systems (mame etc...) seem to be OK with it like that, and it solves the windows/wine/proton controls.

gsrodelgo commented 1 year ago

Hi, as I mentioned above I have replace zero delay boards with arduino boards. I have mapped A0-A3 pins as Dpad with xinput without analog sticks using digitalReads and everything works perfectly fine, ES, mame, wine... No need to remap controller, because as xinput it is recognized as xbox 360 controller which is already mapped in batocera.

My arcade sticks are based on microswitchs so they only have HIGH and LOW states no analog values so Dpad mapping for me is the way to go.

So for me I have managed to solve this with the use of arduino. But the problem still exists and if you map any controller without analog sticks we have key ghosting on wine games.