BetterDisplay icon indicating copy to clipboard operation
BetterDisplay copied to clipboard

Dummy mirroring method for HiDPI scaling (native smooth scaling not affected) - Colors flicker or shade/tone changes after sleep when dummies are mirrored

Open cprcrack opened this issue 3 years ago • 170 comments

When I use the option "Disconnect and reconnect on sleep" or "Disconnect and reconnect on lock" (which by the way are very useful), my screen starts flickering after a reconnection is triggered by those events.

The flickering is like a small variation on brightness only every time I move the mouse pointer by 1px, very strange! The flickering is not visible when doing screen recordings, so I manually recorded a video with my camera, however the effect is more noticeable in person than what the camera shows:

https://www.youtube.com/watch?v=a5oewKMhYew (flickering from 0:30 onwards)

The only way to stop the flickering is quit BetterDummy or manually disconnect and reconnect the dummy.

Any idea of why this bizarre issue happens?

cprcrack avatar Dec 20 '21 21:12 cprcrack

That happens to me too.

nidr0x avatar Dec 21 '21 01:12 nidr0x

Can you guys try toggling the Do not set dummy color profile... option and see if that helps with the flickering?

Screen Shot 2021-12-21 at 7 15 57

waydabber avatar Dec 21 '21 06:12 waydabber

Didn't work, same issue. I played with that option quite a lot as well as the other options and the flickering still happens. As you mentioned color profiles I also went to System preferences > Displays and played with all available color options for both the dummy and the real screen and it just changed the colours but the flickering always remains.

A reminder that the flickering never happens when toggling Dummy properties > Connected. I there any difference in the routine that's called depending on whether it was a manual reconnection or if it was triggered by sleep/lock events?

cprcrack avatar Dec 21 '21 10:12 cprcrack

Hi, no, not really, if you use reconnect on sleep, it connects the same way as you'd do it manually. What happens if you don't use the mirrored dummy sleep workaround? But that should not mess up anything either. An other you can try using the alpha is to see if you use full screen streaming, what happens (in this case it is best to turn off all sleep&screen lock workaround options).

Strange that this issue is happening for some but not for others (I was not able to reproduce it so far on my M1 MBA either with an LG UHD display or a Lenovo QHD display), but there are several reports about the problem so I know it is real and annoying.

waydabber avatar Dec 21 '21 10:12 waydabber

Btw what color profile are you using on your Display? Is it a standard one? Are you using HDR or anything like that? Does the issue happen both with DisplayPort and HDMI? It would be great if we could figure out what specific circumstance triggers the problem (besides sleep obviously).

waydabber avatar Dec 21 '21 10:12 waydabber

The computer is a M1 MBA. The display is a Philips 325E1, it also shows "PHL 325E1" as the selected color profile so it seems to be a custom one for the display, but it's something that was configured automatically. In any case it happens even if I select any standard color profile from the list. There is nothing about HDR in the MacOS settings or hardware screen settings so I don't know if HDR is feature or factor in this issue. I only have one way to connect the screen which is via a Ugreen USB-C hub which has an HDMI output, to which I connect the screen via HDMI.

Sorry that I cannot reproduce it better. The sleep workaround setting doesn't really seem to have any effect on the issue. It definitely happens only after the Mac has gone to sleep. And it happens almost always. On the rare occasions that the issue doesn't happen it seems to be on the "first time" after manually digging with reconnections or completely restarting the app, but even then it maybe only works about 25% of those "first-times".

About the full screen streaming, not sure what's that feature about, but it says that I need Pro to use those features.

cprcrack avatar Dec 21 '21 15:12 cprcrack

If you select the exact same profile for both the dummy and the screen (try Generic RGB for both) the flickering still happens, right? I'll try via HDMI myself, maybe I can reproduce the issue.

Does the display have some kind of setting for "HDMI deep color" or anything like that? Does toggling that help?

