This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[ SOLVED ] Blank screen after 30 seconds idle time.

Tags: None
(comma "," separated)
User avatar
BoonHead.nl
Registered Member
Posts
15
Karma
0
OS
Eureka! Hallelujah! And more of that sorts!

After more than a year and trying every solution to be found on the internet, I finally managed to stop my screen from turning off after every 30 seconds of idle time of my KDE Neon 5.8 LTS (= Ubuntu 16.04 LTS) installation on a Lenovo Carbon X1 generation 3 notebook.

The things I tried before today:
* Changed all the power management settings from KDE's System Settings.
* grub configuration / kernel parameters of which a few I mention from the top of my head like acpi=off, apm=off, etc.. but also some hardware specific switches.
* xorg.conf modifications like Option "DPMS" "False", Option "BlankTime" "0", etc..
* xset tool from the command line: xset -dpms s off s noblank s 0 0 s noexpose; xset s off; xset dpms 0 7200 0; xset dpms force off
* Messed around with systemd's *.target files like sleep.target (I was desperate).

But nothing worked.. not even caffeine or similar tools would run proper or have the desired effect.
Finally I managed to make a caffeine-like bash script that would send the following over the dbus at a regular interval:

dbus-send --print-reply\
--type=method_call\
--dest=org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.SimulateUserActivity

When my screen would go blank after 30 seconds of being idle (usually when reading some web page), this dbus command would cause the screen to be turned on again; in which case the screen would stay on because the system still believed it was post-idle event. If I would use the keyboard or mouse, the 30 second count down would restart. Highly irritating, but workable. At least I stopped being the slave of my computer (it forcing me to press some button every 30 seconds).

But when publicly projecting something using an external HDMI projector, this projector would be subjected to the same shenanigans; including an extra 3 seconds for the projector to "process" the new signal.

I finally made a small breakthrough few days ago using xset. But this only worked by creating a file ~/.xsessionrc and placing xset commands (like those mentioned earlier) in that file.
As I rebooted my notebook, logging in, and leaving my notebook untouched for 30 seconds, the screen would not turn off anymore. But when I adjusted the brightness of my screen, the problem came back; I guess DPMS settings got a reset. So in theory I could adjust the brightness, reboot, and continue using my notebook as normal.

But as I got this close to a real solution, and with renewed determination that the problem must not be one of a **** BIOS (per se), I decided to take a closer look at the dbus events. After all, what did I know about the dbus? My only experience is a copy-pasted command to "SimulateUserActivity"..

I noticed that org.freesmartphone.Device.IdleNotifier was sending a idle_prelock signal. Sure there were some other signals too, but my screen turning off always seem to start with idle_prelock.

The solution to the problem that has plagued me for a long time is to prevent the "idle" event to ever being sent or received by the rest of the system. I did the following, simple, solution:

Open a terminal and type:
Code: Select all
sudo nano /etc/dbus-1/system-local.conf

This will create a new file (/etc/dbus-1/system-local.conf) in which you are allowed to add a custom dbus configuration. This configuration is applied on top of the default definition specified in system.conf.
Add the following content:

Code: Select all
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
 <policy context="default">
  <deny send_interface="org.freesmartphone.Device.IdleNotifier" />
 </policy>
</busconfig>

If the file already contains a configuration, only add the <policy>..</policy> part.

Save the file and and return to the command line by exiting the editor. From the command line / terminal type:
Code: Select all
sudo systemctl reload dbus

This reloads the dbus configuration (a reboot will also do). And from this point on, org.freesmartphone.Device.IdleNotifier is unable to send any signals.

The down-side? Well.. there is a reason for this signal to exist.. and by disabling this signal, your notebook will prolly never get to *any* idle state. It prolly won't go to sleep after 2 hours, or show a screen saver, etc. This might not be the solution, but it is a solution. At least your notebook is usable for more than 30 seconds ;)


Listening to The Skeptics' Guide to the Galaxy podcast is like learning how to ride a bike, but for thinking.
User avatar
toad
Global Moderator
Posts
1258
Karma
7
OS
Well done mate! I would've switched distros immediately ;)


Debian testing
User avatar
BoonHead.nl
Registered Member
Posts
15
Karma
0
OS
Thanx! :)

But I won't learn by switching distros.. and by switching distros, I'll prolly run into different problems..
On the other hand, if I was experienced enough, I would have been able to fix it sooner anyway.. ;)


Listening to The Skeptics' Guide to the Galaxy podcast is like learning how to ride a bike, but for thinking.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell