top | item 9423680

DIY FPGA-based HDMI ambient lighting

124 points| drxzcl | 11 years ago |zerocharactersleft.blogspot.com

48 comments

order
[+] matmann2001|11 years ago|reply
Impressive but overkill. I have my own ambient lighting setup. It runs on a Raspberry Pi and works like this.

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.

[+] mmastrac|11 years ago|reply
Overkill is the best part of personal projects. :) There's nobody saying that technical debt has to wait or that the solution in there is "good enough". It's the chance for a developer to delve deep and solve something in an interesting way, no matter how long it takes.
[+] Animats|11 years ago|reply
"which outputs HDMI and composite in parallel."

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.

[1] http://forum.blu-ray.com/showthread.php?t=230112

[+] derFunk|11 years ago|reply
Your setup is what I'd call an overkill! ;) You probably got this: http://lightberry.eu/ ?

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).

[+] CountSessine|11 years ago|reply
I've watched your video and his. I can see a good 200ms latency in yours. My eyes are just sensitive perhaps? I can't see any latency in his.
[+] neya|11 years ago|reply
Sounds interesting. Do you think we can have a look at the source code as to how you achieve this? Till then, I guess the next best option we have is the OP's link, if I wanted to build something like this.

I believe these simple lights add a lot, particularly to the experience if you're watching a movie. Thanks for sharing your solution :)

[+] bigiain|11 years ago|reply
Sounds nice - can you share any links to video of it in action? I'm very curious...
[+] gugagore|11 years ago|reply
did you ever measure the latency? If a scene is strobing, you might notice a considerable phase offset that would probably be jarring. It would be nice to see this performance measure.
[+] amalag|11 years ago|reply
Sounds awesome. I think a lot of people like me who cannot do that from scratch would love a DIY version with plans.
[+] signalnine|11 years ago|reply
Do you have the code for this up anywhere?
[+] GeorgeHahn|11 years ago|reply
This is more efficient, cheaper, and has lower latency than your solution. It's also way cooler.
[+] distantsounds|11 years ago|reply
>Then wrote a driver for the LED strip, which communicates over SPI.

If you have to write a driver, you might want to reconsider your definition of "overkill."

[+] nsxwolf|11 years ago|reply
I thought HDMI was encrypted to prevent this sort of thing? If you can do this with an FPGA what stops you from designing one that will copy a Blu ray?
[+] fragmede|11 years ago|reply
It's just easier to rip a Bluray in software. Playing back a Bluray and ripping the video is probably going to be real time, while Bluray's will rip faster than that.
[+] white-flame|11 years ago|reply
No, HDMI offers encryption, called HDCP. Note that HDCP also existed on DVI before HDMI rolled around.

The article specifically notes that he skipped HDCP support among other features.

[+] nickysielicki|11 years ago|reply
I can't tell if it would be distracting or awesome.
[+] white-flame|11 years ago|reply
I find it strange that it's apparently desirable both to eliminate any sort of light glow/bleed on the panel itself, and manually add glow bleeding out the sides. :-P
[+] rando3826|11 years ago|reply
Agree. Would love to hear from someone who uses this while working at their computer, and someone who uses it for viewing media on the tv.
[+] eltoozero|11 years ago|reply
It's not much less hassle to go the DIY route, I've been busy polishing off building one of these: http://www.keiang.de/Content-pid-32.html

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.

[+] specto|11 years ago|reply
How did you get yours?
[+] ChuckMcM|11 years ago|reply
Damn, now I am going to own another FPGA board. That looks like a pretty fun project.

Now to build the ultimate LIFE game idler :-)

[+] slowmotiony|11 years ago|reply
This is amazing, but how would a person that doesn't want to hack around too much just buy something like this? Like a starter kit, with some device and a led strip?
[+] huuu|11 years ago|reply
Place another cheap panel behind the tv facing the wall. Flip horizontal and your done.
[+] contergan|11 years ago|reply
Just buy a Philips Ambilight TV.