Uncategorized

HDMI Power Notes

Asked 
Viewed 9 times
0

Main Question: Can my raspberry pi (powered on it’s own) determine if power is being supplied to the monitor (powered by a wall plug)?

I’m trying to determine the power state of the display that is connected to my Raspberry Pi 4.

The following was tried with force_hdmi_hotplug=1 inside /boot/config.txt

By default, I’ve had this option on inside /boot/config.txt because a while ago I was testing this and without force_hdmi_hotplug=1, reconnecting the hdmi cable would not actually turn on the display (the raspberry pi would stay in VGA mode or something).

I have tried using tvservice, but it has not led to any good results. Using tvservice -M (monitor), I found the following results:

  • Disconnecting the display via the HDMI cable from the raspberry pi will yield no events being detected
  • Reconnecting the display via the HDMI cable from the raspberry pi will yield no events being detected

Using tvservice -s (status), I found the following results:

  • state 0xa [HDMI] when connected
  • state 0xa [HDMI] when disconnected

The following was tried with force_hdmi_hotplug=1 NOT INSIDE (disabled) /boot/config.txt

tvservice -M

  • Disconnected the display via the HDMI cable from the raspberry pi will yeild HDMI cable is unplugged.
  • Reconnecting the display via the HDMI cable from the raspberry pi will yield HDMI is attached

tvservice -s

  • Disconnected the display via the HDMI cable from the raspberry pi will yeild state 0x9
  • Disconnected the display via the HDMI cable from the raspberry pi will yeild state 0xa

However, disconnecting the monitor power cable with the HDMI still plugged in will yield the following two events simultaneously:

  • HDMI is unplugged
  • HDMI is attached

tvservice -s will still yield state 0xa and even using xrandr will say that a display is connected. xrandr -display :0 --listmonitors will still list a monitor.

Is what I’m looking for even possible?

  • (1) I don’t understand your question. Do you want to know if the monitor power (eg 200VAC) is switched on? (2) Rpi has it own little 5V power for the HDMI logic circuit. (3) Even HMDI monitor power is NOT switched on, Rpi will still give 5V power to the HDMI logic cct to determine its configuration. In other words, Rpi will check out the mon config even mon has no AC200V power! – tlfong01 12 hours ago   
  • @tlfong01I just read about the 5V power being sent from the RPi! I guess I’m wondering if, from the monitor config, if power is being supplied from a wall. I would like to know if someone has unplugged the power source to the monitor (which is different from the Pi) – Devin 12 hours ago
  • I see what you want, I need to check out the HDMI connector to see if you can do that without messing with any hardware. – tlfong01 12 hours ago   
  • @tlfong01 Thank you! I’ve been reading for a while that the 5V supplied by the Pi to the monitor can return statistics (like what you said), but I can’t find out what kind of statistics are returned other than resolutions/fps/etc. I’m looking for power status along with that info – Devin 12 hours ago
  • this is the first discussion I joined in: raspberrypi.stackexchange.com/questions/99963/…. The TI app notes I commented might be useful. PS the TI link seems broken. Here is a new one: ti.com/lit/an/snva412b/snva412b.pdf. – tlfong01 12 hours ago    
  • @tlfong01 Do you happen to have the PDF handy? The link you provided in that comment does not exist anymore! – Devin 11 hours ago
  • Yes, it is my mistake. The link is in my updated comment above. – tlfong01 11 hours ago   
  • And you might like to read my comments on another HDMI question. raspberrypi.stackexchange.com/questions/101074/… – tlfong01 11 hours ago    
  • And in case you have not read it, this is the schematic showing the Rpi4B HDMI connector: raspberrypi.org/documentation/hardware/raspberrypi/schematics/… – tlfong01 11 hours ago    
  • I see that the Rpi uses I2C to talk to the HDMI. So if Rpi shouts something (Don’t ask me what is “something”, because I don’t know, just wild guessing) to HDMI and gets no reply, then someone has pulled the plug! 🙂 – tlfong01 11 hours ago    
  • @tlfong01 I guess I understand that there is a 5V power supplied to the monitor from the Pi, but after reading the links you gave me I found no information if monitor power state can be determined from the HDMI spec alone. I’m also not very well versed in electronics on this kind of level that we’re getting to. EDIT: I’ll take a look at the I2C information you just commented as well – Devin 11 hours ago
  • (1) Yes so earlier I hinted that it is not a good idea to mess around with the HDMI connector hardware. (2) The I2C method is not easy, because you might need to look into the driver and make changes to the software, But the hardware might explode! (3) If I really need to do it, I will try something like this: open the HDMI monitor chassis, find the 5V/12V power circuit and extract two wires 12V/Ground, or 5V/Ground out to the Rpi side, convert it to 3V3, and let Rpi GPIO to read it. Again, not recommend for newbies, because the monitor also will explode~ 🙂 – tlfong01 11 hours ago   
  • @tlfong01 Yeah I think for my situation this is not possible. Thank you so much for all of the information you gave me! I read this blog post, but it seems too much work for my application. Very interesting stuff indeed, thank you. – Devin 11 hours ago
  • Ah, your I2C HDMI article is good. Have not read it before. Article also warns newbies not to do it. Modifying the kernel (similar to driver) is difficult. Bad thing about driver is even it works one OS version, it might not work next version, so monitor still explodes, only later. I2C over HDMI: blog.koalo.de/2013/11/i2c-over-hdmi.html. Nice to solve problems with you. I usually enjoy solving problems though fail eventually (Like I often got beaten up in squash games, but I still enjoy it every time! 🙂 Cheers. – tlfong01 10 hours ago    Delete

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: