Screen turns black after 20 seconds of inactivity

Hello!

My problem: The screen turns black after 30 seconds of inactivity.

  • Happens consistently. I used a stopwatch: it’s always exactly 30 seconds.
  • It started about 3-5 days ago
  • I tried rebooting the computer. Didn’t help.
  • In Settings > Power
    • I tried to changing “Screen blank” from 5 to 8 minutes or to "Never"→Problem still occurs.
    • The setting for automatic suspend when idle is ON and set to 20 minutes. I tried to change the duration or turning it off→Didn’t fix the issue.
    • I tried the “Performance” and the “Balanced” settings→Problem still occurs
  • The “Cafeine” Gnome extension does prevent the screen from turning off. (At least I won’t go crazy in the meantime!!:sweat_smile:)
  • I updated everything in Gnome Software→Didn’t solve the issue.
  • Maybe related: for the past few months, my computer often fails to wake from sleep. The screen stays black. When that happens, I can connect to the computer using SSH from another computer, but sudo rebootfails to reboot the computer (it does disconnect SSH though, which prevents me from doing anything else. I have to use the physical reset button. :frowning_face:)

Any idea what could be causing these black screens?

Thanks for the otherwise very pleasant linux experience with Fedora Workstation! Your hard work here is appreciated! :heart:

System Details Report

Report details

  • Date generated: 2025-01-23 21:52:00

Hardware Information:

  • Hardware Model: ASUS All Series
  • Memory: 16.0 GiB
  • Processor: Intel® Core™ i7-4770 × 8
  • Graphics: NVIDIA GeForce GTX 1060 6GB
  • Disk Capacity: 3.3 TB

Software Information:

  • Firmware Version: 0703
  • OS Name: Fedora Linux 41 (Workstation Edition)
  • OS Build: (null)
  • OS Type: 64-bit
  • GNOME Version: 47
  • Windowing System: X11
  • Kernel Version: Linux 6.12.9-200.fc41.x86_64
1 Like

Seems like there was a new update just now that solved my problem. Yay! :smile:

The problem is back. I think it comes back after the computer was put to sleep? And a rebook fixes the issue temporarily? I will keep investigating.

In the meantime, anyone has a more permanent solution?

Seems like I’m not the only one:

1 Like

Nvidia, once again…

I have the exact same issue on Fedora (Silverblue) 41. It doesn’t happen on boot: it is somehow related to the device going to sleep at least once and/or connecting an external monitor. However, once the behaviour appears, disconnecting the external display will not change anything, I need to reboot to make it go away. It’s not related to NVIDIA: I use an AMD Radeon Vega graphics card.

I managed to capture the following dbus events:

$ dbus-monitor --session
signal time=1742291096.466587 sender=org.freedesktop.DBus -> destination=:1.237 serial=4294967295 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.237"
signal time=1742291096.466672 sender=org.freedesktop.DBus -> destination=:1.237 serial=4294967295 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.237"
signal time=1742291096.472648 sender=:1.29 -> destination=(null destination) serial=3009 path=/org/gnome/Shell/Introspect; interface=org.gnome.Shell.Introspect; member=WindowsChanged
signal time=1742291126.539817 sender=:1.29 -> destination=:1.54 serial=3010 path=/org/gnome/Mutter/IdleMonitor/Core; interface=org.gnome.Mutter.IdleMonitor; member=WatchFired
   uint32 66
method call time=1742291126.540422 sender=:1.54 -> destination=:1.29 serial=174 path=/org/gnome/Mutter/IdleMonitor/Core; interface=org.gnome.Mutter.IdleMonitor; member=AddUserActiveWatch
method call time=1742291126.540441 sender=:1.54 -> destination=:1.29 serial=175 path=/org/gnome/Mutter/DisplayConfig; interface=org.freedesktop.DBus.Properties; member=Set
   string "org.gnome.Mutter.DisplayConfig"
   string "PowerSaveMode"
   variant       int32 3
method call time=1742291126.541320 sender=:1.29 -> destination=org.freedesktop.DBus serial=3011 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner
   string ":1.54"
method return time=1742291126.541350 sender=org.freedesktop.DBus -> destination=:1.29 serial=4294967295 reply_serial=3011
   string ":1.54"
method return time=1742291126.541361 sender=:1.29 -> destination=:1.54 serial=3012 reply_serial=174
   uint32 68
method return time=1742291126.854660 sender=:1.29 -> destination=:1.54 serial=3013 reply_serial=175
signal time=1742291126.854756 sender=:1.29 -> destination=(null destination) serial=3014 path=/org/gnome/Mutter/DisplayConfig; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.gnome.Mutter.DisplayConfig"
   array [
      dict entry(
         string "PowerSaveMode"
         variant             int32 3
      )
   ]
   array [
   ]
signal time=1742291129.010563 sender=:1.29 -> destination=:1.54 serial=3015 path=/org/gnome/Mutter/IdleMonitor/Core; interface=org.gnome.Mutter.IdleMonitor; member=WatchFired
   uint32 68
method call time=1742291129.011186 sender=:1.54 -> destination=:1.29 serial=176 path=/org/gnome/Mutter/DisplayConfig; interface=org.freedesktop.DBus.Properties; member=Set
   string "org.gnome.Mutter.DisplayConfig"
   string "PowerSaveMode"
   variant       int32 0
method return time=1742291129.011922 sender=:1.29 -> destination=:1.54 serial=3016 reply_serial=176
signal time=1742291129.011980 sender=:1.29 -> destination=(null destination) serial=3017 path=/org/gnome/Mutter/DisplayConfig; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.gnome.Mutter.DisplayConfig"
   array [
      dict entry(
         string "PowerSaveMode"
         variant             int32 0
      )
   ]
   array [
   ]

The line triggering the screen blanking is:

signal time=1742291126.539817 sender=:1.29 -> destination=:1.54 serial=3010 path=/org/gnome/Mutter/IdleMonitor/Core; interface=org.gnome.Mutter.IdleMonitor; member=WatchFired
   uint32 66

But presumably something lower level must tickle Mutter.IdleMonitor. I haven’t been able to figure it out yet.

Some more info:

  • 1.54 is org.gnome.SettingsDaemon.Power (/usr/libexec/gsd-power).
  • 1.29 is org.gnome.Mutter.IdleMonitor (/usr/bin/gnome-shell)
  • I attempted to kill gsd-power and restart it in verbose mode to get debug messages, but that made the bug go away (so the culprit seems to be gsd-power going in a bad state, rather than something lower level generating spurious events interpreted by gsd-power):
$ systemctl --user stop org.gnome.SettingsDaemon.Power.target
$ /usr/libexec/gsd-power -v | tee gsd-power.log &

Enabling verbose mode with an override, hoping to find interesting info later:

$ cat ~/.config/systemd/user/org.gnome.SettingsDaemon.Power.service.d/override.conf
[Service]
ExecStart=
ExecStart=/usr/libexec/gsd-power -v
Environment=G_MESSAGES_DEBUG=all
# You don't need to reload if you use `systemctl --user edit org.gnome.SettingsDaemon.Power.service` to edit the override
$ systemctl --user daemon-reload
# Beware: you need to edit the .service but restart the .target
$ systemctl --user restart org.gnome.SettingsDaemon.Power.target

Impacted users could try the following as a work-around instead of restarting their system:

$ systemctl --user restart org.gnome.SettingsDaemon.Power.target

I have reported the issue upstream with lots of details and a reproducer script: gsd-power: screen blanking after 30 seconds when laptop plugged to dock while suspended (#866) · Issues · GNOME / gnome-settings-daemon · GitLab

In my case it turned out to be caused by the “unblank lock screen” extension: Laptopt screen blanking every 30 seconds when laptop plugged to AC while suspended · Issue #37 · sunwxg/gnome-shell-extension-unblank · GitHub

Hi,

the following command has helped on my PC (fc41)

sudo -u gdm dbus-run-session gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0

If you run
sudo -u gdm dbus-run-session gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout

you get the actual value in seconds.

In a german pc-magazine I have read, this is meant for energy saving

I do not have that extension and restarting the service still fixed the issue for me after suspend on desktop.