[MPlayer-dev-eng] [PATCH] Screen blanking prevention for Maemo
siarhei.siamashka at gmail.com
Fri Jan 15 19:23:00 CET 2010
On Friday 15 January 2010, Dan Oscarsson wrote:
> On 2010-01-14 at 16:57 +0200 Siarhei Siamashka wrote:
> > It would be also nice if you could try benchmarking the overhead of
> > blanking prevention code with different settings for heartbeat period and
> > provide some numbers (probably using mplayer '-benchmark' combined with
> > '-framedrop' or '-hardframedrop' options when trying to watch some heavy
> > video and measure the number of dropped frames).
> I think one way to handle screensaver blocking could be to at start run
> an external command that manages the blocking, and possibly kill the
> external command on exit or run other command then.
> The XDG standard have one command: xdg-screensaver suspend windowid that
> blocks sceensaver and power management as long as windowid exists.
> There is an other command to resume it on same windowid if windowid is
> not going away.
> It should be possible to write special scripts where the xdg commands do
> not exist.
> This way mplayer do not need to run a heartbeat command or do some other
> operations now and then to simulate activity. Instead just one command
> at start and possible one at exit.
There are many ways to solve this problem, all having their own advantages
Running another external process to take care of screen blanking prevention
requires to be careful not to forget to terminate it when it is not needed
anymore (for example, the cases like abnormal termination of mplayer itself
should be handled too). Otherwise the screen kept in a permanently turned on
state will drain battery very fast and the user will be very unhappy.
Another thing to consider is the case when video playback is paused. When
video playback is paused, mplayer also suspends heartbeat activity and the
screen gets eventually blanked, saving some power (which is a good thing).
If using an external process to take care of the blanking prevention, it
would have to be notified about the playback pause in some way. In a paused
state mplayer still prevents CPU from sleeping properly and is draining
battery very fast, but that's another issue.
More information about the MPlayer-dev-eng