Reading a VGA monitor's configuration data with I2C and a PocketBeagle
righto.com
righto.com
HDCP also happens over this interface, so it’s trivial to snoop on the key exchange: https://github.com/ApertureLabsLtd/hdmi-sniff/blob/master/RE...
CEC (control devices via HDMI) happens on a separate channel using a proto also similar to I2C: http://www.quantumdata.com/pdf/CEC_White_Paper.pdf
There are a few good ~cheap CEC adapters for HDMI out there. I’ve used the PulseEight one since they have decent library support plus a CLI. You can also use the HDMI port on a Raspberry Pi to play with CEC: https://github.com/Pulse-Eight/libcec/blob/master/docs/READM...
While the patch was getting merged, I was able to dump the EDID, edit it to be within spec, and then was able to actually flash it BACK to the monitor by using nothing other than this program on github [1], and the HDMI port on a Dell E6430.
I was amazed that was possible to write an EDID from simply connecting to the port, didn't need to open anything up, was able to do it without any special equipment, etc.. I never realized how complicated some of these display protocols can be, but part of it is just i2c, and I guess the hardware is not very restrictive on how that i2c controller can be used outside of display purposes.
Someone with a Raspberry Pi could go around a college campus and wreak havoc if they wanted. Goes to show you that you should not trust any public peripheral, not ever. That's especially important in the age of USB-C and mobile devices where charging and data are put on the same port.
There are probably more fancy things out there that integrate via .prefpane or something, but works good enough for me.
I once used it to play with a set of Melexis IR sensors I'd soldered to the VGA port on a crap video card. It made writing the Arduino code way easier after figuring out all the hard things with Linux. There was even enough power on the VGA pin to run 4 of them!
Really though, it was just exciting to be able to wire some of my own hardware into the computer and write a program to talk to it. Made me feel like I actually own my computer again.
[1] https://www.vesa.org/vesa-standards/
Asks for name, country, and e-mail address, but otherwise immediately redirects to downloadable content directory.
$ edid-decode < /sys/devices/pci0000:00/0000:00:03.0/0000:0f:00.0/drm/card0/card0-HDMI-A-1/edid
Extracted contents:
header: 00 ff ff ff ff ff ff 00
serial number: 00 b3 00 37 00 00 00 00 01 19
... [ followed by more data and the decoded output ] ...
As JFK said, we do these things not because they are easy, but because they are hard :-)
1: Bug 50371 - [BISECTED] HDMI display blank unless VIC set in AVI infoframe
I keep hearing that the Raspberry Pi's peripheral support for things like I2C is pretty bad - is that no longer the case?
It's a pretty easy interface to bit-bang and not too sensitive to the clock line's precision, but it's nice when you can actually use a chip's hardware peripheral as intended.
Bugs like these are not unusual in embedded systems. It is often difficult to fix the hardware and the software will implement some kind of workaround. The web page lists several possible workarounds for this bug.
1: http://www.advamation.com/knowhow/raspberrypi/rpi-i2c-bug.ht...
Seems somehow more "real".
Should have gone into writing drivers but that always seemed so damned tedious. ;/