DisplayMagician icon indicating copy to clipboard operation
DisplayMagician copied to clipboard

Superdisplay Profile Not Loading After System Reboot

Open cerahmed opened this issue 2 years ago • 73 comments

Describe the bug This would be a continuation for issue#96 regarding Superdisplay profile not loading correctly, however this time with new symptoms.

So I'm currently using version 2.3.1.28 found in this comment. Everything was working perfectly and I was able to switch to every Superdisplay profile without issues.

However, seemingly after restarting my pc and reconnecting my Superdisplay tablet, switching to the Superdisplay (both Extended and Duplicated) profiles seems to disable all USB monitors.

To Reproduce I haven't yet confirmed if it happens after every reboot, but I'll do so if the issue can't be figured out from the log file.

Screenshots Configs-Changed

DisplayMagician-Support-20220506-1444.zip

cerahmed avatar May 06 '22 11:05 cerahmed

Hi @ceramod,

Can you please upgrade to the latest production version released, v 2.3.1.60. DisplayMagician should prompt you to upgrade when you first start it.

Then please check if there is an issue with that version, and create a Support ZIP file and upload it.

The reason is that there were a few changes in 2.3.1.60, and now that is the only version I support. It has over 700 users using it so I know it is very reliable (it only has 3 small issues so far).

Thanks Terry

On Fri, 6 May 2022, 23:45 cerahmed, @.***> wrote:

Describe the bug This would be a continuation for issue#96 https://github.com/terrymacdonald/DisplayMagician/issues/96#issue-1206516515 regarding Superdisplay profile not loading correctly, however this time with new symptoms.

So I'm currently using version 2.3.1.28 found in this comment https://github.com/terrymacdonald/DisplayMagician/issues/96#issuecomment-1101960694. Everything was working perfectly and I was able to switch to every Superdisplay profile without issues.

However, seemingly after restarting my pc and reconnecting my Superdisplay tablet, switching to the Superdisplay (both Extended and Duplicated) profiles seems to disable all USB monitors.

To Reproduce I haven't yet confirmed if it happens after every reboot, but I'll do so if the issue can't be figured out from the log file.

Screenshots [image: Configs-Changed] https://user-images.githubusercontent.com/21166481/167125148-482a14ed-4cd2-478f-a02a-b9cd39656c88.jpg

DisplayMagician-Support-20220506-1444.zip https://github.com/terrymacdonald/DisplayMagician/files/8639697/DisplayMagician-Support-20220506-1444.zip

— Reply to this email directly, view it on GitHub https://github.com/terrymacdonald/DisplayMagician/issues/103, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLU5LEWXOQ6QNWNGVYAH53VIUA7NANCNFSM5VH5FHAA . You are receiving this because you were assigned.Message ID: @.***>

terrymacdonald avatar May 06 '22 18:05 terrymacdonald

Hi Terry,

I updated to v2.3.1.60, but it crashes right after showing the initialization dialog. I created a trace log and also attached the relevant files for your review.

DisplayMagician.log Profiles, Shortcuts, and Settings.zip

cerahmed avatar May 07 '22 06:05 cerahmed

I went ahead and deleted DisplayMagician folder inside AppData/Local, and it worked just fine. I'll start testing for the symptoms I described in this post and will get back with my results.

cerahmed avatar May 07 '22 06:05 cerahmed

Hi @ceramed,

You will need to delete your display profiles and recreate them. There were some changes made between 2.3.1.60 and earlier versions of 2.3.1.

Delete the Display profiles json file and then start DisplayMagician and create the display profiles again and it should work.

Thanks Terry

On Sat, 7 May 2022, 18:34 cerahmed, @.***> wrote:

Hi Terry,

I updated to v2.3.1.60, but it crashes right after showing the initialization dialog. I created a trace log and also attached the relevant files for your review.

DisplayMagician.log https://github.com/terrymacdonald/DisplayMagician/files/8644595/DisplayMagician.log Profiles, Shortcuts, and Settings.zip https://github.com/terrymacdonald/DisplayMagician/files/8644597/Profiles.Shortcuts.and.Settings.zip

— Reply to this email directly, view it on GitHub https://github.com/terrymacdonald/DisplayMagician/issues/103#issuecomment-1120146547, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLU5LCGRZLTW6X7FRL3KF3VIYFJDANCNFSM5VH5FHAA . You are receiving this because you were assigned.Message ID: @.***>

terrymacdonald avatar May 07 '22 06:05 terrymacdonald

Hi again Terry,

So I was able to reproduce the issue:

  1. I upgraded to the latest version 2.3.1.60.
  2. Saved new profiles.
  3. Switching between profiles works fine.
  4. Restarted my PC.
  5. Connected SuperDisplay.
  6. Tried switching to the Extended profile.
  7. Both USB monitors become disabled.
  8. Saved logs and attached.

DisplayMagician-Support-20220507-0951.zip

cerahmed avatar May 07 '22 06:05 cerahmed

Thanks,

On holiday right now but I'll check later in the week.

Thanks Terry

On Sat, 7 May 2022, 18:53 cerahmed, @.***> wrote:

Hi again Terry,

So I was able to reproduce the issue:

  1. I upgraded to the latest version 2.3.1.60.
  2. Saved new profiles.
  3. Switching between profiles work fine.
  4. Restarted my PC.
  5. Connected SuperDisplay.
  6. Tried switching to the Extended profile.
  7. Both USB monitors become disabled.
  8. Saved logs and attached.

DisplayMagician-Support-20220507-0951.zip https://github.com/terrymacdonald/DisplayMagician/files/8644618/DisplayMagician-Support-20220507-0951.zip

— Reply to this email directly, view it on GitHub https://github.com/terrymacdonald/DisplayMagician/issues/103#issuecomment-1120149143, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLU5LFH7OEHUI354ZHNML3VIYHQLANCNFSM5VH5FHAA . You are receiving this because you were assigned.Message ID: @.***>

terrymacdonald avatar May 07 '22 06:05 terrymacdonald

Enjoy it Terry.

Another bug I found which you can also inspect in the above logs file is that applying "No SuperDisplay" profile also disables BOTH USB monitors (SuperDisplay + Spacedesk) .. that is, even before restarting the PC.

The "No SuperDisplay" profile is a profile that should disable Superdisplay (to make the screen go black for some time when I don't need it) while keeping the smaller Spacedesk monitor active. However, applying it disables both Superdisplay and Spacedesk displays.

Cheers, Ahmed

cerahmed avatar May 07 '22 07:05 cerahmed

What's probably happening is that it is crashing out of the display changing process, and that is just not enabling the other USB displays. I think there is a previous error, and what you're seeing is the result of it crashing before it gets to the code that enables the other displays.

Should be more apparent when I review the logs.

Thanks Terry

On Sat, 7 May 2022, 19:09 cerahmed, @.***> wrote:

Enjoy it Terry.

Another bug I found which you can also inspect in the above logs file is that applying "No SuperDisplay" profile also disables BOTH USB monitors (SuperDisplay + Spacedesk) .. that is, even before restarting the PC.

The "No SuperDisplay" profile is a profile that should disable Superdisplay (to make the screen go black for some time when I don't need it) while keeping the smaller Spacedesk monitor active. However, applying it disables both Superdisplay and Spacedesk displays.

Cheers, Ahmed

— Reply to this email directly, view it on GitHub https://github.com/terrymacdonald/DisplayMagician/issues/103#issuecomment-1120151549, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLU5LGANTDOXGMM7YRQCV3VIYJL5ANCNFSM5VH5FHAA . You are receiving this because you were assigned.Message ID: @.***>

terrymacdonald avatar May 07 '22 07:05 terrymacdonald

Apologies for the delay on this. Been working on the DRS Settings functionality first, and will look at this next.

Thanks Terry

terrymacdonald avatar May 14 '22 09:05 terrymacdonald

@cerahmed we need to test the NVIDIALibrary code and only that library code. It's time to break out NVIDIAInfo....

I need you to test NVIDIAInfo, a little app that I wrote specifically to test the NVIDIALibrary that I wrote. Because I want to only test the video manipulation works with multiple video cards, we will only use that for testing this. Once we can confirm that it all works then I'll roll it into DisplayMagician.

Can you please download and extract the latest NVIDIAInfo zip file to a folder on your computer from here: NVIDIAInfo-v1.7.4.zip

Open a PowerShell window, and change to the same folder that you extracted NVIDIAInfo into.

IMPORTANT - These instructions are likely to fail, so I need you to save/rename the NVIDIAInfo.log file as shown below. Each run of NVIDIAInfo overwrites the previous NVIDIAInfo.log, so I need you to rename it each time so it doesn't get overwritten. I need to see the log file entries to know what is broken.

Please complete the following instructions in this specific order:

Create a Superdisplay layout with some of your screens then:

  • Save the first config as NVIDIAInfo save first.cfg
  • Rename the NVIDIAInfo.log file to Rename-Item -Path "NVIDIAInfo.log" -NewName "NVIDIAInfo-first-save.log"
  • Check if the first windows display config is equal with NVIDIAInfo equal first.cfg (we want it to be equal)

Next, restart you PC. We need to do this so that it cycles the Superdisplay code so we can see what changes.

Next, after the reboot, create a second superdisplay windows display layout:

  • Save the second windows display as NVIDIAInfo save second.cfg
  • Rename the NVIDIAInfo.log file to Rename-Item -Path "NVIDIAInfo.log" -NewName "NVIDIAInfo-second-save.log"
  • Check if the second windows display config is equal with NVIDIAInfo equal second.cfg (we want it to be equal)
  • Check if the first windows display config is NOT equal with NVIDIAInfo equal first.cfg (we want it to NOT be equal)

Next swap back to the first display layout:

  • Load the first windows display as NVIDIAInfo load first.cfg
  • Rename the NVIDIAInfo.log file to Rename-Item -Path "NVIDIAInfo.log" -NewName "NVIDIAInfo-first-reload.log"
  • Check if the first windows display config is equal with NVIDIAInfo equal first.cfg (we want it to be equal)
  • Save a copy of the current display config for me to compare: NVIDIAInfo save first-reload.cfg
  • Make sure the second windows display config is NOT equal with NVIDIAInfo equal second.cfg (we DO NOT want it to be equal)

Next swap back to the triple screen display layout again:

  • Load the second windows display as NVIDIAInfo load second.cfg
  • Rename the NVIDIAInfo.log file to Rename-Item -Path "NVIDIAInfo.log" -NewName "NVIDIAInfo-second-reload.log"
  • Check if the second windows display config is equal with NVIDIAInfo equal second.cfg (we want it to be equal)
  • Save a copy of the current display config for me to compare: NVIDIAInfo save second-reload.cfg
  • Make sure the first windows display config is NOT equal with NVIDIAInfo equal first.cfg (we DO NOT want it to be equal)

Once that series of tests are done, please include the following files in a ZIP file, and upload the ZIP to this github issue through your web browser (click and drag the file from your File explorer into Github and it will upload):

  • first.cfg
  • first-reload.cfg
  • NVIDIAInfo-first-save.log
  • NVIDIAInfo-first-reload.log
  • second.cfg
  • second-reload.cfg
  • NVIDIAInfo-second-save.log
  • NVIDIAInfo-second-reload.log

I'm hoping that there will be a slight difference between the CFG files created, as that will then help point me at what is changing between reboots with the Superdisplay driver.

Also - Just to let you know - it may be that I cannot fix this. It may be that Superdisplay changes it's settings after a reboot too much and I cannot find a way to work around that. I'll do my best, but I can't promise anything.

Thanks Terry

terrymacdonald avatar May 24 '22 08:05 terrymacdonald

Hey Terry,

Thanks for your time! Below are the results of my testing.

NOTES:

  1. All display profiles are with SuperDisplay in extended mode; no duplicate screens, no Nvidia Surround, etc.
  2. Only change I made between first.cfg and second.cfg is the location of the SuperDisplay monitor to easily identify the changes in monitors identifications after the reboot.
  3. All instructions were strictly followed.

RESULTS:

  1. All the equality checks (7 count) returned NOT equal.
  2. Loading first.cfg fails.
  3. Loading second.cfg succeeded as expected.

Also - Just to let you know - it may be that I cannot fix this.

I'm a hobbyist programmer myself and I totally understand that 💯

Reboot Issue.zip

cerahmed avatar May 24 '22 19:05 cerahmed

@cerahmed this is confusing the heck out of me.

2022-05-24 22:23:48.9444|WARN|DisplayMagicianShared.SharedLogger|WinLibrary/SetActiveConfig: The combination of parameters and flags specified is invalid. Display configuration not applied. So trying again without SDC_FORCE_MODE_ENUMERATION as that works on some computers.
2022-05-24 22:23:48.9444|WARN|DisplayMagicianShared.SharedLogger|WinLibrary/SetActiveConfig: Retry. The combination of parameters and flags specified is invalid. Display configuration not applied. So trying again without any specific data other than the topology as that works on some computers.

From the above, I can see that the problem is with the WinLibrary, not the NVIDIALibrary. It is not liking the the SetDisplayConfig command and is returning an ERROR_INVALID_PARAMETER error: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setdisplayconfig

From that page we can see that ERROR_INVALID_PARAMETER means "The combination of parameters and flags specified is invalid.".... which doesn't help that much as far as error messages go.

My intuition is telling me that the following happened:

  • You saved the first cfg
  • You then modified the display layout and saved as second cfg
  • You rebooted
  • You then attempted to apply the first cfg (which didnt work thanks to WinLibrary error above)
  • You then attempted to apply the second cfg (which did work as display layout hadn't been changed).

So I think we need to do a slightly different test. I need to try and see what changes between the saved config files for the same display after a reboot.

So please do these steps for me please using NVIDIAInfo.....

Delete the NVIDIAInfo config files and log files you made earlier.

Create a Superdisplay layout with some of your screens then:

  • Save the first config as NVIDIAInfo save original.cfg
  • Rename the NVIDIAInfo.log file to Rename-Item -Path "NVIDIAInfo.log" -NewName "NVIDIAInfo-original-save.log"
  • Check if the first windows display config is equal with NVIDIAInfo equal original.cfg (we want it to be equal)

Next, restart your PC. We need to do this so that it cycles the Superdisplay code so we can see what changes.

Next, after the reboot, all your displays should stay in exactly the same display layout. We need to take a snapshot of that config to see what has changed.:

  • Save the post reboot windows display config as NVIDIAInfo save reboot.cfg
  • Rename the NVIDIAInfo.log file to Rename-Item -Path "NVIDIAInfo.log" -NewName "NVIDIAInfo-reboot-save.log"
  • Check if the reboot windows display config is equal with NVIDIAInfo equal reboot.cfg (we want it to be equal)
  • Check if the original windows display config is equal with NVIDIAInfo equal original.cfg (we want it to be equal)

Once that series of tests are done, please include the following files in a ZIP file, and upload the ZIP to this github issue through your web browser (click and drag the file from your File explorer into Github and it will upload):

  • original.cfg
  • reboot.cfg
  • NVIDIAInfo-original-save.log
  • NVIDIAInfo-reboot-save.log

Again, I'm hoping that there will be a noticeable difference between the CFG files created so I can see what changes after a reboot. I need it to be a repeatable change in order to code around the problem....

Thanks Terry

terrymacdonald avatar May 25 '22 07:05 terrymacdonald

Hey Terry,

That is very weird.

I'm currently at work with my laptop and the same superdisplay tablet connected to it (one laptop monitor + Superdisplay monitor), which experiences the same issue when rebooting. So the following testing is done with my laptop.

Results:

  1. All equality checks returned Not equal.
  2. Display profile original.cfg and reboot.cfg should be identical, I have not changed the position nor any settings for the Superdisplay monitor after rebooting.
  3. Followed your instructions as stated and below are the attached results.
  4. As an additional testing, I tried loading back original.cfg after I saved all the files you required above. Interestingly, although it still fails (just like the desktop setup) with the following code:
Attempting to apply NVIDIA display config from .\original.cfg
ERROR - NVIDIAInfo Windows CCD settings were not applied correctly.

However the Superdisplay is not getting disconnected/go black this time, it just keeps working.

If you remember, trying to load a profile after rebooting on my PC causes USB monitors to get disconnected/go black. This is not happening on my laptop using the same superdisplay version/tablet/settings.

  1. Also tried loading the reboot.cfg .. it works as expected.

Test files.zip

cerahmed avatar May 25 '22 10:05 cerahmed

What is confusing me is that none of the equality checks passes. I believe this means that some settings are not captured in the .cfg file that gets saved and we're trying to load. Just a tought.

cerahmed avatar May 25 '22 10:05 cerahmed

The equality tests use the same function to generate the data being compared with each other. The only difference is that the saved config is written to disk and loaded back in again.

It could be possible that the JSON saving/loading is messing with the object in some way, stop that they are not equal when reloaded? I'll have a look at that tomorrow and see what I can find.

I may need to try and install Superdisplay of there isn't a difference I can find as it may only apply to USB displays.

Thanks Terry MacDonald

On Wed, 25 May 2022, 23:00 cerahmed, @.***> wrote:

What is confusing me is that none of the equality checks passes. I believe this means that some settings are not captured in the .cfg file that gets saved and we're trying to load. Just a tought.

— Reply to this email directly, view it on GitHub https://github.com/terrymacdonald/DisplayMagician/issues/103#issuecomment-1137100246, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLU5LGOGWPJ7QJ2PZEVX7TVLYB3LANCNFSM5VH5FHAA . You are receiving this because you were assigned.Message ID: @.***>

terrymacdonald avatar May 25 '22 18:05 terrymacdonald

@cerahmed I found some issues with the way equality testing was being performed (some specific issues with Equals on some objects and the way that Windows changes the display name ordering). I've now updated NVIDIAInfo to v1.7.5 and added the NVIDIA 3D Settings tracking and Windows DPI Scaling (per source mode only).

I think that some of the changes I've made may help fix your Superdisplay issue, so I think it's worth testing again.

Can you please download and extract the latest NVIDIAInfo zip file to a folder on your computer from here: https://github.com/terrymacdonald/NVIDIAInfo/releases/tag/v1.7.5

Open a PowerShell window, and change to the same folder that you extracted NVIDIAInfo into.

IMPORTANT - These instructions are likely to fail, so I need you to save/rename the NVIDIAInfo.log file as shown below. Each run of NVIDIAInfo overwrites the previous NVIDIAInfo.log, so I need you to rename it each time so it doesn't get overwritten. I need to see the log file entries to know what is broken.

Please complete the following instructions in this specific order:

Create a Superdisplay layout with some of your screens then:

  • Save the first config as NVIDIAInfo save first.cfg
  • Rename the NVIDIAInfo.log file to Rename-Item -Path "NVIDIAInfo.log" -NewName "NVIDIAInfo-first-save.log"
  • Check if the first windows display config is equal with NVIDIAInfo equal first.cfg (we want it to be equal)

Next, restart you PC. We need to do this so that it cycles the Superdisplay code so we can see what changes.

Next, after the reboot, create a second superdisplay windows display layout:

  • Save the second windows display as NVIDIAInfo save second.cfg
  • Rename the NVIDIAInfo.log file to Rename-Item -Path "NVIDIAInfo.log" -NewName "NVIDIAInfo-second-save.log"
  • Check if the second windows display config is equal with NVIDIAInfo equal second.cfg (we want it to be equal)
  • Check if the first windows display config is NOT equal with NVIDIAInfo equal first.cfg (we want it to NOT be equal)

Next swap back to the first display layout:

  • Load the first windows display as NVIDIAInfo load first.cfg
  • Rename the NVIDIAInfo.log file to Rename-Item -Path "NVIDIAInfo.log" -NewName "NVIDIAInfo-first-reload.log"
  • Check if the first windows display config is equal with NVIDIAInfo equal first.cfg (we want it to be equal)
  • Save a copy of the current display config for me to compare: NVIDIAInfo save first-reload.cfg
  • Make sure the second windows display config is NOT equal with NVIDIAInfo equal second.cfg (we DO NOT want it to be equal)

Next swap back to the triple screen display layout again:

  • Load the second windows display as NVIDIAInfo load second.cfg
  • Rename the NVIDIAInfo.log file to Rename-Item -Path "NVIDIAInfo.log" -NewName "NVIDIAInfo-second-reload.log"
  • Check if the second windows display config is equal with NVIDIAInfo equal second.cfg (we want it to be equal)
  • Save a copy of the current display config for me to compare: NVIDIAInfo save second-reload.cfg
  • Make sure the first windows display config is NOT equal with NVIDIAInfo equal first.cfg (we DO NOT want it to be equal)

Once that series of tests are done, please include the following files in a ZIP file, and upload the ZIP to this github issue through your web browser (click and drag the file from your File explorer into Github and it will upload):

  • first.cfg
  • first-reload.cfg
  • NVIDIAInfo-first-save.log
  • NVIDIAInfo-first-reload.log
  • second.cfg
  • second-reload.cfg
  • NVIDIAInfo-second-save.log
  • NVIDIAInfo-second-reload.log

I'm hoping that there will be a slight difference between the CFG files created, as that will then help point me at what is changing between reboots with the Superdisplay driver.

Also - Just to let you know - it may be that I cannot fix this. It may be that Superdisplay changes it's settings after a reboot too much and I cannot find a way to work around that. I'll do my best, but I can't promise anything.

Thanks Terry

terrymacdonald avatar May 30 '22 19:05 terrymacdonald

Hey Terry,

The equality seems to work correctly now after running the tests, however loading the profile saved before rebooting still cannot be reloaded.

Below is the response for each instruction:

  • Check if the first windows display config is equal with NVIDIAInfo equal first.cfg (we want it to be equal)

Returns equal.

  • Check if the second windows display config is equal with NVIDIAInfo equal second.cfg (we want it to be equal)

Returns equal

  • Check if the first windows display config is NOT equal with NVIDIAInfo equal first.cfg (we want it to NOT be equal)

Returns NOT equal

  • Load the first windows display as NVIDIAInfo load first.cfg

Failed to load with the following error ERROR - NVIDIAInfo Windows CCD settings were not applied correctly..

  • Check if the first windows display config is equal with NVIDIAInfo equal first.cfg (we want it to be equal)

Returns NOT equal.

  • Make sure the second windows display config is NOT equal with NVIDIAInfo equal second.cfg (we DO NOT want it to be equal)

Returns equal.

  • Load the second windows display as NVIDIAInfo load second.cfg

Didn't load because it's the current active profile The display settings in second.cfg are already installed. No need to install them again. Exiting..

  • Check if the second windows display config is equal with NVIDIAInfo equal second.cfg (we want it to be equal)

Returns equal.

  • Make sure the first windows display config is NOT equal with NVIDIAInfo equal first.cfg (we DO NOT want it to be equal)

Returns NOT equal.

Result.zip

cerahmed avatar May 31 '22 09:05 cerahmed

Awesome. That has at least for us partway there. I can now try and figure out what is different with Superdisplay and how it works. I might try installing it on my test machine to see how it works, but that will take a while to sort out.

I'll take a look at your zip file over the next few days and let you know if I find anything.

Thanks Terry

On Tue, 31 May 2022, 21:47 cerahmed, @.***> wrote:

Hey Terry,

The equality seems to work correctly now after running the tests, however loading the profile saved before rebooting still cannot be reloaded.

Below is the response for each instruction:

  • Check if the first windows display config is equal with NVIDIAInfo equal first.cfg (we want it to be equal)

Returns equal.

  • Check if the second windows display config is equal with NVIDIAInfo equal second.cfg (we want it to be equal)

Returns equal

  • Check if the first windows display config is NOT equal with NVIDIAInfo equal first.cfg (we want it to NOT be equal)

Returns NOT equal

  • Load the first windows display as NVIDIAInfo load first.cfg

Failed to load with the following error ERROR - NVIDIAInfo Windows CCD settings were not applied correctly..

  • Check if the first windows display config is equal with NVIDIAInfo equal first.cfg (we want it to be equal)

Returns NOT equal.

  • Make sure the second windows display config is NOT equal with NVIDIAInfo equal second.cfg (we DO NOT want it to be equal)

Returns equal.

  • Load the second windows display as NVIDIAInfo load second.cfg

Didn't load because it's the current active profile The display settings in second.cfg are already installed. No need to install them again. Exiting. .

  • Check if the second windows display config is equal with NVIDIAInfo equal second.cfg (we want it to be equal)

Returns equal.

  • Make sure the first windows display config is NOT equal with NVIDIAInfo equal first.cfg (we DO NOT want it to be equal)

Returns NOT equal.

Result.zip https://github.com/terrymacdonald/DisplayMagician/files/8803964/Result.zip

— Reply to this email directly, view it on GitHub https://github.com/terrymacdonald/DisplayMagician/issues/103#issuecomment-1141916126, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLU5LCAH5AGBS2RDN5B43DVMXN3PANCNFSM5VH5FHAA . You are receiving this because you were assigned.Message ID: @.***>

terrymacdonald avatar May 31 '22 10:05 terrymacdonald

Hi Terry,

So I went back home after work, and tried the same on my PC (the files shared above were from my laptop/superdisplay setup). Although my comments above are valid for the PC, however I wanted to share new files which could help you detect the issue.

I created first.cfg and second.cfg this time without modifying the position of the Superdisplay (the one I shared in my previous comment has different monitor positions between both profiles).

So this time, when checking equality after restarting and creating an identical profile, first.cfg is equal to second.cfg, and loading first.cfg gives back The display settings in .\first.cfg are already installed. No need to install them again. Exiting.. So I wanted to share both profiles for your review as well.

** P.S. Edit - Additional Informaation: So now with both first.cfg and second.cfg equal in NvidiaInfo check, I tried the following:

  1. After rebooting and saving second.cfg, I changed the position of the SuperDisplay, then tried loading second.cfg - it loaded no problem.

  2. I then went ahead and changed the position again, and tried loading first.cfg - and it did not load!

My guess is that there're some settings not captured by NvidiaInfo that's causing the issue.

Identical Profiles Before and After Reboot.zip

cerahmed avatar May 31 '22 16:05 cerahmed

@cerahmed Great news. I installed Superdisplay on my PC and found the underlying issue. And it was a fairly major error.

The issue was with the Windows display config patching we have to do after each restart of Windows. Microsoft decided to make it really difficult to use their APIs, and change the Adapter identifiers each time windows restarts. This means each time we load a previously saved display config, we have to 'patch it' with the current adapter identifiers that are valid during this run of Windows.

The problem was that some of the patches were not being properly applied, meaning that the config being handed to Windows was a mix of the new adapter ids and the old adapter ids. This just wouldn't work. Also, it would have affected the display config matching logic, as the two configs being compared wouldn't have matched even if all of the other settings were exactly equal.

So, I have now ensured that the adapter ids are being patched correctly, and I've slightly changed where the patching takes place to remove some of the repeated patching that was being done. The result is a Windows display config that works even after a reboot!

Next steps are to get a new version of CCDInfo built, after which I will get you to test. Once we've confirmed CCDInfo works, I'll then make the same changes to NVIDIAInfo, and once that tests ok, we'll roll the changes into DisplayMagician v2.3.2.

Thanks Terry

terrymacdonald avatar Jun 01 '22 23:06 terrymacdonald

@cerahmed ok - we'll skip straight to testing NVIDIAInfo as I had some time to copy the WinLibrary changes over after work today. So, Can you please do the following tests for me with NVIDIA v1.7.6 as that is the version that contains the fixes you need.

Can you please download and extract the latest NVIDIAInfo zip file to a folder on your computer from here: https://github.com/terrymacdonald/NVIDIAInfo/releases/tag/v1.7.6

Open a PowerShell window, and change to the same folder that you extracted NVIDIAInfo into.

Please complete the following instructions in this specific order:

Delete all previous .CFG and .LOG files as we want to start again.

Create a Superdisplay layout with some of your screens then:

  • Save the first config as NVIDIAInfo save first.cfg
  • Rename the NVIDIAInfo.log file to Rename-Item -Path "NVIDIAInfo.log" -NewName "NVIDIAInfo-first-save.log"
  • Check if the first windows display config is equal with NVIDIAInfo equal first.cfg (we want it to be equal)

Next, create a second windows display layout with a disabled superdisplay screen:

  • Save the second windows display as NVIDIAInfo save second.cfg
  • Rename the NVIDIAInfo.log file to Rename-Item -Path "NVIDIAInfo.log" -NewName "NVIDIAInfo-second-save.log"
  • Check if the second windows display config is equal with NVIDIAInfo equal second.cfg (we want it to be equal)
  • Check if the first windows display config is NOT equal with NVIDIAInfo equal first.cfg (we want it to NOT be equal)

Next - REBOOT your computer. You need to do this so that we can see if it will work after a reboot now.

Next swap back to the first display layout:

  • Load the first windows display as NVIDIAInfo load first.cfg
  • Rename the NVIDIAInfo.log file to Rename-Item -Path "NVIDIAInfo.log" -NewName "NVIDIAInfo-first-reload.log"
  • Check if the first windows display config is equal with NVIDIAInfo equal first.cfg (we want it to be equal)
  • Save a copy of the current display config for me to compare: NVIDIAInfo save first-reload.cfg
  • Make sure the second windows display config is NOT equal with NVIDIAInfo equal second.cfg (we DO NOT want it to be equal)

Next swap back to the disabled super display display layout again:

  • Load the second windows display as NVIDIAInfo load second.cfg
  • Rename the NVIDIAInfo.log file to Rename-Item -Path "NVIDIAInfo.log" -NewName "NVIDIAInfo-second-reload.log"
  • Check if the second windows display config is equal with NVIDIAInfo equal second.cfg (we want it to be equal)
  • Save a copy of the current display config for me to compare: NVIDIAInfo save second-reload.cfg
  • Make sure the first windows display config is NOT equal with NVIDIAInfo equal first.cfg (we DO NOT want it to be equal)

Once that series of tests are done, please include the following files in a ZIP file, and upload the ZIP to this github issue through your web browser (click and drag the file from your File explorer into Github and it will upload):

  • first.cfg
  • first-reload.cfg
  • NVIDIAInfo-first-save.log
  • NVIDIAInfo-first-reload.log
  • second.cfg
  • second-reload.cfg
  • NVIDIAInfo-second-save.log
  • NVIDIAInfo-second-reload.log

I'm REALLY hoping this all works as expected, as I performed the exzct same test on my PC and it worked perfectly. 🤞

Thanks Terry

terrymacdonald avatar Jun 02 '22 06:06 terrymacdonald

This fix will go out in the next release of DisplayMagician v2.4.0.

terrymacdonald avatar Jun 02 '22 07:06 terrymacdonald

Hey Terry,

V1.7.6 Tag only has the source code, can you please compile it so I can test it? Otherwise I can test V1.7.7 which has the executable.

cerahmed avatar Jun 02 '22 08:06 cerahmed

Yeah sorry 1.7.7 is the one you want. I had to cancel v1.7.6 because of an error.

On Thu, 2 Jun 2022, 20:16 cerahmed, @.***> wrote:

Hey Terry,

V1.7.6 Tag only has the source code, can you please compile it so I can test it? Otherwise I can test V1.7.7 which has the executable.

— Reply to this email directly, view it on GitHub https://github.com/terrymacdonald/DisplayMagician/issues/103#issuecomment-1144580890, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLU5LA6QG2BG6DH4CS34ETVNBUUXANCNFSM5VH5FHAA . You are receiving this because you were assigned.Message ID: @.***>

terrymacdonald avatar Jun 02 '22 08:06 terrymacdonald

I tried V1.7.7 and it works like a charm on my laptop setup! Awesome.. I'll also check it on my PC when I get back home in a few hours.

The equality checks resulted in what's expected. Switching back and forth between first.cfg and second.cfg worked without an issue.

Results.zip

cerahmed avatar Jun 02 '22 08:06 cerahmed

@cerahmed FINALLY! \o/

This one has been a tricky one to troubleshoot. Sorry it's taken so long, but it did at least uncover a tricky bug that has been in DisplayMagician since we moved to using my WinLibrary. So thanks for helping me find it I guess? So glad it's fixed though!

Oh - did you try it after a reboot just to be sure that works ok too?

Thanks Terry

terrymacdonald avatar Jun 02 '22 08:06 terrymacdonald

Thank YOU for actually taking time to figure the issue out! It seemed so specific and complicated to troubleshoot indeed. Yes! I've done several reboots and other profiles and nothing seems to cause any issue!

I'll do some more testing on my PC that has additional monitors + the small SpaceDesk Monitor .. I'm hopeful it works without issues there as well.

💯👍

cerahmed avatar Jun 02 '22 09:06 cerahmed

@cerahmed a couple of other points too that I've picked up in testing that you may like to know.

  • The same Superdisplay configuration works over USB connection or Wifi connection. No need for a separate display profile.
  • Superdisplay works by having a local fake screen driver which talks to the tablet. What this means is that the fake screen may still be visible to DisplayMagician in some situations until Superdisplay removes the monitor from Windows. Once that happens then the Superdisplay Display Profiles won't work until the screen is readded.

Other than that it should be good to go once I release DisplayMagician! Please note there are a few other little issues people have provided to me that I will need to fix before I release DM v2.4.0.

I will likely drop a copy in here first so that you can test it for me before I do a wider release. This is to iron out anny other little bugs we might find. You have a complicated little setup, and that is great for finding all the edge cases :).

Thanks Terry

terrymacdonald avatar Jun 02 '22 09:06 terrymacdonald

The same Superdisplay configuration works over USB connection or Wifi connection. No need for a separate display profile.

Yes! I'm well aware of that and it's just awesome that it works this way!

Superdisplay works by having a local fake screen driver which talks to the tablet. What this means is that the fake screen may still be visible to DisplayMagician in some situations until Superdisplay removes the monitor from Windows. Once that happens then the Superdisplay Display Profiles won't work until the screen is readded.

Good to know about this! I'll most likely ONLY load profiles when Superdisplay is connected, but thanks for the heads up!

Sure thing, I'll be waiting for any testing units👌

cerahmed avatar Jun 02 '22 09:06 cerahmed

@cerahmed Please test this version of DisplayMagician v2.4.0.10: DisplayMagicianSetup-v2.4.0.10.zip

It is a test version of DisplayMagician that hopefully is nearly ready to ship.

PLEASE NOTE: It will rename your old DisplayMagician settings files which will stop older versions of DisplayMagician from working. This is reversible.

PLEASE ALSO NOTE: You will be required to setup new Display Profiles. This is because we're added new settings (NVIDIA 3D Settings, and Windows DPI Scaling).

Please check the following when you test this version of DisplayMagician that:

  • You are informed during first run of DisplayMagician that you will need to create new Display Profiles
  • Your Game Shortcuts are still there, and that you can update them with the new Display Profiles you create.
  • That you can swap between all the Display Profiles you create without any errors.

Please reply with the results of your testing.

Thanks Terry

terrymacdonald avatar Jun 03 '22 22:06 terrymacdonald