{"id":128,"date":"2013-08-07T14:01:05","date_gmt":"2013-08-07T14:01:05","guid":{"rendered":"http:\/\/libretro.wordpress.com\/?p=128"},"modified":"2015-10-18T04:03:24","modified_gmt":"2015-10-18T04:03:24","slug":"retroarch-android-0-9-9-4","status":"publish","type":"post","link":"https:\/\/www.libretro.com\/index.php\/retroarch-android-0-9-9-4\/","title":{"rendered":"RetroArch Android 0.9.9.4"},"content":{"rendered":"<p><strong>By Squarepusher &#8211;<\/strong><\/p>\n<p>Despite this being a point release, a couple of very important changes have been made regarding the Android port, which made me compelled to make this blog post so that I can explain some of the things that have changed.<\/p>\n<p><strong>New cores added<br \/>\n<\/strong><\/p>\n<p>People always love this part \u2013 especially the Xperia Play guys who are ever struggling to hold onto ever-decreasing internal storage on their outdated devices <img decoding=\"async\" alt=\":)\" src=\"https:\/\/s0.wp.com\/wp-includes\/images\/smilies\/icon_smile.gif\" \/> .<\/p>\n<p>First up is a new core\u00a0 \u2013 <em><strong>Picodrive<\/strong><\/em>. This has been closed-source for a fair while because notaz didn\u2019t like guys like certain guys profiting from it through iPhone ports with donation buttons. With libretro and RetroArch now out, there s justifiable reason to open source it again since the payware\/donationware guys are going to be on the run from now on.<\/p>\n<p>Picodrive is a <em>Sega Genesis\/Sega CD\/Sega 32X emulator<\/em> especially optimized for ARM processors. It is the fastest Mega Drive emulator in existence for ARM-based devices like Android and iOS. Best of all, it comes with a 32X core which should run most games at fullspeed even on a weak ARM Cortex A8 CPU. There is only one game that has somewhat higher system requirements (Virtua Fighter 32X). An iPad Mini\/2 runs this game at 56~57fps \u2013 about two FPS shy of fullspeed \u2013 your mileage may vary on how it performs on [insert your device]. It runs fullspeed on the Nvidia Shield though.<\/p>\n<p>What else is new? A <em><strong>Stella<\/strong><\/em> core \u2013 this is an<em> Atari 2600 emulator<\/em>. We already bundled this for the iOS port but I guess we neglected to add it to the Android port up until now. Anyway, here it is.<\/p>\n<p>Anything else besides? <em><strong>SNES9x mainline<\/strong><\/em> \u2013 ie. not the Next speedhacked version. Use this if you have a beefy device and think you can get away with a non-speedhacked version of SNES9x. It runs at fullspeed with all games on the Nvidia Shield \u2013 your mileage may vary on how it performs on your device. This version of SNES9x is more accurate than SNES9x Next- but is also a lot slower.<\/p>\n<p>We also threw in the <em><strong>Desmume<\/strong><\/em> core \u2013 Nintendo DS emulator \u2013 with meancoot\u2019s ARM JIT backend. It runs pretty much the same as the iOS port \u2013 no, it\u2019s not going to be giving that payware closed-source emu Drastic any run for its money and it\u2019s just thrown in for the \u2018ah what the heck\u2019 factor \u2013 its main usefulness as a libretro core is on the PC \u2013 but seeing how fast ARM hardware is catching up with even laptop Core processors, perhaps it will only take another year or two until ARM devices are at the level of a Core i5 \u2013 so we will keep it on life-support until then.<\/p>\n<p>I felt it was also time to throw in <em><strong>Mednafen PSX &#8211;<\/strong> an alternative PlayStation1 emulator<\/em>. Users of the PC version will know this emulator \u2013 it\u2019s one of the most accurate open-source PS1 emus around right now. It\u2019s always been deemed as totally unsuitable for ARM devices since it has such high system requirements \u2013 however, the Nvidia Shield is showing that there is reason for optimism. On Shield it hovers right now between 35 and 40fps with occasional spikes to 44fps. Give it some time with stuff like ARM Cortex A57 coming out and who knows if this will be able to run at fullspeed. So \u2013 it\u2019s included by default from now in anticipation of that.<\/p>\n<p><em><strong>For practical purposes \u2013 it is recommended you keep using PCSX ReARMed<\/strong><\/em>. Don\u2019t complain to me that this core runs too slow.<\/p>\n<p>There is one other core which has been added \u2013 <em><strong>Instancing Viewer<\/strong><\/em>. This is another GL tech demo that is meant to show off instancing being done in GL. Load it up with any PNG image file and it should be rendered on a bunch of cubes \u2013 you can look at them from a firstperson perspective. You can increase the cube amount by going to RGUI-&gt;Core Options and increasing cube size. Note that the cube sizes are to the power of two \u2013 so 8 is 2 ^\u00a0 meaing 256 cubes. There is no practical gameplay purpose to this right now \u2013 it\u2019s just a Libretro GL tech demo. It might become something more useful later on.<\/p>\n<p><strong>No more static syncing by default<\/strong>We now enable the threaded video option by default. There have been a couple of improvements to it in that it now applies adaptive jittering which should make the jittering less apparent.This option should lead to audio crackle-less gameplay on most devices. Of course, there is still the option to use static syncing and we certainly recommend its use if you know what you are doing and can set the \u2018refresh rate\u2019 in the RetroArch app to exactly match that of your display source\u2019s refreshrate. This option just turned out to be too difficult to setup for most users and because any refresh rate mismatch in RetroArch leads to audio\/video sync being incorrect, this would manifest itself in audio crackles and lead to a broken user experience.On a platform like iOS, this is simply no issue. On Android unfortunately it is. Therefore, we are playing it safe here. Upon starting up RetroArch Android for the first time, it will ask you whether you want to use threaded video or whether you want to \u2018synchronize by refreshrate\u2019. By choosing the latter option you get the old way of how things worked.<\/p>\n<p>NOTE: Static syncing should work fine on nearly all libretro cores. However, there has been one annoying exception, and that is PCSX ReARMed. Certain games (like Chrono Cross, FInal Fantasy VII, Crash Bandicoot 1, and lots more) use variable refresh rates instead of running at a fixed refresh rate. This seems to play havoc with RetroArch Android\u2019s way of doing static syncing right now (it is not a problem on iOS however). Enabling threaded video solves all these problems overnight, so we recommend that if you have your \u2018forced refreshrate\u2019 set up right, that you set \u2018threaded video\u2019 off for the PS1 fighter games like the Tekken games, Tobal games, Street Fighter games and others \u2013 ie. games that are guaranteed to run at 60Hz. For everything else, turn on threaded video for now.<\/p>\n<p><strong>Appeal to low-latency audio in Android 4.1 and up<\/strong><\/p>\n<p>There have been changes to the OpenSL audio driver to target the new low audio-latency capabilities of Android 4.1 and up. This should lead to much better results where the audio isn\u2019t as hopelessly behind the video like it was in previous releases (which really wasn\u2019t our fault but more due to us having to deal with the awful state of Android\u2019s audio capabilities prior to 4.1 and up).<\/p>\n<p>We are aware that people with sub-Android 4.0 devices (and even 4.0 itself) will likely get regressions because their Android version can\u2019t possibly deal with low-latency audio buffer sizes. Unfortunately, there\u2019s no getting around the fact that Android was really fundamentally broken on many different levels up to maybe 4.1 and 4.2. Things certainly have been improving a lot since then, and it makes no sense for us to keep appealing to the lowest common denominator when those phones\/tablets are all going to be replaced in the near foreseeable future anyway (and they should). There\u2019s also no point trying to upgrade most of these outdated devices (like the Xperia Play) to the latest Android version because the system requirements of newer versions of Android won\u2019t allow for it. RAM requirements for instance have gone through the roof since Android 4.0 and up, and so it cuts off all older devices with only 512MB of RAM (and even less).<\/p>\n<p>If the demand is high enough on these old outdated devices, we might introduce back a \u2018high-latency audio\u2019 option. For this release, we are trying to cater to the crowd that bought devices this year and one year ago. We believe that is the right strategy here.<\/p>\n<p><strong>NVidia Shield support<\/strong><\/p>\n<p>So we received an Nvidia Shield from Nvidia (two in fact \u2013 one for me, the other for Themaister) and we are certainly walking away with a higher overall impression of Android now. There are still problems, but they seem at least surmountable now.\u00a0 John Carmack in a recent QuakeCon talk has spoken about some of these issues, but really, it doesn\u2019t take a rocket scientist to fire up adb and look at Logcat and see the pages and pages of garbage collector stalls passing by to sense there is something architecturally very wrong going on with this OS from a high-performance games machine perspective. How Google is ever going to fix this and bring it at parity with iOS on most devices is frankly Google\u2019s problem.<\/p>\n<p><iframe loading=\"lazy\" src=\"\/\/www.youtube.com\/embed\/w1sjRD7NSec?feature=player_embedded\" height=\"360\" width=\"640\" allowfullscreen=\"\" frameborder=\"0\"><\/iframe><\/p>\n<p>Returning back to Shield for a minute \u2013 I am pleased to announce I\u2019ve gotten much more consistent runtime performance results on it than any other Android device so far. Regarding the performance of it \u2013 it\u2019s insane \u2013 I\u2019ve done a lot of performance tests over the past few days and so far it\u2019s definitely the most powerful ARM-based device I\u2019ve used.<\/p>\n<p><a href=\"http:\/\/t.co\/nZDSmzpjec\" rel=\"nofollow\">http:\/\/t.co\/nZDSmzpjec<\/a><\/p>\n<p>Really, people like to deride the device for the Xbox 1 Duke-esque form factor and the high price, but really, I consider this a much better \u2018micro console\u2019 than something like Ouya or GameStick so far. (more on the Ouya stuff later). In fact, I\u2019d say that using it as a RetroArch console alone is worth the cost for $299 \u2013 building our own RetroArch console has been a thing on my mind for sometime but really \u2013 there\u2019s no way we\u2019d manage to do a better job at that pricepoint than Nvidia themselves and certainly not with such hardware inside it. So let\u2019s hope they are successful. I am certainly a believer so far.<\/p>\n<p>And yeah, GPU-wise it still might not be at parity with a PS3 or 360, but CPU-wise? It slaughters a PS3 or Xbox 360. Really, I\u2019ve been stressing this for years and it seems to have only recently been gaining traction after Mark Cerny and co have started admitting how bad the Cell was (he didn\u2019t say that exactly but it\u2019s fairly obvious that is what they are referring to beyond all the media training) \u2013 the per-core performance of a Cell-based CPU (this includes both Xenon CPU in 360 and Cell in PS3 itself) was something like a Pentium 4 2.4GHz CPU. It exhibited most of the same problems \u2013 deep pipelines, high penalties (to the tune of 500ms L2 cache misses \u2013 goddamn!), and to top it all off, in-order execution (and a bunch of SPUs in PS3 which are useless for general-purpose code and with too little local storage).By comparison, anything based on an ARM Cortex A15 design (like Nvidia Shield) is happily blazing past a Core 2 Duo \u2013 which has a level of IPC that a PS3 or 360 could only dream of. So really \u2013 if this is about a \u2018comparison\u2019 between the current-gen consoles and something like Shield, then the current cream of the crop of micro-consoles already wins out by a fair margin when it comes to CPU power \u2013 and then some. I have no doubt that Tegra 5 will exceed PS3 RSX\/360 ATI performance levels and from there it\u2019s basically a race to catching up with the next-gen consoles.<\/p>\n<p>Long story short \u2013 this is no moneyhats \u2013 I consider this the RetroArch handheld games console I wanted to build from the onset and which none of the el-cheapo tablets\/phones ever delivered.<\/p>\n<p><strong>Improved input support \u2013 analog stick support<\/strong><\/p>\n<p>Coinciding with the support for the Nvidia Shield gamepad, we have improved input support in a number of big ways &#8211;<\/p>\n<p><strong>Analog stick support<\/strong><\/p>\n<p>Some cores (like TyrQuake, SceneWalker) already have native analog stick controls \u2013 however, RetroArch Android never exposed analog stick support \u2013 up until version 0.9.9.4 now that is. Devices like the Nvidia Shield, the Xbox 360 gamepad, the Logitech Rumblepad 2 have all been preconfigured to default to \u2018Dual Analog mode\u2019 now. Libretro cores which implement \u2018RETRO_DEVICE_ANALOG\u2019 will now be able to make use of the analog sticks on an input device.<\/p>\n<p>We will need more trial-and-error testing to add this functionality to more input devices. Users are encouraged to help us out in this endeavor.<\/p>\n<p><strong>ANR issues fixed (Application Not Responding)<\/strong><\/p>\n<p>So it turns out that the ever-reliable Google had a bug in their native activity glue code input code that was causing the input buffers to become congested and then start issuing \u2018Application Not Responding\u2019 events to the application if an input event had failed to be picked up on for over more than 5 seconds.<\/p>\n<p>It seems Nvidia picked up on this issue earlier and made a blog post about it \u2013 which is the only reason I have been able to fix it for this release. According to the changelogs, Google has fixed this issue now in their code for the latest NDK version. Unfortunately for them, the latest NDK version seems to be a totally broken regression city fest where at least half of the cores that used to compile fine previously now issue \u2018Internal Compiler errors\u2019 \u2013 so I was forced to use NDK r8b either way.Speaking of which \u2013 to any and all devs reading this stuff \u2013 here are the links which hook you up \u2013 Google doesn\u2019t seem to provide an archive of their previous NDK versions (even though they should) but luckily Nvidia still has a mirror up for it \u2013 so here goes &#8211;<\/p>\n<p><a href=\"https:\/\/t.co\/P5poAtsS0e\" rel=\"nofollow\">https:\/\/t.co\/P5poAtsS0e<\/a> (NDK r8b for Linux x86_64)<\/p>\n<p><a href=\"https:\/\/developer.nvidia.com\/content\/nativeactivity-input-crashes-and-anrs-simple-fix-dangerous-bug\" rel=\"nofollow\">https:\/\/developer.nvidia.com\/content\/nativeactivity-input-crashes-and-anrs-simple-fix-dangerous-bug<\/a> (NativeActivity Input Crashes and ANRs: A Simple fix for a Dangerous Bug)<\/p>\n<p><strong>Input devices fixed (Xbox 360, iPega PG-9017)<br \/>\n<\/strong><\/p>\n<p>Thanks to generous gifts, I was able to fix a number of input devices. First and foremost is the Xbox 360 pad \u2013 the D-pad hat controls should now be properly working. Analog stick support for DEVICE_RETRO_ANALOG has also been added.<\/p>\n<p>Two modes for the iPega PG-9017 have also been added. Set iCade Profile in Settings-&gt;Input to either of the two iPega options to use them with RetroArch.<\/p>\n<p><strong>Ouya Store (??)<\/strong><\/p>\n<p>Some guy has registered on our forum a few days ago and has been talking about wanting to bring this over to the Ouya Store.<\/p>\n<p>We don\u2019t have an Ouya, are likely not to get one unless somebody gifts it ($99 for an Android-based Tegra 3? no thanks), and the Ouya Store policies are absolutely insane (<a href=\"http:\/\/forum.themaister.net\/viewtopic.php?id=741&amp;p=2\" rel=\"nofollow\">http:\/\/forum.themaister.net\/viewtopic.php?id=741&amp;p=2<\/a>) \u2013 a bunch of startup guys thinking they can pull an \u2018Apple Store\u2019 in terms of draconian app store policies. So it\u2019s probably a good thing somebody else is going to prostitute themselves before these guys because I quite honestly wouldn\u2019t have the patience for it.<\/p>\n<p>We\u2019ll see what comes out of it.<\/p>\n<p>Anyway, version 0.9.9.4 is out now. Enjoy \u2013 we hope that people with more recent Android devices will get a much better experience now with it.\u00a0 The iOS version will come a few days later \u2013 most of the work really has been on the Android version for this release.<\/p>\n<p><strong>Download Links<\/strong><\/p>\n<p>APK (r18) \u2013 <a href=\"https:\/\/anonfiles.com\/file\/afb0f033a3f779cb111884400406cd7b\" rel=\"nofollow\">https:\/\/anonfiles.com\/file\/afb0f033a3f779cb111884400406cd7b<\/a><\/p>\n<p>Google Play \u2013 <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=org.retroarch&amp;hl=en\" rel=\"nofollow\">https:\/\/play.google.com\/store\/apps\/details?id=org.retroarch&amp;hl=en<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By Squarepusher &#8211; Despite this being a point release, a couple of very important changes have been made regarding the Android port, which made me compelled to make this blog post so that I can explain some of the things that have changed. New cores added People always love this part \u2013 especially the Xperia [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10,28,5],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/posts\/128"}],"collection":[{"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/comments?post=128"}],"version-history":[{"count":3,"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/posts\/128\/revisions"}],"predecessor-version":[{"id":302,"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/posts\/128\/revisions\/302"}],"wp:attachment":[{"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/media?parent=128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/categories?post=128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/tags?post=128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}