"FAndroidDeviceDetectionRunnable" generating hitch when profiling

I’m using the profiling tools to check the performance of my game and sometimes a thread called “FAndroidDeviceDetectionRunnable” generates a huge hitch on the graph.
I’m running the game in the editor and using “Stat StartFile” and “Stat StopFile” commands to generate the profiling file and analyse it.
What is this android thread for? Why is it triggered if my project is for PC and Consoles only?

Thanks in advance!

1 Like

I am having the exact same problem…
Can anyone clear this up?

89683-capturefandroiddevicedetectionrunnable.jpg

Hey Jan,
I have the same issue and can’t find any answer on it. Have you got some reason about the “FAndridDeviceDetectionRunnable” thread? And the “FUdpMessageProcessor” thread also confuse me too. Any reply will help very much, THX.

Same problem here as well. Engine version 4.13

I had the same issue (4.13.2). Since we are a PC project, I turned off the compilation options for Android and other platforms (Edit->Project Settings->SupportedPlatforms) and the thread appears to have gone away.

Note that I couldn’t find much if any CPU time actually being spent in that thread. As near as I can tell the profiler is listing for how long the indivdual threads are active, not how much CPU they are consuming. This means that threads in “Wait” mode clutter up the profiler quite a bit as they are theoretically active but in process sleeping until woken by interruption.

I believe that the Android detector starts on game start and ends on game end and therefore is quite likely to head this list since it is active for so long. Good news if your PC ever transforms itself into a Android mid-game! I suspect that somehow in detecting an android it is looking for some aspect like a thread that might not exist strictly at gamestart time but will appear very slightly later, and since the thread never appears it sits and waits, so it is probably somewhat less silly/performant than it appears.

A side note relative to all this - there is a lot more likelihood of the issue in the above .jpg being in the GameThread than in the threads above it (many of which when I have been profiling recently often appear to be in Wait mode).

I’m far from an expert on this aspect of UE however. YMMV.

same problem. 4.15.2
FAndridDeviceDetectionRunnable: >1000ms.
Game stops for a whole second.

i have it to, on 4.22 and i am making a game for VR dont know why this is there

I am on 4.22 as well. Whole editor stops every few seconds for about 0.5secs and gets more often overtime.

I looked into the code, and its being called from the “Magic Leap” plug in. Disabling the plugin should fix this.

I tested it in my own project and I don’t see the hitch in the profiler anymore.

1 Like

(push)

@ Jeffery.Zhu
Disabling Magic Leap did not work for me, neither did turning it off in the Supported Platforms.
Magic Leap and other mobile support were already turned off.

I also unchecked Android in the Epic Games Launcher, but nothing changed. I can’t get rid of this CPU Sleep stall. I am now trying to carefully remove all Android related folders from the Engine and the Project (but i’ll restore it if something happens).

I tried unloading these modules, but the editor crashes altogether when clicking “Unload”:


Unhandled Exception: EXCEPTION_ACCESS_VIOLATION 0x00000042

UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
kernel32
ntdll

-Edit-

I was able to remove the Android Device Detection surgically, but there are still other threads left that create hitches.

threads2

How did i remove FAndroidDeviceDetectionRunnable?
I removed all the text containing “Android” from
Intermediate > Config > CoalescedSourceConfigs > Engine.ini and other .ini files.

I went for every folder named “Android” and found the culprit sitting inside
Engine > Binaries > Win64 (> Android).

After deleting, the project initially would not start, but after more surgery, the project actually started and the AndroidDeviceDetection module is finally out of the list.

success-androidGone

Yet, i am left with the above issues in red.
What kinds of threads are they? Are they vital? Can they be turned off, and where?

1 Like

I’m having this issue too, but what I want to know is if this impacts packaged builds in anyway, do you guys have this information?