Any way to temporarily cut HDMI signal
Hi,
I am searching for a way to shut my monitor off after X amount of time. Because the raspberry pi does not have standby functionality I was wondering if anyone is familiar with a way to use the existing shutdown script to actually initiate a stop on the video signal over HDMI. Thus allowing my monitor to go into "no signal" mode and then going into standby.
I do believe I would be able to figure out the above, my biggest issue would be how in the world would I be able to wake the machine back up via XBMC remote or a USB peripheral?
Thanks and any help would be greatly appreciated
I am searching for a way to shut my monitor off after X amount of time. Because the raspberry pi does not have standby functionality I was wondering if anyone is familiar with a way to use the existing shutdown script to actually initiate a stop on the video signal over HDMI. Thus allowing my monitor to go into "no signal" mode and then going into standby.
I do believe I would be able to figure out the above, my biggest issue would be how in the world would I be able to wake the machine back up via XBMC remote or a USB peripheral?
Thanks and any help would be greatly appreciated
Re: Any way to temporarily cut HDMI signal
setterm --help
man setterm
to look at
setterm -blank
setterm -powersave
man setterm
to look at
setterm -blank
setterm -powersave
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe
WARNING - some parts of this post may be erroneous YMMV
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe
Re: Any way to temporarily cut HDMI signal
I attempted the following
Not sure where to go from here
Code: Select all
pi@raspbmc:~$ setterm -powersave hsync
setterm: cannot (un)set powersave mode: Invalid argument
Re: Any way to temporarily cut HDMI signal
Maybe this helps:
Power off:
/opt/vc/bin/tvservice -o
Power on:
/opt/vc/bin/tvservice -p && fbset "1920x1080"
Power off:
/opt/vc/bin/tvservice -o
Power on:
/opt/vc/bin/tvservice -p && fbset "1920x1080"
Re: Any way to temporarily cut HDMI signal
Hello terwarf,
It appears I do not have a /opt/vc/bin directory. This must have something to do with using RASPBMC as the OS. Maybe I shall attempt to make a post asking a similar question on there forum.
There is apparently many ways to do this, perhaps RASPBMC just has not included the means to do so.
Thank you to all for the info
Jake
It appears I do not have a /opt/vc/bin directory. This must have something to do with using RASPBMC as the OS. Maybe I shall attempt to make a post asking a similar question on there forum.
There is apparently many ways to do this, perhaps RASPBMC just has not included the means to do so.
Thank you to all for the info
Jake
Re: Any way to temporarily cut HDMI signal
The tvservice binary is part of the official firmware.
You can get it here: https://github.com/raspberrypi/firmware
Direct download link: https://github.com/raspberrypi/firmware/zipball/master
Copying the opt folder from the zip file to /opt should do the trick, imho
Note:
For the fbset command to work i had to do
Hope this helps
You can get it here: https://github.com/raspberrypi/firmware
Direct download link: https://github.com/raspberrypi/firmware/zipball/master
Copying the opt folder from the zip file to /opt should do the trick, imho
Note:
For the fbset command to work i had to do
Code: Select all
sudo su
fbset -s >> /etc/fb.modes
Re: Any way to temporarily cut HDMI signal
Hello all,
I've got the same problem / question as darkapec but on wheezy
I tried terwarf's suggestion:
Power off:
/opt/vc/bin/tvservice -o
-> works for my config: HDMI->HDMI-DVI cable -> FSC Display, goes in power saving mode.
Power on:
/opt/vc/bin/tvservice -p && fbset "1920x1080"
-> Monitor comes up again, but without a screen redraw / re-init so the screen remains blank / black. fbset output: Unknown video mode '1920x1080' , fbset only output: mode "1184x928" ...
I tried several fbset arguments. The best result I got is:, where the resolution settings are from the fbset output, refreshing only the current terminal window.
Are there any more ideas to power save the monitor and awake it with proper desktop as leaved by script / programatically?
Thank you!
I've got the same problem / question as darkapec but on wheezy
I tried terwarf's suggestion:
Power off:
/opt/vc/bin/tvservice -o
-> works for my config: HDMI->HDMI-DVI cable -> FSC Display, goes in power saving mode.
Power on:
/opt/vc/bin/tvservice -p && fbset "1920x1080"
-> Monitor comes up again, but without a screen redraw / re-init so the screen remains blank / black. fbset output: Unknown video mode '1920x1080' , fbset only output: mode "1184x928" ...
I tried several fbset arguments. The best result I got is:
Code: Select all
fbset -xres 1184 -yres928 -depth 16
Are there any more ideas to power save the monitor and awake it with proper desktop as leaved by script / programatically?
Thank you!
Re: Any way to temporarily cut HDMI signal
Sorry, i haven't tested this with x11...Are there any more ideas to power save the monitor and awake it with proper desktop as leaved by script / programatically?
I'm using raspian, so I'm not sure this also works for you, but you may give it a try...
Code: Select all
sudo apt-get install x11-xserver-utils
/opt/vc/bin/tvservice -o
/opt/vc/bin/tvservice -p && fbset "1184x928" && xrefresh
Code: Select all
xrefresh -d :0.0
Re: Any way to temporarily cut HDMI signal
Hello,
I tried the above, however the display does not redraw and stays black (but with backlight on).
Essentially,
turns off the screen as expected, but
only turns on the screen, but it stays black.
DMPS and screen savers are turned off.
Does anybody out here have an idea? I would need a solution to turn off and on the screen completely when using X11, maybe after a certain time has passed by.
At first I thought about using DPMS, but that does not turn off the screen (i.e. backlight) completely.
Regards,
Oliver
I tried the above, however the display does not redraw and stays black (but with backlight on).
Essentially,
Code: Select all
tvservice -o
Code: Select all
tvservice -p && fbset -xres 1280 -yres 1024 -depth 16 && xrefresh -d :0.0
DMPS and screen savers are turned off.
Does anybody out here have an idea? I would need a solution to turn off and on the screen completely when using X11, maybe after a certain time has passed by.
At first I thought about using DPMS, but that does not turn off the screen (i.e. backlight) completely.
Regards,
Oliver
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6332
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Any way to temporarily cut HDMI signal
I believe fbset ignores you if nothing has changed since the last call. So I think you want to deliberately change something then change back. E.g.olberger wrote:only turns on the screen, but it stays black.Code: Select all
tvservice -p && fbset -xres 1280 -yres 1024 -depth 16 && xrefresh -d :0.0
Code: Select all
tvservice -p && fbset -depth 8 && fbset -depth 16 && xrefresh -d :0.0
Re: Any way to temporarily cut HDMI signal
Strange, this works for me...
Do you see at least the CPU-Meter in the lower right when the screen comes back?
This is the case on my box - firing xrefesh then forces x11 to draw the whole screen again to the framebuffer.
When you can't see the CPU-Meter I would mention there is a screensaver active (xrefresh then will just force repainting a black screen), or the display number you gave xrefresh is wrong. You can get the right number from x-terminal with
I would suggest you try the commands single one after each other (not connected with the &&) from a ssh session and post the output here, if any.
Do you see at least the CPU-Meter in the lower right when the screen comes back?
This is the case on my box - firing xrefesh then forces x11 to draw the whole screen again to the framebuffer.
When you can't see the CPU-Meter I would mention there is a screensaver active (xrefresh then will just force repainting a black screen), or the display number you gave xrefresh is wrong. You can get the right number from x-terminal with
Code: Select all
echo $DISPLAY
Re: Any way to temporarily cut HDMI signal
Thank you dom,
this hint is also good for me!
Here is my summary:
This turns my (HDMI) screen of
and this turns the screen on and displays the desktop again
The whole stuff is now fired by a Python script and the screen will be displayed if the GPIO is attached to HIGH:
this hint is also good for me!
Here is my summary:
This turns my (HDMI) screen of
Code: Select all
/opt/vc/bin/tvservice -o
Code: Select all
/opt/vc/bin/tvservice -p
fbset -xres 1184 -yres 928 -depth 16
fbset -depth 8
fbset -depth 16
xrefresh
Code: Select all
import subprocess
import time
import os
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(16, GPIO.IN)
subprocess.Popen('/opt/vc/bin/tvservice -o', shell=True)
while True:
mybutton= GPIO.input(16)
if mybutton== True:
subprocess.Popen('/opt/vc/bin/tvservice -p', shell=True)
subprocess.Popen('fbset -xres 1184 -yres 928 -depth 16', shell=True)
subprocess.Popen('fbset -depth 8', shell=True)
subprocess.Popen('fbset -depth 16', shell=True)
subprocess.Popen('xrefresh', shell=True)
print ("I'm awake!")
time.sleep(30)
print ("Now I go to sleep!")
time.sleep(3)
subprocess.Popen('/opt/vc/bin/tvservice -o', shell=True)
time.sleep(1)
Re: Any way to temporarily cut HDMI signal
Hi,
I tried the following:
From an X Terminal
Logged in via ssh:
Screen goes blank and eventually turns off
Backlight turns on, screen stays black
screen shows CPU load indicator and clock, rest stays black
Display is updated correctly and everything is fine
Now I put it into a script:
That sometimes works fine for the first time if the time , however trying this more than once usually does not work reliably.
In all those cases it does not work, the image stays black after issuing the fbset command
Screensavers and DPMS have been deactivated - if I do not issue tvservice -o, the screen stays on for hours. There is no reaction on Mouse or keyboard.
Typing startx gets the screen up again, everything stays fine if I kill the new X process with Ctrl-C afterwards, but that sounds not like an solution for a script.
I am using a fairly old Eizo Monitor via a HDMI - DVI cable
Any ideas?
Thanks in advance
oliver
I tried the following:
From an X Terminal
Code: Select all
echo $ DISPLAY
:0
Code: Select all
pi@pi ~ $ tvservice -o
Powering off HDMI
Code: Select all
pi@pi ~ $ tvservice -p
Powering on HDMI with preferred settings
Backlight turns on, screen stays black
Code: Select all
pi@pi ~ $ fbset -xres 1280 -yres 1024 -depth 16 -v
Linux Frame Buffer Device Configuration Version 2.1 (23/06/1999)
(C) Copyright 1995-1999 by Geert Uytterhoeven
Opening frame buffer device `/dev/fb0'
Using current video mode from `/dev/fb0'
Setting video mode to `/dev/fb0'
Code: Select all
pi@pi ~ $ xrefresh -d :0
Now I put it into a script:
Code: Select all
#!/bin/sh
tvservice -p
fbset -xres 1280 -yres 1024 -depth 16 -v
xrefresh -d :0
In all those cases it does not work, the image stays black after issuing the fbset command
Screensavers and DPMS have been deactivated - if I do not issue tvservice -o, the screen stays on for hours. There is no reaction on Mouse or keyboard.
Typing startx gets the screen up again, everything stays fine if I kill the new X process with Ctrl-C afterwards, but that sounds not like an solution for a script.
I am using a fairly old Eizo Monitor via a HDMI - DVI cable
Any ideas?
Thanks in advance
oliver
Re: Any way to temporarily cut HDMI signal
Hi all,
thanks,
the workaround with calling fbset two more times seems to work fine with me. I will try the GPIO solution later on - good idea!
Best regards
Oliver
thanks,
the workaround with calling fbset two more times seems to work fine with me. I will try the GPIO solution later on - good idea!
Best regards
Oliver
Re: Any way to temporarily cut HDMI signal
Hey Jago
Anyway to modify the python script to make it wake on USB or via network interaction?
I am still unsure if this situation will work for me as I do not think some of the components you are calling in your python script are available to RASPBMC users.
I have just been hoping the next release of raspbmc will have some kind of standby built in. Most people are not having issues because they are using TV's and just use a sleep timer on their TV. I on the other hand prefer to use my 27" monitor as a TV and there is not a sleep timer option.
So I either need to find a way to cut the power to the monitor after X amount of time or figure out how to get raspbmc to cut the signal to hdmi.
The python script is a great start, but needing to invoke it via ssh is kinda irritating. Any way to swap the raspbmc shutdown script with the custom python script? Then I would just need a way to wake it up via usb.
Anyway to modify the python script to make it wake on USB or via network interaction?
I am still unsure if this situation will work for me as I do not think some of the components you are calling in your python script are available to RASPBMC users.
I have just been hoping the next release of raspbmc will have some kind of standby built in. Most people are not having issues because they are using TV's and just use a sleep timer on their TV. I on the other hand prefer to use my 27" monitor as a TV and there is not a sleep timer option.
So I either need to find a way to cut the power to the monitor after X amount of time or figure out how to get raspbmc to cut the signal to hdmi.
The python script is a great start, but needing to invoke it via ssh is kinda irritating. Any way to swap the raspbmc shutdown script with the custom python script? Then I would just need a way to wake it up via usb.
Re: Any way to temporarily cut HDMI signal
-deleted as problem already solved, sorry
Last edited by terwarf on Thu Aug 23, 2012 5:22 am, edited 1 time in total.
Re: Any way to temporarily cut HDMI signal
As I've written above these are parts of the firmware, which you can get at https://github.com/raspberrypi/firmwaredarkapec wrote: I am still unsure if this situation will work for me as I do not think some of the components you are calling in your python script are available to RASPBMC users.
As my tv uses ~20 Watts of power in standby mode, I've attached an relais to one of the GPIO pins (via transistor to drive the 5volts the relais needs) and can drive it with my x10 usb remote now, cutting the main power of the tv - maybe that's the way to go for you too?darkapec wrote:So I either need to find a way to cut the power to the monitor after X amount of time or figure out how to get raspbmc to cut the signal to hdmi.