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

Displays rapidly turn on and off and mouse input is interrupted when returning to my "Desktop" profile. Have to hold power button on PC to stop the loop. #350

Closed
tostej opened this issue Nov 24, 2024 · 18 comments
Assignees
Labels
bug Something isn't working

Comments

@tostej
Copy link

tostej commented Nov 24, 2024

Describe the bug
I have a 2 monitor profile titled "Desktop" with a 1920x1080 side monitor and 2560x1440 main monitor. I have a single ultrawide monitor profile titled "Simracing". Switching to the Simracing profile works brilliantly. Switching back to the Desktop profile from that USED to work, but now the flickering behavior described in the title begins, and the only way out is to manually power off my PC. I read the documentation and understand that changing Nvidia settings will break the saved profiles in DisplayMagician, so I remade both my Desktop and Simracing profiles before writing this report since I figured I had broken something, but the behavior persists. An additional note just in case the logs I'm submitting don't include the information and it is relevant: I am running the Nvidia App overlay with "Instant Replay" enabled. Once again, both my DisplayMagician profiles used to work and I could switch between them without issue.

To Reproduce
Steps to reproduce the behaviour:

  1. Use hotkey to enter "Simracing" profile.
  2. Get tired of losing on iRacing ;)
  3. Use hotkey to return to "Desktop" profile
  4. System attempts to return to Desktop profile. Ultrawide monitor turns off as expected, and display temporarily comes up on my two desktop monitors, but they continually flicker on and off and my mouse input is frozen most of the time the display is intact. It persists infinitely and will only stop when I hold the power button on my PC to turn it off.

Expected behaviour
Expected behavior is to simply return to the Desktop profile and resume normal operation of the computer. This used to work, just a few weeks ago.

Screenshots
This isn't really a UI bug that has something I can screenshot, but I am happy to provide anything requested. Hopefully I have sufficiently described the issue.

Reporting Logs
DisplayMagician-Support-20241124-2100.zip (I haven't used GitHub before but hopefully I attached this properly. The instructions don't specify which level of logging is preferred, so I used Full Application Trace in an effort to provide as much information as might be needed.

If DisplayMagician does not:
N/A. The app opens and I have submitted the logs (hopefully correctly)

Enviroment (please complete the following information):

  • Windows Version: 10 Home, 10.0. 19045 Build 19045
  • DisplayMagician Version 2.7.2.1
  • Video Card: EVGA RTX 3080 Ti
  • Number and make/model of monitors: BenQ XL 2420Z, Asus PG27AQDP (Desktop profile) / Samsung LS49AG95 (Simracing profile)
  • Date of last video driver update: November 12, 2024
  • Date of last windows update: Sorry, don't know how to check this but I know I got an automatic Windows update this month at least.

Additional context
I mentioned earlier that I use the Nvidia App (formerly known as Shadowplay) with "Instant Replay" on, and this used to work on both profiles without issue on Display Magician. I thought maybe I had made changes to my recording settings (and I remembered that I had definitely made unrelated Nvidia Control Panel 3D setting changes) and that might have been part of the problem, but I no longer think either of these are the cause because I completely remade the DisplayMagician profiles before requesting support.

As an anecdote, my main monitor in the desktop profile is 2560x1440 at 480Hz (which I suppose you can see in the logs). I previously had another monitor in its place which was similar in spec to the BenQ monitor I described in the "Environment" section above. When I was using that older monitor, I was able to run all 3 of my displays (so two 1080p displays and my 5120x1440 ultrawide) all simultaneously. With this new 1440p 480Hz Asus monitor, I am no longer able to do that. Trying to enable all 3 monitors in either Windows or Nvidia control panel will just force one of the monitors to go unchecked. I assume that this is either a limitation of Windows or my graphics card concerning maximum resolution or combined maximum refresh rate across multiple displays. The reason I bring this up is just to think about if it's possible Windows or DisplayMagician is "hanging on" to the ultrawide display when I try to return to Desktop profile and maybe it's not able to settle on the displays I want because some part of it is still trying to talk to the ultrawide or something like that.

If there's any other information I can offer, please let me know! Thank you for the software and for your technical support.

Edit: I just had the same experience when switching from Desktop to my Simracing profile. Had to power off my computer. This is with the newly created profiles. Not sure what's going wrong.

@tostej tostej added the bug Something isn't working label Nov 24, 2024
@terrymacdonald
Copy link
Owner

My gut feel is that this isn't a DisplayMagician issue per se, but is more how NVIDIA App and DisplayMagician work together.

DisplayMagician is simply a display layout recorder and replayer. It takes a snapshot of the current display layout, then uses the NVIDIA, AMD and Windows Display APIs to replay the settings you recorded earlier. This works in general, but there are a few potential side effects in complex situations such as yours.

  1. If the video driver gets updates, it may add additional driver settings that aren't in your existing config. When this happens your existing Display Profiles won't match the new profile (because DisplayMagician gets the current settings and compares them to the Display Profiles you've saved). You can often tell if this is the case by clicking on an existing Display Profile to change to it. If you do that in DM, and then if you click on the 'Current Display Layout' button, then the original Display Profile normally is selected automatically. If you instead see a 'Current Display Profile' instead, then you know that the DM profile isn't matching, as DM is trying to get you to save this new profile.

To fix this issue, you should update your Display Profile straight after you've applied it, so that your settings will get updated.... in other words click 'Apply', then once it's finished applying press 'Update'. That effectively refreshes the Display Profile.

  1. Another possible problem is when another app makes changes to the display layout after DM has changed it's settings. Some apps may make changes to the display layout, and that will mess with the detection code that DM uses. DM expects there to be an exact match, so if another app messes with the display layout then DM will think its a different layout.

There isn't much you can do in this case. You may be able to run the game you want to use including the Shadowplay app, then swap to do the Apply/Update trick that I mentioned earlier. If you're lucky then that will notice the changes that the overlay app has made and the matching will work.

  1. The last option I can think of, is when the NVIDIA App is getting confused because it expects to be the only App that can change the display Layout. The programmers thought that all users would be using the NVIDIA App, and didn't think that anyone would be changing settings using the NVIDIA Driver API (NvAPI). So its possible that the NVIDIA App and the NVIDIA Driver is getting confused, and they are competing against each other to apply their settings.

My guess is that this is happening:

  • DM uses the NvAPI to tell the NVIDIA driver to set up the screen the way your saved it in the Display Profile.
  • The NvAPI changes the display layout
  • NVIDIA App starts up and tries to apply the display layout overlay it knows about
  • The NvAPI for some reason wont allow that changes so the display layout reverts back
  • NVIDIA App realises it hasnt applied properly, so it tries to apply the display layout overlay it knows about again
  • The NvAPI for some reason wont allow that changes so the display layout reverts back again
  • NVIDIA App realises it hasnt applied properly, so it tries to apply the display layout overlay it knows about again
  • The NvAPI for some reason wont allow that changes so the display layout reverts back again
    etc....

I think you would be better off logging a problem through the NVIDIA App and tell them what you're experiencing. They will have a better understanding of how the NVIDIA App and NvAPI work together.

I'll still have a look through the Log files when I get some time, but I highly doubt I'll see anything in DM, as I think what you're seeing is that third option. I can always be wrong of course, but that's definitely my gut feel.

Thanks
Terry

@tostej
Copy link
Author

tostej commented Nov 25, 2024

Thanks for the reply!

I did see the "current display" behavior you were talking about, so I likely did make some control panel change at some point and broke the profile. I resolved that, sort of.

It turns out I'm a bit of a dummy, I had been using CTRL + ALT + Right Arrow to move to Simracing and CTRL + ALT + Left Arrow to go to Desktop. It was only after doing additional research that I discovered that's already a hotkey to rotate your display in Windows. Perhaps common knowledge, but it had eluded me. The thing is, switching profiles with this hotkey setup would work SOMETIMES. I'd go back and forth to test and it would work fine, and at some point eventually I'd attempt to swap profiles and I'd get the screen flickering issue again, and it would happen on Desktop and Simracing profiles. (I'm not rapidly spamming the hotkeys or anything, but I would try to swap after about a minute when I was testing. Perhaps that still is too quick and that's all my issue really is.) And my display never actually got rotated, but I think it's obvious that I was making my display setup fight itself between inputting a hotkey to change display orientation and simultaneously trying to load a DM profile.

I rebuilt the profiles and tried different hotkeys and it was working like a charm, however around the fourth time or so switching profiles with hotkeys, the flickering monitor problem would come back. Most recently, I was trying CTRL + SHIFT + F1 for Desktop and CTRL + SHIFT + F12 to switch to Simracing. As far as I can tell, there should be no conflicts with those hotkeys.

I can't get a handle on why swapping profiles with hotkeys works some of the time. After testing for a while, I did figure out that once I get the flickering issue, my profiles would then exhibit the "current display" behavior and I would need to click "update" again to fix them.

As of right now, I'm having decent success, but I can't 100% nail down what's causing it to fail when it does. Going to play with it more tomorrow.

@terrymacdonald
Copy link
Owner

terrymacdonald commented Dec 6, 2024 via email

@tostej
Copy link
Author

tostej commented Dec 6, 2024

Yes, it would work all the time until the flickering issue occurred, and the profiles would break once the flickering happened. Keep in mind the only escape from the flickering is to power cycle my whole PC, so that may be the part where the profiles are breaking. I can only come back to observe the status of DM once my PC boots up again. So it's possible that the profiles themselves are technically fine until the PC loses power while it's struggling/fighting itself, but I have no way to verify that as a user.

I have never had the profiles fail (excluding my own error making NVCP changes and forgetting that I did so) without the flickering happening.

I'd be happy to test anything you'd like since I have a pretty unique edge case setup, however for practical purposes I'm just using Windows + P to swap to my racing monitor as needed. This used to not work the way I wanted, so I'm not sure exactly what I did to fix my issue, but for now I'm content to endure the minor inconvenience of using Windows + P and selecting the option I need from that menu in exchange for stability.

Thanks for all your help, and once again let me know if there's anything you want me to test anyway if you're trying to tinker with your program

@TOCA2FREAK
Copy link

I am getting a similar issue.

I have 4 screens. One connected to my HDMI on MB (9800X3D) and the other 3 using DP on my 3080ti.

I have two profiles. One to turn on nvidia surround and the other to turn it off.

I also use hotkeys to swap. CTRL+Alt+S to turn surround on and CTRL+Alt+X to turn surround off.

Now I'm not sure if this issue started happening with a new version of DisplayMagician or because I upgraded to the AMD 9800X3D from i5 10600k. (Fresh install of windows 11)

This doesn't happen all the time, but occasionally when swapping between profiles (doesn't matter which way round I do it) after the profile has finished swapping my 3 monitors connected to my 3080ti will switch off and on again at quick intervals. The monitor connected to the HDMI on my MB is fine though.

If I wait for some time it eventually stops, but sometimes it takes so long, I have to reboot my machine.

@terrymacdonald
Copy link
Owner

terrymacdonald commented Dec 12, 2024 via email

@TOCA2FREAK
Copy link

Hi Terry,

The monitor connected to my MB via HDMI is a BenQ GW2280.

The 3 monitors connected to my 3080ti via DisplayPort are Dell S2721DGFt.

My MB is a GIGABYTE X870E AORUS ELITE WIFI7.

@terrymacdonald
Copy link
Owner

terrymacdonald commented Dec 13, 2024 via email

@TOCA2FREAK
Copy link

Not sure if this is relevant, but it's not the BenQ monitor that keeps turning off and on when swapping profiles, but my Dell monitors.

@terrymacdonald
Copy link
Owner

terrymacdonald commented Dec 13, 2024 via email

@terrymacdonald
Copy link
Owner

@TOCA2FREAK @tostej I've just updated some code that may have been causing a race condition that may have been a partial cause of the issue you are experiencing. I'd really like it if you'd be able to install the latest test version that I've just released here: https://github.com/terrymacdonald/DisplayMagician/releases/tag/v2.7.2.23

Can you please test this to see if it fixes your issue. I'm not sure if it will, but it might, and is worth testing.

Please report back with what you find in this thread.

Thanks
Terry

@tostej
Copy link
Author

tostej commented Jan 5, 2025

So far this seems to have fixed the issue for me! I've been rapidly swapping profiles and basically trying to break it and it's been solid. Occasionally my main monitor will flicker a few times when switching back to it, but it recovers after 3 times or fewer and I can certainly live with that. Although I'd be curious to know why it only happens some of the time.

Of minor note, I set up a third profile to do just the main 1440p 480Hz monitor, just to test swapping among more than 2 profiles. To set up this profile I used Windows+P like I normally do to swap displays and selected "PC screen only" from the menu in Windows. When I did that, it changed my monitor settings to 1080p 60Hz. This behavior happened right after installing the alpha release you just shared. I was able to put my resolution and refresh rate back to normal, but that was a weird behavior and thought you might like to know.

So was the original issue somewhat hardware-specific? I'm not a programmer by any means but I'd be fascinated to understand what you changed.

Thank you!!

@TOCA2FREAK
Copy link

@TOCA2FREAK @tostej I've just updated some code that may have been causing a race condition that may have been a partial cause of the issue you are experiencing. I'd really like it if you'd be able to install the latest test version that I've just released here: https://github.com/terrymacdonald/DisplayMagician/releases/tag/v2.7.2.23

Can you please test this to see if it fixes your issue. I'm not sure if it will, but it might, and is worth testing.

Please report back with what you find in this thread.

Thanks Terry

Just installing this now. Just wanted to know is it recommended to create new display profiles, or is it okay to test with the current profiles I have?

@terrymacdonald
Copy link
Owner

@tostej if you're really interested you can go and check the code charges in the specific commits I made 😀.

Previously I had some logic in DM to prevent people from making multiple profile changes at once. The idea was to allow people to make a profile changes to and to restrict that to a single thread. Whenever someone wanted to do a profile changes to then it would be placed into a queue, and each would be run one after another. This weekend will in earlier versions of DM .

DM v2.7 changed the way that it used the video libraries to always use all of them. This was very different to earlier versions of DM that had an NVIDIA more, an AMD video mode and a windows video mode. This change to use all video libraries is what allowed v2.7 to use iGPUs and dGPUs at the same time. It eliminates a massive weak spot in the abilities of DM.

But this change also caused a problem with that queueing system. When a user applies a display profile, the screen layout changes multiple times as the profile is applied. At each stage, the the video libraries need to independently update the current display profile layout so that they know what's changed. The previous queueing system prevented them all getting the updated display layouts as it expected them to do it serially, when it's more random than that now.

The upshot was that the videos libraries would be made to wait, and sometimes likely even getting outdated information when they finally did get to query the current settings.

The fix was to their away the old code to and move to a simpler 'locking' system that simply drops any profile changes that are requested while another profile changes is underway. Users will instead get a message saying 'you have to wait and try again'. This will be way more reliable.

Hope that explains things ok.

Thanks
Terry

@terrymacdonald
Copy link
Owner

Oh, and the multiple quick flickering is likely due to applying the HDR settings. The way it's currently done is to apply the HDR one screen at a time, and that causes a bit of flickering. It was found to be more reliable that way.

Thanks
Terry

@terrymacdonald
Copy link
Owner

terrymacdonald commented Jan 5, 2025 via email

@tostej
Copy link
Author

tostej commented Jan 5, 2025

This is probably excessively paranoid from me, but does anything about the way DM works now carry any risk of triggering any anti-cheat issues in games because of the way it's interacting with the Nvidia driver? I know it's probably a non-issue but wanted to ask. This incident from back in 2023 made me wonder about it: https://x.com/CounterStrike/status/1712875606776729832

@terrymacdonald
Copy link
Owner

@tostej in short no - you should be fine. DIsplayMagician only records settings from the AM/NVIDIA/Windows display drivers, and it then re-applies those same settings again to the drivers via their standard APIs. THere's nothing tricky going on at all. We simply grab settings and then give them back later.

This is why when the settings change in the driver (say a new feature is added) then display profiles need to be updated again. This is because DM was build to only record and replay, not to do any modification itself. The underlying rule I have is that any config changes need to be done in the NVIDIA/AMD/Windows display settings apps themselves - those devs know what settings are valid and there is no way that I can know that. It's FAR safer for me to simply record the good settings that those apps generate (via the driver) then replay those back later; I know those settings are valid.

Hope that clarifies. I'll close this issue for now, but please feel free to reopen if you are still having the same issue.

Thanks
Terry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants