Android Enthusiasts
Q&A for enthusiasts and power users of the Android operating system
Latest Questions
1
votes
1
answers
6858
views
Android Emulator Hypervisor Driver doesn't work
I have an Android Headunit in my car and I have started to "play" with [Tasker][1] 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 h...
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?
Philipp FJ Mayer
(11 rep)
May 1, 2024, 05:37 PM
• Last activity: Sep 16, 2024, 12:01 AM
1
votes
1
answers
713
views
Possible to use h264_mediacodec hardware encoder in Android?
Is it possible to use hwaccel h264_mediacodec encoder in Android? Here is the error I get in Termux: Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_mediacodec)) Stream #0:1 -> #0:1 (aac (native) -> aac (native)) Press [q] to stop, [?] for help [swscaler @ 0x7493629240] deprecated pixel format used...
Is it possible to use hwaccel h264_mediacodec encoder in Android?
Here is the error I get in Termux:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_mediacodec))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help [swscaler @ 0x7493629240] deprecated pixel format used, make sure you did set range correctly
Last message repeated 3 times
[h264_mediacodec @ 0x73933efe40] Use 1 as the default MediaFormat i-frame-interval, please set gop_size properly (>= fps) [amediacodec_ndk @ 0x73633f47d0] Encoder configure failed, -10000 [h264_mediacodec @ 0x73933efe40] MediaCodec configure failed, Generic error in an external library
[vost#0:0/h264_mediacodec @ 0x73833f5b10] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height. Error while filtering: Generic error in an external library [out#0/mp4 @ 0x73333f9070] Nothing was written into output file, because at least one of its streams received no packets. frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=00:00:01.02 bitrate= 0.0kbits/s dup=1 drop=0 speed=2.94x
[aac @ 0x73933f20c0] Qavg: 5968.975
Conversion failed!
~ $
Yuriy IP
Dec 12, 2023, 08:12 PM
• Last activity: Dec 23, 2023, 06:35 AM
1
votes
0
answers
2282
views
Hardware accelerated ffmpeg using MediaCodec on Android?
I've tried running for example `ffmpeg -i 1_5111632628432240784.MP4 -c:v h264_mediacodec -c:a aac -b:v 1M -g 60 test.mp4` in Termux in different variations, which yields an output like this, regardless of whether I specify output bitrate or not: ``` amediacodec_ndk @ 0xb400006fa0cc6980 Encoder confi...
I've tried running for example
ffmpeg -i 1_5111632628432240784.MP4 -c:v h264_mediacodec -c:a aac -b:v 1M -g 60 test.mp4
in Termux in different variations, which yields an output like this, regardless of whether I specify output bitrate or not:
amediacodec_ndk @ 0xb400006fa0cc6980 Encoder configure failed, -10000
[h264_mediacodec @ 0xb400006fa0cd2000] MediaCodec configure failed, Generic error in an external library
[vost#0:0/h264_mediacodec @ 0xb400006fa0cb9300] Error initializing output stream: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
I saw that ffmpeg supports MediaCodec since February 2023: "MediaCodec decoder via NDKMediaCodec, MediaCodec encoder".
The version I have installed is compiled to support it:
ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers
built with Android (9352603, based on r450784d1) clang version 14.0.7 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0cca074e9238af8b4106c30add4418f6)
configuration: --arch=aarch64 --as=aarch64-linux-android-clang --cc=aarch64-linux-android-clang --cxx=aarch64-linux-android-clang++ --nm=llvm-nm --pkg-config=/home/builder/.termux-build/_cache/android-r25c-api-24-v2/bin/pkg-config --strip=llvm-strip --cross-prefix=aarch64-linux-android- --disable-indevs --disable-outdevs --enable-indev=lavfi --disable-static --disable-symver --enable-cross-compile --enable-gnutls --enable-gpl --enable-version3 --enable-jni --enable-lcms2 --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgme --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenmpt --enable-libopus --enable-librav1e --enable-libsoxr --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-mediacodec --enable-opencl --enable-shared --prefix=/data/data/com.termux/files/usr --target-os=android --extra-libs=-landroid-glob --disable-vulkan --enable-neon --disable-libfdk-aac
libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100
libswresample 4. 10.100 / 4. 10.100
libpostproc 57. 1.100 / 57. 1.100
So my question is, how can I use hardware accelerated video decoding and encoding using ffmpeg on Android in a terminal?
user9279628
(11 rep)
Oct 25, 2023, 08:51 PM
• Last activity: Oct 25, 2023, 10:41 PM
0
votes
0
answers
356
views
VM acceleration is not working on another VM for Android Emulator
We want to run our instrumented tests on Gitlab. We've created a Linux runner(amd64,Ubuntu 22.04) to execute connectedAndroidTest gradle task. However we've come across some obstacles. I have two questions : - According [this article][1], I read that we can not use VM acceleration for android emulat...
We want to run our instrumented tests on Gitlab. We've created a Linux runner(amd64,Ubuntu 22.04) to execute connectedAndroidTest gradle task. However we've come across some obstacles.
I have two questions :
- According this article , I read that we can not use VM acceleration for android emulator in another VM ? Is it true ?
- Is there anyone able to run the instrumented tests on another VM using VM acceleration? VM acceleration is important because it improves execution speed. Otherwise it will take a long time to start the emulator.
While trying this for android-31(x86_64) emulator, I'm getting error below even if KVM is enabled on VM.
KVM: entry failed, hardware error 0x8
FATAL | Emulator: exiting becase of the internal error 'kvm_arch_handle_exit:
hardware error happened in KVM, aborting now
Also I checked these:
$./emulator -accel-check
accel:
0
KVM (version 12) is installed and usable.
accel
$kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
I thought if the official site says like this, maybe it's true. Otherwise we have to build a physical Linux machine for hardware acceleration or we have to increase our resources on VM and continue without VM acceleration. (cpu,memory etc.) :)
Regards,
Tugce.
tugceaktepe
(101 rep)
Mar 14, 2023, 09:07 PM
1
votes
0
answers
1173
views
VLC black screen, and Disable HW Overlays
I have a Samsung Galaxy Xcover 2, with rooted Android 4.1.2. I have installed VLC v3.0.13 on it - which is seemingly the last version that can be installed on Android 4.1.2 (all later builds of VLC for Android require Android 4.2+). I really like VLC because it has NFS sharing built in, so I could i...
I have a Samsung Galaxy Xcover 2, with rooted Android 4.1.2.
I have installed VLC v3.0.13 on it - which is seemingly the last version that can be installed on Android 4.1.2 (all later builds of VLC for Android require Android 4.2+). I really like VLC because it has NFS sharing built in, so I could in principle watch videos from an NFS network share, which I've done previously on other devices with great success.
The problem is: when I play any video on it (mostly 360p .mp4 obtained from
youtube-dl
), audio can be heard, however in full screen mode, screen is black; when GUI with player controls are shown, one can somewhat discern a part of the video being shown in a stripe underneath the controls; and when the device/screen is rotated, there is a brief flash of the video shown, but then it disappears, and the screen goes back to black.
I have found this thread:
* https://emby.media/community/index.php?/topic/31940-black-screen-on-video-playback/ (refers to https://forum.fairphone.com/t/vlc-player-only-shows-black-screen-for-video-playback-on-fp1/19060/7 )
... which seems to describe the exact same problem:
> The problem: No video, just a black screen except when you change
> device orientation (landscape to portrait for example), when you exit
> the playback or when you click settings button, the video appears for
> a fragment of a second.
>
> Audio and subtitles playing correctly.
>
> Probably this problem only occurs in some devices.with pre kitkat
> versions.
>
> The solution: disable HW overlays in Settings > Developer options (if
> Developer options don't shows:
> http://www.androidcentral.com/how-enable-developer-settings-android-42)
Ok, so I went to Android Settings / Developer Options, and checked "Disable HW overlays", however, that seems to have no effect (video still does not appear/screen is still black); besides, when I reboot the phone, "Disable HW overlays" is unchecked again - which is also an experience from a Samsung device later in the same thread:
> I have this exact same issue, and "Disable Hardware overlays" does not work on my Samsung Android phone. Also everytime the phone is rebooted this feature is turned off, meaning hardware overlays are enabled.
So, my question is - is there anything I can do, to get VLC to properly play the video on the screen on this device?
sdaau
(331 rep)
Dec 12, 2020, 07:28 PM
0
votes
0
answers
65
views
SoC compute-resource usage monitor for single app
I need to understand the **compute resource usage of a compute-intensive app**; this includes the **CPU** (ideally including the core ID), **GPU, DSP, AI Engine** in the processor (for Quallcom chips). I have found many ways to track the CPU usage per app, but am yet to find one that tracks the GPU...
I need to understand the **compute resource usage of a compute-intensive app**; this includes the **CPU** (ideally including the core ID), **GPU, DSP, AI Engine** in the processor (for Quallcom chips). I have found many ways to track the CPU usage per app, but am yet to find one that tracks the GPU or DSP usage per app.
What can I use to monitor the compute-resource usage of an app?
kesari
(151 rep)
Nov 2, 2020, 05:14 AM
3
votes
2
answers
8309
views
"Significant Motion sensor" same as accelerometer?
I am trying to understand better the "Significant Motion" sensor: I know that I have accelerometer. Does it mean that the device also supports "Significant Motion sensor"? According to [https://source.android.com/devices/sensors/sensor-types.html#significant_motion][1] it is the same, but I'm not su...
I am trying to understand better the "Significant Motion" sensor:
I know that I have accelerometer. Does it mean that the device also supports "Significant Motion sensor"?
According to https://source.android.com/devices/sensors/sensor-types.html#significant_motion it is the same, but I'm not sure.
Is there a utility/apk to check its validity ?
Thank you,
Ran
ransh
(339 rep)
Jan 23, 2017, 02:15 PM
• Last activity: Jan 3, 2020, 03:03 AM
0
votes
0
answers
1151
views
Difference between Android sensors (acceleration, gyroscope, rotation vector)
I have an Android 7 phone and I have written an Android application for recording the following sensor values: Accelerometer (Sensor.TYPE_ACCELEROMETER) Linear acceleration (Sensor.TYPE_LINEAR_ACCELERATION) Gravity (Sensor.TYPE_GRAVITY) Gyroscope (Sensor.TYPE_GYROSCOPE) Magnetic Field (Sensor.TYPE_M...
I have an Android 7 phone and I have written an Android application for recording the following sensor values:
Accelerometer (Sensor.TYPE_ACCELEROMETER)
Linear acceleration (Sensor.TYPE_LINEAR_ACCELERATION)
Gravity (Sensor.TYPE_GRAVITY)
Gyroscope (Sensor.TYPE_GYROSCOPE)
Magnetic Field (Sensor.TYPE_MAGNETIC_FIELD)
Rotation Vector (Sensor.TYPE_ROTATION_VECTOR)
Game Rotation Vector (Sensor.TYPE_GAME_ROTATION_VECTOR)
I think the linear acceleration is the accelerometer minus gravity.
Can somebody explain what the difference between accelerometer, gyroscope, rotation vector and game rotation vector is? I've read the description in the Android documentation but it is not clear to me.
Moreover, can I use the magnetic field recordings to calculate some motion or position measurements which I'm not getting from the other listed sensor measurements?
machinery
(115 rep)
Apr 3, 2019, 12:10 PM
1
votes
0
answers
2817
views
How do I check if my phone has hardware video encoder?
I own a Samsung j7 2016 and I did some search about the CPU and looked for information tools but I've found codec info but not hardware video encoder info anywhere. If you know any app or adb command to retrieve info about this, it'll be helpful.
I own a Samsung j7 2016 and I did some search about the CPU and looked for information tools but I've found codec info but not hardware video encoder info anywhere.
If you know any app or adb command to retrieve info about this, it'll be helpful.
Uğur Gümüşhan
(111 rep)
Feb 3, 2018, 04:51 AM
0
votes
1
answers
75
views
Any way to have hardware accelerated virtualization without changing HW?
when I installed Android Studio on my Windows box, at the end of installation it told me "Android SDK is up to date" but it complained that "your computer does not support hardware accelerated virtualization". Then it listed some alternative options. Looks like this is because my native HW has non-I...
when I installed Android Studio on my Windows box, at the end of installation it told me
"Android SDK is up to date"
but it complained that
"your computer does not support hardware accelerated virtualization".
Then it listed some alternative options. Looks like this is because my native HW has non-Intel (AMD) CPUs.
So my question to Android developers is,
does anyone know of a way to have hardware accelerated virtualization without changing my PC hardware?
MikeRoger
(103 rep)
Nov 17, 2016, 03:34 PM
• Last activity: Nov 18, 2016, 06:11 PM
0
votes
0
answers
158
views
Increase phone speed
My phone is sometimes freezed. I have installed and configured Clean Master and Battery Doctor, but it still slow. My Phone is Huawei Y300, running Android 4.1. What can I do for speed up the system? Buying another phone is not an option
My phone is sometimes freezed. I have installed and configured Clean Master and Battery Doctor, but it still slow. My Phone is Huawei Y300, running Android 4.1. What can I do for speed up the system?
Buying another phone is not an option
Roberto Tellez Ibarra
(111 rep)
Sep 28, 2015, 03:07 PM
• Last activity: Nov 1, 2016, 01:10 PM
1
votes
0
answers
76
views
Do android games use the graphic card on a laptop?
I installed Android on my laptop as dual boot with indows 8.1 (I am not talking about virtualization or emulators). I have 1 GB NVIDIA graphic card on my laptop. So does Android use my graphic card to improvement game performance?
I installed Android on my laptop as dual boot with indows 8.1 (I am not talking about virtualization or emulators).
I have 1 GB NVIDIA graphic card on my laptop. So does Android use my graphic card to improvement game performance?
Ridham
(129 rep)
Dec 2, 2015, 02:44 PM
• Last activity: Feb 27, 2016, 01:03 AM
2
votes
1
answers
9707
views
Setting up hardware accelerated Android emulation (HAXM) on Fedora or other RPM distributions?
I'm doing Android development, and the emulation is (unsurprisingly) slow. I see there's some documentation for setting up hardware acceleration (Intel HAXM) at http://software.intel.com/en-us/articles/speeding-up-the-android-emulator-on-intel-architecture This documentation covers installation for...
I'm doing Android development, and the emulation is (unsurprisingly) slow. I see there's some documentation for setting up hardware acceleration (Intel HAXM) at
http://software.intel.com/en-us/articles/speeding-up-the-android-emulator-on-intel-architecture
This documentation covers installation for Windows and Linux, but for Linux it's Ubuntu specific - has anyone had success with setting this up on Fedora, or other recent RPM-based distro?
Anthony
(91 rep)
Jan 23, 2014, 09:07 PM
• Last activity: Jan 17, 2016, 03:58 PM
5
votes
1
answers
8058
views
How do I change Android screen orientation via simulating acceleration?
I have developed an app and I need to test it. I have borrowed some devices from my friends and bought a few. Now problem is that I want to test it in both landscape mode and portrait mode but I don't want to keep on changing the orientation of phones every 5 minutes manually by myself. Is there any...
I have developed an app and I need to test it. I have borrowed some devices from my friends and bought a few. Now problem is that I want to test it in both landscape mode and portrait mode but I don't want to keep on changing the orientation of phones every 5 minutes manually by myself.
Is there any adb command or anything else by which I can tell the phone to change its orientation? Can I fool it by simulating acceleration or any other alternative?
I am open to rooting but I prefer any solution which works on non-rooted phones.
Aditya Patawari
(179 rep)
Nov 8, 2012, 08:55 AM
• Last activity: Nov 8, 2012, 11:37 AM
3
votes
3
answers
1150
views
Video player for H264 videos for Adam/Tegra2?
It seems that the Adam is not fast enough to decode my H264 videos. With some players I get unsync audio, some skip video frames. Even usual PAL size (something around 500x300, far from HD). Ok, Those may have non-basic profile, but I think they are [main-profile][1] (most use CABAC, though). The pl...
It seems that the Adam is not fast enough to decode my H264 videos. With some players I get unsync audio, some skip video frames. Even usual PAL size (something around 500x300, far from HD). Ok, Those may have non-basic profile, but I think they are main-profile (most use CABAC, though).
The players I tried include
* MX Video Player -- best results, but can not keep up with most H264 vids
* VPlayer -- good results
* RockPlayer -- often recommended, often tried, no good results.
As you can see, all freely available ones. I *would like* buy one, If I would know that my videos are handled properly.
**Can you suggest a video player that really uses Tegra2 hardware decoding capabilities and therefore will decode the H264 videos nicely?**
(Is it important to know that I run Adamcomb on it?)
towi
(131 rep)
Oct 20, 2011, 09:59 AM
• Last activity: May 9, 2012, 07:03 AM
2
votes
1
answers
588
views
Is there a way to lower GPU load from Ice Cream Sandwich?
I have seen some mentions (including here on Android SE) that Ice Cream Sandwich may not necessarily run optimally (e.g. will be slow/lag) on devices with slower/older GPUs. I assume that's due to GUI elements in the 4.0 being more graphics intensive, same way Windows XP had more graphics intensive...
I have seen some mentions (including here on Android SE) that Ice Cream Sandwich may not necessarily run optimally (e.g. will be slow/lag) on devices with slower/older GPUs.
I assume that's due to GUI elements in the 4.0 being more graphics intensive, same way Windows XP had more graphics intensive GUI as well as Vista/Windows 7 had Aero.
However, on Windows, you always had an option to explicitly downgrade the OS's graphics effects, to improve performance (especially on older hardware) - e.g. you could turn off various GUI element transitions - see screenshot below. As far as I know, you can also turn off Aero on Windows Vista/7 (though I don't use them so not certain).
**QUESTION: Is it possible to similarly tune Ice Cream Sandwich to downgrade GUI graphics frills to improve performance on older GPUs?**
I'm only interested in regular OS/app performance, NOT game graphics performance.

DVK
(2099 rep)
Feb 7, 2012, 09:37 PM
• Last activity: Feb 7, 2012, 10:04 PM
4
votes
3
answers
1075
views
Is there any graphic-accelerated PDF reader for Android?
I use Adobe's Reader and ThinkFree Office, but they both are too slow. Any suggestions?
I use Adobe's Reader and ThinkFree Office, but they both are too slow. Any suggestions?
Andrei Moiseev
(187 rep)
Jul 10, 2011, 03:47 PM
• Last activity: Nov 12, 2011, 07:28 PM
Showing page 1 of 17 total questions