26

I have a really irritating issue where my external monitors randomly goes black for a few seconds and then returns. This happens every other minute, but sometimes i can sit for 30 minutes before it happens again. It affects both my external monitors, usually the one i am currently working on.

This is my setup:

Samsung 27" + Acer 24" monitors -> TESmart Dual Monitor KVM via HDMI -> Thinkpad Pro Dock via HDMI/DisplayPort -> Lenovo Thinkpad T440p Ubuntu 20.04 LTS.

The KVM is also connected to my Windows 10 desktop, but i have never experienced any issues on that, which is why I'm thinking it may be an Ubuntu issue.

What I've tried so far without results:

  1. Changing refresh rates on both screens to 60, 59,94 and 50hz

  2. Made sure all cables are properly connected

  3. Updated to latest firmware on Thinkpad Pro Dock

  4. Switched between XORG and Wayland, and changed refresh rates on both

  5. Enabled / disabled fractional scaling

  6. Updated the system with apt-get update/upgrade

Here is a paste of graphics troubleshooting from https://help.ubuntu.com/community/GraphicsTroubleshootingProcedure :

https://pastebin.com/xWemAjFz

Thank you very much!

edit:

The occurrence rate of this issue seems to be correlated to the battery percentage on my laptop. Maybe this can point somebody to a solution?

Sapomex
  • 377

5 Answers5

13

Try to set no_turbo to 1 to "limit the driver to selecting P-State below the turbo frequency range"[1].

% cat /sys/devices/system/cpu/intel_pstate/no_turbo

to see if cpu's turbo is enabled (enabled: 0, disabled:1). To disable it type

echo "1" | sudo tee /sys/devices/system/cpu/intel_pstate/no_turbo

It worked for me, but I don't know if it is a permanent change, since I changed it just in the current session. Hope it works for you too.

UPDATE: No more random black screen on second monitor (HDMI) since then!

[1] https://www.kernel.org/doc/Documentation/cpu-freq/intel-pstate.txt

2

Deleting monitors.xml fixed that issue for me. Please create a backup before deleting the file and then try:

rm ~/.config/monitors.xml

Oddly enough logging off after that wasn't enough for me, it required a reboot. I tried the procedure twice to confirm.

A few more details: I had this issue after updating from Ubuntu 20.04 to Ubuntu 22.04. The monitor went black every few seconds, especially when I switched between windows, scrolled down in firefox or watched a video with mpv player. After creating a new user I noticed the issue was fixed, which led me to play around with ~/.local and ~/.config.

1

This discussion on github contained a workaround that worked for me

https://github.com/rolandguelle/razer-blade-stealth-linux/issues/18

As for a fix, there is a suggested fix in there but I don't think it works.

Either way, the workaround is to set your output audio device to something other than your internal speaker, either by plugging in headphones/headset to the audio jack, or selecting HDMI/Displayport as the output audio device.

Strangely enough the problem still occurs for me when opening the pulseaudio volume controls, but it seems that the random occurrences while web browsing don't happen anymore.

The cause of the problem seems related to the Intel audio device, and it's affecting the display only because the Intel audio device is interacting with HDMI in some way. When it happens coincides with a video being on a webpage, which occur regularly (ie, even in ads sometimes).

thomasrutter
  • 37,804
0

Make sure your mobile is nowhere near to notebook cables. I had the same problem with two different notebooks, one with Ubuntu 22.04, the other one with Mint 21. Tried all solutions and workarounds, with always only temporary success. Then I noticed, when I sit down to my desk, I eventually put my mobile phone on the HDMI and phone cable running across in front of me. I removed it, and blackening has gone ever since. It is hard to say it for sure, since it has always been a random problem, but it looks quite likely, and rational to me. High energy EM pulses are bad news.

IFaz
  • 1
0

I did the answer from Iagoba Apellaniz. That made the situation substantially better.

However, I did notice that when I used JetBrain's CLion it still went black screen for a few seconds. Note there is also some black/white dot speckle (hard to see) on the screen as well.

Update: One more twist. I started RhythmBox and the speckling got worse and the black screen started happening again.

Searched and found some discussions about audio automatically being sent to the HDMI port. My monitors cannot play audio. So it seems the audio going to HDMI port may be interfering with the monitor's video display hardware. That could possibly/likely(?) cause the speckling. The black screen may be a side effect as well if the monitor's hardware/software can't handle the incoming "noise" on HDMI.

More searching and found that PulseAudio can be used to fix this. How can I disable an audio HDMI device?

So I tried it:

sudo apt install pulseaudio
sudo nano /etc/pulse/client.conf
# uncomment “auto-connect-display = no”  
sudo reboot

No speckle, no black screens.

Restarted RhythmBox. No speckle, no black screens.

Went back in to intel_pstate and reset that value:

cd sys/devices/system/cpu/intel_pstate
sudo nano no_turbo
# reset to 0

Still no speckle, no black screens.

Is this the final true source of the issue? maybe. Will update again if I find any more issues.

Update#2: it's been good for couple of months and then it got bad. Updated Ubuntu several times. The last time it got black screens again. The speckle came back.

Noticed that setting the Sound | Output | Configuration to "High Fidelity Playback (A2DP Sink, codec SBC-XQ)" killed the audio, but made the speckle go away. And when I set it back to "High Fidelity Playback (A2DP Sink, codec SBC)" I got audio and the speckle diminished but was still there. A few seconds later the screen went black again.

Tried removing the 2nd display. That helped.

I had been using a "Tobenone" box to get multiple displays on it. Just to try it out, I got rid of it and plugged in only 1 display. That fixed it. Then I added the 2nd display into the Cubi NUC's 2nd HDMI port. And that still worked fine again.

Rebooted several times. Still clean. Been a week, still clean.

Not sure if it is a combination of getting rid of the Tobenone and use PulseAudio or if it's just the Tobenone box.

Will let update again if the speckle comes back.

JohnA
  • 119