Retroarch not recognizing simultaneous button presses

Literally a one-bit fix (changing a single character from 0x30 (‘0’) to 0x31 (‘1’) for what seems like is a bug in the Android NDK. :stuck_out_tongue: Whatever works I guess. It definitely solves this from my testing though. :slight_smile:

It works perfectly now! Tested fighting games and the simultaneous button presses work all the time! Big thanks to diablo, good job man! Guys report if you find any bugs.

Working for me too. I tested with PCSX Rearmed and Genesis Plus GX and inputs work great. I still have an odd input isue with the PSX core where the up input is unresponsive on the right analog (and the default setting is inverted for Moga Hero Power).

That’s great! I hope we don’t discover any issues with the fix these next few days.

I know that the fix does change one thing if you are using an Nvidia Shield TV and the Shield controller: Clicking the NVIDIA button on the controller will not go back into the RetroArch menu at the moment. The autoconfig for NVIDIA_SHIELD_Gamepad.cfg needs to be updated and the keycode for the menu button needs to be changed from 84 to 203. If we don’t see any issues with the fix the next couple of days I’ll submit a pull request for this change - unless someone beats me to it :slight_smile:

Fantastic news, great work diablodiab. I will install the nightly and test all of my devices later today.

Just to clarify, the Moga right analog mapping issue was there before the fix. I deleted aFBA and started using Retroarch for FBA again since it runs so much better in Retroarch. Thanks for the fix!

Edit: I noticed in a couple games with analog controls in FBA like Galaxy Force II and Space Harrier, the dpad inputs are acting weird, with both the touch inputs and external controllers.

Edit: After trying the games in the Windows FBA, it seems the input issue is a FBA input mapping issue rather than an issue with Retroarch.

Back attacks in Golden Axe working perfectly now. I’m assuming this fix will have made it into the v1.3.4 release? I’ll try it later today if I can.

Yes it should be part of the latest release.

Working perfectly so far, no bugs found. I am curious as to how changing just one single value fixed the bug. Anyone knows?

The fix is more of a workaround for a bug that must be in the Android NDK.

By changing the value, the call to ALooper_pollAll was changed from a non-blocking call to a short 1 ms blocking call (0 = nonblocking call, 1 = 1ms blocking call).

It really should be enough to use a non-blocking call to check for queued events which would then be available for handling in the inputQueue. But for some reason this would only lead to one input event being added to the inputQueue despite there being more available. Changing it to a short blocking call solved this problem. I’m not sure why it was necessary - that’s why I’m thinking it might be a bug in the NDK. The bug was found by narrowing it down to that function call after debugging the code surrounding that call.

Fantastic find, thank you again. I believe this fix may be more significant than making a handful of fighting games playable.

I have a Belkin Bluetooth keyboard that never worked very well as a controller with the Android version of RetroArch. Certain button combinations wouldn’t register, keys got “stuck on” frequently and I gave up trying to play Super Mario Brothers and such. It worked much better with other emus and with RetroArch when paired with a PC.

Since this fix was implemented, it’s working perfectly.

Hi!

Today I updated to the latest nightly build (also tried latest stable) on my Shield TV running on the latest firmware. Unfortunately neither keycode 84 nor 203 works for me to bring up the RetroArch menu although KeyEvent Display confirms that my Shield controller returns keycode 84 on pressing the Nvidia button.

[QUOTE=Frufo;38840]Hi!

Today I updated to the latest nightly build (also tried latest stable) on my Shield TV running on the latest firmware. Unfortunately neither keycode 84 nor 203 works for me to bring up the RetroArch menu although KeyEvent Display confirms that my Shield controller returns keycode 84 on pressing the Nvidia button.[/QUOTE] Try holding the Nvidia button down for a second. Does this make a difference?

You are a mighty wizard! Holding the button works with keycode 203. :slight_smile:

Incidently I found the thread where I first encountered this input bug, back in 2014:

http://libretro.com/forums/showthread.php?t=1685&p=17301&viewfull=1#post17301

I neglected to mention which specific version I was running (d’oh!) but that’s not to say it was introduced in that version, just the first time I hit it since the JXD was my first Android device with physical controls.

Sorry for bumping an older thread but I’m having an issue where games won’t recognize when I press X+A or Y+B simultaneously on my Xbox series controller connected to Android via bluetooth. Other button combos seem to work fine, such as A+B or X+Y. I’ve tested this on the Flycast core. I don’t have this problem with other apps, just retroarch.

1 Like

There is an android-only input setting that will hold onto the inputs to try and make them register on the same frame. I can’t remember the name of it and since I don’t have any android devices on me, I can’t look it up for you.

I found it, “Input Block Timeout” under Latency in the settings menu. I set this to the max setting and it fixed the issue. Thanks!

nice! sorry I couldn’t be more helpful on tracking it down lol. I’m glad you found it.

It will hold onto your inputs for as long as it’s set, so if your inputs start feeling unresponsive, try dialing it back some. You’ll want it as low as possible while still being reasonably easy to hit them simultaneously.

Thanks for this. Was having this same problem on Android.