After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 562847 - screensaver starts when movie plays
screensaver starts when movie plays
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: Movie player
2.24.x
Other All
: Normal normal
: ---
Assigned To: General Totem maintainer(s)
General Totem maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2008-12-01 10:23 UTC by Alejandro
Modified: 2009-02-03 17:11 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24



Description Alejandro 2008-12-01 10:23:18 UTC
Please describe the problem:
Hi, I thought that playing a movie in Totem was supposed to keep gnome-screensaver from start.... however I just watched a movie and had to move the mouse once and again because the screensaver kept going off. Is this supposed to work like this?

Thanks.

(from https://bugs.launchpad.net/ubuntu/+source/totem/+bug/59688)

Steps to reproduce:
1. start a movie
2. see screensaver appear

Actual results:
2. see screensaver appear

Expected results:
screensaver gets not started.

Does this happen every time?
yes.

Other information:
The bug is forwarded from https://bugs.launchpad.net/ubuntu/+source/totem/+bug/59688 
It appeared some time ago and was fixed, but in the newest version "Intrepid" the bug appears again.
Comment 1 Philip Withnall 2008-12-02 19:29:23 UTC
Are you in fullscreen mode? Totem only inhibits the screensaver when in fullscreen mode. This is because many people use Totem to play music in the background, and if it inhibited their screensavers, their laptops might overheat or have reduced battery life.
Comment 2 Alejandro 2008-12-07 18:20:36 UTC
Yes, even in fullscreen mode this does appear.
Thanks for helping.
Comment 3 Philip Withnall 2008-12-07 18:39:28 UTC
Do any messages appear on the console if you run Totem with `totem --debug` and reproduce the bug?

What's the output of `gconftool -g /apps/totem/plugins/screensaver/active`?
Comment 4 Alejandro 2009-01-08 12:34:22 UTC
$ gconftool -g /apps/totem/plugins/screensaver/active
true



$ totem --debug
** (totem:8293): DEBUG: Init of Python module
** (totem:8293): DEBUG: Registering Python plugin instance: BBCViewer+TotemPythonPlugin
** (totem:8293): DEBUG: Creating object of type BBCViewer+TotemPythonPlugin
** (totem:8293): DEBUG: Creating Python plugin instance
** (totem:8293): DEBUG: Init of Python module
** (totem:8293): DEBUG: Registering Python plugin instance: YouTube+TotemPythonPlugin
** (totem:8293): DEBUG: Creating object of type YouTube+TotemPythonPlugin
** (totem:8293): DEBUG: Creating Python plugin instance

I start a video and the screensaver gets activated, but not output in the console.

Thanks!
Comment 5 François Kooman 2009-01-20 00:28:33 UTC
@Philip Withnall:

<code>
        if (totem_is_playing (totem) != FALSE && (lock_screensaver_on_audio || can_get_frames))
                totem_scrsaver_disable (pi->scr);
        else
                totem_scrsaver_enable (pi->scr);
</code>

from http://svn.gnome.org/viewvc/totem/trunk/src/plugins/screensaver/totem-screensaver.c?revision=5895&view=markup (row 122). 

As far as I can see there is no check whether or not Totem is in full screen mode. "can_get_frames" indicates whether a movie is playing apparently.

`gconftool -g /apps/totem/lock_screensaver_on_audio` might also be interesting. When this is "true" the screen saver never becomes active when totem is playing (any file) it seems. 

The goal of this is to not let screens go to power save mode when the screen has speakers attached that also turn off in that case?

In the UI this is referred to with "Allow the screen saver to activate even when audio-only is played". Which doesn't seem to be correct behavior if you look at the code above and the goal of the functionality.

The real underlying problem of this issue seems to be that "can_get_frames" doesn't work correctly when you start playing a file, it's always false on start of a file even if that file is a movie. A pause action, or a scroll in the file makes can_get_frames become true when a movie is being played so the screensaver is correctly inhibited. I guess can_get_frames is called too soon after a (new) file is being opened, the frames aren't yet available.

Also: "Allow the screen saver to activate even when audio-only is played" should really be reworded, maybe something like "Never activate screensaver when playing audio only file".

@Alejandro:
Quick fix: set "Allow the screen saver to activate even when audio-only is played" to true, now the screen saver will never be activated when something (also audio only file) is playing.
Comment 6 Bastien Nocera 2009-01-21 15:13:54 UTC
I don't think can_get_frames is actually the problem. I can see that it's correctly set to TRUE as soon as something starts playing.

Which backend were you using when you reproduced that problem? Where did you add the debug?
Comment 7 François Kooman 2009-01-21 15:40:17 UTC
can_get_frames: 0  <-- on startup (just ./totem)
can_get_frames: 0  <-- two lines after opening movie file (audio/video?)
can_get_frames: 0
can_get_frames: 1  <-- this happens as soon as you pause the file
can_get_frames: 1
can_get_frames: 1
can_get_frames: 1
can_get_frames: 1
can_get_frames: 1

This is totem-2.24.3-1.fc10.x86_64 (on Fedora 10) using the GStreamer backend (Help, About: Movie Player using GStreamer 0.10.21)

=== cut from src/plugins/screensaver/totem-screensaver.c ===
        can_get_frames = bacon_video_widget_can_get_frames (bvw, NULL);

        printf("can_get_frames: %d\n", can_get_frames);

        if (totem_is_playing (totem) != FALSE && (lock_screensaver_on_audio || can_get_frames))
=== /cut ===
Comment 8 Bastien Nocera 2009-02-03 17:11:41 UTC
2009-02-03  Bastien Nocera  <hadess@hadess.net>

        * src/plugins/screensaver/totem-screensaver.c (got_metadata_cb),
        (impl_activate), (impl_deactivate): Also update the screensaver
        status when we get more metadata from the backend, as it's possible
        we don't detect there's a video stream when playing starts
        (Closes: #562847)