-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
platform/windows: release frame early during mouse movement #286
Conversation
c2bad49
to
3886b4a
Compare
78aa7ff
to
87aa253
Compare
I updated the patch to only release the frame early when mouse movement occurred. I'm still not confident this is the best way to fix the issue in the code, but perhaps someone can test and point out a better solution. |
d709328
to
e784dc3
Compare
I've been wondering about this issue. Any ideas when it might get merged? |
This PR dramatically improves the problem to the extent that I'm using it on my machine, but I'm not convinced this is the ideal way to fix the issue. Without this PR, any mouse movement during capture of certain content would cause Microsoft's documentation states:
Sunshine already does this, but it holds the frame for the |
I'm getting similar errors to what the failed appveyor build shows, are there any extra pre-requisites/commands that need to be run to build this? |
Thank you for the heads up @psyke83, I was also having the same problem that I couldn't reproduce on my local build but only on GitHub actions |
Resolves visual stutter during mouse movement in certain applications.
* add DXGI_ERROR_INVALID_CALL: assume that the application already released the frame. * DXGI_ERROR_ACCESS_LOST: reinit without assuming that the frame was released. See: https://docs.microsoft.com/en-us/windows/win32/api/dxgi1_2/nf-dxgi1_2-idxgioutputduplication-releaseframe Fixes intermittant stream disconnection due to frames not being released correctly during mode (fullscreen <-> windowed) changes, which is exacerbated if frames are not released immediately before AcquireNextFrame.
After some more research, I found this: https://docs.microsoft.com/en-us/windows/win32/direct3ddxgi/desktop-dup-api When This PR was only helping to mask the issue by giving |
Unfortunately, processing dirty rects* doesn't seem to affect slight stutter effect noticeable when *If anyone is interested, here's a test branch: master...psyke83:dirty_rects |
I recommend to always send frames to the client even though the screen is not changed. Only for Windows. As far as I know, a new screen capture mechanism was introduced in 7ddf8bb, while the old one works fine on Windows. See: #253
|
@hksdpc250 I've tested older builds without the capture callback change, but it has its own issues compared to master. The positive difference is that there isn't any lag in simple desktop applications such as Notepad (which is closer related to your bug report than this, I imagine). Unfortunately, performance for 3D applications, especially in windowed mode, is very choppy. Calling |
Resolves visual stutter during mouse movement in certain applications.
Proposed resolution for: #227
It seems that waiting for the frame to be released between consecutive
snapshot
functions calls introduces visual stutter (only in certain applications & during mouse movement - see above linked issue). This may not be the ideal way to implement the fix, so feedback is appreciated.