Author Topic: Dual Monitor: "xset dpms force off ", but backlight returns  (Read 3963 times)

0 Members and 1 Guest are viewing this topic.

Offline theMuspilli

  • Neuling
  • *
  • Posts: 21
  • I'm new. Be nice!
    • me on dA
  • Branch: stable
  • Desktop: xfce
  • Skill: Intermediate
Dual Monitor: "xset dpms force off ", but backlight returns
« on: 17. December 2015, 23:01:58 »
Hello,

I am new to dual monitor stuff - at least in non ancient times with non ancient technology - and I face a problem with my new setup.

I have attached an ASUS PB278QR 27'' display to my Lenovo thinkpad W520 (nvidia optimus 1000) via DisplayPort. In the Xfce settings I have arranged the display to be one big display with the external monitor being the left and primary display and the notebook display being on the right side. So far that constellation works ok.

Now what I want to do: Blank both screens and switch them off for a while - while the laptop continues to work on a calculation or a download and I am absent ... Easy?

1st try:

I used to send my notebook display to sleep with a simple command bound to a hotkey:

Code: [Select]
sleep 2; xset dpms force off
This still works - initially. But the external display switches back on the backlight after about 2 seconds. The laptop display stays black without backlight.

2nd try:

I tried to specify the display and try again, but

Code: [Select]
$ xset -display :0.0 dpms force off
is exactly the same (as the two physical screens are just one xsceen?!).

3rd try:

Evaluating xbacklight i discovered that

Code: [Select]
$ xbacklight -d :0.0 -set 2

does exactly nothing here. I would suspect that it would be visible to set the display to 2% of the max brightness, wouldn't it?

4th try:
Stumbling upon http://www.shallowsky.com/linux/x-screen-blanking.html I also tried this ancient art:

Code: [Select]
[folognorri] ~ $ vbetool dpms off
mmap /dev/zero: Operation not permitted
Failed to initialise LRMI (Linux Real-Mode Interface).

Just a permissions issue?

5th try:

The xfce energy settings result into the same old issue.  The switch off time is only honoured by the laptop display, the external display does not switch off the backlight. Starting an all-night download results in the backlight switched on all the time.

6th try:

Back to the primitives: using the monitors power button to switch it off completely. Great! It works! The backlight is off - what a surprise. Surprise number two is that the laptop screen reawakens and all the windows that were on the external monitor get transferred to the laptop monitor. What a fabulous mess!

7th try:

I don't recall the command (do not find it in bash history), but disabling the external display resulted in a nice "no DisplayPort signal" shown on it and after that also the backlight switched off. On the laptop however the display went alive again and presented me with the dialogue to configure the desktop - the one with the mirror option ... Off course all the windows were again transferred to the laptops display to compose the usual mess.

That is how far I got. I have not completely run out of ideas, but I hope that someone else might already have experienced and solved the same problem. Also hints on how to get a more precise diagnose of the problem are most welcome.

Any help appreciated

Offline gohlip

  • Held Mitglied
  • *****
  • Posts: 1689
  • Desktop: OpenBox
  • GPU Card: nvidia
  • GPU driver: nonfree
  • Kernel: linux46 - x64
  • Skill: Intermediate
Re: Dual Monitor: "xset dpms force off ", but backlight returns
« Reply #1 on: 18. December 2015, 00:33:57 »

Try
Code: [Select]
xset -dpms; xset s off
Life is a sexually transmitted disease with a 100% mortality rate.

Offline theMuspilli

  • Neuling
  • *
  • Posts: 21
  • I'm new. Be nice!
    • me on dA
  • Branch: stable
  • Desktop: xfce
  • Skill: Intermediate
Re: Dual Monitor: "xset dpms force off ", but backlight returns
« Reply #2 on: 18. December 2015, 01:22:57 »
Try
Code: [Select]
xset -dpms; xset s off

The command is successful (error level 0), but has no visible effects on neither of the screens: no blanking, no switching off the screens.

As I first installed KDE plasma 5 and then added Xfce - which I am now using all the time - I might boot into KDE once more and see how things are there. If there screen locking works and also the switching off of the backlights, I could try to adopt commands from there. (In case of success also using kwin as a wm would be an idea, though I like what I have now with devilspie establishing window rules).

