Slow when launched using launchd

Hello,

I am setting up an interactive video installation for a gallery and followed the 4evr tutorial:
http://openframeworks.cc/ofBook/chapters/installation_up_4evr_macosx.html

Part of it suggests using launchd to automatically launch the app at startup and even if it crashes. And so I did. And it seemed to work fine. But…

For some reason, while the app usually makes 50fps without effort, it is now struggling to go beyond 35fps and sometimes it goes down to under 25fps.

It took me some time but, finally, I found that the culprit is launchd. If I launch the app directly it runs smoothly.

I adapted my launchd file from the example linked in 4evr:

Any ideas on why this is happening?

So now I stopped using launchd. It’s not a big deal since my app is quite stable and I don’t expect it to explode. Still, it would be more robust to use it.

Thanks in advance,
Nuno

Hi! Is there any chance there’s two instances running at the same time? If not, does your app use the same amount of cpu when launched manually and when launched using launchd? Could it be that they load different assets when started in different ways?

1 Like

I don’t think I’m launching 2 instances at the same time because I was monitoring it in the Activity Monitor and there was only one there.

When launched manually the app uses substantially less CPU: 60% instead of >90%.

If by assets you mean the videos, I’m 100% sure the same videos are being used in both scenarios.

Maybe launchd needs extra parameters which I don’t know of. Anyway… I gave up. The app is quite stable and the only advantage of launchd was to relaunch it automatically if it crashed. It has been up for several days now with no crashes so I’ll forget about this because unfortunately I currently don’t have time to investigate it further.

Also, I still hope I can make this run in Raspberry Pi… and maybe there it won’t make any difference. I’ll come back to this thread once I try it there.

Still… I’m curious…

Thanks for your suggestions! Any other ideas are welcome!

Regards,
Nuno

People seem to have high cpu issues with launchd.

1 Like

I see… so there is indeed something.
Good to know. Thanks @hamoid !
Anyway, I’ll disregard launchd for now. It is not essential and I don’t have time to dig into it.