[mythtv-users] 'xrandr --auto' on resume
David Linville
dlinvill at networksdown.com
Fri Nov 10 02:15:54 UTC 2017
On Wed, Nov 8, 2017 at 4:43 AM, Tim Draper <veehexx at zoho.com> wrote:
>
>
>
> ---- On Tue, 31 Oct 2017 00:35:48 +0000 Stephen Worthington <
> stephen_agent at jsw.gen.nz> wrote ----
> > On Mon, 30 Oct 2017 15:10:49 +0000, you wrote:
> >
> > >After some changes to my main FE moving between IR and bluetooth
> control, i've had to move from wake-on-IR (poweroff) to resume-on-usb (s3
> sleep).
> > >
> > >along with this, i've found i need to run 'xrandr --auto' for the NUC
> to redetect the TV/AVR. i assume something todo with EDID data.
> > >unfortuntately i've not had much luck in getting this reliable. afaik
> it's in the correct pm-utils script dir with execute perms
> (/usr/lib/pm-utils/sleep.d/)
> > >
> > >Sometimes the display resumes, sometimes not. when it fails, SSH into
> the FE and running the script manually will always bring the display back.
> I've done a simple 'sleep 5' in the script and that doesnt makes things
> better.
> > >
> > >does anyone have an idea for solution, or a better way to handle
> resuming?
> > >if it helps any, cabling is NUC > AVR > TV with HDMI to connect
> between them.
> >
> > It seems that xrandr only works if the X session it is trying to
> > control is the same user as xrandr is running from. So if you ssh in
> > as the same user as the desktop is running under, it works (but you
> > will have to specify the desktop to connect to). So in my case, if I
> > ssh to my MythTV box as root and run xrandr, it does not work. But if
> > I ssh as my mythfrontend user (stephen), this command does work:
> >
> > xrandr -d :0.0
> >
> > I have never delved into how the /usr/lib/pm-utils/sleep.d/ scripts
> > work, but my guess would be that they are run from root, so xrandr
> > will not work from there. From a root ssh, this works:
> >
> > su -c "xrandr -d :0.0" stephen
> >
> > So I suspect that is what you will need to do from a
> > /usr/lib/pm-utils/sleep.d/ script.
> > _______________________________________________
> > mythtv-users mailing list
> > mythtv-users at mythtv.org
> > http://lists.mythtv.org/mailman/listinfo/mythtv-users
> > http://wiki.mythtv.org/Mailing_List_etiquette
> > MythTV Forums: https://forum.mythtv.org
> >
>
> interesting info on the 'xrandr -d :0.0'.
> i've always used the 'export DISPLAY=:0' method prior to interacting with
> xrandr.
>
> your right on pmutils requiring root.
>
> seems my problem was a number of things.
> 1) have to exit mythtv playback before sleeping the FE. no problem, i just
> configured my harmony remote to use the MENU jumppoint, wait 1 second, then
> send sleep command. If i dont exit livetv, something gets upset and end up
> with a frozen screen on resume. somewhat expected results for a nicer
> experience on resume using a jumppoint is the simpliest way to handle this
> 2) re-ordered my harmony remote startup order. TV on (tv the goes through
> warmup locking out further commands), AVR on & source select, 1sec delay,
> TV source select, and finally bluetooth wakeup command for NUC.
> 3) the main issue i think was that i didnt have 'sleep' defined on my
> harmony remote for the power-off process, so the NUC never actually entered
> S3 sleep, thus pmutils scripts were never called when i thought i was
> resuming.
>
> sorry it's taken so long to get back - been a week of life getting in the
> way and only just found the time this morning to look at it.
>
>
I recently got a celeron NUC6CAYH and had to do some fiddling to get the
HDMI to set correctly on resume. My issue was the dislpay switching to 4k
mode so I triggered xrandr to revert to 1920 while the tv turns on. I
ended up with the following script triggering under pmutils. When run from
pmutils the script would give an error about not connecting to DISPLAY
until I added the XAUTHORITY line. The pause 5 catches when the tv needs
more time to wake up from a longer inactivity.
My NUC is waking from IR because it will actually power on from full power
loss with an MCE wake up command.
#!/bin/sh
#Runs on resume
export XAUTHORITY=/home/<X user>/.Xauthority
export DISPLAY=:0.0
xrandr --display :0.0 -s 1920x1080 -r 60
sleep 5; xrandr --display :0.0 -s 1920x1080 -r 60
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20171109/55b3901c/attachment.html>
More information about the mythtv-users
mailing list