jonnydmb
Posts: 3
Joined: Sun Apr 13, 2014 7:12 pm

HDMI output tvservice -p results in blank screen

Sun Apr 13, 2014 7:42 pm

Sorry, I'm new to all this - spent a few hours searching google as well as the forums here...

I'm trying to switch the screen connected to the Pi's HDMI port on and off via a python script.

tvservice -o works fine - the screen goes off.
tvservoce -p switches the screen back on, but it remains blank. The backlight goes on, but no display.

if I execute 'startx' from an SSH terminal (on a different computer) and then hit 'ctrl-x' the display comes to life...

How do I get this to work in the my python script?

I'm trying to replicate this tutorial:
https://github.com/samuelclay/Raspberry-Pi-Photo-Frame

... everything works except for switching the screen on and off...


Any help is greatly appreciated!


Best regards,
Andrew

jonnydmb
Posts: 3
Joined: Sun Apr 13, 2014 7:12 pm

Re: HDMI output tvservice -p results in blank screen

Thu May 01, 2014 11:27 am

... anyone have an idea on what could be going on here? Sadly, I'm still stuck! :-(

User avatar
DougieLawson
Posts: 41773
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: HDMI output tvservice -p results in blank screen

Thu May 01, 2014 11:36 am

Languages using left-hand whitespace for syntax are ridiculous

DMs sent on Twitter/LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

pibaldhorse
Posts: 1
Joined: Sun Nov 30, 2014 9:21 pm

Re: HDMI output tvservice -p results in blank screen

Sun Nov 30, 2014 9:42 pm

Novice here,
From what I read the blank screen after HDMI come back on seems to have something to do with the frame buffer getting stuck after tvservice -p turns the HDMI port back to the preferred HDMI settings.

Somehow CHANGING a setting using the fbset program will get the screen displaying content once again.

I changed my monitor_off.sh script to
fbset -accel false
tvservice -0

I changed my monitor_on.sh script to
tvservice -p
fbset -accel true

Thus before each time the port is turned off text acceleration in hardware is turned off and after the port is turned on the acceleration is turned on. I chose this setting to change because it seemed trivial.

geraint123
Posts: 1
Joined: Sat May 02, 2020 1:16 pm

Re: HDMI output tvservice -p results in blank screen

Sat May 02, 2020 1:24 pm

This worked for me thanks!

Or another way is to set the current foreground virtual terminal to another one and then change it back. (I have no idea if this is accurate, but in my head this is like alt-tab and alt-tab back again).

Code: Select all

fgconsole
gives you the current number - let's say it's 7

Code: Select all

chvt 1
chvt 7
And it's back!
Full script (not mine) here: https://gist.github.com/AGWA/9874925

The other thing is, for me this had to be run with sudo otherwise I got
Couldn't get a file descriptor referring to the console

audas
Posts: 41
Joined: Tue Oct 01, 2019 11:11 pm

Re: HDMI output tvservice -p results in blank screen

Mon Jun 15, 2020 10:24 pm

This is the ONLY thing which worked for me with dual screens running.

You can NOT USE CEC-HDMI with second HDMI port which I think is a disaster but apparrantly not enough people use the second HDMI port (so why bother having it ?).


There is NO WAY - literally no way at all - to turn off the second HDMI screen - this is just so bad.

stubright
Posts: 152
Joined: Sat Dec 24, 2011 11:12 pm

Re: HDMI output tvservice -p results in blank screen

Mon Jun 15, 2020 10:52 pm

audas wrote:
Mon Jun 15, 2020 10:24 pm
There is NO WAY - literally no way at all - to turn off the second HDMI screen - this is just so bad.
Some modern TVs allow for IP control, for example
Sony
https://www.npmjs.com/package/sony-bravia-tv-remote
LG
https://github.com/klattimer/LGWebOSRemote
I haven't tried them but I don't see any reason it wouldn't work.

audas
Posts: 41
Joined: Tue Oct 01, 2019 11:11 pm

Re: HDMI output tvservice -p results in blank screen

Tue Jun 16, 2020 1:22 am

This is interesting thanks so much.
I am looking to maybe try with some sort of USB infrared ? I have no idea just free balling.
There MUST be some sort of solution to allow us to control things connected to the second HDMI port.

It really is beyond crazy that it has no control because no one wants to use it. This is the sort of thing which affects things long term it really is.

Raspberry pi - 3,000 units - and only a small percentage want HDMI over the second port. I'm looking to purchase 3,000 units myself - but I wont without HDMI over the second port.

Crazy business ideas. Already looking to move to Intel for my start up on this one issue decided by engineers who think the only thing people use Pi for is Kodi.

User avatar
DougieLawson
Posts: 41773
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: HDMI output tvservice -p results in blank screen

Tue Jun 16, 2020 6:58 am

audas wrote:
Mon Jun 15, 2020 10:24 pm
This is the ONLY thing which worked for me with dual screens running.

You can NOT USE CEC-HDMI with second HDMI port which I think is a disaster but apparrantly not enough people use the second HDMI port (so why bother having it ?).


There is NO WAY - literally no way at all - to turn off the second HDMI screen - this is just so bad.
What does tvservice -l give you?
What does tvservice -v 0 -p do?
What does tvservice -v 1 -p do?
What does tvservice -v 2 -p do?

Sorry I don't have a Pi4 but those options were added 15 months ago to support multiple devices.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on Twitter/LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

audas
Posts: 41
Joined: Tue Oct 01, 2019 11:11 pm

Re: HDMI output tvservice -p results in blank screen

Fri Nov 06, 2020 4:00 am

Thanks for your reply - sorry for taking so long - I will take at look and get back to you.

Return to “Troubleshooting”