Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#7291 closed defect (wontfix)

Screensaver not reset in a timely fashion

Reported by: mythtv@… Owned by: Janne Grunau
Priority: minor Milestone: unknown
Component: MythTV - Video Playback Version: unknown
Severity: medium Keywords:
Cc: Ticket locked: no


While watching a ripped DVD (in VIDEO_TS format), the screensaver does not appear to be disabled properly.

2009-10-11 02:53:12.051 ScreenSaverX11Private: Calling xscreensaver-command -deactivate

2009-10-11 02:53:12.065 ScreenSaverX11Private: Calling gnome-screensaver-command --poke

The above commands appear in the output of mythfrontend -v playback every 50 seconds or so (screensaver is set to blank screen after 1 minute). This appears to work correctly, until a DVDNAV_CELL_CHANGE occurs. At some point over the next minute, the screensaver will activate, and then at about a minute after the DVDNAV_CELL_CHANGE, the screensaver will deactivate itself.

I believe that this is due to the reset of the timer that occurs shortly after the DVDNAV_CELL_CHANGE

2009-10-11 02:51:32.042 ScreenSaverX11Private: ResetTimer? -- begin

2009-10-11 02:51:32.042 ScreenSaverX11Private: StopTimer?

2009-10-11 02:51:32.042 ScreenSaverX11Private: StartTimer?

2009-10-11 02:51:32.042 ScreenSaverX11Private: ResetTimer? -- end

From a short look at the code, my understanding is that the ResetTimer? function starts the countdown before the next --disable or --poke from the beginning, but doesn't do anything to stop the screensaver from activating.

An example timeline:

00:00:00 screensaver --disable and --poke

00:00:45 ScreenSaverX11Private: ResetTimer?

00:01:00 Screensaver is activated here (1 min since last --poke)

00:01:45 screensaver --disable and --poke. Screensaver is deactivated here (1 min since timer reset)

I am not familiar with the code, so I can't be sure whether there is an issue with a poke of the screensaver failing in the function that calls ResetTimer?, or whether it is a problem with ResetTimer? itself.

Change History (6)

comment:1 Changed 12 years ago by mythtv@…

I should probably mention that I am currently using the mythbuntu trunk build of SVN.

comment:2 Changed 12 years ago by mythtv@…

Issue mostly resolved by increasing the frequency of the poke to < 1/2 of the interval of the screensaver timeout. The default value should be sufficient for screensaver timeouts of more than about 2(probably most users).

A discussion with sphery on the irc channel raised the concern that increasing the frequency of the poke may cause problems with performance due to the overhead of repeated external calls, and the suggestion that the default should stay as it is as it is currently not a problem for most users.

comment:3 Changed 11 years ago by stuartm

Component: MythTV - User Interface LibraryMythTV - Video Playback
Owner: changed from stuartm to Janne Grunau

comment:4 Changed 11 years ago by sphery

Resolution: wontfix
Status: newclosed

The current settings work fine for the vast majority of users. The once-per-minute screensaver poke will work for any user with a screensaver timeout of 2 minutes or higher, and decreasing the poke interval to 25sec would be extra work for the system to do during playback--where performance is critical--and would only be helpful for users who have screensavers set with a 1-minute timeout. Therefore, users who wish to run with a 1-minute screensaver timeout can modify the code that pokes the screensaver manually (or just settle for a 2-minute screensaver timeout).

In the future, I plan to add support for xdg-screensaver, which will take a very different approach to screensaver disabling/enabling, and won't be affected by the screensaver timeout.

comment:5 Changed 11 years ago by sphery

(In [24559]) Add support for xdg-screensaver from xdg-utils ( ).

This adds a new class ScreenSaverXDG that provides support for enabling/disabling an X11 screensaver using the xdg-screensaver script from xdg-utils. xdg-screensaver basically implements all of the functionality MythTV had implemented in ScreenSaverX11 (and more)--it handles making sure any supported screensaver applications do not activate when not wanted and handles DPMS enabling/disabling--even if no screensaver applications are running. Therefore, ScreenSaverXDG is significantly simpler than ScreenSaverX11. xdg-screensaver currently supports xscreensaver, GNOME screenaver, KDE screensaver, and support for other screensavers can easily be added to the script.

The biggest benefit of using xdg-screensaver is that it is designed to allow safely disabling a screensaver application such that the screensaver state will be restored even in the event that the suspending application crashes. If mythfrontend crashes after suspending the screensaver, xdg-screensaver will notice that the mythfrontend window no longer exists, so it will re-enable the screensaver. Therefore, rather than poke the screensaver once every 50s during playback, as we do with xscreensaver and gnome-screensaver in ScreenSaverX11 (so we never have to disable the screensaver and risk leaving it in the wrong state after a crash), xdg-screensaver allows us to simply "suspend" the screensaver on playback startup and "resume" the screensaver on playback pause/exit/... This means that users on underpowered systems or users affected by the GNOME screensaver issue that causes gnome-screensaver-command to take significant resources on every execution will no longer see playback issues every 50s or so if they have xdg-screensaver installed.

Refs #7291. Fixes #8357 with slightly modified patch from Johnny Walker. Thanks to Johnny for the patch and for the testing.

comment:6 Changed 11 years ago by sphery

(In [24636]) Remove the xdg-screensaver support by reverting [24559].

While the promise of xdg-screensaver is great, it seems that neither distros nor desktop environments have any desire to support it. Users on various distros with various desktop environments using various (including supported and not supported) screensaver applications found that it did not work for them. Until it's properly supported by distros and desktop environments, it's not useful.

Fixes #8443. Refs #8357. Refs #7291.

Note: See TracTickets for help on using tickets.