Systems goes to sleep mode while playing a movies

Hi,

I have migrated to opensuse from Ubuntu and have installed 11.4 on my laptop with windows 7 dual boot. Now the issue is that the power management keeps executing even if the laptop is in working mode. For example, I have configured the power profile to dim the screen after 10 min, start screensaver after 15 min, make the system sleep after 20 min. This should be applicable when the system is idle but it gets executed while I am watching a movie. Whenever I watch a movie, the screen goes dim after 10 min, starts screensaver and even goes to sleep mode while the movie is playing.

I need a solution that will execute these power options when my laptop is in idle state.

Ok. I did some google and found that this issue does exist on other linux distros as well. The multimedia apps fails to poll the system telling it that the user is idle though its not.

Does anyone else has faced this issue? Any idea about a fix for this?

On 2011-04-26 23:06, rgupta52 wrote:
> Does anyone else has faced this issue? Any idea about a fix for this?

The problem is that there is not a common command or whatever that allows a
multimedia application to tell the system not to sleep. Kde may have a
method, gnome may have another…

For example, xine tricks the keyboard into changing some key press status
so that the system thinks there is user activity.

Search the forum to see if this has been asked before.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

On Tue, 26 Apr 2011 16:06:01 +0000, rgupta52 wrote:

> I need a solution that will execute these power options when my laptop
> is in idle state.

The challenge is in identifying what constitutes an ‘idle state’. If
you’re watching a movie, the mouse and keyboard are not active, so that’s
what’s being perceived as an ‘idle’ state and is triggering the timer.

A possible solution would be to launch your media player with a script
that disables the screensaver and DPMS settings (for your monitor) before
running and re-enables them afterwards.

For example, if you use GNOME, you could do:

#!/bin/bash
gnome-screensaver-command --exit
xset -dpms
xine
xset +dpms; xset dpms 600
gnome-screensaver &

(the ‘xset dpms 600’ sets the screen power off to 10 minutes)

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

On 2011-04-27 00:26, Jim Henderson wrote:

> A possible solution would be to launch your media player with a script
> that disables the screensaver and DPMS settings (for your monitor) before
> running and re-enables them afterwards.

But you see, this should be automatic. The user should not have to do such
hacks. Not even the multimedia application designer!

There should be a common api, system call, or whatever, that disables
screen saving features (screen saver, screen dimmer), for any possible desktop.

There has been some agreements on features the desktop should have, to
behave nicely with one another. This should be one more feature.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

I would like to see it, and a number of other things, automatic. I would also want to make sure it doesn’t lock the advanced users from making it do what they want it to.

I maythink it would be more the responsibility of the movie player to turn those things off or suspend them while playing. Preferably with the ability to suppress the suppress features.

Or should it be up to the distributions’, so if the distribution is for desktop (consumer) use it does this automatically while distributions for hacking may not and give the user more control?

Thanks Jim, for that quick script. Is that complete? I just may use it, except many of the movies I use are over the internet so it is actually using the Flash or other technology inside a browser, rather than a stand-alone applications.

I found that the TOTEM Player is what I was looking for. Watching movie in totem avoids trigerring the power management parameters.

Thanks for the script Jim. But this would become annoying running the script everytime whenever you want to watch a movie. I am wondering how this has not came in the consideration of the OpenSuse developers.

Hi,

Just to add somme morte information. There is a little apps that just do that I think. It is called : Caffeine. Some guys have package it in OBS. Look there. It prevents the screesaver and the sleep mode from starting.

So for Gnome, Totem does it, and for KDE Caffeine does?

Yes, Kaffeine does that. But I don’t have any issues at all with VLC. That’s another option, I think.

On 2011-04-27 15:36, dragonbite wrote:
> I maythink it would be more the responsibility of the movie player to
> turn those things off or suspend them while playing. Preferably with the
> ability to suppress the suppress features

The movie player people can not do it because the desktop people first have
to agree and make a handle to do it. That is what I’ve been telling all the
time.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

No no dragonbite. Caffeine is not Kaffeine. It is not the same apps.

Here’s the link to the project : Caffeine in Launchpad

Here’s some apps found in OBS (available only for the 11.3) : https://build.opensuse.org/package/show?package=caffeine&project=home%3ANovA80

I use VLC to watch DVDs and it still tries to go to sleep, even when I switch the power settings to never. Any other ideas?

My mistake. Sorry.

Whoops! :shame:

On Wed, 27 Apr 2011 01:03:07 +0000, Carlos E. R. wrote:

> On 2011-04-27 00:26, Jim Henderson wrote:
>
>> A possible solution would be to launch your media player with a script
>> that disables the screensaver and DPMS settings (for your monitor)
>> before running and re-enables them afterwards.
>
> But you see, this should be automatic. The user should not have to do
> such hacks. Not even the multimedia application designer!
>
> There should be a common api, system call, or whatever, that disables
> screen saving features (screen saver, screen dimmer), for any possible
> desktop.
>
> There has been some agreements on features the desktop should have, to
> behave nicely with one another. This should be one more feature.

Sure, should be, but I can’t answer it based on what it should be
able to do - I can answer based on what I know works, though. :slight_smile:

Jim

Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

On Wed, 27 Apr 2011 15:36:01 +0000, rgupta52 wrote:

> I found that the TOTEM Player is what I was looking for. Watching movie
> in totem avoids trigerring the power management parameters.
>
> Thanks for the script Jim. But this would become annoying running the
> script everytime whenever you want to watch a movie. I am wondering how
> this has not came in the consideration of the OpenSuse developers.

Well, keep in mind that the openSUSE developers don’t write the video
apps, and one of the potential issues is that there are multiple desktops
available, each with their own API set. So it gets complicated to write
something that works for many different desktops.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

TOTEM fails to do the trick on gnome 3.0
same is the case with gnome mplayer
even much touted banshee fails

precisely reason why set power off screen setting for 2 hrs,since this enables me to watch entire movie in peace :wink:

On 2011-04-29 19:08, Jim Henderson wrote:

> Sure, should be, but I can’t answer it based on what it should be
> able to do - I can answer based on what I know works, though. :slight_smile:

Ok, but then it is not a solution. It is a hack, a workaround, a bypass…
whatever :wink:

By the way, xine in my gnome does not sleep. It uses the keyboard trick I
mentioned.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

On Fri, 29 Apr 2011 23:50:08 +0000, Carlos E. R. wrote:

> On 2011-04-29 19:08, Jim Henderson wrote:
>
>> Sure, should be, but I can’t answer it based on what it should be
>> able to do - I can answer based on what I know works, though. :slight_smile:
>
> Ok, but then it is not a solution. It is a hack, a workaround, a
> bypass… whatever :wink:

That’s semantics, but OK. :slight_smile:

> By the way, xine in my gnome does not sleep. It uses the keyboard trick
> I mentioned.

Great. :slight_smile:

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C