V4L2 FPS drops on android with more cores - android

I have three android devices Single core, Dual core and Quad core. I was able to make an app using v4l2 to grab the picture.
In standby mode all three devices are giving me 30FPS (as announced by camera hardware provider). But as soon as I start some processing on image and draw on canvas the FPS of Dual core and Quad core devices drops drastically. Single core device FPS reaches 28 which is acceptable but Dual core becomes 18 (on average) and Quad core 12.
I have used CPU performance governor in all three devices. Without performance mode FPS are even lower.
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Initially I thought it has something to do with customized linux kernel in android So,
I flashed PicUntu on quad core device but still I saw similar behavior in FPS drop. On Desktop with Windows and Ubuntu there is no such issue in the camera. I guess it has something to do with ARM.
Have anyone faced similar problem for UVC camera with V4L2 driver on android(ARM devices)? Is there any way to increase the FPS?
EDIT ** Adding some more information
For KitKat device if I bind my usb task to single core (taskset), FPS is improving by small factor. In kitkat overall performance is also better than Jelly bean.
I am not sure why usb speed suffers when the application goes to background even when overall cpu usage is small.

Related

Inexplicable performance difference in Unity Android

Scenario: I have a simple scene with around 15k tris (depending on where you look), using Legacy Difuse shaders.
I run the game on a Galaxy S5 Android 6.0.1. From GSM Arena:
released 2014, April
Chipset Qualcomm MSM8974AC Snapdragon 801 (28 nm)
CPU Quad-core 2.5 GHz Krait 400
GPU Adreno 330
Getting 50 FPS average
Profiler screenshots
I run the game on a Lenovo P2 Android 7.0. GSM Arena:
Released 2016, November
Chipset Qualcomm MSM8953 Snapdragon 625 (14 nm)
CPU Octa-core 2.0 GHz Cortex-A53
GPU Adreno 506
Getting 38 FPS average
Profile screenshots
What I've tried so far:
replace the legacy difuse shader with mobile difuse -> both phones gain 10 fps, same performance gap
disable auto graphics api and force GLES2 - no difference
force GLES3 - no difference
tried using the Snapdragon profiler to make a snapshot capture but it keeps crashing when I try to take the snapshot
forcing the same resolution on both devices (1080), no change (I was thinking that Unity might do some magic and downscale on the S5), also note that both phones are 1080p
Unity 2018.3.0f2
Same game, same graphics profiles (preferences), same everything. How is this possible?
This is just a stripped down main menu of the game. The main scene of the game (a city with 80k tris on average, and many Standard shaders, runs at over 40 FPS on GS5, and at 28-30 on P2 :/. I also tried the city scene on a Xperia XA2 (slightly better specs than the P2) and it runs at around 56-60 fps)
PS: Notice in the screenshots how because of looking at a different area, the S5 renders more things on screen, yet still has so much more FPS than the P2
// Edit Updated thread with the missing info from comments bellow

What is the maximum framerate achievable on Android and iOS devices with Unity3d?

I was wondering what is the maximum framerate that could be achieved on iOS and Android devices with Unity3d. Can 60 fps and 100 fps be reached?
What FPS should I provide:
Android as a platform aims to provide 60fps as a standard. However, keep in mind this is for Applications which come nowhere near the GPU requirements of a game.
If you can't do all of the calculations you require in 16ms (60fps) you should aim to provide 30fps and provide the user a consistent experience. User's will quickly detect variations in frame rate and interpret this as a performance issue with their phone.
Never over-promise and under-deliver.
Modern phones claim to have quad core processors with other incredible hardware profiles. Rarely are you taking advantage of the full capabilities of a phone, the hardware and Android platform is designed to use as minimal battery as possible and cut corners when it can.
Your user's phone is typically idling and the full potential will be activated for a sparing amount of ms to perform work and catch up on operations.
What is the max performance on Android:
You can search for Android benchmark test's using Unity, keep a very open mind for what each phone puts through as there are more than 12,000 hardware configurations for Android.
Your development phone and those for testing should be expected to be significantly better than your user's phones.

how many the waves(threads) are scheduled and executed on the GPU using OpenCL?

I'm developing android app using OpenCL with Adreno GPU. I read the 'Snapdragon OpenCL General Programming and optimization'. but I can't see any information about size of wave(threads) or warp on Adreno devices.
On desktop GPU AMD have 64 threads wavefront size, and Nvidia GPU have 32. This information is very important for choosing best workgroup size, and making code optimization.
I wonder how many the waves are scheduled and executed on the GPU.
Can someone provide such information.

andengine (android opengl) low cpu usage

I have an andengine game, which has:
45-50-55 fps on a normal Galaxy S3, the phone temperature is warm.
stable 60 fps on CM11 Galaxy S3 with root in performance mode (maximum cpu frequence = 1400mhz) . With root you can modify the cpu frequence. The phone temperature is almost hot.
40-45fps on my Nexus 6 (without root), but this phone is faster than galaxy s3! The phone temperature is almost cold.
The resolutions of the game are the same!
The main question is: why does my game fps same on the both device? On Nexus6 it should be faster!
The game is: https://play.google.com/store/apps/details?id=com.hattedskull.gangsters
when a cpu is faster but does show less performance then the other cpus, it could be that it uses only 1 of 2,4,8,12 cores. thats just 25% usages, s the cpu stays cold. a single core cpu will always burn at 100%, and gets warm. Multithreading is the solution. that will "force" the cpu to go at 100%, and the game will run faster
I am answering my question, because it is not obvious (for me), so the solution is:
Performance mode: After rooting the phone, I changed the scaling governor (at processor) mode in performance, changing min hz was not necessary. Now the phone are hot, not warm!
Mobil ads bad performance: I switched off all the internet connections (wifi, mobile), therefore the mobile ad disappeared from the game. I use admob in my game, which has not the best performance.
These caused the FPS drops in my game(s)!

WebRTC AEC not working on Android with USB Camera

We have a webrtc enabled service with 2 different endpoints; a web app and a native android app. The android app is installed on a android device with a USB Camera.
Using the web app on chrome/firefox, pc2pc audio quality is almost perfect. But we want to improve pc2android and android2android audio quality.
Chrome uses acoustic echo cancellation (AEC - conference) for high-end devices. But for Android it forces AECM -- a light-weight AEC for mobiles. We are not happy with the AECM performance. For our native app, we modify webrc source-code to use AEC instead. But the result is even worse. It acts like echo cancellation is totally disabled and we end up having so much echo and feedback!
According to this issue, AEC should only work with 8k and 16k sample rates and only in high-end devices. That should be OK. We are using PCMU codec having 8k sample rate and I think our Android device is powerful enough to overcome the additional computational complexity of AEC:
Quad core ARM CPU # 2Ghz
8 core Mali-450MP GPU # 600Mhz
DDR3 1GB RAM
Android Kit Kat
If needed, I'm happy to share plots of our echo cancellation performance.
Is it not possible to use AEC for mobiles or are we missing something?
maybe you need to adjust the latency for estimate the echo.

Categories

Resources