Skip to content
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

(windows) allow desktop screen capture to fail gracefully when switching to / from exclusive fullscreen applications #1041

Open
lucasvanhalst opened this issue Jan 5, 2025 · 5 comments

Comments

@lucasvanhalst
Copy link

It would be great if the software screen capture could ignore some DXGI_ERROR_WAIT_TIMEOUT's (see logs "AcquireNextFrame didn't return the frame. Just warning: the screen has not changed?")
It happens most of the times (but not always) when switching from the desktop to a fullscreen application (such as a game) that uses the 'exclusive fullscreen' display mode.
For now I fix it by simply restarting hyperhdr but that's quite annoying. I could also fix it by running games in (borderless) windowed mode, but some games run quite a bit worse in that mode for some reason.

I've looked at the code and it looks like when the grabbers status DXGI_ERROR_WAIT_TIMEOUT's is triggered, the warningCounter keeps being decreased until it reaches 0, at which point the grabber gets disabled. I don't actually care that some frames are skipped, it seems like switching to/from exclusive fullscreen triggers a bunch of these DXGI_ERROR_WAIT_TIMEOUT's, causing the grabber to eventually disable itself.
I'm not sure what the best solution is.

See https://github.com/awawa-dev/HyperHDR/blob/master/sources/grabber/windows/DX/DxGrabber.cpp#L991-L1003

Bug report, debug log and your config file (FULL LOGS ARE MANDATORY)

logs: https://pastebin.com/zXrQUniD

Steps to reproduce

  • start hyperhdr, configure it to use software screen capture
  • start a game in windowed mode
  • switch to/from exclusive fullscreen mode a couple of times (alt+enter in most games)
  • the dxgrabber sometimes disables itself.

What is expected?

the software screen capture keeps working, even though some frames are skipped

What is actually happening?

the software screen capture gets disabled and the leds turn off (because I didn't configure another source)

System

HyperHDR Server: 
- Build:           (HEAD detached at v21.0.0.0beta1) (Awawa-44cfc99/b125da9-1733427229)
- Build time:      Dec  5 2024 19:38:05
- Git Remote:      https://github.com/awawa-dev/HyperHDR
- Version:         21.0.0.0beta1
- UI Lang:         en (BrowserLang: en-GB)
- Avail Capt:      Windows (Microsoft Media Foundation)
- Database:        read/write

HyperHDR Server OS: 
- Distribution:   Windows 11 Version 23H2
- Architecture:   x86_64
- CPU Model:      AMD Ryzen 7 7800X3D 8-Core Processor
- Kernel:         winnt (10.0.22631 (WS: 64))
- Qt Version:     6.5.3
- OpenSSL:        OpenSSL 3.2.3 3 Sep 2024
- Browser:        Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
@awawa-dev
Copy link
Owner

awawa-dev commented Jan 5, 2025

Hi
warningCounter does nothing, it just limits the number of log messages so as not to completely clutter the log output. So this is not a problem, as it does not reset the grabber: you simple wont see more warnings when it reaches 0 in current grabber session.

@lucasvanhalst
Copy link
Author

Ok I see, but still, the grabber stops working around half of the time when switching to / from exclusive fullscreen mode as seen in the logs "Priority 245 is now inactive". Priority 245 is the instance screen capture in my case. Not sure why though.

@awawa-dev
Copy link
Owner

In the logs you only have DXGI_ERROR_WAIT_TIMEOUT, which is a quite common temporary state, when the screen has not changed. There are no other signs that something is wrong and this state will stay with you forever so that we can't detect it and handle it differently, e.g. by restarting the grabber.

@lucasvanhalst
Copy link
Author

Ok, so is there anything I could do to fix/investigate the issue where it disables the grabber after switching to exclusive fullscreen mode?

@awawa-dev
Copy link
Owner

Need more clues, maybe display.d3dDuplicate status or one of its resources has been invalidated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants