Mobile Gaming on Personal Computers with Direct Android Emulation

Mobile Gaming on Personal Computers with Direct Android Emulation

Mobile Gaming on Personal Computers with Direct Android Emulation Qifan Yang1;2, Zhenhua Li1 , Yunhao Liu1;3, Hai Long2, Yuanchao Huang2, Jiaming He2, Tianyin Xu4, Ennan Zhai5 1Tsinghua University 2Tencent Co. Ltd. 3Michigan State University 4UIUC 5Yale University ABSTRACT 1 INTRODUCTION Playing Android games on Windows x86 PCs has gained As one killer application of PCs and mobile devices, computer enormous popularity in recent years, and the de facto solu- games make a billion-dollar business: as of 2018, the world- tion is to use mobile emulators built with the AOVB (Android- wide market is valued at 137.9 billion US dollars [52]. The x86 On VirtualBox) architecture. When playing heavy 3D evolution of computer games has driven a number of techni- Android games with AOVB, however, users often suffer un- cal innovations in terms of both hardware (larger memories, satisfactory smoothness due to the considerable overhead faster CPUs, and graphics cards) and software (e.g., multime- of full virtualization. This paper presents DAOW, a game- dia support and OS kernel improvements) [12]. oriented Android emulator implementing the idea of direct Along with the proliferation of mobile devices, mobile Android emulation, which eliminates the overhead of full vir- gaming has become the largest segment of the market: mo- tualization by directly executing Android app binaries on top bile games contribute to 51% of all game revenues in 2018 [52]. of x86-based Windows. Based on pragmatic, efficient instruc- As a result, many game vendors prioritize implementing mo- tion rewriting and syscall emulation, DAOW offers foreign bile games over their PC or console versions. Today, few Android binaries direct access to the domestic PC hardware mobile games have corresponding PC versions due to the through Windows kernel interfaces, achieving nearly native tremendous efforts for porting mobile-based implementa- hardware performance. Moreover, it leverages graphics and tion onto PC platforms with different OSes and architectures. security techniques to enhance user experiences and prevent Even with tool support (e.g., Unity [44] and Unreal [45]), the cheating in gaming. As of late 2018, DAOW has been adopted porting is non-trivial—existing tools provide neither correct- by over 50 million PC users to run thousands of heavy 3D ness guarantee nor usability control. Android games. Compared with AOVB, DAOW improves the The mobile-first game development creates high demands smoothness by 21% on average, decreases the game startup for supporting mobile games on PC platforms [34], driven time by 48%, and reduces the memory usage by 22%. by at least three motivations. First, some users may want to play games that only provide mobile versions, while not ACM Reference Format: owning the required mobile devices. Second, the gaming Qifan Yang, Zhenhua Li, Yunhao Liu, Hai Long, Yuanchao Huang, Jiaming He, Tianyin Xu, and Ennan Zhai. 2019. Mobile Gaming experiences are generally better with PCs’ large screen and on Personal Computers with Direct Android Emulation. In The high resolution. Third, PC-based gaming can deliver better 25th Annual International Conference on Mobile Computing and control via the physical keyboard and accurate mouse control. Networking (MobiCom ’19), October 21–25, 2019, Los Cabos, Mexico. As a matter of fact, there have been more than 70 competitors ACM, New York, NY, USA, 15 pages. https://doi.org/10.1145/3300061. in the PC-based mobile game market [11]. 3300122 The de facto solution for playing mobile games on PCs is often dependent on mobile emulators, such as Bluestacks [10], Permission to make digital or hard copies of all or part of this work for Genymotion [18], KoPlayer [27], Nox [9], and MEmu [31]. personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear All these game-oriented emulators use a full virtualization this notice and the full citation on the first page. Copyrights for components architecture, known as AOVB (Android-x86 On VirtualBox)— of this work owned by others than ACM must be honored. Abstracting with running Android-x86 [5] on top of a VirtualBox [47] virtual credit is permitted. To copy otherwise, or republish, to post on servers or to machine (VM). Android-x86 is an x86 porting of the Android redistribute to lists, requires prior specific permission and/or a fee. Request OS, and VirtualBox bridges Android-x86 (the guest OS) to permissions from [email protected]. the host OS (e.g., Windows). Given that most Android games MobiCom ’19, October 21–25, 2019, Los Cabos, Mexico © 2019 Association for Computing Machinery. rely on native ARM libraries, Intel Houdini [4] is typically ACM ISBN 978-1-4503-6169-9/19/10...$15.00 used for translating ARM instructions into x86 instructions https://doi.org/10.1145/3300061.3300122 at the binary level. The AOVB architecture gains popularity for its free, open-source nature, and most importantly being DAOW Emulator App Instance Media Host fully transparent to unmodified mobile game binaries. Customized Linux ARM Input Android-x86 Binary Context-aware While AOVB-based emulators can run most mobile games, Key Mapping they only provide desired gaming experiences for 2D games rewrite- dynamic on-load translation Sound and less interactive 3D games. For heavy 3D games (cf. §4.1) Memory Mapping I/O Compatible fork Compatible Shared like Vainglory [38] and PUBG Mobile [41], AOVB-based em- Android-x86 Linux x86 Memory Graphics ulators lead to significantly degraded gaming experiences Binary Binary Anti-Aliasing (measured by smoothness, cf. §3.1). Note that gaming is differ- Linux Linux Smoothness syscall syscall Evaluator ent from many other applications, in which millisecond-level User mode stagnation can be detrimental to the overall experience. Kernel mode DAOW Kernel Driver We have built and maintained an AOVB-based emulator Execution Windows Syscall DAOW Syscalls (referred to as AOVB-EMU), which has been used by more Handler Syscalls Translation (10/7/XP) than 30 million users to run over 40,000 Android game apps. Our measurement of its user experiences shows that the per- Figure 1: Architectural overview of DAOW. formance bottleneck roots in the considerable overhead of full virtualization (§3.2). With the goal of supporting heavy mobile games, we apply a series of para-virtualization and We address these challenges with the following endeavors hardware-assisted optimizations to AOVB-EMU (§3.3), in- in the design and implementation of DAOW: cluding GPU acceleration for graphic processing, VirtIO [36] • We take a data-driven, pragmatic approach to fulfill cost- for increasing the bandwidth of rendering pipelines, and In- efficient instruction rewriting and syscall emulation. We tel VT [43]. While these optimizations substantially increase comprehensively profile the instructions and syscalls used the smoothness when running heavy 3D games, they are in a wide variety of Android game apps. Based on this, we insufficient to provide the desired experiences. To address reduce the many different types of instructions that need this, we need to break the boundary of virtualization. rewriting to only a few “patterns”; for each pattern, we utilize trampolines and write native Windows utility func- This paper presents DAOW [39] which, to the best of our tions to minimize the changes in binary structures during knowledge, is the first and the only emulator that can pro- instruction rewriting. Besides, we prioritize supporting vide the same level of smoothness for running heavy 3D the popular syscalls while treat the rarely used ones as Android games on Windows PCs, as being played natively exceptions; we also exploit the “common divisors” among on Android phones. This is accomplished based on the idea the syscalls to greatly simplify the engineering efforts. of direct Android emulation, which directly executes Android • app binaries on top of x86-based Windows. More specifically, We make a number of optimizations in DAOW to improve its DAOW provides foreign Android binaries with direct access performance. We enhance the efficiency of syscall emula- to the domestic PC hardware through Windows kernel inter- tion through extensive resource sharing, early preparation, faces, thus achieving nearly native hardware performance. and delayed execution. We also use shared memory for Direct Android emulation faces a number of challenges direct bulk data transfer between the app instances and from the distinctions at the levels of ISA (ARM vs. x86), OS the media component for real-time user interactions. In (Android vs. Windows), and device control (touch screen addition, we employ security approaches to prevent ex- vs. physical keyboard and mouse). First, data structures and ternal cheating programs (e.g., aimbot and speed hack on execution behavior of binaries are distinct between Android Windows) from modifying Android game app instances. and Windows. Instruction-level rewriting can fix the dis- • We leverage a series of graphics techniques to bridge the in- tinction, but change the layout of the original binaries and teraction gap between mobile and PC-based gaming. We de- complicate the implementation. Second, Android/Linux and sign an intelligent mapping technique which dynamically Windows have different sets of system calls (syscalls). Trans- detects on-screen buttons and maps them to appropriate lating Linux syscalls to Windows requires significant engi- keys of the physical keyboards. Moreover, we design a neering efforts, as well as incurring large runtime overhead if progressive anti-aliasing method that assembles multiple not appropriately implemented. Third, there is an interaction existing techniques to smoothen rendering distortion and gap between mobile and PC-based gaming. PC games use eliminate aliasing, without user-perceived overhead. physical keyboards and mouses for inputs; mobile games Figure 1 plots the system architecture that embodies our define a variety of buttons in different contexts. Also, PCs’ design of DAOW with three components: 1) Emulator, 2) large screens could enlarge the subtle rendering issues of Kernel Driver, and 3) Media Host.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    15 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us