Moreover I wonder if things would be different, if I configured the two displays to be two xscreens. The "Nvidia X Server Settings" offer that, but do not discuss the effects of such an configuration. So I am not sure what to expect.

As I mentioned the field of dual displays is new for me and therefore I lack lots of experience and have o precise idea where the journey might take me to. ;-)


Offline gohlip

  • Held Mitglied
  • *****
  • Posts: 1689
  • Desktop: OpenBox
  • GPU Card: nvidia
  • GPU driver: nonfree
  • Kernel: linux46 - x64
  • Skill: Intermediate
Re: Dual Monitor: "xset dpms force off ", but backlight returns
« Reply #3 on: 18. December 2015, 01:44:41 »
My bad, sorry. the command above is the very opposite of what you wanted.  :-[

Your original command -
Code: [Select]
sleep 2; xset dpms forceTry without sleep - 
Code: [Select]
xset dpms forceBut of course moving the mouse pressing any keyboard key will wake up system.
It works for me. Good luck.
Life is a sexually transmitted disease with a 100% mortality rate.

Offline theMuspilli

  • Neuling
  • *
  • Posts: 21
  • I'm new. Be nice!
    • me on dA
  • Branch: stable
  • Desktop: xfce
  • Skill: Intermediate
Re: Dual Monitor: "xset dpms force off ", but backlight returns
« Reply #4 on: 18. December 2015, 02:48:24 »
My bad, sorry. the command above is the very opposite of what you wanted.  :-[

No problem, no harm done. ;-)

Your original command -
Code: [Select]
sleep 2; xset dpms forceTry without sleep - 
Code: [Select]
xset dpms forceBut of course moving the mouse pressing any keyboard key will wake up system.
It works for me. Good luck.

I guess you mean "force off", but I also tested "force suspend" and "force standby". Same problem, the monitor switches nicely off and two seconds later the backlight is turned on again - while the notebooks display is really black without any backlight.

I the meantime I also booted into KDE and tested there. Almost the same story. After the specified time the screen blanks black, the backlight is turned off and two seconds later it is back again. If had the screen lock into the display manager (sddm) 1 minute later, the lock screen will stay on the external monitor (no blanking will take place at all) while the notebook display switches off and remains black as I want it - until I move the mouse or hit a key -> then the lock screen will become shown also on the notebook display.

A funny problem it is, it feels like early 1990s. Tomorrow (here it is mighty late now) I will have a look at the monitor settings again and perhaps toy around with programs that promise to regulate the backlight intensity. But if nothing else helps, I will send a nice little "xset dpms force off" to that bugger of a monitor every second.   >:D

Offline gohlip

  • Held Mitglied
  • *****
  • Posts: 1689
  • Desktop: OpenBox
  • GPU Card: nvidia
  • GPU driver: nonfree
  • Kernel: linux46 - x64
  • Skill: Intermediate
Life is a sexually transmitted disease with a 100% mortality rate.

Offline theMuspilli

  • Neuling
  • *
  • Posts: 21
  • I'm new. Be nice!
    • me on dA
  • Branch: stable
  • Desktop: xfce
  • Skill: Intermediate
Re: Dual Monitor: "xset dpms force off ", but backlight returns
« Reply #6 on: 18. December 2015, 11:09:20 »
Yes, I mean "force off" - clearly I need coffee  ;D

Here's 2 links that may help, let us know how it went, ya?

http://superuser.com/questions/140060/is-there-a-way-to-turn-one-monitor-off-in-a-dual-head-setup
http://unix.stackexchange.com/questions/42203/turning-off-dual-monitors-with-xset-dpms-force-off-does-not-work-why

Cheers.

First of all: thanks alot for all your help! I really appreciate that! :-D

For me it is a stumbling through the dark - without a real understanding of what is going on ... Many unknown factors ...
Anyway, I tried some more things:

(numbering continued from my initial post)

8th try:

Using a python script posted by martin marinov on http://unix.stackexchange.com/questions/4466/screen-turns-on-automatically-xset-dpms-force-off?rq=1
Code: [Select]
import sys, select, subprocess
while True:
    p = subprocess.Popen(['xset', 'dpms', 'force', 'off'],
        stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    if sys.stdin in select.select([sys.stdin], [], [], 0)[0]:
        break

No success and the script crashes nicely after a short while.

9th try:

perl script reposted by Sasha Shepherd on the same webpage:

Code: [Select]
perl -e 'select(undef,undef,undef,.1)' && xset dpms force off

No change in issue: external monitor's backlight on.

According to the comment there this is just looping with a 0.1 sec sleep in between. So I can probably forget about looping.

10th try:

Having had some sleep made me think of having a look at the processes running and see if there is anything suspicious. I killed a couple of userland processes that obviously might perform actions every other second, but so far have not hit the jackpot. Anyway: as the laptop's internal display behaves all the time exactly as it is supposed to be, I doubt that there is something wrong with the xset command or some userland program interfering.

11th try:

As suggested on http://unix.stackexchange.com/questions/42203/turning-off-dual-monitors-with-xset-dpms-force-off-does-not-work-why I tried this (in a bash script):

Code: [Select]
xrandr --output LVDS-0 --primary
xset dpms force off
xrandr --output DP-3 --primary
xset dpms force off

LVDS-0 is the laptop's internal display, DP-3 the external monitor attached via DisplayPort.

It does not make any difference. It has already been an established fact, that xset sees the two as one huge screen. And no matter which display is primary the laptop's display always goes black and lights off first, the external monitor will follow within a second and after 1-2 seconds after that will switch the backlight back on.

When I execute the above command I will not see any effect of the second xset command, even if I put a "sleep 10" between them and even if I leave out the xrandr commands. My interpretation is that for xset the displays = the xscreen is already in "dmps force off" mode and it does not do a thing on the second invocation. On the other hand I read at least 2 comments hinting that looping the xset command would be an option.

(Not really) the 12th attempt:

Code: [Select]
xrandr --output DP-3 --brightness 0

does not affect the annoying backlight issue in any way.

A PS to my "7th try":

Probably I did this

Code: [Select]
xrandr --output DP-3 --off

to switch the external monitor off completely.

Later I might continue with this approach, but then switch off the laptop's screen first to make it impossible for the window manager to move all the windows there (and thusly mess up my desktops completely). I just have to very carefully think about how to get back from the resulting "headless" setup into my dual-head setup. Kind of frightens me to think that I might be stuck in a headless config. ;-)
Moreover I almost expect the window manager to cause some havoc in headless state anyway and do not trust that my arrangment of windows will be preserved through the headless state.

I would recommend to myself performing crosstests with another computer, another monitor, perhaps also with windows, but none of all that I have at my disposal. Maybe I could test the issue with some linux live cd, we will see. While there are lots of things left to test, I still have a live beside my quest for the holy grail of switching off the backlight ... ;-) How nice it would be just to be able to switch of the monitor without the wm shuffling all the windows to the remaining display as a immediate reaction!

Offline gohlip

  • Held Mitglied
  • *****
  • Posts: 1689
  • Desktop: OpenBox
  • GPU Card: nvidia
  • GPU driver: nonfree
  • Kernel: linux46 - x64
  • Skill: Intermediate
Re: Dual Monitor: "xset dpms force off ", but backlight returns
« Reply #7 on: 19. December 2015, 06:12:07 »
Ho! Ho! Ho!
That's heck a lot you've tried.  ;D

If I were you, I probably just manually use the physical monitor button.  ::)

Cheers. Merry Christmas.
Life is a sexually transmitted disease with a 100% mortality rate.

Offline theMuspilli

  • Neuling
  • *
  • Posts: 21
  • I'm new. Be nice!
    • me on dA
  • Branch: stable
  • Desktop: xfce
  • Skill: Intermediate
Re: Dual Monitor: "xset dpms force off ", but backlight returns
« Reply #8 on: 19. December 2015, 10:47:59 »
Ho! Ho! Ho!
That's heck a lot you've tried.  ;D

If I were you, I probably just manually use the physical monitor button.  ::)

Cheers. Merry Christmas.

If you was me, you'd have done that already ;-)
It was my 6th try and - though there may be room for improvement - nothing short of utmost embarrassing.

We'd expect:

1. Powering off the monitor by operating the power button, the display switches off.
2. Everything is nice, even the backlight is off.
3. Hitting the power button again we can continue to work in no time at all.

This is what happens:

1. Exactly like above, exactly like expected.
2. Exactly like above, exactly like expected. But behold!
2.a) After 5-10 seconds "the system" notices that one of the two monitors is no longer there.
2.b) The system (manjaro? xshell? xfce? even devilspie?) moves all windows that were open on the now missing display to the remaining display, even if that display was "dpms forced off" and has to be waked up first, creating quite a mess on each of the virtual desktops.
2.c) After a while the energy managment switches off the remaining display again.
3.a) Switching on our external monitor, the "system" notices that here is a "new monitor" and presents to us a dialog, if we want to use mirroring, twinview or one of the monitors for everything (and switch the other off).
3.b) I select "twinview". Now my Laptop display is the primary display and on the left side, though, before all this story it was not the primary display and on the right side - as it is in the physical world. The result is that (most of) the windows are on the wrong screen.
3.c) I open up the "Nvidia X Server Settings" to correct the arrangement of the screens, apply the changes and (most of) the windows are where they belong again.
3.d) But some windows are lost, appear neither in docky nor in Alt-Tab-List. If I notice that, I can try to restart the devilspie demon hoping that it has a window rule for the missing window(s) and will find and place them where they belong.
3.e) Not all windows could be resurrected, so I kill the tasks whose window is unreachable now.
3.f. I restart the programs that I had to kill.
3.g. Ready to continue work.

