(English version below)
Mir ist aufgefallen, dass immer wenn ich VDR mit softhddevice (pesintta) benutzt habe und danach entweder beendet oder zumindest softhddevice detached habe, dann die automatische Abschaltung des Monitors bei Inaktivität nicht mehr funktioniert und manuell mit "xset dpms on" wieder aktiviert werden muss. Daher habe ich mir mal angeschaut, was softhddevice diesbezüglich so macht. Dabei ist mir aufgefallen, dass DPMS und der Screensaver in der video.c-Funktion VideoExit(void) zwar wieder aktiviert werden, das aber nicht durchschlägt. Ich habe zum Test mal die beiden Kommandos weiter nach hinten geschoben, und damit geht es dann bei mir.
Patch:
- --- video.c.xscreensave-orig 2018-01-03 15:19:49.125733497 +0100
- +++ video.c 2018-01-03 15:20:40.617733300 +0100
- @@ -13786,11 +13786,6 @@
- if (!XlibDisplay) { // no init or failed
- return;
- }
- - //
- - // Reenable screensaver / DPMS.
- - //
- - X11DPMSReenable(Connection);
- - X11SuspendScreenSaver(Connection, 0);
- #ifdef USE_VIDEO_THREAD
- VideoThreadExit();
- @@ -13812,6 +13807,12 @@
- //RandrExit();
- //
- + // Reenable screensaver / DPMS.
- + //
- + X11DPMSReenable(Connection);
- + X11SuspendScreenSaver(Connection, 0);
- +
- + //
- // X11/xcb cleanup
- //
- if (VideoWindow != XCB_NONE) {
Ich muss dazu sagen, dass ich mir auch in den Funktionen VaapiDisplayFrame(void) und entsprechend VdpauDisplayFrame(void) nicht sicher bin, um nicht X11SuspendScreenSaver dort genau falsch herum ausgeführt werden abhängig von "filled". Das muss ich noch beobachten, bzw. vielleicht kennt sich hier ja jemand aus. X11DPMSDisable/X11DPMSReenable ist dort jedenfalls richtig genutzt. Nur, warum stellt man DPMS wieder auf ein, aber suspendiert den Screensaver. Müsste es nicht so sein: DPMS ein, Screensaver ein? Kann sich den Code mal jemand von den Experten kurz anschauen?
English:
I noticed that whenever I have used VDR with softhddevice (pensintta branch) and then stopped VDR (or at least detached softhddevice), the automatic blanking of my screen did not work anymore and had to be switched on manually with "xset dpms on". Therefore I checked in softhddevice why this is the case and found code to re-activate DPMS in video.c in VideoExit(void). However, for some reason this did not really have an effect. As a test, I tried moving the two commands (to re-enable DPMS and to unsuspend the screensaver) to a place further down in the same function, and now it works for me fine. Please see the patch above and (@pesintta or rofafor ) please consider checking it in if it looks fine for you.
Note: I also looked into the functions VaapiDisplayFrame(void) and VdpauDisplayFrame(void) to see how they enable/disable DPMS depending on if "filled" is set or not (i.e. if the selected channel is a TV channel [filled==true] or a radio channel [filled==false]". It does the right thing for DPMS, but I am really unsure about the screensaver. If filled==true (i.e. radio), it re-enables DPMS (correct), but I believe it suspends the screensaver if I understand the code right!? Does this make sense? Also if it's a TV channel, it switches DPMS off (correct), but unsuspends the screensaver (???). I am monitoring this now to see if the screensaver really kicks in, but it would be good if somebody could review this code.