You are not logged in.

#1 2014-09-05 00:46:34

bnb2235
Member
Registered: 2011-02-13
Posts: 119

DPMS with GDM lock screen after suspend

Hello,
I have recently setup a multiseat system. This has shown me a DPMS issue after return from suspend. Things don't seem to be perfectly reproducible, but generally speaking, the problem goes like this:
Either user suspends the system
Either user resumes the system with power button
If no one does anything, both screens will go to "the curtain" and the monitors will not turn off. If either user works at their station, their station will apply DPMS normally. The other station will continue at the curtain. If escape is pressed on the station which is not in use, then the monitor on that station will now turn off normally.

In some cases, a resume from suspend will cause both monitors to turn off in about 15 seconds. One monitor will remain off, and the other will turn back on after about two seconds and never go off again.

I read somewhere about this happening because a monitor is trying to auto select an input and then that causes a hotplug event. In my case, I have disabled auto source select on the one monitor, and the other monitor only has one input.

It seems like a dirty solution would be a script:
"on resume", press escape on seat0 and seat1

I have completely broken down the multiseat setup for testing and returned to the Intel integrated graphics. It seems that the same behavior happens where dpms after resume from suspend does not work. I guess that in a traditional single seat setup, no one would resume from suspend and then not actually use their computer.

Can anyone offer any suggestions to try? Does anyone else have an issue where the monitor will not turn off after a return from suspend if they do not use the computer?

Thanks

Edit: Up to date system running full gnome DE

Last edited by bnb2235 (2014-09-05 00:49:19)

Offline

#2 2014-09-07 02:04:01

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: DPMS with GDM lock screen after suspend

Update:
I notice that after resume from suspend, simply wiggling the mouse at each seat will allow the monitors (either an unused station, or both monitors for testing) to go to sleep. I added a script like I mentioned above, but it does not solve the problem. I tried using xdotool to press the escape key and to move the mouse. The script does what is written, but the dpms issue is not solved.
/usr/lib/systemd/system-sleep/escape.sh

