close lid suspends correctly and wakealarm resumes from suspend to run cron jobs but opening lid reveals no display

Bug #1705551 reported by Pierre A. Fortier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pm-utils (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

[Problem]

When I close the laptop lid, pm-action runs the following code which I have added:

sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm" # clear alarm
sh -c "echo `date '+%s' -d '7am next day + 30 minutes'` > /sys/class/rtc/rtc0/wakealarm" # set alarm

and then suspends. At 7:30 AM the next day, the laptop resumes from suspend with the lid closed and executes cron jobs (e.g. some backups). If I open the lid then there is no display. I tried several options to resume the display:

- [FAILS] all sorts of keyboard combinations
- [FAILS] ssh -X into laptop and execute "sudo -u bierre env DISPLAY=:0 /usr/bin/xrandr --auto" (n.b. when I run "sudo -u bierre env" there is no DISPLAY variable)
- [MANUAL HACK] closing the lid causes the laptop to suspend and then opening the lid causes it to resume with a normal working display

I would like a solution or SOFTWARE HACK which I could add to /usr/lib/pm-utils/sleep.d/99video during resume from suspend triggered by wakealarm so that opening the lid would reveal a working display.

[Laptop System Information]

laptop = MacBookPro5,5
pm-utils version = 1.4.1-13ubuntu0.2
kernel = Linux version 3.19.0-32-generic (buildd@lgw01-43) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #37~14.04.1-Ubuntu SMP Thu Oct 22 09:41:40 UTC 2015
OS = "Linux Mint 17.3 Rosa" based on "14.04.3 LTS, Trusty Tahr"
desktop environment = XFCE
video card = NVIDIA Corporation C79 [GeForce 9400M] (rev b1) (prog-if 00 [VGA controller])
video driver = [633938.944] (II) NOUVEAU(0): Output LVDS-1

[Additional Information]

After my cron backup job is finished it will check if the lid is closed. If it is closed then it will run pm-suspend. If I then open the lid, the laptop resumes with a normal working display. So the problem of no visible display occurs only when I open the lid after resume from wakealarm and before the backup job suspends the laptop.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi,
you said "all sorts of keyboard combinations" but maybe it is worth a try. I had a similar case where it actually enabled the display, but at brightness 0 - you might not accidentally have the same case? I could get it on by using the FN keys to increase brightness in those cases.

Another question would be if you never close the lid, but suspend via SW.
And next day you wakeup via the alarm (while the lid was still open when sleeping) - is it then waking up normally with display enabled?

Finally - I beg your pardon as I'm not an expert on this - but the following could enable it.
You might need tweaks to actually "reach" your xorg, but I'm sure you can do that. Once you did call:
 $ xset dpms force off
That should disable the power saving blank that your screen is in.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

incomplete - waiting for more feedback

Changed in pm-utils (Ubuntu):
status: New → Incomplete
Revision history for this message
Pierre A. Fortier (bierre) wrote : Re: [Bug 1705551] Re: close lid suspends correctly and wakealarm resumes from suspend to run cron jobs but opening lid reveals no display
Download full text (4.2 KiB)

Hi,

With regards to "FN keys", I tried all the FN keys and Ctrl+Alt+FN keys and
Esc and many others but nothing worked.

With regards to "never close the lid, but suspend via SW", (1) while in
xfce account I ran sudo pm-suspend which suspended the laptop and (2) I
then pressed the shift key and the laptop resumed normally with a working
display. I repeated this with a remote ssh login into the laptop and it
also worked perfectly.

With regards to "xset dpms force off", when I do a remote ssh login into
the laptop which resumed from wakealarm and has no display, I don't see a
DISPLAY environment variable. When I execute "sudo -u bierre env DISPLAY=:0
/usr/bin/xrandr --auto", the system reports:

No protocol specified
Can't open display :0

I don't know if I am remotely executing this command correctly.
Furthermore, I don't know how to reach xorg to execute "xset dpms force
off".

Thanks,
Pierre

On Fri, Jul 21, 2017 at 3:50 AM, ChristianEhrhardt <
<email address hidden>> wrote:

> Hi,
> you said "all sorts of keyboard combinations" but maybe it is worth a try.
> I had a similar case where it actually enabled the display, but at
> brightness 0 - you might not accidentally have the same case? I could get
> it on by using the FN keys to increase brightness in those cases.
>
> Another question would be if you never close the lid, but suspend via SW.
> And next day you wakeup via the alarm (while the lid was still open when
> sleeping) - is it then waking up normally with display enabled?
>
> Finally - I beg your pardon as I'm not an expert on this - but the
> following could enable it.
> You might need tweaks to actually "reach" your xorg, but I'm sure you can
> do that. Once you did call:
> $ xset dpms force off
> That should disable the power saving blank that your screen is in.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1705551
>
> Title:
> close lid suspends correctly and wakealarm resumes from suspend to run
> cron jobs but opening lid reveals no display
>
> Status in pm-utils package in Ubuntu:
> Incomplete
>
> Bug description:
> [Problem]
>
> When I close the laptop lid, pm-action runs the following code which I
> have added:
>
> sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm" # clear alarm
> sh -c "echo `date '+%s' -d '7am next day + 30 minutes'` >
> /sys/class/rtc/rtc0/wakealarm" # set alarm
>
> and then suspends. At 7:30 AM the next day, the laptop resumes from
> suspend with the lid closed and executes cron jobs (e.g. some
> backups). If I open the lid then there is no display. I tried several
> options to resume the display:
>
> - [FAILS] all sorts of keyboard combinations
> - [FAILS] ssh -X into laptop and execute "sudo -u bierre env DISPLAY=:0
> /usr/bin/xrandr --auto" (n.b. when I run "sudo -u bierre env" there is no
> DISPLAY variable)
> - [MANUAL HACK] closing the lid causes the laptop to suspend and then
> opening the lid causes it to resume with a normal working display
>
> I would like a solution or SOFTWARE HACK which I could add to /usr/lib
> /pm-utils/sleep.d/99video during resume from suspend triggered b...

Read more...

Revision history for this message
Pierre A. Fortier (bierre) wrote :
Download full text (4.9 KiB)

Sorry, I forgot to make a correction to my [Additional Information] which I
re-tested. After my cron backup job is finished it will check if the lid is
closed. If it is closed then it will run pm-suspend. If I then open the
lid, the laptop resumes without a normal working display. So pm-suspend
suspended the laptop without a display and the next time I open the lid the
laptop resumes without a display.

Thanks,
Pierre

On Fri, Jul 21, 2017 at 4:04 PM, Pierre Fortier <email address hidden>
wrote:

> Hi,
>
> With regards to "FN keys", I tried all the FN keys and Ctrl+Alt+FN keys
> and Esc and many others but nothing worked.
>
> With regards to "never close the lid, but suspend via SW", (1) while in
> xfce account I ran sudo pm-suspend which suspended the laptop and (2) I
> then pressed the shift key and the laptop resumed normally with a working
> display. I repeated this with a remote ssh login into the laptop and it
> also worked perfectly.
>
> With regards to "xset dpms force off", when I do a remote ssh login into
> the laptop which resumed from wakealarm and has no display, I don't see a
> DISPLAY environment variable. When I execute "sudo -u bierre env DISPLAY=:0
> /usr/bin/xrandr --auto", the system reports:
>
> No protocol specified
> Can't open display :0
>
> I don't know if I am remotely executing this command correctly.
> Furthermore, I don't know how to reach xorg to execute "xset dpms force
> off".
>
> Thanks,
> Pierre
>
>
> On Fri, Jul 21, 2017 at 3:50 AM, ChristianEhrhardt <
> <email address hidden>> wrote:
>
>> Hi,
>> you said "all sorts of keyboard combinations" but maybe it is worth a
>> try. I had a similar case where it actually enabled the display, but at
>> brightness 0 - you might not accidentally have the same case? I could get
>> it on by using the FN keys to increase brightness in those cases.
>>
>> Another question would be if you never close the lid, but suspend via SW.
>> And next day you wakeup via the alarm (while the lid was still open when
>> sleeping) - is it then waking up normally with display enabled?
>>
>> Finally - I beg your pardon as I'm not an expert on this - but the
>> following could enable it.
>> You might need tweaks to actually "reach" your xorg, but I'm sure you can
>> do that. Once you did call:
>> $ xset dpms force off
>> That should disable the power saving blank that your screen is in.
>>
>> --
>> You received this bug notification because you are subscribed to the bug
>> report.
>> https://bugs.launchpad.net/bugs/1705551
>>
>> Title:
>> close lid suspends correctly and wakealarm resumes from suspend to run
>> cron jobs but opening lid reveals no display
>>
>> Status in pm-utils package in Ubuntu:
>> Incomplete
>>
>> Bug description:
>> [Problem]
>>
>> When I close the laptop lid, pm-action runs the following code which I
>> have added:
>>
>> sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm" # clear alarm
>> sh -c "echo `date '+%s' -d '7am next day + 30 minutes'` >
>> /sys/class/rtc/rtc0/wakealarm" # set alarm
>>
>> and then suspends. At 7:30 AM the next day, the laptop resumes from
>> suspend with the lid closed and executes cron jobs (e.g. some
>> backups). If I...

Read more...

Revision history for this message
Pierre A. Fortier (bierre) wrote :
Download full text (6.1 KiB)

I found a SOFTWARE HACK.

In xfce, I created ctrl+alt+s as a keyboard application shortcut which runs
"xrandr --auto". The black display now resumes correctly after pressing
ctrl+alt+s.

[Other Notes]

I discovered how to run xset by setting the XAUTHORITY environement
variable:

sudo -u bierre env XAUTHORITY=/home/bierre/.Xauthority DISPLAY=:0 xset dpms
force off

This command worked but it did nothing (i.e. the screen did not turn on and
"xset -q" indicates no change in DPMS). However, "xset -dpms" disabled DPMS
but the display did not turn on. I also noted that running "xrandr --auto"
when the lid is closed does nothing.

I'm guessing that wakealarm and manually opening the lid do not trigger all
the same software actions. With wakealarm the display does not come on
because the lid is closed and then opening the lid does not trigger any
event because the system has resumed already. Adding a lid open event to
trigger "xrandr --auto" for wakealarm when the the lid is closed might be
another SOFTWARE HACK.

Thanks,
Pierre

On Fri, Jul 21, 2017 at 4:22 PM, Pierre Fortier <email address hidden>
wrote:

> Sorry, I forgot to make a correction to my [Additional Information] which
> I re-tested. After my cron backup job is finished it will check if the lid
> is closed. If it is closed then it will run pm-suspend. If I then open the
> lid, the laptop resumes without a normal working display. So pm-suspend
> suspended the laptop without a display and the next time I open the lid the
> laptop resumes without a display.
>
> Thanks,
> Pierre
>
>
> On Fri, Jul 21, 2017 at 4:04 PM, Pierre Fortier <email address hidden>
> wrote:
>
>> Hi,
>>
>> With regards to "FN keys", I tried all the FN keys and Ctrl+Alt+FN keys
>> and Esc and many others but nothing worked.
>>
>> With regards to "never close the lid, but suspend via SW", (1) while in
>> xfce account I ran sudo pm-suspend which suspended the laptop and (2) I
>> then pressed the shift key and the laptop resumed normally with a working
>> display. I repeated this with a remote ssh login into the laptop and it
>> also worked perfectly.
>>
>> With regards to "xset dpms force off", when I do a remote ssh login into
>> the laptop which resumed from wakealarm and has no display, I don't see a
>> DISPLAY environment variable. When I execute "sudo -u bierre env DISPLAY=:0
>> /usr/bin/xrandr --auto", the system reports:
>>
>> No protocol specified
>> Can't open display :0
>>
>> I don't know if I am remotely executing this command correctly.
>> Furthermore, I don't know how to reach xorg to execute "xset dpms force
>> off".
>>
>> Thanks,
>> Pierre
>>
>>
>> On Fri, Jul 21, 2017 at 3:50 AM, ChristianEhrhardt <
>> <email address hidden>> wrote:
>>
>>> Hi,
>>> you said "all sorts of keyboard combinations" but maybe it is worth a
>>> try. I had a similar case where it actually enabled the display, but at
>>> brightness 0 - you might not accidentally have the same case? I could get
>>> it on by using the FN keys to increase brightness in those cases.
>>>
>>> Another question would be if you never close the lid, but suspend via SW.
>>> And next day you wakeup via the alarm (while the lid was still open when
...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for pm-utils (Ubuntu) because there has been no activity for 60 days.]

Changed in pm-utils (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.