(To access Pro stuff select BetterDumy Pro -> Try... - but I'll try to make this clearer.)

waydabber avatar Dec 21 '21 16:12 waydabber

Experiencing same issue, using HDMI on a mac mini and macOS 12.1 with a Asus ProArt 27" display (this was happening with 12.0.1 as well, 12.1 update did not fix). I spent forever with Apple and it wasn't until safe mode that we realized it wasn't hardware/Apple software and eventually found BetterDummy was causing it to happen. It also happens with my keyboard as well as mouse, although mouse is far worse.

I have been able to fix it by disconnecting the HDMI cable connecting the monitor, waiting 10 seconds, and plugging it back in. This always solves the problem.

I don't see the preferences option described above - or even the Pro option. I'm using 1.0.13. See attached. Screen Shot 2021-12-21 at 8 35 28 PM

jonmenaster avatar Dec 22 '21 04:12 jonmenaster

Hi @jonmenaster - yes, the extra settings are available in the v1.1.0-alpha2 version.

Anybody here who has this issue over HDMI could try this over DisplayPort? It would be great to clarify whether this issue happens only with HDMI or not. Thank you!

waydabber avatar Dec 22 '21 09:12 waydabber

If you select the exact same profile for both the dummy and the screen (try Generic RGB for both) the flickering still happens, right? I'll try via HDMI myself, maybe I can reproduce the issue.

Does the display have some kind of setting for "HDMI deep color" or anything like that? Does toggling that help?

(To access Pro stuff select BetterDumy Pro -> Try... - but I'll try to make this clearer.)

Yes I tried the same Generic RGB for both and it still happens, and no my monitor doesn't have any kind of setting like that.

cprcrack avatar Dec 23 '21 03:12 cprcrack

Flickers happen when moving mouse.

chrisge78 avatar Dec 23 '21 09:12 chrisge78

All right. I'll try to recreate this issue on a HDMI display, hopefully I'll succeed and see if there is anything I can do about it. The nature of the problem (it happens only after sleep) might suggest it is actually some kind of macOS bug but we could still understand what are the exact circumstances that triggers the problem and the figure out if there is any workaround for it.

waydabber avatar Dec 23 '21 09:12 waydabber

Ok, I was able to recreate this problem consistently on an M1 Mini connected to a Lenovo QHD display. The issue presented itself both with USB-C->DisplayPort and HDMI->HDMI connections.

I was unable to recreate this with an M1 MBA connected to an LG UHD display with the same method, so the issue seems to be specific to some setups or displays.

Even on the Lenovo QHD setup the problem does not present itself by default, as the dispay's colorspace set by the Mac automatically is Generic RGB (even though the color profile name is the display's) which is the same as what the Dummy uses.

The following procedure induces the problem on the affected setup consistently:

  1. Ensure that the Dummy is mirror main for the external screen
  2. Set the external screen color profile to something markedly other than the default Generic RGB - for example Display P3 (for a strong effect) or Adobe RGB (for a more subtle effect).
  3. Ensure that the Dummy's color profile remains Dummy...
  4. Disconnect the dummy
  5. Reconnect the dummy
  6. Activate sleep
  7. Wait until the display goes to standby
  8. Wake the mac
  9. Result: the color space will alternate between Dummy... (which is Generic RGB) and the external screen's color profile on every mouse movement, creating a flickering effect.

The following procedure eliminates the problem on the affected setup consistently:

  1. Ensure that the Dummy is mirror main for the external screen
  2. Set the external screen color profile to Dummy...
  3. Ensure that the Dummy's color profile remains Dummy...
  4. Disconnect the dummy
  5. Reconnect the dummy
  6. Activate sleep
  7. Wait until the display goes to standby
  8. Wake the mac
  9. Result: the color space should not alternate and there should be no flickering anymore.

Steps 3 and 4 are important to ensure the fix works, if you simply change the color profiles to Dummy... for both displays, the issue will not be fixed.

@chrisge78 - can you please try whether following the procedure mentioned above eliminates the problem for you as well (and as a counter-check you can try to induce the problem afterwards again). Thank you!

waydabber avatar Dec 23 '21 10:12 waydabber

Ok I tried that an initially I thought it worked... but it didn't. Now the flickering is totally unnoticeable on white/light and black/dark areas of the screen (so normally most of the screen), but on the areas where there is color, it seems to be specially with purple, the flickering is still the same. Very strange!

And by the way the Dummy... color profile doesn't work very well on my screen, the contrast between white and light areas is not enough, this is noticeable for example on Chrome's selected tab when on light mode, it's not clear enough which tab is selected as opposed to when I used my monitor's color profile, so it's not ideal either having to use a certain color profile.

cprcrack avatar Dec 23 '21 12:12 cprcrack

Interesting. What is the colorsync profile of your display by default? You can check it's details in the ColorSync Utility.

You should make a screenshot of the wtpt, and rXYZ values. I can give you a test build that has these values applied to the dummy and see if that resolves the issue and makes the colors right and solves the flickering issue.

Screen Shot 2021-12-23 at 14 35 35 Screen Shot 2021-12-23 at 14 35 53

waydabber avatar Dec 23 '21 13:12 waydabber

Screenshot 2021-12-23 at 15 12 51 Screenshot 2021-12-23 at 15 14 24

cprcrack avatar Dec 23 '21 14:12 cprcrack

Well, this is indeed different from Generic RGB. :)

Here is a test build that is customized to this display. Let's see if there is a change.

https://www.dropbox.com/s/v8rznserxmu1299/BetterDummy-phl-test.zip?dl=0

waydabber avatar Dec 23 '21 14:12 waydabber

Well pretty random things happened. I managed to see no-flickering for 3 times in a row which is atypical, but then the flickering returned on the whole screen and I think it was bigger than ever. Then playing with the color profiles (because I was not sure if I was supposed to leave them at Dummy 16:9 for the dummy and PHL325E1 for my monitor), I also saw flickers only on purple coloured areas when using Dummy 16:9 on both screens. And to add another extra random thing, my monitor abruptly shut down while the big flickers where happening and made a static noise when doing so. Fortunately it all went back to normal in a few seconds.

cprcrack avatar Dec 23 '21 15:12 cprcrack

that is strange. The static noise happens when the HDMI connection looses sync and suggests a hardware level failure (which might be software induced). The whole thing (starting with the flickering) seems to be a bug in macOS and it might be that some component of the graphichs subsystem failed to a point of no return and was restarted eventually by some watchdog thingy.

The background to this is that some displays pass custom chromaticity descriptors as part of their EDID table (which describes the display's physical properties to the OS), based on which MacOS creates a customized ICC (color) profile that matches that specific display. The OS uses this profile to calculate how to translate the colors of various UI elements so it looks natural on the display. When there is mirroring, the OS should also be able to translate colors between colorspaces from the mirror source display to the target display. When mirroring from and to physical displays, there doesn't seem to be problem, but when the source is a virtual display, macOS seems to behave in totally unexpected ways on some setups.

waydabber avatar Dec 23 '21 15:12 waydabber

(but to be fair, we should note that the display management of macOS is rather unstable so if you start connecting/disconnecting things like crazy and changing settings too quickly in Displays, macOS will probably freak out as a default course of action without BetterDummy's help...)

waydabber avatar Dec 23 '21 15:12 waydabber

Hi,

I had same issue with flickering on external display after macbook wakes up, but seems that your instruction from this message is solve it, thanks!

if it may be helpful, my setup is MBP M1 Pro 16" + Xiaomi Surface display 34" QHD, connected via HDMI – HDMI btw, will try to switch cable to Displayport – USB-C, will se how that will work.

p.s. thanks a lot for the BetterDummy, it's amazing piece of software for me.

trttkm avatar Dec 26 '21 14:12 trttkm

Hi @trttkm - thanks for the feedback! This fix (and the way to induce the issue) works reliably to me but due to the inherent finickiness of display management on macOS, the issue might still manifest itself especially if making display configuration changes in quick successions as @cprcrack mentioned. I think the interface is irrelevant (I was able to reproduce the issue on USB-C/DisplayPort and HDMI as well with a QHD display - interestingly I wasn't able to recreate the problem at all on a MBA and a 4K display).

waydabber avatar Dec 26 '21 16:12 waydabber

Hi,

Thanks a lot for this excellent work!

I also had the issue with my dell monitor and MacBook pro. And the issue still exists after I followed the steps mentioned by @waydabber.

But when I uninstall the version 1.0.13 and install v1.0.12, the issue does not exist anymore. Hope this helps!

Update: Still exists with v1.0.12 😞

DualProblem avatar Dec 28 '21 07:12 DualProblem

Just wanted to add that I'm able to stop the flickering by turning on HDR on my monitor and turning it back off. It's a bit annoying to do it every time i wake up my computer though. I'm hoping maybe it can help pinpointing the issue

BillyLavoie avatar Dec 29 '21 00:12 BillyLavoie

Unfortunately, I must say, too – flickering still exists even after described steps. And as @BillyLavoie said – check/uncheck HDR in display settings removes it. Also I note that flickering seems visible mostly on blue/purple color.

trttkm avatar Dec 29 '21 08:12 trttkm

Chiming in here - I have the same issue but only with one of my monitors, the Gigabyte M27Q.

Turning on HDR and leaving it on solves the issue, the check/uncheck is not as effective as it does come back to flicker for me. Definitely a strange one!

ye-david avatar Jan 01 '22 23:01 ye-david

It would be interesting to test the v1.1.0 alpha version's full screen streaming mode and see if the flicker happens with that as well.

HDR changes how color works so it makes sense that this affects the issue, but for most leaving HDR on permanently is not a good solution.

An other thing that could be tried if any of you have an iPad - does the issue manifest itself when you mirror a Sidecar display to the main display as well (without BetterDummy running)?

Thank you!

waydabber avatar Jan 02 '22 12:01 waydabber

(the rationale for testing a Sidecar->external monitor mirroring scenario is that Sidecar uses the same virtual display APIs as BetterDummy.)

waydabber avatar Jan 02 '22 12:01 waydabber

I tried the alpha but in the displays preference pane it would leave my monitor in there as some kind of ghost monitor. My mouse and windows could go in it but I can't see the content of it because my monitor is actually showing the stream from the dummy.

BillyLavoie avatar Jan 03 '22 17:01 BillyLavoie

Hi @BillyLavoie - yes, that is normal. In a future update the mouse will be prohibited to go there - the question is whether the flickering is fixed.

It would be great if somebody who consistently experiences (and can reproduce) the flickering issue and has an iPad and could try the Sidecar->External display mirroring thing - does the flickering present itself in a similar fashion or not?

waydabber avatar Jan 03 '22 19:01 waydabber