343 points · by tormeh · 3y ago · 144 comments
They're thinking about this wrong. They need to make it zero work, followed by optional optimizations, like Apple did with their M1.
Remember when Google told everyone to test their Android apps on x86. And then again on MIPS? And then nothing happened. Developers will not waste their time.
Apple rented out DTK systems for $500 for developers to get their hands on ARM hardware and port their applications. Hardly zero work. You couldn't even keep the hardware, you had to send it back (and originally you wouldn't even get $500 in credit to buy a production system with, luckily they fixed that after the easily predictable uproar).
Google is providing software emulators instead, much easier to work with and doesn't require complicated device logistics. Not only that, but the only audience that really needs to do work to get ready, are either those producing NDK applications, or those working on hardware support for RISC-V.
Java/Kotlin applications would not need any porting. Sounds like zero work to me!
You'd need a DTK to know if you're fine with emulation or not.
If you cared at all about your app running, you wouldn't just assume that it magically runs fine on an emulation layer you never touched, and that at speeds that are reasonable.
For a reference point, Rosetta was far from being great, and while some apps could run against it, it was most of the time an ultra painful experience. That pain helped devs to put the effort into making native versions, but it also means you couldn't expect Rosetta 2 to give acceptable performances from Apple's track record.
luckily because this has mostly been fixed and is also the biggest stumbling block when going from x86 => RISC-V
Through there was something about the specific LR/SC definition which I found quite problematic when it comes to implementing certain atomic patterns. But that was 2?? years or so ago and I don't remember the details at all.
Eitherway theoretically if you have a correct C++ standard compatible program without UB it should "just work" on RISK-V by now, but then I don't think such a thing exists (/s/j).
(It's not that many Debian or Fedora community contributors have a mainframe in their basement—yet the software they package tends to build and run on s390x just fine. Okay, maybe there are some endianess issues, but you wouldn't hit those with RISC-V.)
no, this has little to do with android
but "GNU/Linux applications are typically quite portable across CPUs" is only this case because a lot of people have a lot of interest and time invested into making that work
but for many commercial apps there is little insensitive to spend any time into making them work with anything but ARM (even older armv7 might not be supported because depending on what your app does the market share makes that not worth it)
still with both ARM and RSIV-V havine somewhat similar memory models and in general today people writing much more C/C++ standard compatible code instead of "it's UB in therefor but will work on this hardware"-nonsense I don't see to many technical issues
on issue could be that a non negligible amount of Android apps which use the NDK use it only to "link" code from other toolchains into android apps, e.g. rust binaries. And while I'm not worried about rust I wouldn't be surprised if some toolchains used might not support RISK-V when it starts to become relevant. Especially when it comes to the (mostly but not fully) snake oil nonsense stuff banking apps tend to use I would be surprised if there wouldn't be some issues.
Through in the end the biggest issue is a fully non technical one:
- if you release an app with NDK you want to test it on real hardware for all archs you support (no matter if there is some auto cross compilation or interpretation (like Roseta)
- but to do so you need access to such hardware, emulators might be okay but are not always cutting it
- but there aren't any RISK-V android phones yet
- but to release such phones you want to have apps, especially stuff like paypal or banking apps available
- but to have such things available the providers much evaluate it to be worth the money it costs to test which is based on marked share which is starting at 0 and slow growing due to missing support for some apps and missing killer features
So I think RISK-V android will be a think but as long as multiple big companies are not pushing it strongly it will take a very long time until it becomes relevant in any way.
In reality I have a lot more trouble with differences between macOS versions than differences between CPU architectures.
x86 builds of Android apps & libraries are extremely common to have since it's the most common target for emulators.
As for MIPS, I don't think Google ever pushed it. It was just kinda there.
Also also, this blog post is aimed at device manufacturers more than app developers which is why it talks about building AOSP & pending patches. It's not asking app devs to do anything (in fact it even says at the bottom "Make sure to stay tuned as we look into ways to make it as easy for Android developers writing native to target new platforms as it is for our Java and Kotlin developers!")
No, I don't think they do in a general sense. It's in the title: "What you need to know to be ready" --> if you would like to be ready, we have some information/advice for you. You can take it or leave it.
% Note: I'm using the word "you" here as it is used in the title, not you specifically.
Also, and I missed this at the time, it seems like Qualcomm was restricting manufacturers from also using competitors chips[2], although it seems the ruling was reversed on appeal [3], there's still evidence of restrictions. It would be unappealing to market an x86 device if it means losing access to Qualcomm cpus, especially in an era where Qualcomm modems were practically mandatory, so it makes sense that the only x86 (Asus Zenphone) I can think of is made by a company that didn't make a lot of phones.
Personally, I don't think the lack of app support would have been that much of a problem for sales of phones in the 2012 to 2016 time frame. If you got a couple hundred thousand phones out there, app developers would add support, because it wasn't too hard, a lot of developers were running x86 Android emulators, and they may have already had the x86 native code libraries and just didn't ship them because why bother when there's no phones.
Some of the first generation Asus Zenphone ran on x86, and it might have been rough for a while, but I think they sold reasonable numbers, and app developers started shipping x86 libraries. I don't know when Google Play added support for ABI specific APKs, maybe that was a factor too (if you have to have everything you support in the APK, then you'll be careful about what you support)
[1] https://www.pcworld.com/article/414673/intel-is-on-the-verge...
[2] https://www.cnn.com/2019/05/22/tech/qualcomm-antitrust/index...
[3] https://www.reuters.com/article/us-qualcomm-antitrust-idUSKC...
Android apps aren't AOT-compiled to any specific architecture at build time; that happens after installation on the device itself.
Nowadays AOT compilation happens when the device is idle, taking into account either the generated PGO metadata gathered by the JIT, or the one downloaded alongside the APK at installation time.
how prevalent is ndk use? games and multimedia apps maybe?
See the subthread at https://news.ycombinator.com/item?id=37996820
Qualcomms latest: https://lists.riscv.org/g/tech-profiles/attachment/400/0/AOS... where they claim that their proposed "make RISC-V a bit like aarch64" Zics extension plus a 32-bit long jump achieves better code density than RV64GC, and without the downsides of the C extension they've been harping about.
I guess google forcing RV64GC or RV64G_Zigs could be the tie braker here.
But while removing or changing the C instruction when it's rolled out isn't really an option as long as it's mostly about emulator testing they probably don't care too much.
Their proposal is no good[0].
>No clearly discernible technical benefit for native RISC-V cores, and some clear technical disadvantages for both low-end and highend implementations
0. https://lists.riscv.org/g/tech-profiles/attachment/353/0/RIS...
In reality, it seems logical to me that all the players here have an interest in the long term health of RISC-V, including applicability to higher end cores. Qualcomm is showing data supporting their position. And Sifive is showing data supporting their position. Will be interesting to see which wins, and whoever it will be it'll hopefully be the best for the long term health of RISC-V even if it means one of the parties needs to partially redesign their cores.
The real question is why?
nm: https://www.quora.com/Why-was-the-ARM-Thumb-instruction-set-...
Unsure what you asking? The RISC-V C extension has some vague similarities with thumb. But the Qualcomm proposed Zics extension absolutely hasn't. Zics adds things like more advanced addressing modes, load/store pair instructions etc. that are found in the aarch64 ISA, all with 32-bit instructions. Notable that ARM didn't create any 16-bit Thumb variant of aarch64.
The old emulator is a real pain to get working, and the new one comes with many benefits.
Somehow I never knew you could just run `launch_cvd` manually.
Would also be cool if we could get Android Studio for Platform running as well, I'm guessing it shouldn't deviate too much from regular Android Studio.
I'd be more concerned about ARM support stagnating.
RISK-V is currently not really that competitive on the lower end marked as there are just too cheap ARM chips
but it is e.g. very competitive for companies needing large quantities of simple but slightly customized chips where existing cheap ARM chips aren't an option and customized arm chips are too expensive
and there are currently no competitive RISK-V chips in the high end marked
it can somewhat compete on the mid marked, if it wouldn't be for too low quantities driving the price up
it also could be interesting if e.g. Intel or AMD decides to enter the non x86 market as they could cut out license cost to ARM
but all in all I wouldn't be worried about ARM support being reduced in the ecosystem for many many years to come
the reason is, unlike phone and tablet vendors, small players just can't catch up the new changes from Android, which is very complex, gradually they moved away.
Or even nothing at all, you can run Qt6 standalone and have a very nice touch interface.
> Also, does this require across the stack changes? i.e. not just OS ones.
I'm not sure where you draw the boundary between 'stack' and 'os'. Can you expand a bit?
Do you have any links? I'm curious, and not a little bit skeptical about the near-term competitiveness of RISC-V in the mobile space.
https://news.ycombinator.com/item?id=37924092
https://news.ycombinator.com/item?id=37919907
It doesn't exactly sound imminent.
It typically takes 2-3 years from core announcement to being in an SoC for a high end phone.
They are coming.
Arm will have something newer by then, of course, but a 2023 flagship Galaxy S23 is not going to look stupid in 2026.
Haven't tried the AOSP port for the LiCheePi 4a yet. Probably should give it a whirl just to see if things just work.
That's easier just to try downloading Minecraft through the Play Store than boot strapping the entire toolchain needed to get PolyMC working.
The one problem is banking, at least in Sweden we are still dependent on mobile BankID (for online purchases above $20 f.ex.), which only runs on iOS and Android.
Without that, one must run Android to get access to mobile apps, which is essential.
e.g. in Germany you have similar situations when it comes to online banking for some banks (through not when it's about card->terminal payment)
for example credit card apps in the EU have 2FA (which doesn't always trigger and there is still the legacy protocols for payments from outside of the EU so a bit uh, maybe, pointless)
this 2FA is for most banks handled by and app (different apps tho)
and many of this apps bathed in "security" snake oil making them impossible to run even on a non-rooted but de-googled android phone
same for pay with you phone over NFC, e.g. it currently doesn't work for my bank with my phone and I'm speculating that it's because the secure modules attestation is not is not whitelisted (the phone uses a "industry" ARM chip instead of a typical consumer one so attestation derived ids/keys can be "unexpected")
(Through also where I live there is a law for having some kind of b2b online banking API, so theoretically a company could create an app which does work on unusual phones, or create a device like you mentioned.)
To boil down the problem: To access the western systems you need to keep feeding Apple, Google and Microsoft (AGM).
The alternatives are non-existing still 15 years after the release of the smartphone (that in retrospective probably was the dumbest thing humans have made).
The dream device = dual boot tablet Android/iOS and vanilla linux will never exist?
So you have to shoot for vanilla linux (maybe ARM, probably RiscV) and tell the banks that you are dropping support for AGM.
It's a "I'm not in here with you, you are in here with me" sort of moment.
This goes hand-in-hand with root certificates, taxes and the health/legal system at large; everything made by humans without consulting nature first.
I got popcorn, but I'm kinda worried too.
BankID is owned by the Swedish banks. It is required for some government- and healthcare sites as well, despite it being a commercial monopoly.
The openness of the RISC-V specification is great for chip designers, manufacturers, and researchers. But it has basically no effect on end users, except indirectly (i.e. hopefully the chips are cheaper, because there's more competition and no license fees).
[0] https://mntre.com/media/reform_md/2022-09-29-rkx7-showcase.h...
The indirect effects are the point.
It's the graphics card, the display hardware, the camera, the video encoding/decoding - these are all proprietary, undocumented blobs of IP with no upstream support. Your RISCV Android phone is still going to have all of those, it makes exactly zero difference.
RISC-V CPUs don't have any of that as there's no requirement that actual implementation be open source, only the ISA. And it's not like you can change it. You can't buy a RISC-V CPU and fiddle with the design, you don't get the source nor the toolchain. All you get are the man pages, and guess what? You get those with x86 and ARM, too!
And so far entirely about AOSP and getting that running.
GApps (the non-free part) isn't mentioned at all. And like someone else said, there's use cases besides phones that use android. And some people Run de-googled android on phones, it's just degraded :/
- googler, but far from anything android