[vlc-devel] [PATCH] Add dpms module to switch it off while playing

Olivier Brunel jjk at jjacky.com
Fri Oct 25 22:10:00 CEST 2013


On 10/25/13 21:42, Rémi Denis-Courmont wrote:
> Le vendredi 25 octobre 2013 21:01:06 Olivier Brunel a écrit :
>> On 10/25/13 20:51, Rémi Denis-Courmont wrote:
>>>    Hello,
>>>
>>> The DPMS extension of X11 is meant for the desktop power management
>>> component to use, not for normal applications. Changing DPMS settings via
>>> xset, Xlib or XCB would clobber the desktop settings, which is obviously
>>> *not* acceptable.
>>>
>>> Normally, the desktop should automatically disarm and rearm DPMS when the
>>> screensaver is inhibited and uninhibited respectively. If it does not,
>>> then it is a the bug in the desktop environment. There are no ways to fix
>>> this problem in VLC for lack of a proper API.
>>
>> Well, as I said the right thing to do would have been to call
>> xdg-screensaver,
> 
> That is what VLC already does - if D-Bus probing fails. And better yet, LibVLC 
> also does it; it does not depend on the VLC playlist.

Right, but VLC also keeps things suspended while paused, which as I said
was my main motivation for writing this.
When e.g. I pause something and go AFK for some time, I expect
DPMS/screensaver to be back on and eventually quick in. Otherwise you
could as well suspend things on startup & until VLC exits... :p

> 
>> but for that I would have needed to send it the window
>> ID, which I don't know how to get from VLC.
> 
> That is not true. xdg-screensaver has two modes. Only one of them, 
> suspend/resume, requires a window ID. The reset mode does not, and that is 

Yeah, that's what I meant: to use suspend/resume I'd have needed a
window ID.

> what VLC uses. In fact, reset turns out to be more reliable as suspend/resume 
> had a propensity to leave dangling processes around.

Possible, but as as Rafaël said - and as I experienced - that doesn't
prevent monitors from turning off, so not really a perfect solution.

> 
>> And since (in my specific setup) that call would pretty much call xset,
> 
> Your specific setup is not the setup of other people. This patch is not 
> acceptable as is and that is the end of it.

Of course not, I don't deny that & never expected the patch to be merged
as is, but surely it can be discussed/improved...

> 
>> I did that directly. If the window ID can be obtained, calling
>> xdg-screensaver suspend/resume would be a better solution of course.
> 
> The only theoretical advantage of suspend/resume over reset is enabling xdg-
> screensaver to keep the D-Bus connection open (which some screensavers 
> require). But since xdg-screensaver is so far a shell script, that advantage 
> remains wholly theoretical.
> 
> On the other hand, reset has the advantage of not depending on xprop, not 
> requiring a persistent process and not being tied to X11.
> 




More information about the vlc-devel mailing list