DIY FPGA-based HDMI ambient lighting
zerocharactersleft.blogspot.com
zerocharactersleft.blogspot.com
1) I get the video signal from the composite output of my cable box (or any video source), which outputs HDMI and composite in parallel. If that weren't the case, I could have used an HDMI splitter and HDMI2Composite converter. I prefer the composite signal, as its not encrypted, and you don't really need to waste processing on an HD resolution signal. The "resolution" of your LEDs around your display doesn't even come close to even an SD video signal.
2) The composite cables run into a USB Video Capture card, which I picked up for pretty cheap on Amazon. The USB card is plugged into a Raspberry Pi, running Raspbian.
3) I got the driver for the video card working on Pi. Then wrote a driver for the LED strip, which communicates over SPI.
4) My main program, which is set to run on powerup, will make the video card sample the video signal as fast as it can. I do some image processing on the capture to average the pixel colors in each of several rectangular areas around the border of the image, each assigned to a corresponding LED. Then I send the SPI signal to drive the LED to that color. The sampling, image processing, and LED driving is plenty fast that the LED "frame rate" is well above perceptible limits.
5) This is all configurable with a config file that accepts parameters for LED layout, how big the area to process for each LED should be, overlapping those areas for smoother color transitions, how many frames to average the colors over (also for smoother transitions), etc.
6) The wiring is the simplest part. Power source, split off to a usb connector to power the Pi, the other line split into power and ground for the LED strip. The strip needs 2 lines for communication as part of the SPI protocol, which are just wired to appropriate GPIO pins on the Pi.
Boom. Done.
I sometimes think of a distinction between the engineering way and the hacker way. Both are good, and the two are related, but they aren't the same. If HN has a purpose in the world it surely is to champion the latter, whose mottos are "gratifying curiosity" and "just because". By "the engineering way" I mean creativity operating under economic or organizational constraints that demand justification and exclude the whimsical. You end up with different projects and products that way.
But I don't think matmann2001 was being critical—just eager to share the cool details of their own ambient lighting setup, which is an excellent thing to do and squarely on the hacker side of this distinction.
There's a balance that every hacker has to find. Sometimes it's good to just get something out the door, sometimes you've invented an excuse to learn technology X. :)
It's much easier to sidestep HDCP altogether, which can be done with a simple AV converter.
I believe these simple lights add a lot, particularly to the experience if you're watching a movie. Thanks for sharing your solution :)
Cheaper? Definitely not
Lower latency? Likely, but the difference in latency would be undetectable
Way Cooler? Yeah, I'll give him that one.
Taking that into account, the difference in power drain for our respective computing resources would be dwarfed by the power requirements for the LEDs, such that the difference is near negligable.
If you have to write a driver, you might want to reconsider your definition of "overkill."
2) SPI is a ridiculously simple protocol. I have a background in embedded systems, so it's really not a lot of effort. Particularly compared to the OP, who deconstructed and intercepted the entire HDMI protocol on an FPGA. I'd consider the effort required for that task as quite a bit more.
For low performance applications, it works perfectly.
That's the "analog hole", and it closed January 1, 2014. No Blu-Ray player manufactured after that date offers analog video output.[1]
Of course, if your source is a Blu-Ray player, the HDMI output will have HDCP encryption, so the approach from the article won't work either. There are some "HDMI splitters" which don't encrypt on the output side, but most splitters now do re-encrypt.
You can download the verilog for a HDCP "overlay" (which, for obvious legal reasons only encrypts HDCP so that a video overlay can be put on a digital image) from: http://kosagi.com/netv_hardware/
This has been presented at http://events.ccc.de/congress/2011/Fahrplan/events/4686.en.h... .
From this code you could create your personal HDCP removing HDMI-splitters using the FPGA module used by the original article.
It makes color and brightness transitions smoother, which makes the overall effect less distracting, and likely less seizure inducing.
Too many single components for my taste.
Having an all-inclusive solution like this one with a dedicated FPGA makes much more sense to me. Unfortunately it seems that a high res solution is never going to work for all use cases due to HDCP, processort speed etc, and it will probably never launch commercially because of Philips' ambilight patents like EP 1379082.
I've been looking for an in-between all-in-one solution which takes HDMI as an input for the past years, but there's no real reasonable solution which I would take.
The best I saw to this date is this: http://www.keiang.de/Content-pid-32.html, but unfortunately it's not publicly available (he didn't release the circuit diagram and the list of electrical components needed, at least the last time I researched the site).
Also, an HD signal as input to the ambient light setup just isn't necessary. The software (or FPGA) is going to average pixel colors around the border to effectively reduce the resolution to match your LED spacing. With an HD signal, you're just spending more processing power/time to filter out and throw away more information.
The article specifically notes that he skipped HDCP support among other features.
PS, it's not obvious but if you email the guy he'll sell you one, also he doesn't ship to the US so don't ask me how I got mine.
Now to build the ultimate LIFE game idler :-)
https://www.kickstarter.com/projects/woodenshark/lightpack-a...