#!/bin/sh
case $1/$2 in
  pre/*)
    echo "Going to $2..."
    ;;
  post/*)
    echo "Waking up from $2..."

    sleep 5
    DISPLAY=:1
    export DISPLAY
    xdotool key Escape
    xdotool mousemove 0 0
    xdotool mousemove 50 50
    DISPLAY=:0
    export DISPLAY
    xdotool key Escape
    xdotool mousemove 0 0
    xdotool mousemove 50 50
    ;;
esac

Any idea?

Edit:
I would also like to add that on seat1, many times the mouse cursor will not be visible after suspend. To get the pointer back, all I need to do is restart the shell. I did switch monitors and keyboards, and the lost cursor is always with seat1. Seat1 is the video card which is in the PCI-e x4 slot. I have tried disabling PCI-e 2 and also disabling dpm.  None of those settings helped with the dpms or lost cursor issue.

Thanks

Last edited by bnb2235 (2014-09-07 02:24:24)

Offline

#3 2014-09-07 02:13:06

progandy
Member
Registered: 2012-05-17
Posts: 5,193

Re: DPMS with GDM lock screen after suspend

Maybe try "xset +dpms s reset"


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2014-09-07 03:04:49

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: DPMS with GDM lock screen after suspend

Thanks for the reply progandy. I guess you mean to add that command to the script. I did that and it did not help.
I tried a couple more lines too, to no avail...

    xset -display :1 dpms force on
    xset -display :1 s reset
    xset -display :1 s off
    xset -display :0 dpms force on
    xset -display :0 s reset
    xset -display :0 s off

I would try the closed source video drivers, but it seems an xorg file is required for catalyst drivers. I really don't want to go down the road of an xorg.conf

Offline

#5 2014-09-08 04:35:36

markzz
Member
From: Michigan, United States
Registered: 2013-06-08
Posts: 89
Website

Re: DPMS with GDM lock screen after suspend

GDM seems to just ignore any DPMS rules and does its own thing.

https://bbs.archlinux.org/viewtopic.php?id=171750

Last edited by markzz (2014-09-08 05:02:20)


I don't want to work.  I want to bang on the drum all day.

Offline

#6 2014-10-01 00:15:06

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: DPMS with GDM lock screen after suspend

I don't know if it is accurate to mark this thread as solved, but I did work around the problem using xsreensaver...

I did try with xss-lock and i3-lock, but this was not completely successful. I guess that since GDM is resetting all of the power settings which would normally be settable with xset, i3lock was not consistently turning off the monitor(s). For refererence, If i did "xset s 180", within a minute or two, a "xset -q" would show timeout was reset to zero.

I guess it is the fact that xscreensaver has it's own power management that it is working. However, it does seem that I needed to use an actual screensaver for things to work consistently. The blank screen option with or without the quick power off setting did not provide consistent results. Side note, my UPS has a watt meter in it. It is amazing to see how much power some of the screensavers take. Some cause a 3 watt increase while other cause a 20 watt increase in power consumption.

So currently in each user's ~/.config/autostart is a file to start xscreensaver
~/.config/autostart/screensaver.desktop

[Desktop Entry]
Type=Application
Exec=xscreensaver -no-splash
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=Screensaver
Name=Screensaver
Comment[en_US]=Start the screensaver
Comment=Start the screensaver

To lock the screen on suspend, I am using a systemd service. Amazingly (to me) the "user" does not need to be defined. It also does not seem to matter that I create an additional service for a display which does not exist. (sometimes the "main seat" is display 0, and sometimes it is seat 2?) Perhaps it is not the cleanest solution, but it is working...
/etc/systemd/system/screenlockdisplay0.service

[Unit]
Description=Lock X session at suspend
Before=sleep.target
 
[Service]
Environment=DISPLAY=:0
ExecStart=/usr/bin/xscreensaver-command --lock
 
[Install]
WantedBy=sleep.target

/etc/systemd/system/screenlockdisplay1.service

[Unit]
Description=Lock X session at suspend
Before=sleep.target
 
[Service]
Environment=DISPLAY=:1
ExecStart=/usr/bin/xscreensaver-command --lock
 
[Install]
WantedBy=sleep.target

/etc/systemd/system/screenlockdisplay2.service

[Unit]
Description=Lock X session at suspend
Before=sleep.target
 
[Service]
Environment=DISPLAY=:2
ExecStart=/usr/bin/xscreensaver-command --lock
 
[Install]
WantedBy=sleep.target

and a keyboard shortcut to lock the screen with Super + L
xscreensaver-command --lock

Now all seems well with screen locking and suspend. Even the mouse does not seem to disappear anymore on the second seat.

Last edited by bnb2235 (2014-10-01 00:16:29)

Offline

#7 2014-12-28 01:52:34

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: DPMS with GDM lock screen after suspend

I wanted to update my last post in this thread, but I want to make it  a separate post...
xscreensaver gave me troubles with user activity. I have the same problem which I also found other people have in regards to keyboard activity not being considered activity. I noticed it several times while I was reviewing a bunch of pictures with image viewer. I was only pressing the right arrow key to advance to the next picture, and xscreensaver locked my screen. I was not able to find a solution to this problem with xscreensaver, so I tried i3lock again.

From the this thread, I learned that LightDM also supports Multiseat.

I am now using LightDM instead of GDM as my login manager. Some things which seem advantageous over GDM:
1. LightDM is not altering the DPMS settings of the X server during normal runtime.
2. LightDM is consistent with seat assignment. (e.g. Seat0 = Display :0, Seat1 = Display :1)

My Multiseat setup is very simple. I have two users and two desks. Each user sits at the same desk all the time. This is good because when I had systemd files while using GDM, I did not need to specify a user inside the unit file. The unit file still worked. With LightDM, I need to specify the user to get the unit file to work.

Something else I noticed (not sure what causes it) is that when the computer resumes from suspend, the DPMS settings are all set to 0

These are the units, desktopfiles, and scripts which are working for me. When I put i3lock back into service, I got this feedback "We are back to Simon again?", (she meant i3lock itself) so I added Simon as the lockscreen image too. I got Simon from here. I padded the image to fit the 1600x1200 screens and put it at /usr/share/backgrounds/simon.png My definition of ideal screen locking is that after the screen locks, the monitor turns off after 30 seconds. I believe this is the GDM design, but it just doesn't work for me in my Multiseat setup...

The resume services required a sleep, otherwise they did not succeed at resetting the DPMS time.

/etc/systemd/system/resume-bryan.service

[Unit]
Description=Set DPMS after resume
After=suspend.target

[Service]
User=bryan
Environment=DISPLAY=:0
ExecStartPre=/usr/bin/sleep 1
ExecStart=/usr/bin/xset dpms 0 0 30

[Install]
WantedBy=suspend.target

/etc/systemd/system/resume-teresa.service

[Unit]
Description=Set DPMS after resume
After=suspend.target

[Service]
User=teresa
Environment=DISPLAY=:1
ExecStartPre=/usr/bin/sleep 1
ExecStart=/usr/bin/xset dpms 0 0 30

[Install]
WantedBy=suspend.target

/etc/systemd/system/suspend-bryan.service

[Unit]
Description=Lock X session at suspend
Before=sleep.target
 
[Service]
User=bryan
Environment=DISPLAY=:0
ExecStart=/usr/bin/xautolock -locknow
 
[Install]
WantedBy=sleep.target

/etc/systemd/system/suspend-teresa.service

[Unit]
Description=Lock X session at suspend
Before=sleep.target
 
[Service]
User=teresa
Environment=DISPLAY=:1
ExecStart=/usr/bin/xautolock -locknow
 
[Install]
WantedBy=sleep.target

/usr/local/bin/i3lock-more

#!/bin/sh
xset dpms 0 0 30
i3lock -n -i /usr/share/backgrounds/simon.png && xset dpms 0 0 7200

Off time in DPMS is set to two hours to allow watching movies. The screen saver is locking the screen and turning off the monitor before that if needed.

~/.config/autostart/xautolock.desktop

[Desktop Entry]
Type=Application
Exec=xautolock -time 3 -corners -000 -notify 10 -notifier 'notify-send --hint=int:transient:1 "Screen will lock in 10 seconds"' -locker i3lock-more
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=XautoLock
Name=XautoLock
Comment[en_US]=AutoLock the screen
Comment=AutoLock the screen

For reference in the xautolock command:
-time 3 is my preference
-time 15 is for Teresa in her ~/.config/autostart/xautolock.desktop
-corners -000 prevents the screen from locking while the mouse is in the top left corner.  Full screen youtube doesn't care how hard I push the mouse into the corner. Regular screen, well thank you pressure sensitive Gnome Shell ;-)
-notifier 'notify-send --hint=int:transient:1 "Screen will lock in 10 seconds"' gives a system message 10 seconds before screen lock
--hint=int:transient:1 prevents the message from being persistent. Without --hint, the message system will fill with messages from every time the screen locked on timeout.

And this is not totally relevant to this topic, but I put it here anyway. I hear "Why can't I press Ctrl-Alt-Del to get the task manager?" I also wanted a more consistent way/place for log out and suspend, so I added this:
/usr/local/bin/gnome-exit

#!/bin/sh

# File Name: gnome-exit
# Purpose: exit script for gnome-shell
# depends on faenza-icon-theme for icons
# depends on gtkdialog
# Latest Change: 10-21-2014
######################################################################################################

#!/bin/sh

export Logout='


<window window_position="1" title="Log Out" icon-name="exit" resizable="false">
<vbox>
  <frame>
  <hbox>
	<vbox>
	  <hbox>
		<button>
		<height>48</height>
		<width>48</width>
		<label>"Lock Screen  "</label>
		<input file>"/usr/share/icons/Faenza-Darker/actions/48/gnome-lockscreen.png"</input>
		<action>xautolock -locknow</action>
        <action>EXIT:close</action>
		</button>
      </hbox>
	  <hbox>
		<button>
		<height>48</height>
		<width>48</width>
		<label>"Suspend        "</label>
		<input file>"/usr/share/icons/Faenza-Dark/apps/48/system-suspend.png"</input>
		<action>systemctl suspend -i</action>
        <action>EXIT:close</action>
		</button>
	  </hbox>
	  <hbox>
		<button>
		<height>48</height>
		<width>48</width>
		<label>"Log Out         "</label>
		<input file>"/usr/share/icons/Faenza-Dark/apps/48/gnome-session-logout.png"</input>
		<action>gnome-session-quit</action>
		</button>
         </hbox>
	  <hbox>
		<button>
		<height>48</height>
		<width>48</width>
		<label>"Shutdown     "</label>
		<input file>"/usr/share/icons/Faenza-Dark/actions/48/system-shutdown.png"</input>
		<action>gnome-session-quit --power-off</action>
		</button>
	  </hbox>
	  <hbox>
		<button>
		<height>48</height>
		<width>48</width>
		<label>"Task Manager"</label>
		<input file>"/usr/share/icons/Faenza/apps/48/gnome-system-monitor.png"</input>
		<action>gnome-system-monitor & </action>
        <action>EXIT:close</action>
                </button>
	  </hbox>
	  <hbox>
		<button>
		<height>48</height>
		<width>48</width>
		<label>"Cancel           "</label>
		<input file>"/usr/share/icons/Faenza-Darker/actions/48/application-exit.png"</input>
		<action>EXIT:close</action>
                </button>
	  </hbox>
	</vbox>
  </hbox>
  </frame>
  </vbox>
</window>
'

gtkdialog --program=Logout
unset Logout

Of course it has a desktop file and a place on the favorites bar.

Offline

Board footer

Powered by FluxBB