Sounds like a bad joke? Well, it is! But also it is reality.

Step 3.c): I could probably also achieve this with xrandr. The advantage would be that I could define a hotkey for this.

Just for comparison:
1. Hotkeying to "xset dpms force off"
2. Ignoring that the backlight of the external monitor is still active.
3. Gently touch the thinkpad's touchpad - ready to continue work again.

There might also be an option for a permanent design as an old Nvidia manual indicates. It was not recommended for notebooks, but I would not care about that, as my Thinkpad is 99.5% stationary.

Moreover I wonder what would happen, if I did not opt for "twinview", but for two separate x screens. How would xfce handle that? How would the virtual desktops behave? Would there be the same number of virtual desktops for each x screen? And would changing from workspace 5 to 8 on screen 1 also result in the same  changing on screen 2. Or would the virtual desktops of screen 2 start where the ones of screen 1 end (like virtual desktops 1-4 belong to x screen 1, and the virtual desktops 5-8 belong to x screen 2)?
Unfortunately this topic seems to be extremly unpopular, I found almost no information in the web and exactly nothing on youtube.

So far my tale of adventure 6 and some related thoughts. ;-)

I now will go for a bit of christmas shopping and perhaps also buy something to calm me down - just in case I'll get too excited about monitors. ;-)

Have a nice Xmas everyone - or just a good time!

Offline gohlip

  • Held Mitglied
  • *****
  • Posts: 1689
  • Desktop: OpenBox
  • GPU Card: nvidia
  • GPU driver: nonfree
  • Kernel: linux46 - x64
  • Skill: Intermediate
Re: Dual Monitor: "xset dpms force off ", but backlight returns
« Reply #9 on: 19. December 2015, 16:27:15 »

Reading your last post, it may be a thinkpad thingy, but I am not sure.

Quote
Have a nice Xmas everyone - or just a good time!
Thanks. But I don't need Xmas to have a good time. Every day is Xmas to me. Cheers.
Life is a sexually transmitted disease with a 100% mortality rate.

Offline arunj

  • Neuling
  • *
  • Posts: 8
  • I'm new. Be nice!
  • Skill: Intermediate
Re: Dual Monitor: "xset dpms force off ", but backlight returns
« Reply #10 on: 08. April 2016, 17:10:51 »
Hi,

maybe it's a little late but

Code: [Select]
xbacklight -set 10
worked for me. I used some scripts based on the same. Find the details here:
http://tuxdiary.com/2016/04/08/fix-brightness-issues-on-manjaro/.

Offline gohlip

  • Held Mitglied
  • *****
  • Posts: 1689
  • Desktop: OpenBox
  • GPU Card: nvidia
  • GPU driver: nonfree
  • Kernel: linux46 - x64
  • Skill: Intermediate
Re: Dual Monitor: "xset dpms force off ", but backlight returns
« Reply #11 on: 08. April 2016, 18:08:04 »
Hi arunj,
maybe it's a little late but

Merry Christmas!

But seriously, thanks for your input and welcome to Manjaro.
Cheers.

Life is a sexually transmitted disease with a 100% mortality rate.