[SOLVED] How do I stop the screen from blanking when I watch 1 hour Youtube movies?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've come to the realization that any proper solution to this needs to start with "just don't use xscreensaver".
I noticed that xscreensaver was coming on even after I'd done "xset s off", and I suspected that xscreensaver wasn't well-behaved in regards to the XResetScreenSaver/XGetScreenSaver API.
So I locked at xscreensaver's source code for confirmation and, oh, man... it's much worse than I thought.
Instead of just querying the timeout value from X and honoring it, it actually assumes that the value you'd set using xset (or that was set by, say, a game or media player that wants to disable the screen saver) is wrong, and tries to "correct" it for you.
This is ridiculous.
[EDIT: I later checked the xscreensaver tarball that was linked from LinuxFromScratch, and it's notably less ridiculous than that fork. But it still doesn't honor xset settings.]
(It also looks to me like xlockmore actually honors the standard X API to disable the screen saver, and should be a worthy substitute for xscreensaver).
Note: if you're picking a screen saver or a locker, make sure it calls and honors either XGetScreensaver (linked above) or XScreenSaverQueryInfo. When MPlayer plays a movie, it uses both systems.
I've also noticed that xautolock honors XScreenSaverQueryInfo. But then, I'd assume that anything would be more well-behaved than xscreensaver.
The recommendation by the gnome-screensaver project for how a program should disable the screen saver is to call XResetScreenSaver. Here's a link to their recommendation.
Quote:
For reference, joystick using applications that use SDL are expected to not activate the screensaver any longer, due to changes in SDL ( ). Applications not using SDL should call XResetScreensaver as appropriate to avoid screensaver activation.
MPlayer also calls XResetScreenSaver to disable the screen saver when it's playing movies. This is mentioned right in its manpage:
Quote:
Code:
-stop-xscreensaver (X11 only)
Turns off xscreensaver at startup and turns it on again on exit. If your screensaver supports neither the XSS nor XResetScreenSaver API please use -heartbeat-cmd instead.
I'm going to leave the previous post (which I made before fact-checking everything) as-is, but this post is what I know for sure.
The takeaway? If you set your screen saver interval for one minute, play a full-screen video in MPlayer for one minute, and the screen saver comes on, then something is wrong. I'm a bit curious as to which screen savers fail this test.
My current understanding of the way this should normally work is that the the screen saver or locker calls XScreensaverQueryInfo to poll for the idle time, and the game or media player calls XResetScreenSaver to reset the idle time.
I'm aware of a program that should be helpful for looking into this:
Go into init level 3. If this will still happen this is because power management of your system - power saving by blanking the screen. Xscreensaver has not much to do with this. Perhaps of course.
Edit: Precisely I meant after hour of passive input. Cause you cant watch youtube in frame buffer - except possibly using VLC - at least I know VLC can ue frame buffer as output device.
I really dislike xscreensaver also. For what it's worth, Cinnamon's screensaver seems to "just work" without being overdesigned. There is also a Cinnamon applet to automatically disable power saving when media is playing, which seems to work pretty well. It can also be activated or deactivated manually. Since switching to Cinnamon, I have had no need for custom scripts to do this sort of thing.
I wanted to make sure I had my technical understanding right. Specifically:
the screen saver is supposed to call XScreenSaverQueryInfo to get the elapsed idle time and to decide when to activate
the game or media player is supposed to call XResetScreenSaver to reset the elapsed idle time, and to delay the screen saver from activating
So of course I wrote a program to confirm that:
Code:
#include <X11/extensions/scrnsaver.h>
#include <unistd.h>
#include <stdio.h>
int main()
{
int i;
XScreenSaverInfo *ssi;
Display *dpy;
int event_basep;
int error_basep;
dpy = XOpenDisplay(0);
XScreenSaverQueryExtension(dpy, &event_basep, &error_basep);
ssi = XScreenSaverAllocInfo();
for (i = 0; i < 10; i++)
{
sleep(1);
XScreenSaverQueryInfo(dpy, DefaultRootWindow(dpy), ssi);
printf("%d\n", ssi->idle / 1000);
if (i == 5)
{
XResetScreenSaver(dpy);
}
}
return 0;
}
It runs for ten seconds. At each second, it queries the elapsed idle time the way a screen saver would, and prints it. At the fifth second, it resets that time the way a program that wants to suspend the screen saver would.
If you name it "sstest.c", then you can build it like this:
Code:
gcc sstest.c -lX11 -lXss
When you run it and leave it alone, letting the idle time accumulate, it prints out:
Code:
0
1
2
3
4
5
0
1
2
3
This confirms what I said in my previous two posts. If you're running a screen saver that queries its idle time with XScreenSaverQueryInfo, it should be suspending automagically when you play games and watch movies. And as far as I know, that's every screen saver or screen locker other than xscreensaver. So: drop it and use literally anything else. I'd imagine that xfce4-screensaver would become a good choice on Slackware before long.
Anyway, here are some interesting links I stumbled across.
Google apparently has a screen locker. I'm not interested in using it, but it's interesting that it exists:
I used to love screen savers.. but at a point I came to the realization that they didn't serve much purpose since I never sat around to watch them.
Work policy has ingrained into me locking my computer when I get up.. so at this point i've just disabled screensavers entirely and rely on ctrl+alt+L to lock it and turn off the monitor.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.