the screen keeps locking while I watch video (missing support for Wayland's idle_inhibit_unstable_v1)

Bug #1740771 reported by Imre Péntek
46
This bug affects 7 people
Affects Status Importance Assigned to Milestone
MPV
Fix Released
Unknown
Mutter
Fix Released
Unknown
mpv (Ubuntu)
Fix Released
Medium
Unassigned
mutter (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Upstream: https://gitlab.gnome.org/GNOME/mutter/issues/20

---

Reproducibility:

100% reproducible

steps to reproduce:

1. $ mpv -fv anyvideo_long_enough.anyformat
2. now please refrain from any mouse/keyboard activity, wait for the screensaver to activate
3. screensaver activates

problem:

the screensaver activates

desired behaviour:

the screensaver shouldn't activate

long description:

Hello,

the screen keeps locking while I watch video with mpv. Basically the screensaver gets activated.

but according to man mpv:

       --heartbeat-cmd=<command>

          WARNING:
              This option is redundant with Lua scripting. Further, it shouldn't be needed for disabling screensaver anyway, since mpv will call xdg-screensaver
              when using X11 backend. As a consequence this option has been deprecated with no direct replacement.

...

That all said as the screen getting locked contradicts the manpage, I consider this a bug. Thank you for the fix in advance.

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: mpv 0.26.0-3ubuntu1
ProcVersionSignature: Ubuntu 4.13.0-21.24-generic 4.13.13
Uname: Linux 4.13.0-21-generic x86_64
ApportVersion: 2.20.7-0ubuntu3.6
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Mon Jan 1 19:10:42 2018
InstallationDate: Installed on 2017-12-25 (7 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Release amd64 (20171018)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=hu_HU.UTF-8
 SHELL=/bin/bash
SourcePackage: mpv
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Imre Péntek (pentek-imre) wrote :
Revision history for this message
Imre Péntek (pentek-imre) wrote :

also I have

alias mpv='mpv --no-audio-display --volume-max=132 --cache-secs=120'

but I'm pretty sure unaliasing mpv wouldn't change the presence of the bug

Revision history for this message
James Cowgill (jcowgill) wrote :

Is it possible for you to test mpv 0.27?

There was a screensaver related fix, but I am not sure if it will fix your issue:
https://github.com/mpv-player/mpv/commit/82d9419f62c90cecc13c492e3b68feebe0229daa

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It appears Imre is using a wayland session. And starting in Ubuntu 17.10, mpv uses pure Wayland by default. This means any X11 screensaver fix is probably irrelevant.

The required feature for Wayland clients is apparently the 'idle_inhibit_unstable_v1' protocol which can be found in detail in:
  /usr/share/wayland-protocols/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml
And see also:
  https://lists.freedesktop.org/archives/wayland-devel/2016-April/027950.html
  https://blogs.s-osg.org/inhibited-wayland-desktop-part-1/

Given it's an 'unstable' protocol subject to change and that I don't see it being used in the mpv source code yet, maybe the mpv authors have decided to ignore it for now? Or maybe they don't know it exists?

Best that someone logs an issue with MPV directly to get Wayland idle inhibition support added in a future version:
  https://github.com/mpv-player/mpv/issues

Revision history for this message
James Cowgill (jcowgill) wrote :

It looks like support was added as part of the wayland rewrite in 0.28:
https://github.com/mpv-player/mpv/commit/68f9ee7e0b3fdddfa42fa11a15d9ae84460d5e19

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

That's the one, thanks. We'll need to wait for v0.28

Changed in mpv (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
summary: - the screen keeps locking while I wath video with mpv
+ the screen keeps locking while I watch video with mpv
Revision history for this message
Doug McMahon (mc3man) wrote : Re: the screen keeps locking while I watch video with mpv

As I mentioned elsewhere it's not solely a matter of mpv-0.28+, support for the protocol needs to be in mutter also.
A workaround for current wayland/mpv users is to start mpv with gnome-session-inhibit, i.e
gnome-session-inhibit mpv /path/to/file
(- at least in 0.28, may also work in 0.27

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Yes. And for some reason I thought it was already in mutter. But I can't find it now. So mutter also needs fixing.

Changed in mutter (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
summary: - the screen keeps locking while I watch video with mpv
+ the screen keeps locking while I watch video with mpv (missing support
+ for Wayland's idle_inhibit_unstable_v1)
Revision history for this message
Doug McMahon (mc3man) wrote : Re: the screen keeps locking while I watch video with mpv (missing support for Wayland's idle_inhibit_unstable_v1)

forgot to mention I did file a mutter bug though it wouldn't appear to be something forthcoming soon..
https://gitlab.gnome.org/GNOME/mutter/issues/20

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

A fix for mutter/gnome-shell is now pending:
https://gitlab.gnome.org/GNOME/mutter/merge_requests/111

summary: - the screen keeps locking while I watch video with mpv (missing support
- for Wayland's idle_inhibit_unstable_v1)
+ the screen keeps locking while I watch video (missing support for
+ Wayland's idle_inhibit_unstable_v1)
description: updated
tags: added: bionic cosmic
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

mpv (0.29.0-1ubuntu1) cosmic; urgency=medium

  * Rewrote 08_fix-lp1698287.patch to work with the latest mpv source code,
    allowing VAAPI to work in Wayland sessions out-of-the-box. (LP: #1698287)
  * Reintroduce mpv.conf.ubuntu to enable VAAPI acceleration by default.
    (LP: #1708102)
  * Rebased on latest Debian version 0.29.0-1.

 -- Daniel van Vugt <email address hidden> Thu, 09 Aug 2018 18:04:13 +0800

Changed in mpv (Ubuntu):
status: Triaged → Fix Released
Doug McMahon (mc3man)
tags: added: disco
Changed in mpv:
status: Unknown → Fix Released
Changed in mutter:
status: Unknown → New
tags: removed: artful cosmic
tags: removed: disco
Revision history for this message
Imre Péntek (pentek-imre) wrote :

as far as I can tell this bug is not present in 19.10 (fixed)

Revision history for this message
Imre Péntek (pentek-imre) wrote :

note to self: check my home ubuntu if I have any alias set for mpv

Revision history for this message
Doug McMahon (mc3man) wrote : Re: [Bug 1740771] Re: the screen keeps locking while I watch video (missing support for Wayland's idle_inhibit_unstable_v1)

On 2/11/20 11:16 AM, Imre Péntek wrote:
> as far as I can tell this bug is not present in 19.10 (fixed)
>
No, clearly never fixed and still an issue in 20.04.

Only way around is for user from cli to use gnome-session-inhibit mpv
/path/to/file

Revision history for this message
Doug McMahon (mc3man) wrote :

List of some mpv issues with gnome wayland, the window deco is somewhat mitigated by the new osc overlay that will, by default show in the absence of window deco.
https://github.com/mpv-player/mpv/wiki/FAQ#i-use-gnome-wayland-and-i-have-xyz-problem

Revision history for this message
Imre Péntek (pentek-imre) wrote :

nonetheless I do not experience the core issue (screensaver activating, and the unability to temporarily disable it while an mpv playback is running)

alias mpv='mpv --no-audio-display --volume-max=132 --cache-secs=120 --alang=hu'

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 19.10
Release: 19.10
Codename: eoan

up-to-date

Revision history for this message
Amr Ibrahim (amribrahim1987) wrote :

This is still an issue in Focal in Wayland. Screen blanking occurs during video playback.

tags: added: focal
Revision history for this message
Imre Péntek (pentek-imre) wrote :

hello this bug is still present in jammy, however

    apport-collect 1740771

says

    Package mutter not installed and no hook available, ignoring

if there's anything I can do to help you fixing this issue, let me know.

thank you in advance.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
tags: added: jammy
tags: removed: bionic
Changed in mutter:
status: New → Fix Released
Changed in mutter (Ubuntu):
status: Triaged → Fix Committed
tags: added: fixed-in-mutter-45 fixed-upstream
Revision history for this message
Imre Péntek (pentek-imre) wrote :

when the package with this patch will be released? I can confirm the bug is still present as of now (up-to-date jammy)

Revision history for this message
Daniel van Vugt (vanvugt) wrote (last edit ):

I expect it will be in the final mutter 45.0 release (not in the beta). So it will only be in Ubuntu 23.10 and later.

tags: added: fixed-in-mutter-45.rc
removed: fixed-in-mutter-45
Revision history for this message
Imre Péntek (pentek-imre) wrote :

will it be backported to 22.04 LTS?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The diff looks simple enough that it might get backported in future:
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3145/diffs

But we should let the dust settle and the feature mature and get fully tested in the 45 release first.

Changed in mutter (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Imre Péntek (pentek-imre) wrote :

bug still present in jammy

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Yes the fix is only in Ubuntu 23.10 and later for now.

Revision history for this message
Imre Péntek (pentek-imre) wrote :

will it ever be bacported?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.