Resolve 60 fps lock issue for WGC capture by setting the MinUpdateInterval property of the WGC capture session.#785
Conversation
Resolves 60 fps lock issue for WGC capture
|
Thanks for the patch! One question, does this min interval needs to be synced to the requested framerate or setting to 10000 won't result in unnecessary captures? |
|
For me it did not make any noticable difference, but it would make sense to verify this. |
|
You are right, it seems that it can cause unnecessary captures, and although I dont see any performance degradation, it makes sense to limit, so I will update the branch. |
|
I have tested with the MinUpdateInterval set to the frametimes corresponding to 30, 60, 75, 100 and 120 Hz. With this calculation: And strangely it works for 120, 75, 60 and 30, but for 100Hz it records only 50 pfs and for 90 it records only around 80. This is a really strange behavior that I cannot explain. The documentation from Microsoft is also isn't exactly helpful: https://learn.microsoft.com/en-us/uwp/api/windows.graphics.capture.graphicscapturesession.minupdateinterval?view=winrt-26100 |
|
According to this issue it seems your implementation is correct, but it's really weird. How much wasted frames are there when just set it to 10000? Is there frame pacing issues? |
|
I do not see any frame pacing issues when looking at TestUfo for example. On the topic of wasted frames, it is hard to say as I do not see into the inner workings of the WGC API. 10000 corresponds to a framerate of 1000 Hz, which is a lot. |
|
Apollo/src/platform/windows/display_wgc.cpp Line 268 in d293fee Can you check the time difference? A rough implemtation is enough, set a static variable here and diff it each time when snapshot is called |
|
Tried on my computer, but with or without this patch WGC never goes over 24fps and IDK why... |
|
It's AppleMusic... Something strange happens if I have AppleMusic running and then connect the virtual display, it stutters like hell. Close it and then open it within the virtual display, it's normal again. But then I disconnects the virtual display, AppleMusic stutters on the physical monitor...... How weird it is. |
bca68d0 to
cd91170
Compare
|
Tested working fine on my machine, even with the weird refresh rates. Thanks for the contribution! |
Original commit: ClassicOldSong/Apollo#785
Resolve 60 fps lock issue for WGC capture by setting the MinUpdateInterval property of the WGC capture session.
Fixes: #676 and partially #620