Issues with application focus (unreal vs TD) in fulldome

I see the network editor, does the same thing happen when you are in Perform Mode?

Yes sorry, Because we are outputting to a dome in perform mode it doesn’t line up correctly on my dual monitor setup (obviously no dome in the office!)

So I went into network to create the example.

We don’t do anything specifically different when TD is not in focus, I’d assume the OS or the graphics driver is just giving other applications higher priority since they have focus.

Are you using Unreal as a UI interface? If so you can make a UI in the same perform window and send OSC back to Unreal to avoid TouchDesigner losing focus.

I have a similar problem but with two TD instances. Instance not in focus practically runs at half speed.

I’ve also hit this problem with multiple TD instances. The one with focus is given more processing power. It seems like certain functions are affected and others aren’t though. If anyone figures out how to get past this I would love to hear it - This is a huge hindrance in systems where one generative TD patch with generative content is Spouting to another TD application that is projection mapping. If I manually combine the patches, 60fps! But then I lose the flexibility of not having the main projection mapping output stutter when switching generative content. Toxes are not the answer here (unless the process comp comes into play?) because tox loading at this point hangs the main thread, which is unacceptable for certain applications.

This just happens in any program running GPU accelerated graphics. The graphics card/OS automatically prioritizes one program over the other. I still haven’t figured out how to disable this.

I have the same problem when Spouting my generative TD patches to Resolume Arena, which is mapping and outputing the video. When focus is on Arena, everything runs smooth, when focusing TD (where I got my UIs), Arena framerate drops causing the output to lag…

Didn’t find solution yet…

Seems like this registry value may be helpful.

blogs.msdn.microsoft.com/embedd … r-quantum/

1 Like

Oh wow I hope this works, I’ve been dealing with this for years and changing entire infrastructure pipelines to compensate for this issue!

From reading that registry trick Malcolm posted, it looks to me you can set it so all background tasks and foreground tasks receive an even amount of processor time. But be beware a computer can have many background tasks, so I’m not sure you would want to elevate them all to get equal processing time as the (very few) foreground tasks.

Another option to test:
Set your foreground tasks which are not in focus with a batch file to a higher priority like this:

wmic process where name="MyUnrealExecutable.exe" CALL setpriority "high prority"
wmic process where name="TouchDesigner099.exe" CALL setpriority "high prority"

That process priority can be any of these strings:
“idle”, “low”, “below normal”, “normal”, “above normal”, “high priority”, “realtime”
From what I read online the “realtime” option is not advised as it can cause starvation of the keyboard and mouse threads to the extent that they become unresponsive :wink:

2 Likes

Ya the issue with window’s priority system is that it’s not balanced. If something with higher priority still wants CPU time, the OS will completely starve lower priority processes. It doesn’t mean ‘give it a proportional amount of more time’.

Wanting to try this, but unfamiliar with what those commands would look like in a batch script.

Is it just loading them into a text file and changing the extension to .bat?

My system only recently starting having this issue between Resolume and TD, trying any any all posible solutions.

1 Like

Having the Same issue…Here is what my .bat looked like

@echo off
set path=“C:\Program Files\Derivative\TouchDesigner099\bin”

*START %path% %path%\touchdesigner099 -gpuformonitor 1 “C:\Users\superCoolGuy\Desktop\display.toe” *
START %path% %path%\touchdesigner099 -gpuformonitor 0 “C:\Users\superCoolGuy\Desktop\output.toe”

timeout /t 60 /nobreak

wmic process where name=“TouchDesigner099.exe” CALL setpriority “high priority”

echo Done.
TIMEOUT 10
exit

I added a delay to delay the priority to give time for the program to load…also a -gpuformonitor as I am using multiple gpu’s.
It didn’t work for me…changing focus still can cause performance issues. I will report back is I find a solution.

1 Like

Check this out, guys! It worked for me. The fps on unreal stay stable even when I’m focus on TD window

3 Likes

Thanks for posting that @patrick_hartono! I assumed it was a windows process scheduling issue, not a deliberate performance reduction by UE.

2 Likes

going mad to solve this … :frowning:

We used a hack in a recent project, different softwares, having a similar issue by opening a single pixel window on top of everything else as the focus.

For us it always seems to be something on the GPU level when utilising nearly all of its processing power. that the focused application is given rights before the background application.

i believe that i’ve solved…

in my case the solution is pretty easy. i’m working for virtualproductions, so unreal have to send (using the spout plugin) the data to touchdesigner… but the problem is limit touchdesigner and unreal at the same framerate.
ex. if 30fps are need touch have to been stopped a 30fps and unreal in the same way.
for unreal use this command in the console: t.MaxFPS 30 and magically the frame rate is always balanced.

Just another note on this.

I’ve been working on streaming date from TD to UE via NDI on the same machine, and noticing this same performance issue.

I believe this is related to UE’s wanting to run at whatever the maximum available frame rate is by default.

On a machine with a RTX5000, UE5 will run my project at about 100fps. If TD is attempting to concurrently run in realtime at 60fps, it will stutter because UE has taken over control of the GPU refresh rate. The solution would seem to be going into project settings in UE and setting a “fixed framerate” for the project at 60. Doing this I get smooth 60fps playback in both UE and TD.

1 Like