1

I have an Android Headunit in my car and I have started to "play" with Tasker automation as a hobby. I wanted to create some Tasker scenes on my personal computer using the Android Emulator from Android Studio since sitting in the car all day is not convenient. Unfortunately, I cannot get the hardware acceleration to work and the virtual devices are very slow.

I tried to set up the Android Emulator hypervisor driver as described here.

Settings I made:

  • Windows Features deactivated: VM-platform, Windows-Sandbox, Credential Guard, Hypervisor Platform

  • BIOS: Intel Virtualization Technology: On (cannot be switched off); Intel VT-d Feature: On (cannot be switched off)

I've installed the Driver via SDK-Tools: Android Emulator hypervisor driver (installer): Installed (Version 2.2.0)

The installer from Github failed (silent_install.bat) (I translated the output-message):

[SC] ControlService ERROR 1062:

Service not started.

[SC] DeleteService SUCCESS
[SC] StartService NOT SUCCESSFUL, ERROR 4294967201.

Check for Hardware Acceleration in the Emulator failed: emulator -accel-check liefert folgende Antwort:

INFO    | Storing crashdata in: C:\Users\xxxx\AppData\Local\Temp\\AndroidEmulator\emu-crash-34.1.20.db, detection is enabled for process: 15964
Mayer\AppData\Local\Android\Sdk\emulator\emulator-check.exe:
100
Unknown argument
Mayer\AppData\Local\Android\Sdk\emulator\emulator-check.exe
accel:
0
Please disable Hyper-V before using the Android Emulator.  Start a command prompt as Administrator, run 'bcdedit /set hypervisorlaunchtype off', reboot.WHPX (10.0.19045) is installed and usable.
accel

I ran bcdedit /set hypervisorlaunchtype off as suggested and it succeeded.

But the check in Windows command line shows that driver is not running: sc query aehd

SERVICE_NAME: aehd                             
        TYPE               : 1  KERNEL_DRIVER  
        STATE              : 1  STOPPED        
        WIN32_EXIT_CODE    : 31  (0x1f)        
        SERVICE_EXIT_CODE  : 0  (0x0)          
        CHECKPOINT         : 0x0               
        WAIT_HINT          : 0x0 

The Check for Hardware Acceleration in the Emulator failed: emulator -accel-check

INFO    | Storing crashdata in: C:\Users\*****\AppData\Local\Temp\\AndroidEmulator\emu-crash-34.1.20.db, detection is enabled for process: 15964
Mayer\AppData\Local\Android\Sdk\emulator\emulator-check.exe:
100
Unknown argument
Mayer\AppData\Local\Android\Sdk\emulator\emulator-check.exe
accel:
0
Please disable Hyper-V before using the Android Emulator.  Start a command prompt as Administrator, run `bcdedit /set hypervisorlaunchtype off`, reboot.WHPX (10.0.19045) is installed and usable.
accel

System-Information:

Windows 10 Enterprise 10.0.19045 Build 19045
Processor: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz, 2803 MHz, 4 Kerne, 8 logische Prozessoren
Physical Memory: 16.0 GB
BIOS: LENOVO N34ET48W (1.48),28.01.2022

Android Studio Information:

Android Studio Iguana 2023.2.1 Patch 1
Android SDK Build-Tools 35-rc3

Does anybody know what I am doing wrong?

1
  • If you execute systeminfo on command-line at the end of the output there should be a section about Hyper-V. Does it show that all features are disabled?
    – Robert
    Commented May 2 at 7:11

1 Answer 1

1

We have the same problem but found a solution. What I did was use an elevated cmd prompt to run my avd.

  1. Open cmd with admin rights
  2. Go to c:\users\"your username"\AppData\Local\Android\Sdk\emulator
  3. Then use the following syntax: emulator -avd "avd_name" -gpu "mode"

Example: I named my virtual device as "xXx" so my command would be; emulator -avd xXx -gpu "mode"

For the -gpu mode:

  • auto: Let the emulator choose between hardware or software graphics acceleration based on your computer setup.

  • host: Use the GPU on your computer for hardware acceleration. This option typically provides the highest graphics quality and performance for the emulator. However, if your graphics drivers have issues rendering OpenGL, you might need to use the swiftshader_indirect or angle_indirect options.

  • swiftshader_indirect: Use a Quick Boot-compatible variant of SwiftShader to render graphics using software acceleration. This option is a good alternative to host mode if your computer can't use hardware acceleration.

  • angle_indirect: (Windows only) Use a Quick Boot-compatible variant of ANGLE Direct3D to render graphics using software acceleration. This option is a good alternative to host mode if your computer can't use hardware acceleration. In most cases, ANGLE performance is similar to using host mode because ANGLE uses Microsoft DirectX instead of OpenGL.

    On Windows, Microsoft DirectX drivers typically have fewer issues than OpenGL drivers. This option uses Direct3D 11 and requires Windows 10, Windows 8.1, or Windows 7 SP1 with the Windows 7 Platform Update.

  • guest: Use guest-side software rendering. This option provides the lowest graphics quality and performance for the emulator.

After you have chosen a mode, then proceed using the syntax: emulator -avd xXx -gpu angle_indirect

By the way, the host mode is the fastest, but go ahead and experiment at your own risk.

Hope this helps!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .