Opened 14 years ago

Closed 14 years ago

Last modified 6 years ago

#29 closed patch (fixed)

XScreenSaver support

Reported by: neil@… Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

This patch adds support for disabling XScreenSaver while playing recordings etc. Add "--enable-xss" to your configure options when building, and it will execute "xscreensaver-command -deactivate" every 60 seconds. This disables the standard X screensaver/DPMS support, but I don't imagine anyone would need both of these activated.

Attachments (6)

screensaver-xss.diff (2.7 KB) - added by neil@… 14 years ago.
Diff for system changes
screensaver-xss.tar.bz2 (850 bytes) - added by neil@… 14 years ago.
New xscreensaver support files
screensaver-x11.diff (4.2 KB) - added by neil@… 14 years ago.
replacement patch rolled into screensaver-x11
screensaver-x11-1.1.diff (4.7 KB) - added by neil@… 14 years ago.
(1.1) replacement patch using runtime detection
screensaver-x11-1.2.diff (5.3 KB) - added by neil@… 14 years ago.
(1.2) processRunning moved to libmyth/util
screensaver-x11-1.3.diff (3.2 KB) - added by neil@… 14 years ago.
(1.3) detection changed to use "xscreensaver-command -version"

Download all attachments as: .zip

Change History (21)

Changed 14 years ago by neil@…

Attachment: screensaver-xss.diff added

Diff for system changes

Changed 14 years ago by neil@…

Attachment: screensaver-xss.tar.bz2 added

New xscreensaver support files

comment:1 Changed 14 years ago by Isaac Richards

Can't xscreensaver be set to enable itself only if dpms is on? In that case, wouldn't the existing screensaver support (in screensaver-x11.cpp) be sufficient?

comment:2 Changed 14 years ago by jdonavan

There's a checkbox in the KDE screensaver settings for it. Running xscreensaver-demo reveals a power management section that proably does the same thing.

comment:3 Changed 14 years ago by neil@…

Xscreensaver has support for disabling it's graphics if it detects the screen has been shut down by dpms, but I haven't seen any options for running only when dpms is enabled.I know KDE 3.2 added support for this, but not Xscreensaver (yet). I'm not running KDE so this isn't an option.

The power management section of xscreensaver-demo just enables support for it's own dpms timers (which override any other dpms settings).

comment:4 Changed 14 years ago by Isaac Richards

I'd like to see this rolled into screensaver-x11, then.

comment:5 Changed 14 years ago by neil@…

I wanted to avoid bloating screensaver-x11 because it appears that almost no X11 Myth users actually run Xscreensaver.

Here is the version rolled into screensaver-x11 (with a lot of ifdefs).

Changed 14 years ago by neil@…

Attachment: screensaver-x11.diff added

replacement patch rolled into screensaver-x11

comment:6 Changed 14 years ago by Robert Tsai <rtsai>

I'm an X11 Myth user. I don't run Xscreensaver because I couldn't suppress it when I was watching stuff. So here we are :).

Would it be possible to make the timer configurable (perhaps an undocumented database option)? Even better would be to read the ~/.xscreensaver file and set the timer for a few seconds shy of the configured timeout. That way we don't have to unnecessarily "ping" xscreensaver any more than necessary.

I happen to have a pretty short timeout on my system (90 seconds), so the patch as-is doesn't help me.

comment:7 Changed 14 years ago by Isaac Richards

Why does this need ifdefs? Can't it simply test to see if xscreensaver is running when it's first initialized, then just do its stuff without ifdefs? There's no source dependency or anything..

comment:8 Changed 14 years ago by neil@…

Isaac, hopefully this is closer to what you want - it detects xscreensaver at runtime by parsing /proc.

Robert, I added support for a database setting "xscreensaverInterval" which allows the default timer interval (60 seconds) to be configured per-host. Set to the number of seconds required, or 0 to disable the timer.

Changed 14 years ago by neil@…

Attachment: screensaver-x11-1.1.diff added

(1.1) replacement patch using runtime detection

Changed 14 years ago by neil@…

Attachment: screensaver-x11-1.2.diff added

(1.2) processRunning moved to libmyth/util

comment:9 Changed 14 years ago by Isaac Richards

Couldn't the 'processRunning' test be better done by parsing the output of 'xscreensaver-command -version'? Just a bit simpler, I'd think..

comment:10 Changed 14 years ago by Mario Limonciello <mario.mailing@…>

I've noticed that while using this patch, DPMS won't be disabled at all while Xscreensaver is disabled.

I typically have DPMS enabled for maybe an hour timeout, so if watching a 3 hour movie, I'll have to either go move my mouse or send an 'xset dpms force on' to the machine from my laptop.

Could it be possible to merge something in to this patch that will query the x-server for DPMS settings as well, and if enabled then disable DPMS when the recording starts playing and re-enable it when the recording stops playing?

The only issue I'd see with doing it that way is that if myth were to crash during a recording playback, DPMS stays turned off, which isn't really the end of the world for me.

Changed 14 years ago by neil@…

Attachment: screensaver-x11-1.3.diff added

(1.3) detection changed to use "xscreensaver-command -version"

comment:11 Changed 14 years ago by neil@…

New patch using result from "xscreensaver-command -version" for detection

Mario, this patch shouldn't touch the DPMS code already there. Does it work correctly without the patch? Have you configured DPMS through XScreenSaver, or with xset?

comment:12 Changed 14 years ago by Mario Limonciello <mario.mailing@…>

I set DPMS through Xscreensaver, and I'm not really sure if it ever worked without the patch. I always had the issue of xscreensaver popping up, and would send an irxevent with my remote or go move the mouse to disable it. Xscreensaver always would kick in before the dpms counter.

Sometime this week I'll rebuild myth without this patch, and set dpms to some really low number through xscreensaver, and then kill the xscreensaver process and see what happens with myth handling dpms code. Then ill try with xset, and then lastly I'll give one more go with this patch.

comment:13 Changed 14 years ago by neil@…

This is an issue with the interaction between X11 and XScreenSaver, not Myth.

XScreenSaver has a watchdog timer that continually resets the DPMS options, so it prevents Myth from actually disabling DPMS. The -deactivate command then doesn't reset the internal X11 DPMS counters, so you're left with DPMS that will always follow what's been configured in XScreenSaver.

I've suggested a couple of options to Jamie - you can monitor the XScreenSaver changelog in case he implements any of them.

comment:14 Changed 14 years ago by Mario Limonciello <mario.mailing@…>

I guess a temporary fix with this new information would be to just configure DPMS through my xorg.conf and disable xscreensaver DPMS support alltogether.

I have to wonder though, what does mplayer do to get around this? I was watching a movie last night with mplayer with xscreensaver support set to not allow xscreensaver to turn on while the movie is in playback mode. The screensaver never even winked at me, and neither did DPMS.

comment:15 Changed 14 years ago by Isaac Richards

Resolution: fixed
Status: newclosed

(In [6977]) Patch mostly from Neil to add support for XScreenSaver. Simplified slightly.

Closes #29.

If you get linking errors, do a distclean.

Note: See TracTickets for help on using tickets.