Xperia Play: can't get to menu/SNES performance/core specific binds

Okay, I have a few questions/problems.

I’m running RetroArch on an Xperia Play running latest stable CyanogenMod.

First thing is that the circle button on the Play is actually the back button, so if I have it bound, which it is in the Autodetect settings btw, I can’t exit a game and get back to the menu. The only way I can change settings or game is by fully rebooting the phone. Most emulators I’ve used have the Menu button take you to the menu.(makes a lot of sense doesn’t it?) Is there any way around this besides custom binds without circle/back bound, which I’m already doing?

Second is why does the SNES core not seem to run fullspeed on this? SHOULD it on Xperia Play? Could it be a refresh rate problem even though I don’t have stuttering on other systems? Maybe I could try to overclock? The reason I’m asking instead of just assuming the worst is because I can run Snes9x EX+ fullspeed no problem, and it’s the same core. Isn’t it?

Last is more of a feature suggestion than anything I guess, but there should really be a way to have keybinds on a per system basis. I like to have A/B on the Down/Left buttons for Game Boy, but obviously would rather have it laid out like SNES for other things (like SNES).

Thanks for any help.

Oh trust me, it makes a lot of ‘sense’. What doesn’t make a lot of ‘sense’, though, is the way Sony implemented this thing - at all.

Is there any way around this besides custom binds without circle/back bound, which I’m already doing?

Xperia Play’s controls are quite crappy in that it’s actually two or three separate devices ‘duct-taped’ together to act as ‘one input device’ -they really implemented it in the most crappy way possible. Basically it is a huge headache for us to even ensure that it works at all and without a proper ‘unit’ to test it on, any revision we make to the controls has the potential to remove one of the ‘hacks’ we have to put in to get every single button working on that thing.

Overall it was better if the Xperia Play had never existed so we wouldn’t have to put in all these hacks in the first place.

Second is why does the SNES core not seem to run fullspeed on this? SHOULD it on Xperia Play? Could it be a refresh rate problem even though I don’t have stuttering on other systems? Maybe I could try to overclock? The reason I’m asking instead of just assuming the worst is because I can run Snes9x EX+ fullspeed no problem, and it’s the same core. Isn’t it?

SNES9x Ex+ uses frameskipping - it’s turned on by default so you likely have it turned on without even noticing it (you can try setting it to Frameskip 0 and see how well it performs then - I think it will audio crackle from time to time - at least that is what I experienced with even the SNES9x 1.43-based SNES9x EX). If something has to ‘frameskip’ above 0, it is NOT running fullspeed, period.

RetroArch has no frameskip option and probably never will - if you don’t bring the adequate hardware to the table then and if the port starts dropping below 60fps then you’ll instantly notice it by audio stuttering.

Unfortunately Android is just a crap operating system from a real-time performance perspective so you get terrible performance compared to Blackberry QNX or Apple iOS. This is aggravated by whatever vendor’s specific firmware you might happen to be using and the ‘refresh rate’ of your screen and/or reported value.

That and the fact that Xperia Play in general are quite weak phones by now, factor in that even the tiniest ‘background service’ can potentially ruin performance (anything from a weather app to Google Play services itself that kick in the Java garbage collector - you can check if this is the case by checking out the log with stderr/stdout redirected), and there really is no telling what might be affecting performance for you on your particular device - too many external variables that are unrelated to RetroArch.

You might want to try again with threaded video when that is implemented (should be in the next version), but really, most of the time when something is running below par, it’s either your hardware, your particular software configuration or your firmware to blame for it. Just throwing frameskip in like Broglia does and calling it a day is not something we are particularly interested in. He never did any meaningful optimizations to SNES9x (AFAIK) so there is nothing even there that I’d want to take notes from - it is a bogstand port, nothing special, nothing fancy.

And it isn’t really our problem that your average quad-core Android phone can’t even manage to perform on par with a Nintendo Wii - that is the fault of Google that designed this OS to begin with and made it so woefully slow/underperforming.

Nearly ALL of the SNES games on SNES9x Next run at fullspeed on a Nintendo Wii of all things (including games that Nintendo couldn’t even manage to run on Virtual Console, such as Star Fox 1). If your Android phone can’t manage to do the same, then the obvious conclusion is that its runtime performance (in combination with this OS) is below that of even a Nintendo Wii. Sometimes the truth hurts and sometimes it really isn’t ‘our fault’ and things are running below user expectations due to a number of factors which are outside our control as ‘userland’-space programmers.

