Why is running android app so slow on windows 7, pentium n3540? - performance

I installed android studio 2.2 and created emulator nexus 4.
My emulator's details are:
Name: Nexus_4_API_23
CPU/ABI: Google APIs Intel Atom (x86_64)
Path: D:\Programs\Android\.android\avd\Nexus_4_API_23.avd
Target: google_apis [Google APIs] (API level 23)
Skin: nexus_4
SD Card: D:\Programs\Android\.android\avd\Nexus_4_API_23.avd\sdcard.img
hw.dPad: no
runtime.network.speed: full
hw.accelerometer: yes
hw.device.name: Nexus 4
vm.heapSize: 64
skin.dynamic: yes
hw.device.manufacturer: Google
hw.gps: yes
hw.initialOrientation: Portrait
image.androidVersion.api: 23
hw.audioInput: yes
image.sysdir.1: system-images\android-23\google_apis\x86_64\
tag.id: google_apis
showDeviceFrame: yes
hw.camera.back: emulated
hw.mainKeys: no
AvdId: Nexus_4_API_23
hw.camera.front: emulated
hw.lcd.density: 320
avd.ini.displayname: Nexus 4 API 23
hw.gpu.mode: auto
hw.device.hash2: MD5:6930e145748b87e87d3f40cabd140a41
hw.ramSize: 512
hw.trackBall: no
hw.battery: yes
hw.cpu.ncore: 2
hw.sdCard: yes
tag.display: Google APIs
runtime.network.latency: none
hw.keyboard: yes
hw.sensors.proximity: yes
disk.dataPartition.size: 800M
hw.sensors.orientation: yes
avd.ini.encoding: UTF-8
hw.gpu.enabled: yes
When I run simple app it does gradle rebuild and launches it on emulator. And it takes near 2 minutes every time I run it even when emulator is on.
In console, run ends with these messages:
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
I/OpenGLRenderer: Initialized EGL, version 1.4
D/gralloc_ranchu: Emulator without host-side GPU emulation detected.
Haxm is installed and working. Intel virtualization technology is enabled in bios.
What is wrong with my emulator options?
Why is my android studio so slow?

Solved it. In android studio go to Tools>Android>AVD Manager.
Click on edit button of your virtual device
Next find Graphics option and select Hardware - GLES 2.0.
Now running app when emulator is on is very quick.
And in console there is no message: Emulator without host-side GPU emulation detected.
The best android tutorial I've found is at https://www.udacity.com/course/new-android-fundamentals--ud851
There are more free android tutorials at https://www.udacity.com/courses/android

Two suggestions for best performance:
Install Intel HAXM:
https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager
Enable Host GPU:

Related

Android Emulator, graphical glitches on Windows 11

I have a Windows 11 machine, with a RTX 3050 graphics card. It's a Dell G15 laptop. I cannot find a (good) solution to the graphical glitches that appears on an Android Emulator.
The only "solution" I found was to change the hw.gpu.mode in the config.ini file from auto to guest. That fixes the glitches, but causes really bad performance issues and one app I developed with Flutter for my company straight up doesn't load. (loads when hw.gpu.mode=auto).
I'd appreciate if you can point me to the right direction to solving this. Let me know if you need any other details about my machine:
OS: Windows 11 Home Single Language [64-bit]
Kernel: 10.0.22000.0
CPU: 11th Gen Intel(R) Core(TM) i5-11260H # 2.60GHz
GPU: NVIDIA GeForce RTX 3050 Laptop GPU
Nvidia driver version: 516.94 (Downloaded the "Game ready driver" from GeForce Experience)
This problem is only on emulators with android 12+, personally i installed a device with android 11 and a second device with android13 for tests.
It seems like dedicated Nvidia GPU's are causing the problem. I have a 3060 laptop and I have the same issue and when I set it to guest it seems to work. My guess is that setting changes it from using the GPU to the CPU. I would recommend you try setting android studio to use integrated graphics instead of dedicated. Since I have a 8 core CPU compared to a 4 core CPU of yours, I'm guessing that's the reason I don't get as bad performance

DirectX 11 steam.dll overhead on Windows 7

I have dx11 app which drops performance on win7 when linked with steam.dll.
App hangs in dx11.device->CreateDeferredContext for ~8ms in ~75% frames in main thread.
No such issue in app built without steam. Also cannot reproduce on win10.
I suspect that Steam hooks DirectX calls and does something to them, like adding additional synchronization or something.
Any help is appreciated.
App info:
32 bit app built on Windows 10 with visual studio 2017 (version 15.4.5)
command buffers with deferred context are created each frame (hang is there)
Swapchain present mode for Windows 7: DXGI_SWAP_EFFECT_SEQUENTIAL with VSync
Problem environment:
Lenovo laptop with Windows 7
NVidia GeForce 840m with 378.66 driver
DirectX feature level 11.0
Disabling "steam overlay" in steam client settings doesn't help
GPU frame time according to performance queries is low (~5ms)

High CPU usage with Android emulator (qemu-system-i386.exe)

The emulator qemu-system-i386.exe cpu usage almost constantly running between 7~9
Android studio 2.1
Android SDK Tools: 25.1.3
Host Operating System: Windows 7 - i7 2630QM - 8GB Ram
Intel x86 Atom System Image installed
No matter what setting i change in the emulator like: emulated performance, multi-core CPU, x86-64 image, always the same thing
It is really annoying fan always on
Anyone had a fix for this issue?
The cause of the constant CPU usage could be the sound. If you do not need sound in your emulator you can disable it by editing the AVD's config file.
Change/add those two lines
hw.audioInput=no
hw.audioOutput=no
Update: As buncis commented you can also try to disable GPS if not needed:
hw.GPS = no
On Linux/Mac the file is located at ~/.android/avd/<AVD_Name>.avd/config.ini
On Windows the file is located at C:\Users\<username>\.android\avd\<AVD_Name>.avd\config.ini
On Mac I noticed that the emulator was using over 100% CPU after my laptop went to sleep. Turning the audio off as Benjamin suggested didn't fix that problem.
Restarting the simulated device by long-pressing the power button on the emulator works for me.
Using the x86_64 (Or the 64 bit) emulator solved it for me. They recommend the x86 version, but it was acting up for me.
To find out what on the virtual device is using the most CPU:
adb shell
$ top
This will show you a list of processes with the highest CPU usage atop.
This will help you determine whether it's a process (such as your app) inside the emulator, another process inside the emulator, or just the emulation itself using a lot of CPU.
In the latter case, try optimizing the emulator by installing HAX (Native intel instructions) or perhaps enable hardware acceleration using the AVD profile editor.
I had that problem on the start of November 2018.
Virtual device was contently trying to connect to the mobile network data, so I turned it off inside of the device itself.
Work great now.
The same problem with qemu on Win7, HAXM 7.2.0. I've tried switch off audio, it didn't help, qemu consumes about 20% of CPU anytime, Android works very slow on both x86 and x64 images.
I've found solutions in HAXM's Release Notes file:
On Windows, Avast Antivirus may interfere with HAXM and cause Android Emulator or QEMU to run very slowly. A workaround is to uncheck "Use nested virtualization where available" in Avast Settings > Troubleshooting.
I have Avast Pro Antivirus 18.5. I've unchecked this param, rebooted PC and now qemu consumes 0% in idle, Android works fine.
UPDATE: if QEMU started consume CPU again, first check Avast's update status. After background update Avast may start to interfere to HAXM again. Just reboot Windows to solve it.
In my case using hardware graphic solved my problem.
my case, coz I choose software for graphics rendering in adv. so after a change to the hardware reduce CPU usage from 60 to 10, and CPU temp from 70 to 40.
I am on macOS Catalina(Version 10.15.2) with Intel Core i9 and 16 GB RAM and Radeon Pro 560X 4GB Graphics.
I solved high CPU usage by qemu by restarting the emulated device using the emulated power button.
Also, while creating the AVD, I chose Hardware Graphics Renderer instead of Auto.
Using kind of old Android version I used Lollipop Galaxy Nexus API 22 dropped CPU usage from 220% to around 30% ! ...
I also switched: Emulated Performance > Graphics > Hardware
Using Android Api 25 ... Hardware for graphics and turning off AVD audio and GPS didn't work for me...
Platform: MacOS
I reduced the CPU usage of my emulator by setting the framerate of the monitor to 60hz. It was on 144hz and my CPU was running at 60% - 70%. By only changing the framerate of the monitor, it's now sitting at 3% usage.
I wasn't able to shut the audio off with the config.ini file, but only with the -noaudio cmd line argument to qemu. However, with Android Studio 3.2, you can't add custom arguments to the emulator, so I made this:
In the emulator dir of the Android SDK, in my case ~/Android/Sdk/emulator/
mv emulator emulator.orig
Make a bash script called emulator with the content:
#!/bin/bash
DIR=`dirname "$0"`
$DIR/emulator.orig -noaudio $*
Then:
chmod +x emulator
Now, the argument -noaudio will be added to all invocations of emulator from Android Studio and will save you a lot of CPU cycles.
I solved it by cancelling "Auto-save current state to Quickboot"
Snapshots -> Settings -> Auto-save current state to Quickboot - NO
I had the same issue recently on Windows 10 (18363): the AVD used all of the host's 16 Threads at 100%, it seems the android.hardware.graphics.composer#2.1-service process on the AVD was to blame.
What helped in my case: going to AVD settings - Advanced - change the OpenGL ES renderer to Desktop native OpenGL and restart the AVD. Now it uses like 2-3% of my CPU resources. Hope this helps someone.
Update:
I have installed Genymotion plugin at genymotion.com/plugins, and it has an amazing performance
In my case, I only encountered this issue when running multiple instances of the emulator.
Re-run the Intel Hardware Accelerated Execution Manager (HAXM) installer provided in the Android SDK (<Android SDK path>\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm-android.exe), select Change, and see how much memory is allocated to HAXM. If it's 2 GB or less, you probably want to raise it to at least 4 GB. Then restart your emulator and see if the CPU usage drops.
Disable location in settings and also disable touch sounds.
In my case it was the fast boot that was causing the problem, to force into normal boot open the text file in C:\Users\<username>\.android\avd\<AVD name>\config.ini and change at least one of the values.
for example change the line
hw.battery=yes
to
hw.battery=no
In my case it was Airplane mode, when turned ON the CPU usage jumped to 99%:
adb shell
$ top
The issue was noticed on Android 10.0 x86.
If you turn Airplane Mode OFF then the CPU usage should return to normal.
Changing the resolution worked form me. I was using 1440 x 2560 560 dpi Oreo 8.1. Now im using M-DPI Oreo 8.1
For me I turned WIFI off and I dropped from 112% usage to 10%. I would recommend doing this
Just do
$adb shell
$top
Look the PID which high CPU
$kill -9 <PID>
on api31&32: do EDIT each AVD config with Show Advanced Settings and be sure to:
Multi-Core CPU > max (<=> hw.cpu.ncore=8,
4/cores is not enough and may overheat cpu strongly)
Graphics > Hardware (GLES 2.0)
No-SDCard (<=> hw.sdCard=no)

Initializing D3D12 debug interfaces failing on laptop with GeForce 960M

When I try to call D3D12GetDebugInterface or CreateDXGIFactory2 with the flag DXGI_CREATE_FACTORY_DEBUG, the calls are failing on my laptop, but not on my desktop. Other calls work fine on the laptop and I can render stuff -- I just can't initialize the debug layer. The desktop has an oldish GeForce 650 Ti, and the laptop is a Dell XPS15 laptop (latest gen), which has a GeForce GTX 960M. Both have the latest drivers (361.43). Any ideas what could be going wrong?
I posted on the NVIDIA devtalk forum first, but cross-posted to stackoverflow because the official NVIDIA forum seems pretty dead.
For Direct3D 12, both the debug layer and the WARP12 device are part of the Graphics Tools feature-on-demand which is not part of the default install. You need to enable it on your desktop system.
This FOD package is specific to your version of Windows 10. If you had it enabled but then upgrade the OS (say from 10240 to 10586) the existing Graphics Tools feature-on-demand is disabled. You need to re-enable it so the newer matching version can be installed.
See Visual C++ Team Blog

Windows Phone 8 emulator with ARM NEON

When developing an application for Windows Phone 8 on ARM, is there a way to simulate or emulate the app if it has ARM NEON assembly? I.e., is the code compiled for x86 and run natively, or is it there a way to actually emulate an ARM NEON machine?
The Windows Phone 8 emulator is an x86 environment, so ARM code isn't going to work.
There's no emulator, but there's a free remote device access service, courtesy of Nokia, at http://rda.cellulardata.com/devices . You can't debug, but you can watch it run. Bake in some visible reporting into your app, publish it as a beta, download to a device and enjoy.
Since it's a beta, it won't be available via store search; you'd have to type in a URL. A link shortening service or a forward page on your own web space would come in handy here.
You have to explicitly designate your own Live ID as a beta tester account for a beta project. The Store doesn't recognize the "I'm downloading my own app" situation.
...let me add that the Phone devices are still ARM, so if you want to run on both device and emulator, you'll need to compile your native code for both ARM and x86.

Resources