Screen flickering
Probably an AMD framebuffer issue. Only appears if resolution is set to 2560x1440.
Workaround
One workaround is to always reset the resolution on display wakeup. We can use the displayplacer and sleepwatcher utilities to do this automatically after every display wakeup.
- Install https://github.com/jakehilborn/displayplacer
- Install https://www.bernhard-baehr.de with
brew install sleepwatcher - Run
displayplacer listand get a string with all your displays, order, etc - Create
~/Library/LaunchAgents/de.bernhard-baehr.sleepwatcher-displayfix.plistwith the template below - Run
launchctl load ~/Library/LaunchAgents/de.bernhard-baehr.sleepwatcher-displayfix.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>de.bernhard-baehr.sleepwatcher-displayfix</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/sbin/sleepwatcher</string>
<string>-W</string>
<string>sleep 10; /usr/local/bin/displayplacer "id:E5BB9F08-9D64-22D5-06B5-9872624162C9 res:3008x1692 hz:60 color_depth:8 scaling:on origin:(0,0) degree:0" ; /usr/local/bin/displayplacer "id:E5BB9F08-9D64-22D5-06B5-9872624162C9 res:2560x1440 hz:60 color_depth:8 scaling:on origin:(0,0) degree:0"</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
Replace the two displayplacer argument strings with your own custom string. The difference between the two instances is that first we set the res to a higher one res:3008x1692 and then to what we want res:2560x1440. The sleep 10 prevents any issues trying to set the resolution before the display turns on.
Do you fix it in kernel?
It’s very difficult. I’ve been looking but I can’t find anything. The workaround is the best I can come up with right now.
same issue after wakeup, on dell p2715q 3840 x 2160
With workaround?
Just 1.4.1 , is there any progress?thx:)
What about Inject EDID? @osy86
I have not tried, please let me know if you try.
it is not working. and how do fix preview image?
You're referring to #18 ?
Just chiming in to relay my configuration and confirm that I'm seeing severe flickering on one of my monitors at any resolution when HiDPI is enabled:
HVK 10.15.1 (and also tested w/ 10.15.2 beta) HP Envy 27" 4K (flickering) QNIX 27" QHD (not flickering)
So far I've tried two cables - a mDP to DP cable, and a USB-C to USB-C cable. Both experience flickering that makes the system more or less unusable.
Thank you for all your hard work getting us this far!
I've got 24k AOC U2879G6 screens. when use 1 screen and set HIDPI to 19201080,everything works fine. When I plug into the 2rd screen, all the 2 screens flickering, whatever HIDPI setting. Then I plug out the 2rd screen, everything become normal again without rebooting or log out.
and no flicker happened when both screen are orignal 4K definition.
delete whatevergreen changes nothing,still flickering
Just chiming in to relay my configuration and confirm that I'm seeing severe flickering on one of my monitors at any resolution when HiDPI is enabled:
HVK 10.15.1 (and also tested w/ 10.15.2 beta) HP Envy 27" 4K (flickering) QNIX 27" QHD (not flickering)
So far I've tried two cables - a mDP to DP cable, and a USB-C to USB-C cable. Both experience flickering that makes the system more or less unusable.
Thank you for all your hard work getting us this far!
Have you ever tried to output 3 screens, like 2 via DP(or USB-C since ultimately it uses DP) and 1 via HDMI (you can connect both HDMI and DP to one of your display if possible).
I have the same issue:
- When connecting only one 4K display (1.5:1 scaling, "looks like" 2560x1440), the workaround fixes the problem.
- If I then connect a second display (a 2K, 1200x1600; rotated) the 4K display starts flickering (even after the workaround which fixed it above). The workaround no-longer works when attempted after connecting the display. If I disconnect the 2K display, so there is only one 4K display connected, the workaround works again. Reconnecting the same 2K display a second time causes the 4K display to start flickering again.
- If I then connect a third display (another 2K, 1200x1600; rotated), the 4K display resets to 2:1 retina scaling. If I change it to 1.5:1 scaling, everything works again (i.e. workaround OK).
- With three displays connected, if I sleep and wake up the computer, the 4K display flickers again. The workaround doesn't help. One new workaround I found was to physically unplug the 4K display and plug it back in. That seems to reset the framebuffer, but is not ideal. Right now I am just disabling computer sleep in System Preferences, but would much rather have it sleep overnight when I do. ;-)
I am using two USB-C to DP adapters (one for 4K, one for 2K) and one DP port (second 2K). I found that using the HDMI port for the 4K display, and using both DP ports for each of the 2K displays, did not change the above behavior.
On a separate note, I found that using the HDMI port for the 4K display caused my windows to re-arrange on display wake up (not necessarily computer wake up). This hasn't happened so far when using two USB-C DP adapters and the DP port. Perhaps a lag in the AMD card initializing the HDMI chipset? Do they use a discrete IC that performs a DP > HDMI signal conversion like some of the other NUCs?
Happy to perform other tests, and any hacks the legendary @osy86 might come up with!
Adding a 3rd display fixes the headache inducing flicker I was experiencing with a 2nd display...
Building on @Yrp said in #212 (that bug should probably be a dupe of this):
- [ ] Going from 1 to 2 displays causes intermittent flickering
- [x] Going from 2 to 3 displays resolves the flickering
- [x] Dropping down from 3 to 2 displays -> no flickering either
- [x] Going 2 to 3 to 2 again -> no flickering
- [ ] Dropping from 2 to 1 and then back up to 2 again results in flickering
The displays I'm using are:
- LG 4K via miniDP
- Samsung 2K via miniDP
- 720p MPi3508 Raspberry Pi Display (3.5")
The resolutions of the displays doesn't seem to matter, the 4K w/ the 720p had flickering going from 1 to 2 displays.
I might be able to hook up a 4th display to the second HDMI, if knowing that behaviour would be helpful.
Haven't tried with any screens sleeping.
There are HDMI and DP Dummy (ghost) display adapter plugs that can be used to fake a screen which could be an inexpensive hardware workaround (~$2 on ebay from China)
Adding a 3rd display fixes the headache inducing flicker I was experiencing with a 2nd display...
Building on @Yrp said in #212 (that bug should probably be a dupe of this):
- [ ] Going from 1 to 2 displays causes intermittent flickering
- [x] Going from 2 to 3 displays resolves the flickering
- [x] Dropping down from 3 to 2 displays -> no flickering either
- [x] Going 2 to 3 to 2 again -> no flickering
- [ ] Dropping from 2 to 1 and then back up to 2 again results in flickering
The displays I'm using are:
- LG 4K via miniDP
- Samsung 2K via miniDP
- 720p MPi3508 Raspberry Pi Display (3.5")
The resolutions of the displays doesn't seem to matter, the 4K w/ the 720p had flickering going from 1 to 2 displays.
I might be able to hook up a 4th display to the second HDMI, if knowing that behaviour would be helpful.
Haven't tried with any screens sleeping.
There are HDMI and DP Dummy (ghost) display adapter plugs that can be used to fake a screen which could be an inexpensive hardware workaround (~$2 on ebay from China)
Your summary is very good!
I've now done some additional testing with 4 displays. The displays I'm using are:
- LG 4K via miniDP
- Samsung 2K via miniDP
- 720p MPi3508 Raspberry Pi Display (3.5") via HDMI
- SyncMaster 206 (1680x1050 res) via HDMI
- [x] Mirroring w/ 2 Displays -> no flickering
- [ ] 1 to 2 mirrored to 2 not mirrored -> flickering
- [x] 1 to 3 to 2 mirrored to 2 not mirrored -> no flickering
- [x] 2 to 3 to 4 -> no flickering
- [x] 4 to 3 to 2 -> no flickering
This seems to confirm the flickering effects only occur when a second display is added and clear after adding a 3rd or more displays until the number of active displays falls back to 1 and rises to 2 again.
I've now done some additional testing with 4 displays. The displays I'm using are:
- LG 4K via miniDP
- Samsung 2K via miniDP
- 720p MPi3508 Raspberry Pi Display (3.5") via HDMI
- SyncMaster 206 (1680x1050 res) via HDMI
- [x] Mirroring w/ 2 Displays -> no flickering
- [ ] 1 to 2 mirrored to 2 not mirrored -> flickering
- [x] 1 to 3 to 2 mirrored to 2 not mirrored -> no flickering
- [x] 2 to 3 to 4 -> no flickering
- [x] 4 to 3 to 2 -> no flickering
This seems to confirm the flickering effects only occur when a second display is added and clear after adding a 3rd or more displays until the number of active displays falls back to 1 and rises to 2 again.
In my case, mirroring displays can cause consistent flickering... (4K+2K)
@KrisCris interesting... My 2K display is rotated 90 degrees. I wonder if that has an effect (certainly the mirrored resolution is lower)