Therefore, I can use "tvservice -o" to disable HDMI on the raspberry Pi and "tvservice -p" to turn it on. After turning it back on, I probably need to do "fbset -depth 8 & fbset -depth 16" to re-enable the frame buffer, and then force X11 redrawing.
My question is: how do I do this in C? I have an X11 application and I can control X11 redrawing without problems, but how do I disable / enable HDMI in C again and how to enable the frame buffer again after re-enabling HDMI?
To give the background, I have a mute application that works as a kind of media server, managed by an Android application. Currently, I have finally disabled HDMI shutdown after a timeout. However, to save energy, I would like to disable HDMI when the application is not in use, then turn it on and show the RPi application on the screen using libcec to determine when the TV uses the RPi HDMI connection to turn on HDMI and off.
source
share