5

I'm running the Qt5 application on my raspberry pi and I would like to introduce some kind of a power-saving feature.

I don't use x11 or wayland, because I don't need it, but I use gles2 (OpenGL for Embedded Systems).

I want to use tvservice --off and tvservice --preferred to toggle between turned off / turned on screen.

My problem is that when I call tvservice --preferred the display turns on but the screen is black (no application output is shown).

Question:
How can I turn it on and see the application that was running previously?

Tested:
When I restart the Qt5 application - it's being displayed correctly.

Changing foreground virtual terminal with chvt (as suggested here) does not help.

Changing framebuffer depth to different and back again with fbset -depth 16 ; fbset -depth 32 (I've seen it on some forum, cannot find which) also does not help.

Any ideas?

14

tvservice is not the best to turn off and on the screen.

Much better way to do this (found after a day of searching) is using vcgencmd command (more on this here).

vcgencmd display_power 0 turns off the screen

vcgencmd display_power 1 turns on the screen

This allows the Qt application to be visible on the screen after turning it off and back on.

  • This is perfect! I was looking for something like this for a Pi3.. – WreckeR Mar 8 '18 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.