121
submitted 1 year ago by Mandy@beehaw.org to c/linux@lemmy.ml

the one thing linux really hasnt been made on par with winblows yet is the dreadful amount of options for android simulation -the most popular choice seems to be Waydroid, but its such an unneeded hassle to set up at all -genymotion is just slow -and than you have things like android x86 which entirely defeat the point of an emulator

you are viewing a single comment's thread
view the rest of the comments
[-] luthis@lemmy.nz 1 points 1 year ago

Instead of an emulator, what about a VM? Does that option exist?

[-] lemmyvore@feddit.nl 6 points 1 year ago

What would you put in the VM? Each Android ROM is highly hardware dependent and each device's internal storage is highly fragmented into a couple dozen partitions configured in proprietary formats.

Theoretically a GSI ROM is supposed to be hardware-independent thanks to Treble but you would still need a common base to go with any GSI ROM and I'm not sure a generic one has been made specifically for use in a VM.

[-] drwankingstein@lemmy.dbzer0.com 3 points 1 year ago

What would you put in the VM? Each Android ROM is highly hardware dependent and each device’s internal storage is highly fragmented into a couple dozen partitions configured in proprietary formats.

Android x86 and derivatives are as generic as possible, like any other linux ISO you can flash it to most any computer assuming the kernel is new enough, Bliss OS is up to date with the latest LTS kernel based on xanmod, and android 12L

[-] squaresinger@feddit.de 0 points 1 year ago

Just androidx86.That's an Android distro highly customized to running in a VM.

[-] drwankingstein@lemmy.dbzer0.com 1 points 1 year ago

no it isn't, it isnt that at all, that is so far off the mark it's extraordinary. Android x86 is as it's name implies, a generic x86 iso. you can install it to physical hardware or a VMM equally the same, in fact, it's literally the exact opposite of highly customized.

it's explicitly as generic as it can be

[-] squaresinger@feddit.de 1 points 1 year ago

Apparently you never had a look at it. Getting Android to run on x86 is by far not trivial these days. To make it work, Android-x86 has a lot of modifications over AOSP, including drivers, HAL and a lot more.

Just checkout their Git to see what they had to do to get it working.

[-] drwankingstein@lemmy.dbzer0.com 1 points 1 year ago

I am intimately familiar, it is not highly customized for VMs, it is as generic as it can be. a lot of work was put into making it work on x86 as a whole, but not just VMs.

[-] squaresinger@feddit.de 0 points 1 year ago

Ever seen a single instance in the real world where this is running outside of a VM?

[-] drwankingstein@lemmy.dbzer0.com 0 points 1 year ago

Yes. Many. Blisslabs has partnerd with EIDU to work on tablets for low income countries. I personally have sold android boxes with Bliss. Ax86 has a large number of sponsors that are/were casinos. There are people working on using it in cars. 2-In-1s. ETC.

VMs are the minority use case...

[-] drwankingstein@lemmy.dbzer0.com 4 points 1 year ago

nearly all android emulators are VMs, usually vbox, common ones include bluestacks memuplay. WSA uses hyper-v infranstructure. GooglePlay Games uses crosvm

[-] skullgiver@popplesburger.hilciferous.nl 1 points 1 year ago* (last edited 1 year ago)

[This comment has been deleted by an automated system]

[-] drwankingstein@lemmy.dbzer0.com 1 points 1 year ago

there are lots of reasons I myself use a healthy blend of waydroid and Bliss+Qemu

[-] henrikx@lemmy.dbzer0.com 0 points 1 year ago

VM = x86 = android-x86 which OP already mentioned

[-] x3i@lemmy.x3i.tech 2 points 1 year ago

No, qemu can run ARM images with ease. If I recall correctly, waydroid is using that approach

[-] drwankingstein@lemmy.dbzer0.com 2 points 1 year ago

it's not. waydroid and bliss both use libhoudini/libndk like most other android systems.

[-] x3i@lemmy.x3i.tech 1 points 1 year ago

Thanks for the correction, has been a while since I used waydroid :)

[-] 520@kbin.social 1 points 1 year ago

Nah, they'd be as slow as a 486 running modern Windows if that was their approach

[-] drwankingstein@lemmy.dbzer0.com 0 points 1 year ago

yeah but android emulators = VM = x86 = android-x86

[-] 520@kbin.social 3 points 1 year ago

There's a bit more to an emulator than simply running Android on x86 hardware.

[-] drwankingstein@lemmy.dbzer0.com 1 points 1 year ago

not really no. I mean, sure you could add a fancy gui on top of it. but 90% of android emulators are some kind of android x86 + libhoudini/ndk + vmm. some modify surfaceflinger so that each application will render to it's own window, but usually it's just disabling launcher, and sending some kind of command to open the app from a gui (IE. sending adb launch commands)

[-] 520@kbin.social 2 points 1 year ago* (last edited 1 year ago)

Yes and no.

In general it is true that an emulator just needs to translate instructions, but for things like games and the Android operating system, your emulator also needs to use whatever hardware acceleration you have or it will run like dogshit.

Android makes extensive use of graphical acceleration to the point where it is a mandatory requirement. There is no part of the UI that doesn't use hardware acceleration.

Luckily Android uses OpenGL ES, and there are means to translate that into Vulkan without too much issue.

But what you're talking about is virtualisation for the most part - the only thing arguably doing any actual emulation in your scenario is libhoudini. Otherwise, there isn't any translation of instructions - The Android VM instructions get executed directly on Ring 0 of the CPU

[-] drwankingstein@lemmy.dbzer0.com 1 points 1 year ago* (last edited 1 year ago)

whatever hardware acceleration you have or it will run like dogshit.

and? vbox, qemu, hyperv and vmware, all have gpu acceleration to a degree. Qemu will also be getting vulkan acceleration soon

EDIT: forgot crosvm (google play games) which does too

[-] 520@kbin.social 1 points 1 year ago* (last edited 1 year ago)

And therefore it means that in addition to doing translation work, they themselves need to implement hardware acceleration. That's why you see many game emulators requiring DirectX even if the console in question never used it.

Oh, and 4 of the 5 products you mentioned are not emulators. Of the 5, only QEMU is fully capable of emulation. There is a massive and important difference between virtual machines and emulation.

[-] drwankingstein@lemmy.dbzer0.com 1 points 1 year ago* (last edited 1 year ago)

nearly every single emulator, for Windows is a VM pretty much. Blue stacks, memuplay, WSA, Google Play games.

no, there is no difference between virtualization and emulation. virtualizations just hardware accelerated emulation. That's it. If you use blue stacks and call it emulation, because it's emulation, all the sudden it's not emulation because it's virtualization?

If that is the bar, then there are incredibly few Android emulators. Yes some Android emulators, or rather virtualizers, do implement some custom GPU acceleration stuff. but not all, Google Play games uses CrossVM with vulkan cereal, WSA uses their weird stack. genymotion IIRC uses virgl, so does qemu.

EDIT: by the way, with VirtualBox VMware so and so forth, you are still emulating. you are emulating NICs, oftentimes you are emulating GPU, you are emulating storage controllers, you are emulating PCI controllers, so on and so forth.

[-] 520@kbin.social 1 points 1 year ago

no, there is no difference between virtualization and emulation.

Yes there is.

virtualizations just hardware accelerated emulation. That’s it.

Actually it's the opposite: virtualisation does as little emulation as possible. At a high level, it acts more as a ring-fence around native resources than an actual emulator. With most virtualisation, the only things that are getting emulated are minor components with little computing involved like sound and networking cards.

The reason virtualisation is so fast compared to emulation is because it's running the code as-is and not translating it.

If that is the bar, then there are incredibly few Android emulators.

That is correct. You basically have QEMU and that's it.

oftentimes you are emulating GPU.

Not exactly. If you are not doing GPU passthrough, either fixed or mediated, most virtualisation software use API forwarding for 3D acceleration APIs. That is, the hypervisor passes calls to Vulkan, DirectX, etc, from the guest to the host, has the host's GPU render it, then pass it back.

GPU emulation is a very last resort, as the performance is dreadful.

[-] drwankingstein@lemmy.dbzer0.com 1 points 1 year ago

Virtualization is a specialization of emulation. to emulate something merely means to imitate. virtualization is still emulating a secondary PC environment. Saying virtualisation is not emulation is just fudging terms because people don't like the implication that the term "emulation" has. I recommend reading WINE's FAQ where even they admit that it would be more accurate to say "wine is not just an emulator". Virtualization is just a subclass of emulation.

most virtualisation software use API forwarding for 3D acceleration APIs

this is a common misconception Most VMMs emulate GPU. virtualbox, vmware, wsa, and qemu all emulate GPU (or rather, technically a gallium driver) for opengl support on linux and even windows. as windows guests under virtualbox actually uses gallium nine/dxvk under the hood (perf is still crap somehow though). the technical breakdown for qemu would be [ host gpu <--> gallium <--> opengl <--> qemu pipe <--> virgl <--> gallium calls <--> opengl <--> application ]

vmware/vbox are slightly different as it's an accelerated backend to vmgfx but that too emulates a gallium backend on linux meaning it's doing ogl -> gallium -> ogl etc.... Hyper-v/wsa is the exact same situation as both. I don't believe that bluestacks and memuplay deviates from this greatly. though it's not something I have looked in depth into.

it wasn't until recently with virglrenderer venus for qemu/crosvm and hyper-v gpu-pv that we have gotten real API forwarding for VMs (technically android's cuttlefish also had it IIRC, but preformance was terrible when I played with it, hyper-v also had something but it was really bad too).

as for other forms of api forwarding, qemu-3dfx is a prime example of real "api forwarding" to an extent, rather it forwards 3dfx and opengl calls to the host. and you can have d3d support via wined3d.

this post was submitted on 14 Aug 2023
121 points (92.9% liked)

Linux

48335 readers
695 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS