terrymacdonald / DisplayMagician

DisplayMagician is an open source tool for automatically configuring your displays and sound for a game or application from a single Windows Shortcut.
https://displaymagician.littlebitbig.com
GNU General Public License v3.0
443 stars 18 forks source link

Superdisplay Profile Not Loading After System Reboot #103

Open cerahmed opened 2 years ago

cerahmed commented 2 years ago

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

terrymacdonald commented 2 years ago

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: @.***>

cerahmed commented 2 years ago

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 commented 2 years ago

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.

terrymacdonald commented 2 years ago

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: @.***>

cerahmed commented 2 years ago

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

terrymacdonald commented 2 years ago

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: @.***>

cerahmed commented 2 years ago

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

terrymacdonald commented 2 years ago

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 commented 2 years ago

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

Thanks Terry

terrymacdonald commented 2 years ago

@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:

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:

Next swap back to the first display layout:

Next swap back to the triple screen display layout again:

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):

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

cerahmed commented 2 years ago

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

terrymacdonald commented 2 years ago

@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:

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:

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.:

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):

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

cerahmed commented 2 years ago

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.

5) Also tried loading the reboot.cfg .. it works as expected.

Test files.zip

cerahmed commented 2 years ago

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.

terrymacdonald commented 2 years ago

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 commented 2 years ago

@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:

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:

Next swap back to the first display layout:

Next swap back to the triple screen display layout again:

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):

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

cerahmed commented 2 years ago

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

terrymacdonald commented 2 years ago

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: @.***>

cerahmed commented 2 years ago

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

terrymacdonald commented 2 years ago

@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 commented 2 years ago

@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:

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

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:

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

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):

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 commented 2 years ago

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

cerahmed commented 2 years ago

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.

terrymacdonald commented 2 years ago

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: @.***>

cerahmed commented 2 years ago

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

terrymacdonald commented 2 years ago

@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

cerahmed commented 2 years ago

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.

πŸ’―πŸ‘

terrymacdonald commented 2 years ago

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

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

cerahmed commented 2 years ago

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πŸ‘Œ

terrymacdonald commented 2 years ago

@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:

Please reply with the results of your testing.

Thanks Terry

cerahmed commented 2 years ago

Hey Terry,

I have done several tests and here're the results:

1) For the first app run only, it does show the warning asking to create new profiles - check. 2) I haven't used any game profiles yet, but I'll do that in future testing. 3) Here it gets a little weird:

After installing the new version and restarting the PC to make the necessary changes/flushing, I created two Superdisplay profiles (1) Extended mode and (2) Duplicated mode.

Switching to the Duplicated profile works no problem, but loading the Extended profile failed! All that without restarting the PC still. I deleted all profiles so that I can make a readable log file with descriptive steps, however when I recreated the same profiles, both loaded no problem!

So after successfully loading both Extended and Duplicated, I tried restarting the PC and try loading them. Weirdly, the Extended profile didn't load correctly (puts the USB monitors off), but the Duplicated profile loaded without any problems!

I captured the log file for your review below. DisplayMagician-Support-20220604-1547.zip

cerahmed commented 2 years ago

So closing the application and relaunching it (without restarting again) made both profiles work! Pretty weird. Logs for that below.

DisplayMagician-Support-20220604-1603.zip

cerahmed commented 2 years ago

So it seems like a pattern. After the above I:

1) Restarted the PC. 2) DisplayMagician Launched on Startup (Superdisplay is not yet connected). 3) Connected SuperDisplay. 4) Tried loading the profile with the hotkey -> it fails. 5) Closed the app and relaunched it. 6) Tried again loading the profile with the hotkey -> it works.

It seems like the Superdisplay monitor HAS to be connected BEFORE DisplayMagician launches in order to update its ID correctly. In other words, DisplayMagician needs to be started after the Superdisplay is connected.

Perhaps changing the logic of updating the ID's to be just before loading the profile (instead of at application launch) would solve the issue. Not sure though if it's a time consuming process that will lead to a higher profile load time πŸ€”

Log for the step above: DisplayMagician-Support-20220604-1610.zip

cerahmed commented 2 years ago

Sorry for bombarding you with my results, but I did the same testing as above again and again, to notice that the Extended profile indeed works the way I elaborated above, however with the same steps the Duplicated fails to load.

DisplayMagician-Support-20220604-1627.zip

Got to say that the NvidiaInfo V1.7.7 continued to work flawlessly until now.

terrymacdonald commented 2 years ago

That's going to take a while to unpack @ceramed! I'll do some testing on my own system and see what I can find with duplicated mode.

Thanks Terry

On Sun, 5 Jun 2022, 01:29 cerahmed, @.***> wrote:

Sorry for bombarding you with my results, but I did the same testing as above again and again, to notice that the Extended profile indeed works the way I elaborated above, however with the same steps the Duplicated fails to load.

DisplayMagician-Support-20220604-1627.zip https://github.com/terrymacdonald/DisplayMagician/files/8837804/DisplayMagician-Support-20220604-1627.zip

β€” Reply to this email directly, view it on GitHub https://github.com/terrymacdonald/DisplayMagician/issues/103#issuecomment-1146611506, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLU5LDKROFHRK7V7RJNWQLVNNKZXANCNFSM5VH5FHAA . You are receiving this because you modified the open/close state.Message ID: @.***>

terrymacdonald commented 2 years ago

@cerahmed looks like you have a single display showing up twice!

"WINAPI|\\\\?\\PCI#VEN_10DE&DEV_2484&SUBSYS_261719DA&REV_A1#4&2de8dd5b&0&0008#{5b45201d-f2f2-4f3b-85bb-30ff1f953599}|DISPLAYCONFIG_OUTPUT_TECHNOLOGY_DVI|11596|3372|\\\\?\\DISPLAY#SAM0D2C#5&79edafc&2&UID4354#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}|C24F390",
        "WINAPI|\\\\?\\PCI#VEN_10DE&DEV_2484&SUBSYS_261719DA&REV_A1#4&2de8dd5b&0&0008#{5b45201d-f2f2-4f3b-85bb-30ff1f953599}|DISPLAYCONFIG_OUTPUT_TECHNOLOGY_DVI|11596|3372|\\\\?\\DISPLAY#SAM0D2C#5&79edafc&2&UID4356#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}|C24F390",
        "WINAPI|\\\\?\\PCI#VEN_10DE&DEV_2484&SUBSYS_261719DA&REV_A1#4&2de8dd5b&0&0008#{5b45201d-f2f2-4f3b-85bb-30ff1f953599}|DISPLAYCONFIG_OUTPUT_TECHNOLOGY_HDMI|44592|26094|\\\\?\\DISPLAY#LEN65EE#5&79edafc&2&UID4352#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}|LEN Y27q-20",
        "WINAPI|\\\\?\\SuperDisplay#Display#1&3343b12b&4&1234#{5b45201d-f2f2-4f3b-85bb-30ff1f953599}|DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INDIRECT_WIRED|0|0|\\\\?\\DISPLAY#Default_Monitor#2&1a22f9d1&0&UID256#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}|",
        "WINAPI|\\\\?\\SWD#{1BAAD4AC-CD9D-4207-B4FF-C4F160604B13}#0000#{5b45201d-f2f2-4f3b-85bb-30ff1f953599}|DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INDIRECT_WIRED|0|0|\\\\?\\DISPLAY#Default_Monitor#1&1efbcd86&2&UID256#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}|"

This in turn appears to have caused all sorts of problems with duplicate UID values (both SuperDisplay and SWD have UID256). This appears to be causing issues like this:

2022-06-04 16:25:24.4753|ERROR|DisplayMagician.Program|WinLibrary/PatchAdapterIDs: Exception while going through the display config HDR info to update the adapter id|System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at DisplayMagicianShared.Windows.WinLibrary.PatchWindowsDisplayConfig(WINDOWS_DISPLAY_CONFIG& savedDisplayConfig)

and this:

2022-06-04 16:25:29.6946|ERROR|DisplayMagician.Program|WinLibrary/PatchAdapterIDs: Exception while going through the display adapters update the adapter ids|System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at DisplayMagicianShared.Windows.WinLibrary.PatchWindowsDisplayConfig(WINDOWS_DISPLAY_CONFIG& savedDisplayConfig)

and this:

2022-06-04 16:25:34.7871|ERROR|DisplayMagician.Program|ProfileItem/GetWindowsScreenPositions: Exception trying to get the position of the taskbar on display 256|System.InvalidOperationException: Sequence contains no matching element
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
   at DisplayMagicianShared.ProfileItem.FindAllWindowsScreens()
2022-06-04 16:25:34.7871|WARN|DisplayMagician.Program|ProfileItem/GetWindowsScreenPositions: Exception trying to get the position of the taskbar on display 256|System.InvalidOperationException: Sequence contains no matching element
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
   at DisplayMagicianShared.ProfileItem.FindAllWindowsScreens()
2022-06-04 16:25:34.7871|TRACE|DisplayMagician.Program|ProfileItem/GetWindowsScreenPositions: Added a new Screen 256 (822x400) at position 2560,0.
2022-06-04 16:25:34.7871|ERROR|DisplayMagician.Program|ProfileItem/GetWindowsScreenPositions: Exception trying to get the position of the taskbar on display 256|System.InvalidOperationException: Sequence contains no matching element
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
   at DisplayMagicianShared.ProfileItem.FindAllWindowsScreens()
2022-06-04 16:25:34.7871|WARN|DisplayMagician.Program|ProfileItem/GetWindowsScreenPositions: Exception trying to get the position of the taskbar on display 256|System.InvalidOperationException: Sequence contains no matching element
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
   at DisplayMagicianShared.ProfileItem.FindAllWindowsScreens()
2022-06-04 16:25:34.7871|TRACE|DisplayMagician.Program|ProfileItem/GetWindowsScreenPositions: Added a new Screen 256 (2960x1848) at position -201,1440.

I think I might be able to fix this? I'll need to figure out a way of doing so. It may involve changing the file format again in order to get this to work, so It'll be better to do this now than wait until the future....

I'll do some more digging with my own testing here. Can you please give me a link to SpaceDesk? I may need to install that too if I'm going to troubleshoot having both of them installed.

Can you please also describe your 'Duplicated' layout a bit more for me please? Can you please screenshot the Windows settings display layout and then label each screen with what it is, and if it is extended or cloned? Then I'll be able to read your config and know what is what. That will also help with figuring out which bits of code are failing.

Thanks Terry

cerahmed commented 2 years ago

Hi Terry,

Yeah I believe having two USB monitors make things a bit more complicated. Here's the link to SpaceDesk: https://www.spacedesk.net/

My PC setup is as follows (when in Duplicate Mode):

Duplicate-Setup

Let me know should you require further clarification on my settings!

terrymacdonald commented 2 years ago

@cerahmed How are you getting your Superdisplay to allow Duplicated mode? When I try to do so it won't let me select Duplicate, only Extend:

image

So I can't do any testing myself. I should be able to do some testing with your configs though.

Thanks Terry

terrymacdonald commented 2 years ago

@cerahmed, can you please do me another favour? Can you please download NVIDIAInfo v1.7.9 (latest version) from here: https://github.com/terrymacdonald/NVIDIAInfo/releases/tag/v1.7.9

Can you then please recreate your duplicated and extended display using NVIDIAInfo v1.7.9 and save them to extended.cfg and duplicated.cfg. Then please try swapping between those two modes, and lets see what breaks.

Please then ZIP up the log files, and the .cfg files, and then upload it here again, and I'll see what else there is happening.

If I have two cfg files then I can use NVIDIAInfo to test them out, which is a LOT simpler to troubleshoot.

It looks like SpaceDesk creates a new fake adapter, as well as a fake display, but I think that part is still working. I really think it's the fact that the SpaceDesk fake display and the Superdisplay fake Display both use the UID256, and I think there is still some bit of old code in there that isn't using the adapter ID and UID combined together. This test you're doing will hopefully point me to the right bit of code.

Thanks Terry

cerahmed commented 2 years ago

Hey Terry,

My Windows Display Settings allow me to choose Duplicate Mode as follows. I'm not sure why this setting is not showing up in yours!

image

As for the testing, I'm currently on my Laptop with no Spacedesk attached, would you want me to create the extended and duplicated profiles on my laptop or wait until I go back home to my PC?

terrymacdonald commented 2 years ago

@ceramed, wait until you're home. No rush as I'm just about to go to bed.

Thanks Terry

On Mon, 6 Jun 2022, 20:03 cerahmed, @.***> wrote:

Hey Terry,

My Windows Display Settings allow me to choose Duplicate Mode as follows. I'm not sure why this setting is not showing up in yours!

[image: image] https://user-images.githubusercontent.com/21166481/172120526-ce0b9588-75e7-4036-bfc5-e13c0a4b9473.png

As for the testing, I'm currently on my Laptop with no Spacedesk attached, would you want me to create the extended and duplicated profiles on my laptop or wait until I go back home to my PC?

β€” Reply to this email directly, view it on GitHub https://github.com/terrymacdonald/DisplayMagician/issues/103#issuecomment-1147164906, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLU5LGMOREF3IOJC3C2FILVNWWF3ANCNFSM5VH5FHAA . You are receiving this because you modified the open/close state.Message ID: @.***>

cerahmed commented 2 years ago

Hey Terry,

Apologies for the late response! Got a little busy..

I have done the testing you've asked for:

(WITHOUT/BEFORE Restarting the PC) 1) Saved the extended profile. 2) Renamed log to extended-save. 3) Saved the duplicated profile. 4) Renamed log to duplicated-save. 5) Tried loading extended.cfg -> it fails -> Renamed log to extended-reload 6) Although I've done it by mistake, but the result is interesting! I tried loading extended.cfg for a second time -> it worked! -> Renamed log to extended-second-reload. 7) Tried loading duplicated -> it works -> Renamed log to duplicated-reload.

Before Restarting PC.zip

As some additional testing, I went ahead and restarted the PC, and did the following:

(AFTER Restarting the PC)

8) Saved an extended-after-restart profile. (This might have slightly different position than extended profile before restarting). 9) Renamed log to extended-save-after-restart. 10) Saved a duplicated profile. (Again, this might have a slightly different position than the duplicated before restarting). 11) Renamed log to duplicated-save-after-restart.

Then I tried loading the before restart, and after restart profiles, to see what happens:

12) Tried loading extended profile (the one before restarting) -> it fails. 13) Renamed log to load-extended1. 14) Tried loading extended-after-restart -> it works. 15) Renamed log to load-extended2. 16) Tried loading duplicated profile (the one before restarting) -> it works. 17) Renamed log to load-duplicated1. 18) Tried loading duplicated-after-restart -> it works. 19) Renamed log to load-duplicated2.

After Restarting PC.zip

20) At the very end of the testing and after zipping the results, I went ahead and tried loading extended (the one that failed in bullet#12) and it worked! 21) Renamed log to load-extended1-second-time.

NVIDIAInfo-load-extended1-second-time.log

I know the after restarting logs were not asked for, but it might help you diagnose any issues that you might face! Ignore them if they don't make sense or too complicated to follow along πŸ˜„

terrymacdonald commented 2 years ago

Oh cool! This gives me loads of logs to sift through. This is about the best set of CFG and log files I've gotten, so I'm hopeful I can find the issue.

I'm a little bit hampered by the fact I don't have an additional device to test spacedesk at the same time. But will see what I can scrounge up.

I forgot to ask, are you on windows 10 or 11?

Thanks Terry

On Thu, 9 Jun 2022, 03:59 cerahmed, @.***> wrote:

Hey Terry,

Apologies for the late response! Got a little busy..

I have done the testing you've asked for:

(WITHOUT/BEFORE Restarting the PC)

  1. Saved the extended profile.
  2. Renamed log to extended-save.
  3. Saved the duplicated profile.
  4. Renamed log to duplicated-save.
  5. Tried loading extended.cfg -> it fails -> Renamed log to extended-reload
  6. Although I've done it by mistake, but the result is interesting! I tried loading extended.cfg for a second time -> it worked! -> Renamed log to extended-second-reload.
  7. Tried loading duplicated -> it works -> Renamed log to duplicated-reload.

Before Restarting PC.zip https://github.com/terrymacdonald/DisplayMagician/files/8863154/Before.Restarting.PC.zip

As some additional testing, I went ahead and restarted the PC, and did the following:

(AFTER Restarting the PC)

  1. Saved an extended-after-restart profile. (This might have slightly difference position than extended profile before restarting).
  2. Renamed log to extended-save-after-restart.
  3. Saved a duplicated profile. (Again, this might have a slightly different position than the duplicated before restarting).
  4. Renamed log to duplicated-save-after-restart.

Then I tried loading the before restart, and after restart profiles, to see what happens:

  1. Tried loading extended profile (the one before restarting) -> it fails.
  2. Renamed log to load-extended1.
  3. Tried loading extended-after-restart -> it works.
  4. Renamed log to load-extended2.
  5. Tried loading duplicated profile (the one before restarting) -> it works.
  6. Renamed log to load-duplicated1.
  7. Tried loading duplicated-after-restart -> it works.
  8. Renamed log to load-duplicated2.

After Restarting PC.zip https://github.com/terrymacdonald/DisplayMagician/files/8863236/After.Restarting.PC.zip

  1. At the very end of the testing and after zipping the results, I went ahead and tried loading extended (the one that failed in bullet#12) and it worked!
  2. Renamed log to load-extended1-second-time.

NVIDIAInfo-load-extended1-second-time.log https://github.com/terrymacdonald/DisplayMagician/files/8863259/NVIDIAInfo-load-extended1-second-time.log

I know the after restarting logs were not asked for, but it might help you diagnose any issues that you might face! Ignore them if they don't make sense or too complicated to follow along πŸ˜„

β€” Reply to this email directly, view it on GitHub https://github.com/terrymacdonald/DisplayMagician/issues/103#issuecomment-1150104813, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLU5LDN53TGQXO2RGEP4B3VOC7MPANCNFSM5VH5FHAA . You are receiving this because you modified the open/close state.Message ID: @.***>

cerahmed commented 2 years ago

Great!

I'm on Windows 11 latest public release.

terrymacdonald commented 2 years ago

@cerahmed While we wait for my fix, can you please give this test version of DisplayMagician a go? I've found a couple of things that may be the cause of the error you got (not sure though).

  1. It looks like NVIDIA have made their NvAPI_Mosaic_SetDisplayGrids function only work with a SET_TOPOLOGY_FLAG value of NONE in the latest version of the driver. All other flag values results in a Crash to Desktop (CTD) :(. I have removed the other flags I used so that the driver will keep working.

  2. Patch adapter ids (which patches Windows adapter ids so they work after a reboot) had a bug caused in a recent update. This would only update the first adapter seen, and not any others. This meant that a config wouldn't work after a reboot.

I have also updated the UI window placement when applying a profile. Because the screen coordinates change when applying a new display layout, the UI used to sometimes go off screen, and it was a pain to try and move it to the right place so you could see it again. I have changed that so that when a display profile is applied it will move the UI to the middle of the primary monitor, and will also then center the Display Profile screen. This should make DisplayMagician far easier to use.

To install DisplayMagician v2.4.0.26, please download this zip file and install the exe inside it. Please test the software and make sure that it now swaps display profiles without any errors: DisplayMagicianSetup-v2.4.0.26.zip

Thanks Terry

cerahmed commented 2 years ago

Glad to hear that you were able to identify some bugs!

I uninstalled the older version of Display Magician and installed V2.4.0.26 as requested.

1) Created extended and duplicated profiles as before. 2) Switching back and forth between them works flawlessly! (before restarting) 3) Restarted my PC then tried loading extended for three times -> unfortunately it failed. Right After Applying Extended (for 3 times) - Failed.zip

4) Tried loading duplicated after extended has failed and the USB screen went black -> it worked! Right After Applying Duplicated - Works.zip

5) Went ahead and closed DisplayMagician and relaunched it, then tried loading extended -> it worked as I expected. Closed and Relaunched App - Applied Extended - Works.zip

terrymacdonald commented 2 years ago

Darn it. Ok, so we've still got some issues to sort out specific to SpaceDesk and Superdisplay. At least we're getting a little closer each time.....

Thanks Terry

On Fri, 10 Jun 2022, 01:43 cerahmed, @.***> wrote:

Glad to hear that you were able to identify some bugs!

I uninstalled the older version of Display Magician and installed V2.4.0.26 as requested.

1.

Created extended and duplicated profiles as before. 2.

Switching back and forth between them works flawlessly! (before restarting) 3.

Restarted my PC then tried loading extended for three times -> unfortunately it failed. Right After Applying Extended (for 3 times) - Failed.zip https://github.com/terrymacdonald/DisplayMagician/files/8870858/Right.After.Applying.Extended.for.3.times.-.Failed.zip 4.

Tried loading duplicated after extended has failed and the USB screen went black -> it worked! Right After Applying Duplicated - Works.zip https://github.com/terrymacdonald/DisplayMagician/files/8870865/Right.After.Applying.Duplicated.-.Works.zip 5.

Went ahead and closed Display Fusion and relaunched it, then tried loading extended -> it worked as I expected. Closed and Relaunched App - Applied Extended - Works.zip https://github.com/terrymacdonald/DisplayMagician/files/8870896/Closed.and.Relaunched.App.-.Applied.Extended.-.Works.zip

β€” Reply to this email directly, view it on GitHub https://github.com/terrymacdonald/DisplayMagician/issues/103#issuecomment-1151138567, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLU5LHUBUMG45UCMIO4MLDVOHYIVANCNFSM5VH5FHAA . You are receiving this because you modified the open/close state.Message ID: @.***>

terrymacdonald commented 2 years ago

@cerahmed So, managed to get Superdisplay and SpaceDesk working together on my system, and have started testing. One thing I found out is that the taskbarlayout recording can have a delay of 15 seconds, so I have added some checks to prevent the display config from saving until Windows updates the registry with the taskbar layout. This means it can take up to 20 seconds to save a config, but at least it ensures that the config is always valid.

I was able to duplicate the Superdisplay screen on the SpaceDesk screen, but I cannot duplicate other screens on either of those two. It appears either they or Windows prevent this from happening.

I then updated CCDInfo with the new logic so that we can concentrate on the WinLibrary code to see where the error may lie.

In my testing, it seems that either Superdisplay or SpaceDesk is stopping the display swap from a duplicated display layout to an extended one. It looks like its something to do with the way that the display drivers themselves work. I can't find any error at the moment that is specifically a DisplayMagician one. I'll keep looking and I'll keep testing, but at this point it looks like I may not be able to fix it in DisplayMagician.

One thought I had was, why do you need to use Superdisplay AND SpaceDesk? It looks like SpaceDesk can run more than one screen with the cool client->server driver model it uses. You might be able to have two SpaceDesk tablets and not use Superdisplay, and it might work ok. In fact, I'm going to test that later on tonight to see if it works.

Thanks Terry

cerahmed commented 2 years ago

Hi Terry,

I will try the steps I made in my last comment with my laptop that only has SuperDisplay installed; will share the results later.

The reason why I use both is because my first choice is SuperDisplay, as it can drive an android tablet at its full resolution @ 120Hz! That's crazy good for using it as a pen tablet monitor and other stuff. But SuperDisplay can only work with one device at a time, so I use SpaceDesk to drive my small phone next to my main monitor displaying sensor gauges and volume controls, etc.

Last thought, I've been using NvidiaInfo V1.7.7 to temporarily adjust my monitor settings ever since I tested it, and it worked 99% of the time (sometimes it requires loading the profile twice for it to work) - but as far as my testing goes, it does work!

terrymacdonald commented 2 years ago

@cerahmed Did NVIDIAInfo v1.7.9 work ok?

Another thought I had was that it could be that the display layout changes need to fully be changed before being saved. The reason I say this is that I currently monitor the windows taskbar location using some registry keys. These registry keys aren't actually updated until 15-20 seconds after the display layout change has happened. It is possible that the taskbar layout needs to settle down to it's final position before saving the setting.

We can actually try this with CCDInfo v1.7.9b that I've included here: CCDInfo-v1.7.9b.zip

Please extract CCDInfo v1.7.9b to a new folder.

Can you please create two new display layouts similar to your existing extended and duplicated ones, but can you please wait for 30 seconds after you have made the display layout changes, and then save them with CCDInfo after the 30 seconds has passed? The idea is that we are giving windows time to set all the things it needs to set, and then after its finished making changes we'll save then. I'm hoping this may work...

Then please try swapping between those two new display configs, and see if that works ok.

This version of CCDInfo also has a few bugfixes in it that may have been causing you issues. That, combined with the waiting 30 seconds before saving a new display layout may help things work a bit better.

Please then send me through the log files and cfg files to analyse.

Thanks Terry