Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple emulators crash on mouse click if using an overlay. #8326

Closed
MrLightgun opened this issue Feb 20, 2019 · 17 comments
Closed

Multiple emulators crash on mouse click if using an overlay. #8326

MrLightgun opened this issue Feb 20, 2019 · 17 comments
Labels
bisected Issues which have been bisected to a specific commit or change. bug: minor bug : osd bug: udev

Comments

@MrLightgun
Copy link

Description

If you load an overlay using standard functionality in RetroArch and have a mouse attached. When you perform a mouse click the emulator core completely freezes and requires a reset. This happens across multiple cores.

I suspect this is in a bug to do with touchscreen controls that use an overlay, otherwise the 2 bits of functionality are very unrelated. Please note this bug occurs just using a normal overlay image/bezel, it doesn't require any touchscreen controls to be added.

Expected behavior

The emulator should not crash and the mouse should function as it would if there was no overlay loaded.

Actual behavior

On any mouse click the emulator is completely freezing / crashing requiring a reset.

Steps to reproduce the bug

This happens on a Raspberry Pi using RetroPie however I believe it is a Libretro bug.

  1. Connect mouse.
  2. Start system
  3. Load a core such a LR-FCEUMM,LR-PCSX-REARMED,LR-SNES9X
  4. Add an overlay image of any type.
  5. Click a Mouse button
  6. Core immediately freezes

Bisect Results

[Try to bisect and tell us when this started happening]

This thread on the issues says it is happening at least as far back as 1.7.2. I would suspect it is a very long standing issue.
https://retropie.org.uk/forum/topic/16926/retroarch-cores-crash-on-trigger-press-mouse-click-with-overlay-active

Version/Commit

You can find this information under Information/System Information

1.7.2 up until the latest release.

Environment information

  • OS: Raspberry Pi / RetroPie - V4.4 but also occured on the Odroid XU4 using the ORA RetroPie release.

Thank you to anyone that takes the time to look at this bug. Kind regards.

@orbea
Copy link
Contributor

orbea commented Feb 21, 2019

I tried with pcsx-rearmed and while it did not crash here, RetroArch and the core both freeze upon clicking the left mouse button when an overlay is enabled.

@orbea
Copy link
Contributor

orbea commented Feb 21, 2019

This broke between v1.6.0 and v1.6.1 where before it did not freeze and it was possible to control a core by clicking a gamepad overlay.

I bisected this to where the freezes started.

11559f294af0a479c497ca0c6416059cd35bd0aa is the first bad commit
commit 11559f294af0a479c497ca0c6416059cd35bd0aa
Author: Zoran Vuckovic <casdevel@gmail.com>
Date:   Fri Jun 2 07:57:07 2017 +0200

    Add multiple mice support to udev driver

:040000 040000 b0917a7cbb14d5bc0e4a68e345b1465979ef7044 101b76b68f34f247dd9c2eccd781e8f4066a057e M	input

11559f2

This also broke in an earlier commit where all mouse clicks on the psx gamepad overlay are registered as L2 instead of the correct button like before.

2056ebc80378fabf1f96883de3c7c930c809d101 is the first bad commit
commit 2056ebc80378fabf1f96883de3c7c930c809d101
Author: Zoran Vuckovic <casdevel@gmail.com>
Date:   Fri Jun 2 01:08:28 2017 +0200

    Allow udev input to be used with X11 context

:040000 040000 73351e8a90dbd19dc573b1ae9e57304fda761f98 162cbac6462954d191373fbf0ba14ad0456cb1d8 M	gfx

2056ebc

I next confirmed that his is only a problem with the udev input driver and I was not able to reproduce any issues with the x, SDL2 or linuxraw input drivers where clicking the gamepad overlay worked as expected.

@MrLightgun What input driver are you using?

@orbea
Copy link
Contributor

orbea commented Feb 21, 2019

@casdevel Can you please take a look at this issue? Any help would be appreciated!

I was able to reproduce this with both snes9x-libretro and pcsx-rearmed.

@orbea orbea added bug: udev bisected Issues which have been bisected to a specific commit or change. labels Feb 21, 2019
@MrLightgun
Copy link
Author

MrLightgun commented Feb 21, 2019

Hi @orbea , thank you for your time, I'm using udev input driver.

@orbea
Copy link
Contributor

orbea commented Feb 26, 2019

I tried all three patches which all solve the freeze, but the 2nd and 3rd have an issue where mouse clicks are registered just by moving the mouse and not when clicking. This is undesirable with a gamepad overlay. The first patch doesn't have this problem, but the buttons seem misaligned with the overlay and clicking the correct button is hard or impossible. This seems to be a step in the right direction. :)

Thanks for taking the time to help!

@ghost
Copy link

ghost commented Feb 26, 2019

Someone who is familiar with overlay code should check this loop:

for (i = 0;

It looks like incorrect usage of the "input_driver::input_state" function on line
input_ptr->input_state(input_data, joypad_info,

@ghost
Copy link

ghost commented Feb 27, 2019

@orbea try again https://github.com/casdevel/RetroArch/tree/i8326. Note that link is the same but code is different.

@orbea
Copy link
Contributor

orbea commented Feb 27, 2019

@casdevel I tried it again, it seems slightly better when I can sometimes click the correct button, but its still misaligned with others. Take the psx gamepad overly for example with snes9x.

@MrLightgun
Copy link
Author

Hi Both @orbea and @casdevel , thank you very much for your efforts, I haven't previously compiled Retroarch from code so I need to get the hang of that before I can test your fixes. @orbea what platform are you testing the fixes on? Do you think I need a full Linux PC or will I be able to do it on the Raspberry Pi?

@orbea
Copy link
Contributor

orbea commented Feb 27, 2019

@MrLightgun I'm testing with destop linux, I don't think this issue is specific to arm, just the udev input driver.

@ghost
Copy link

ghost commented Feb 28, 2019

Pointer misalignment is udev driver issue and is not overlay specific. Crash/freeze is not udev driver issue but can be fixed in driver code.

I still think that this should be fixed in overlay code.

@MrLightgun
Copy link
Author

@casdevel do you see any possible negatives with your fix other than it's a defensive work around? @orbea were you completely unable to click on the overlay buttons before and now you can? Can we promote this defensive fix and I'll raise a different issue about the misalignment if I can replicate? Thank you both

@orbea
Copy link
Contributor

orbea commented Feb 28, 2019

I still think that this should be fixed in overlay code.

Agreed, I wish I could help more though...

@ghost
Copy link

ghost commented Feb 28, 2019

OK, my mistake, I completely forgot about multi-touch. This is an udev driver issue after all. My last commit is still OK, I'm just gonna add comment about multi-touch and make a pull request.

@MrLightgun you may open a new issue about pointer misalignment. In the meantime you may try some other input driver.

inactive123 added a commit that referenced this issue Feb 28, 2019
@MrLightgun
Copy link
Author

Fantastic thank you both, much appreciated.

@hizzlekizzle
Copy link
Contributor

I take it this is resolved, so I'm going to close the issue. If not and I'm misunderstanding, feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bisected Issues which have been bisected to a specific commit or change. bug: minor bug : osd bug: udev
Projects
None yet
Development

No branches or pull requests

3 participants