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?
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.
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.
@ 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).
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.
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?