Android on x86 and Binary Translation

So the other major and obvious piece of the puzzle is what changes were required to make Android and all of its applications run on x86. Android itself has already been built for x86 before, and again we’ve seen and played with it running all the way back at IDF 2010. That part of the puzzle is relatively understood, but the devil again is in the edge cases. Among the things that need massaging for x86 are the Dalvik VM, x86 JIT, NDK, and JavaScript engine.

Android itself is actually an ideal platform for Intel to target, as the vast majority of Android applications in the Play Store run atop the Dalvik VM and use the Android Framework (75–80% are commonly cited numbers, depending on how you’re counting). The rest either are Dalvik VM applications that run and use JNI (Java Native Interface) libraries that are built for ARM only, or NDK (Native Development Kit) applications. So where does Intel’s binary translation secret sauce fit into all this? Simply put, Intel’s binary translation is the mitigation for both libraries and NDK applications that haven’t yet been ported to x86, and allows the device to expose itself as supporting two application binary interfaces (ABIs), both x86 and ARMv5, in fact this is easy enough to see upon superficial inspection of build.prop:

ro.product.cpu.abi=x86
...
ro.product.cpu.abi2=armeabi

In the case of Dalvik applications, developers don’t need to do anything. Thankfully again this is the vast majority of Android applications you encounter on a daily basis - they just work, given that Intel has made Dalvik work with x86 and spit out the right machine code.

NDK applications are also easy enough to mitigate - the developer simply needs to recompile the NDK project, which supports ARMv5 (‘armeabi’), ARMv7 (‘armeabi-v7a’), and x86 (‘x86’). Building for x86 will deliver code that’s tailored (unsurprisingly) exactly to the Saltwell CPU feature set, or more explicitly what you’d get by running GCC with the compiler flags “-march=i686 -msse3 -mstackrealign -mfpmath=sse” - this is all outlined in the CPU-ARCH-ABIS.html document as part of the NDK documentation. The resulting APK can be packaged as a “fat binary” with machine code for all three platforms, and upon install only the proper one is unpacked and installed.

The remaining two cases are where binary translation come in. In the case of applications that haven’t been rebuilt with the NDK to target x86, the binary translator magic kicks in and translates the armeabi version into x86. The same applies for applications that request some JNI libraries that are currently ARM only.

Intel outlines this in a number of slides which have made their way online, and the process is virtually completely transparent to end users and Dalvik applications. The x86 compatible Dalvik VM is a part of the OS, as are the ARM to Atom BT phase for JNI libraries. ARM native NDK apps on the other hand are translated by Intel in the cloud, validated against Intel's Android x86 emulator and pushed to the Play Store. The point is the bulk of binary translation happens away from the device itself and running on much faster Xeons in the cloud. As binary translation requires more cycles than natively running the code, which in turn consumes additional power, this was the only route for Intel to ensure that Atom would remain power efficient (and high performance) even on non-native NDK apps. Update: Intel has clarified and informed us there is no cloud aspect to binary translation, it is 100% done on the device for ARM NDK applications.

It's still unclear just how long this process takes after a developer has uploaded a non-x86 NDK app to the Play Store, or what happens if the process fails to validate for whatever reason (Does Intel get in touch with the developer? Is the app forever excluded?). Intel is being unusually vague about how all of this works unfortunately.

The combination of all of these efforts should result in over 90% of the apps in the Play Store working right away. What about in our experience? We discuss that next.

Software: Nearly Flawless

The X900 that I was sent came running Android 2.3.7, which is the latest version on the 2.3 branch. Xolo intends to deliver an Android 4.0.3 update later, and Intel internally has its own 4.0.x image stable and ready to go, which we’ve seen running on the FFRD a bunch before. It’s a bit odd to see things going this way when 4.0.x is clearly already ready, but no doubt some logistical issues with carrier support are the final hurdle. I’m eager to check out Intel’s 4.0.x port and intend to update when that happens.

 

Xolo and Intel have basically left things entirely stock with the X900. The notifications shade has one minor positive change - inclusion of the power controls, and Swype is bundled in addition to the stock Android 2.3 keyboard. There’s one Xolo Care support application preloaded, and basically nothing else. I can honestly say this is the least preloaded junk I’ve ever seen on a non-Nexus device.

 

So the next logical step is talking about how well Android and its apps work on x86 in practice, and the answer is unsurprisingly that almost everything is perfect. I installed about 80% of all the Android applications I’ve ever installed on any Android phone (thanks to the new Google Play ‘All’ tab) and nearly all of them worked perfectly. In fact, all of my daily driver applications work flawlessly: Twitter for Android, Baconreader, Speedtest.net, Barcode Scanner, Astro, Dropbox, Facebook, GPS Test Plus, GPS Status, Instagram, IP Cam Viewer, GTA III, Remote Desktop, Swiftkey X, and WiFi Analyzer all work perfectly.

 

That said there are indeed a few edge cases where things don’t seem to be perfect. For one, Flash 11 isn’t available for the X900, and throws an error in the market. The device does come preloaded running Flash 10.3 however, which gets the job done although is a bit dated. In addition, although Netflix would download, the installer would throw a ‘package file invalid’ error upon install. This is what leads me to think there’s some APK interception in the cloud and perhaps translation up there, and Netflix DRM not translating, but that’s speculation. Other than this, everything else I encountered works flawlessly, I wager your average Android user wouldn't be able to tell that this is running on a completely different architecture.

Medfield: Intel in a Smartphone Performance
Comments Locked

106 Comments

View All Comments

  • tipoo - Wednesday, April 25, 2012 - link

    Looks like Krait still has a significant lead over Intels competitor, and it was shipping sooner. Intels doesn't have better CPU performance, GPU performance, or battery life, it's just ok at everything. I think their advantage will no doubt grow with 22nm, but for now we finally see Intel entering some stiff CPU competition, even if its for the low power draw segment.
  • Lucian Armasu - Wednesday, April 25, 2012 - link

    That's the question: why would manufacturers care? Just because it's Intel? And why would they want to repeat the PC situation where they got an Intel lock-in, when there's much better competition with ARM makers, and they can get the chips for a much cheaper price (which Brian didn't take into account in this review).
  • haar - Wednesday, April 25, 2012 - link

    <strong> But, can it play Crysis? </strong>. ROFLMAO! (sorry, first and last time i will use this... but really it is a perfect line imao)
  • y2kBug - Wednesday, April 25, 2012 - link

    It seems that Intel put a lot efforts to make Android run on x86. Even if I think that this will not bring Intel any money in return; here is an idea how to make these efforts not to die in vain. Make this runtime work on Windows, so that we can run Android apps on the upcoming Windows 8 tablets. This will make upcoming Windows 8 tablets so much more useful from the very start.
  • superPC - Wednesday, April 25, 2012 - link

    YouWave ( http://youwave.com/ ) and BlueStack ( http://bluestacks.com/ ) can already do that on windows 7 right now. BlueStack has shown that it can run android apps on windows 8 PC (it just doesn't have live tiles http://www.youtube.com/watch?v=SKAOkpX7Q2E ).
  • aegisofrime - Wednesday, April 25, 2012 - link

    Am I the only one who can't wait for an Android phone rocking ULV Haswell? That is gonna be such a beast. Modern in-order architecture + hopefully decent GPU.
  • tipoo - Wednesday, April 25, 2012 - link

    Yeah, Atom is quite an old architecture now in chip terms, a redesign could bring Intel back up in a huge way. While I was disappointed by this SoC, bearing in mind how old it is and its competing against new designs like Krait, I guess they could do much much better with a real new Atom.
  • Khato - Wednesday, April 25, 2012 - link

    Whereas my guess is that we'll be seeing conroe-class performance out of the silvermont cores in Medfield's successor. Hence why I couldn't help but chuckle at the second to last line in the review, "What I'm waiting for is that Conroe moment, but in a smartphone."
  • tipoo - Wednesday, April 25, 2012 - link

    Conroe class performance would certainly bring these devices up to "good enough" territory. But current Atoms are only a fraction that performance still. We'll have to wait and see I guess.
  • B3an - Thursday, April 26, 2012 - link

    You're both idiots if you think Intel could get Conroe class or vastly better Atom performance out of 32 or 22nm.

    The whole reason Intel have used the 'old' Atom design in the first place is because it's simple and small, which means lower transistor count, smaller die, and lower power consumptions. If you honestly think they could have got Conroe level complexity or performance in a phone SoC with anywhere near acceptable power consumption and die size, even at 22nm, then you're both living in a fantasy universe.

Log in

Don't have an account? Sign up now