Are you running CM 7.2 or 9.1? I wouldn’t bother with CM 9 on the Xperia Play because the video performance is just horrible. To quote the developer of Snes9x EX+ “Qualcomm totally messed up the Android 4.0 drivers for the chip used on this phone”. CM 7.2 is much better for emulators.

This is a Cyanogenmod thing, which the stock ROM does not suffer from. If I were you, I would revert to the stock ROM, root it and remove the SEMC bloat with Titanium Backup or similar. There are just too many problems with CM on the Play in my experience. All the issues you mention plus random FCs, greatly reduced battery life…

Yes, easily. PCSX ReARMed runs at full speed on mine, better than the PlayStation Pocket app that came with it. Considering Squarepusher’s note about Starfox on Wii, it just shows how good RetroArch really is.

Well okay then. That makes sense. Thanks for the thought out reply.

Anyway, why not just make the menu button go to the menu? What’s wrong with that?

Edit: I had the reply window open for a while and didn’t see Modeler’s reply.

Yeah, it’s CM9.1.0. I was actually thinking about going back to stock, but wasn’t really considering it. I knew ICS had worse performance, but I didn’t think it would be anything so huge. I think I might actually try it out now. Thanks.

We are in the process of adding an ingame menu that is not dependent on overlays. We could ‘theoretically’ bind any button to that ingame menu then.

The problem with Xperia Play is that we have no device to test it on - so somebody with an Xperia Play needs to come online on IRC (#retroarch and freenode) so that he can perform some tests for us - that is the only way a fix will be reached. This is the same way we managed to implement workable Xperia Play controls in the first place.

Due to the fact that the ‘Zeus pad’ is split up into three separate devices (and also due to the fact that some of the ‘keycodes’ overlap with each other) means it is not as easy adding keycodes as it is with other devices and requires hands-on testing to make sure we got it right the first time.

well, the stock rom does suffer of the same problem, and as stated by squarepusher, controls were perfect on r11, and issue of circle/back key came back in r12. with my constatations, playing snes on xplay isn t bad except some roms. first you have to give the good refresh rate, AND THE GOOD ROM; what i want to say is that if you play [E] rom with refresh rate at 58.85, most games will play good (if you have stopped wifi and services running in background). but there is good chances that you play with [Us] roms, because they play with no problems on broglias emus (the [E] roms on broglias run too fast with audio and videos issues). hope it helps when can i go on irc to help?

I would be happy to help out. Never used IRC chat before though, so you might have to bear with me. Anything I can test in the meantime or would we need to go through it step-by-step?

Cheers.

If you don’t plan on using IRC extensively in the future, I recommend just hopping on Freenode’s web IRC applet: http://webchat.freenode.net/

Just give yourself a nickname, put ‘#retroarch’ in the blank labeled ‘channels’ and solve the captcha and you should be all set.

If you happen to need another Xperia Play user, I’d be more than happy to help. I have an additional bug or error that I wish to file as well.

This is a Cyanogenmod thing, which the stock ROM does not suffer from.[/quote]

I retract this statement. You’re right, the circle and back buttons are both mapped to Pad 0: 4 even when using the stock ROM. Sorry for the confusion.

The way to distinguish between whether the circle or back button is being pressed is to check for the ALT modifier.

There is a similar issue here that even lists a useful code snippet: http://code.google.com/p/imame4all/issues/detail?id=203 (it also links to the sonymobile developer instuctions developer.sonymobile.com/2011/02/13/xperia-play-game-keys)

In order to differentiate between the Circle button and the Back key, which use the same key code, the developer needs to check whether or not the ALT button is enabled or disabled. When the Circle button is pressed, ALT is enabled; when the Back key is pressed, ALT is disabled.

Here is the code snippet:

public boolean onKeyDown(int keyCode, KeyEvent event) {

if (keyCode == KeyEvent.KEYCODE_BACK) { // Remember both circle and back key provide same keycode

if(!event.isAltPressed()) { //check alt to differentiate between BACK and CIRCLE

//Do something (May be quit the game) Log.i(“Back Key pressed”, “You pressed BACK key”);

}else {

//Do something else in the game Log.i(“Circle Key pressed”, “You pressed CIRCLE key”);

}

return false;

}

return super.onKeyDown(keyCode, event);

}

Any chance of getting this implemented to distinguish the back from the circle key or is there a fix for this? (currently it seems they both function the same - as one of the controller buttons, meaning I can’t use back to go back)

~Troop

http://forum.themaister.net/viewtopic.php?pid=3185#p3185