Retroarch not recognizing simultaneous button presses

It should be

It’s interesting that the problem is specific to Android. If I use my 8bitdo controller with the Linux build of RetroArch, it works flawlessly. As the OP noted there are other Android apps that don’t suffer from this issue such as MAME.

My JXD arrived (flashed it with the official 4.4.4 Kitkat ROM) and it’s the same as the GPD. It would be great to see this fixed. It’s mostly beat-'em-ups that require simultaneous button presses, e.g. Tekken, Final Fight, Streets of Rage, TMNT, Double Dragon…

I confirm this issue using Nvidia Shield Portable with Kitkat. The bug is present in all cores and makes most emulators pretty much unusable on Android, especially with fighting games. The bug prevents the system from recognizing two button presses at the “same time,” Golden Axe Genesis A+B is a good test. The Android polling code must have a slight delay between recognizing button 1 and button 2 “down” action, maybe there is one frame lag or something. I can certainly hold jump and then press attack and that gives the expected “slash while jumping” action, but the overhead slash does not work.

The code is here:

I think the bug is probably in the functions

android_input_poll_event_type_key, android_input_poll, or android_input_poll_input (sic)

or maybe in one of the functions below those last two.

I cannot see anything wrong immediately, comparing to a much older version of this. But quite a bit of complexity has been added over the versions, and maybe some delay was introduced due to the handling of all these events that causes button presses that happen “almost” simultaneously to be recognized with a few frames delay between them in current versions of Retroarch android?

The fact that it works with touch events seems to speak against this hypotheses.

Also, the fact that it works on Xperia means that the bug does not happen when the two buttons are on different controller IDs (the Xperia hack simply combines two controller IDs into one). This should help, but I cannot see where that distinction comes into play during the pollAll loop really.

Man sounds serious, this bug makes a ton of games unplayable hope they find what is the problem.

Guys is this bug present in 1.3.2?

yes it is. we still haven’t figured out why it’s happening, and until we do, we can’t really fix it.

I added some logging to my local copy of the Android input code and can see all presses being registered (it’s not like pressing two at once masks one of them) so it appears to be a timing issue of some sort. I’m currently not sure if it’s just that they’re not registering close-enough together in time for the emulator to realize that two presses are occurring at essentially the same time (the logcat messages indicate this may be the case, but I don’t know how accurate those are) or if perhaps this is some sort of odd race condition that could be occurring or the like. I’ll continue investigating tonight once I’ve got access to my Shield TV. :slight_smile:

When I swapped out the stock kernel for the Faux123 kernel on my Nexus tablet, it fixed the issue… (Don’t know if that helps, maybe you can compare the two and see what’s different)

Just the sort of thing I don’t think we want to hear since I’d hope kernel parameters and tuning wouldn’t affect this sort of thing. :confused: Since it seems other Android emulators don’t have this problem (though before I kill myself with trying to debug this more I suppose I’ll verify that by installing MD.emu or the like on my Shield TV :p) and even (much) older versions of Retroarch apparently didn’t, I’m still hopeful we can find a solution for this.

That is great man! keep the good work, hope you find a solution.

I did confirm MD.emu definitely has no problem registering multiple simultaneous button presses (was doing back-attacks in Golden Axe no problem). I’ve made a few changes to the RA Android input code that fix what are likely technically bugs but they don’t seem to cause any undue issues (specifically, RA’s way of ‘dealing’ with predispatched input events - i.e., those that are to be handled by the system instead of the app, seems to be incorrect based on Google’s NDK specifications). That said, this is still looking like a timing issue - multiple simultaneous button presses seem to almost always register a couple frames apart (occasionally separated by one, and very rarely, on the actual same frame). Golden Axe, at least, seems to have a very tight window for this and only is triggering back-attacks when the B & C buttons are in fact detected being pressed on the same frame, hence back-attacks almost never working on it. :wink:

Some good info: Recently I went back to my Archos Gamepad 2 and tried Retroarch 1.3.2 and tested the combo in Golden Axe using the fba core and the genesis core and it worked! Even when using the touchscreen overlays the back attacks worked perfectly. The Archos Gamepad 2 still uses Android 4.2.2 so that may be a clue. Gonna test some fighting games.

Tested Garou and MvsC on the fba core but unlike Golden Axe the simultaneous button presses do not work all the time, they work like 60% of the time which is weird cause it is the same core, tested the fighting games on the stand alone mame4droid and the simultaneous button presses work all the time. Any suggestions on what other games for other cores should I test?

Tested the same fighting games on the MAME git core and the same thing happens so it is not a fba core only issue, touchscreen overlays work perfectly on both cores btw the simultaneous button presses work all the time.

From my testing and what others have said this appears to be solely a physical button issue, and seemingly may be somewhat device-specific as well. Within RA itself, it definitely looks to solely be an input timing issue in RA’s Android input driver, with the RA cores being completely separate from this.

Any games that may happen to have looser timing requirements for simultaneous presses (i.e., two separate presses within, say, 3 frames - i.e., 50 ms of one another being treated as simultaneous) may work relatively OK with this issue present anyway but of course many games didn’t do that since that necessarily creates slight input lag. Given that fighting and brawler games (where extremely responsive controls are needed) are among the most common for such button combinations, it’s not surprising that most of them are very demanding in needing you to press all buttons at exactly the same time. :slight_smile:

Link to the github issue for anyone interested:

Has anyone tried changing the joypad driver to hid? Or messing with the input settings too see if it makes any difference?

I haven’t tried the different driver (if it works at all, it’s possible but unlikely it may solve this, but is still definitely worth investigating) but I did try the different input poll type settings (early / normal / late), which made no difference.

Any fix yet? It’s pretty incosistent for me as simultaneous button presses seems to work about 1 in 20 attempts for me (testing on Tekken 3).

Hi man any news on this? Did you tested it?