Friday, September 17, 2010

Fix: Linux screen blanks during video playback

Whenever I play videos on my Linux box with a browser-based player (i.e., YouTube) or Hulu Desktop after a few minutes the screen goes blank. I bump the mouse and it comes back. The screensaver is not only not turned on, I uninstalled it completely. Power Management is set to "never" turn off the monitor. So I find out that many Linux distros apparently ship with TWO screen savers and power managers activated. There are the "Gnome" (or KDE) ones and then there are the X server ones. It's easy to turn off the ones in the Desktop Environment, but that doesn't turn off the X server ones!

Ok, so forget most of what you've read on the internet regarding this - lots of the "fixes" out there refer to display blanking while in text/console mode or for older versions of the X server, or additions to your xorg.conf file which don't work anymore. Plus, the fixes generally don't survive a reboot or a restart of the X server, others won't take effect until you do restart the X server. Argh!

But, remember, I said to forget about those? Yeah. So here's what finally seems to have solved it for me. You use your administrative privileges (you have those right?) and open the following file in your favorite text editor:

/etc/gdm/PreSession

At the end of it tack on the following two lines:

xset s off
xset -dpms

Save the file, reboot. That *should* (if you have every other screen blanking/saving feature turned off) prevent it from blanking out the screen after several minutes while watching online videos.

Some Linux players, such as XBMC, don't require this fix as they implement other methods to prevent the screen blanking when you haven't touched the mouse or typed anything in a while.

No comments: