Adobe-CEP / CEP-Resources

Tools and documentation for building Creative Cloud app extensions with CEP
https://www.adobe.io/apis/creativecloud/cep.html
1.61k stars 824 forks source link

Extensions are locked to ~30fps on macOS #467

Open GoodBoyNinja opened 1 year ago

GoodBoyNinja commented 1 year ago

Hey.

The problem: On Macs, extensions are locked to <60fps (maybe even 30fps), which makes performance feel much worse than on PC.

I have been testing my extension panel on a 14" M1 Pro MacBook pro with (120hz display). I can't help but notice that the panel is locked to a lower fps:

https://user-images.githubusercontent.com/66829812/192144512-e39e10d5-4abe-437c-b7fb-7fbcf12222e3.mov

This is not a code issue nor an M1 issue, I have had this experience with other macs as well. On PC, the same extension runs buttery smooth.

This is also not a 120hz vs 60hz issue. If I limit my mac's display to 60hz, the maximum fps is still noticeably lower. I can also use chrome's debugging tools to prove that there are no fps drops in my interface.

https://user-images.githubusercontent.com/66829812/192145048-63f1df44-ce5e-4259-b653-a9ea67bf8bb9.mov

Other extensions seem to behave the same, feeling just overall sluggish compared to the host app. This seems purely like a rendering issue, as if your implementation of CEF in After-Effects is capping the maximum frame rate on macs. On PCs things run very smoothly.

I know that you guys are busy and aiming to moving to UXP soon, but please, this is not a small issue. It affects performance simnifically for all mac users, making buying extensions for mac less appealing and puts a cap on our ability to develop good tools for After-Effects, essentially hurting our income as well. With the top performance looking like this, you're basically making us feel like the best we can do with 3rd party plugins is to give users some buttons and sliders, and it's really discouraging.

Please look into this. It makes the hard work we put into developing for the Adobe ecosystem feel like a waste of time. Saar

GoodBoyNinja commented 1 year ago

I don't know anything about how cef is implemented, but I can point out to resources I have found online: https://www.magpcss.org/ceforum/viewtopic.php?f=6&t=12029 https://github.com/cefsharp/CefSharp/issues/2275 https://bitbucket.org/chromiumembedded/cef/issues/3077/offscreen-rendering-capped-at-60fps-in https://groups.google.com/g/cefpython/c/k-R1ql6256A?pli=1 https://github.com/cefsharp/CefSharp/issues/1261 https://code.google.com/archive/p/chromiumembedded/issues/1368

GoodBoyNinja commented 1 year ago

Hey! After some more online reading I couldn't find anything that truly solves the problem. However, I have found that inserting the following parameters in the manifest.xml inside the <CEFCommandLine> tag makes a difference:

  <Parameter>--windowless-frame-rate=60</Parameter>
  <Parameter>--disable-frame-rate-limit</Parameter>
  <Parameter>--disable-gpu-vsync</Parameter>
  <Parameter>--disable-gpu</Parameter>
  <Parameter>--disable-gpu-compositing</Parameter>
  <Parameter>--hardware-acceleration=false</Parameter>
  <Parameter>--hardware-video-decode-framerate=0</Parameter>
  <Parameter>--enable-begin-frame-scheduling</Parameter>

I believe some of those tags are redundant but not sure yet which ones exactly.

However, that doesn't solve the problem completely. While rendering seems to reach much higher frame rates now, interactions with the mouse are not entirely smooth and can feel a bit off, and some mouse interactions can feel delayed or out of sync. I have not yet tested it on a pc and can't verify it doesn't damage the experience there, which was fine before.

GoodBoyNinja commented 1 year ago

Any feedback on this issue will be tremendously appreciated, thanks!

GoodBoyNinja commented 1 year ago

I will try again in a month

PerryDesign commented 1 year ago

@GoodBoyNinja Did you happen to test on Win and confirm that things are still functioning properly?

GoodBoyNinja commented 1 year ago

@GoodBoyNinja Did you happen to test on Win and confirm that things are still functioning properly?

Not in the past couple of months, but before that, yes. This extension has been developed mostly on Windows where things were always perfectly smooth. Others' extensions seem to behave similarly.

PerryDesign commented 1 year ago

@sujaisivanandan Would you be able to take a look at this issue?

manishkrmishra commented 1 year ago

@GoodBoyNinja : The CEF has clamped frame rate @ 30fps for the OSR. CEP doesn't actually interfere here for the performance concerns. The single available workaround can be to use --disable-frame-rate-limit as CEFCommandLineParameter, but we don't recommend it. It essentially turns the vsync off & can shoot up CPU & GPU usage to max. Also, the results are going to be choppy & stuttering.

GoodBoyNinja commented 1 year ago

@GoodBoyNinja : The CEF has clamped frame rate @ 30fps for the OSR. CEP doesn't actually interfere here for the performance concerns. The single available workaround can be to use --disable-frame-rate-limit as CEFCommandLineParameter, but we don't recommend it. It essentially turns the vsync off & can shoot up CPU & GPU usage to max. Also, the results are going to be choppy & stuttering.

Sounds like it's time to shift my future hopes towards UXP. Thank you both for the informative answers!