Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inhibiting Screensaver whilst playing files? #58

Closed
Chromace opened this issue Sep 23, 2016 · 24 comments
Closed

Inhibiting Screensaver whilst playing files? #58

Chromace opened this issue Sep 23, 2016 · 24 comments
Labels

Comments

@Chromace
Copy link

Usually, QMPlay2 will prevent the screen from turning off whilst it is playing files (video/URL + audio). However, this is currently not the case - after the designated screen switch-off time, the screen powers off, with the video/audio still playing.

@zaps166 zaps166 added the bug label Sep 23, 2016
@zaps166
Copy link
Owner

zaps166 commented Sep 23, 2016

Probably because of this: 52df396

Tested only on xset s 1 which sets screensaver to 1 second. With this works properly for me. Could you describe your screensaver and/or power management settings, your desktop environment and what have you done in QMPlay2 when screensaver starts when it shouldn't?

@Chromace
Copy link
Author

Chromace commented Sep 23, 2016

I'll do my best. I'm using the Plasma Desktop on Arch, with the 'screen energy saving' option turned on to switch off the screen after 10 minutes on AC power and 5 minutes on battery power.

Experimentally, I toggled the switch off to 1 minute as to test QMPlay2's screensaver inhibiting ability, and played a YouTube video which lasted 10 minutes. The screen turned blank after the minute was up. This also occured for full-screen audio (with album art), which inhibited screen blanking in the past (thanks for that again ^^).

For the screen to turn blank, all I have to do is wait for the designated blank time - I don't touch the computer.

(Apologies - I wasn't sure what the 'close and comment' option did ^^;)

@Chromace Chromace reopened this Sep 23, 2016
@zaps166
Copy link
Owner

zaps166 commented Sep 23, 2016

Thanks, I'll try on Plasma Desktop soon.

One more thing, could you execute xset s 1 in terminal - this will enable screensaver after one second. It is blocked by QMPlay2 for me properly (xset s 0 to disable screensaver).

@Chromace
Copy link
Author

Chromace commented Sep 23, 2016

Enabling the screensaver with xset (before + after disabling Plasma's screen blanking) results in the screensaver being triggered after one second even whilst playing videos or full-screen audio. QMPlay2 does not appear to block the screensaver.

@zaps166
Copy link
Owner

zaps166 commented Sep 23, 2016

Thanks, but weird 😄
I assume that you have Qt 5.7.0, QMPlay2 uses Qt 5 and you open QMPlay2 and play YouTube video, right?

@Chromace
Copy link
Author

Yes. I've also tested it with full-screen audio files as well as local video files - same results.

@zaps166
Copy link
Owner

zaps166 commented Sep 23, 2016

Thanks! If I won't able to check what's wrong, so I'll send you something to test, OK?

@Chromace
Copy link
Author

Sure! :)

@zaps166
Copy link
Owner

zaps166 commented Sep 23, 2016

xset s 1 on KDE 5 - properly blocked (you must set this before starting playback)
Screensaver from KDE 5 power management - not blocked

@Chromace
Copy link
Author

Apologies - on trying again properly, I have the same results as you do.

@zaps166
Copy link
Owner

zaps166 commented Sep 23, 2016

I don't want to use XResetScreenSaver() again, because it is bad and causes not smooth playback on some drivers (OpenGL is not smooth on entire X session, e.g. Intel+OpenGL Compositor+VSync).

Maybe KDE screen saver can't be disabled using XSetScreenSaver() or I'm using in incorrectly...

@zaps166
Copy link
Owner

zaps166 commented Sep 23, 2016

Try also:

xset -dpms
xset s off

and later enable again:

xset dpms
xset s on

Edit: Without QMPlay2 :)

@Chromace
Copy link
Author

Sure. What was the expected results?

With 'xset -dpms && xset s off', and Plasma power management turned on, the screen blanks even with full-screen audio files. However, video files work fine.

The computer does automatically suspend itself however, regardless of whether or not the screensaver is inhibited.

@zaps166
Copy link
Owner

zaps166 commented Sep 24, 2016

the screen blanks even with full-screen audio files. However, video files work fine.

Full-screen and video playback should have the same result. Please try without QMPlay2 (only commands in terminal), because it might override something, but I think that it won't work properly.

@zaps166
Copy link
Owner

zaps166 commented Sep 24, 2016

Maybe I'll use command-line DBus for common desktop sessions, it should work.

@Chromace
Copy link
Author

I've found that QMPlay2 does inhibit audio files. Interestingly enough, the screensaver appears for a second or two, then goes away.

@zaps166
Copy link
Owner

zaps166 commented Sep 24, 2016

the screensaver appears for a second or two

Exactly, event with xdg-screensaver suspend {winid} or xdg-screensaver reset in the loop doesn't work properly (the script uses dbus inside). Maybe it is also KDE bug after a recent update?

Could you try QMPlay2 16.09.04 for both: full-screen audio and next for video playback?

@Chromace
Copy link
Author

Sure. Both full-screen audio and video playback in 16.09.04 inhibit the screensaver (1 minute threshold).

@zaps166
Copy link
Owner

zaps166 commented Sep 24, 2016

Thanks, but can it also inhibit session lock (16.09.04)?

@Chromace
Copy link
Author

Yes. Session locking and suspending is inhibited in 16.09.04.

@zaps166
Copy link
Owner

zaps166 commented Sep 24, 2016

Ok, so the best solution is to reset screensaver in a timer like in previous QMPlay2 version, bu I'll do it better than before.

@zaps166
Copy link
Owner

zaps166 commented Sep 24, 2016

Using DBus and other APIs (depends on Desktop Environment) is not good for me 😄

@zaps166
Copy link
Owner

zaps166 commented Sep 24, 2016

Thanks for the bug report!

Correct behavior for screen saver with timeout >= 30 sec:

  • Full-screen mode should always inhibit during video/audio playback.
  • Windowed mode should inhibit only non-paused video playback.

@Chromace
Copy link
Author

Thank-you! The screen-saver is inhibited :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants