
DIY FPGA-based HDMI ambient lighting - drxzcl
http://zerocharactersleft.blogspot.com/2015/04/diy-fpga-based-hdmi-ambient-lighting.html
======
matmann2001
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
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.

~~~
dang
You're right. And the paths that creativity follows in the unconstrained case
are important. Sometimes they lead to dead ends, and sometimes to new things
that never would have gotten started otherwise.

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.

~~~
matmann2001
You captured my sentiments well. I found OP's project extremely impressive and
I never meant to detract from the hard work he put into it. When I was
designing my own system, doing HDMI decoding on an FPGA was an option I
considered. But HDCP (a from of DRM encryption on HDMI signals) was the deal
breaker. Although there has been some recent research on MITM attacks to break
HDCP, it's currently beyond my budget and patience.

It's much easier to sidestep HDCP altogether, which can be done with a simple
AV converter.

------
nsxwolf
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?

~~~
white-flame
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.

~~~
mikeash
And just to clarify, "offers encryption" means it's optional. The sender can
require HDCP if it wishes, but it can also transmit plain unencrypted data.
Some devices will work either way, but restrict what they do without HDCP.
(For example, iTunes on a Mac won't play DRM'd videos if a non-HDCP connection
is present.) Presumably whatever this guy is using for his video source
doesn't require HDCP.

------
nickysielicki
I can't tell if it would be distracting or awesome.

~~~
AceJohnny2
Awesome. It perceptually extends the image on the screen. Some companies have
products based on it:

[https://www.google.com/search?q=philips+ambilight&tbm=isch](https://www.google.com/search?q=philips+ambilight&tbm=isch)

[http://en.wikipedia.org/wiki/Ambilight](http://en.wikipedia.org/wiki/Ambilight)

------
eltoozero
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](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
How did you get yours?

------
ChuckMcM
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 :-)

------
luminositymen
have you seen this one: [https://www.indiegogo.com/projects/ambivision-
standalone-amb...](https://www.indiegogo.com/projects/ambivision-standalone-
ambient-lighting-device/x/8427436)

------
slowmotiony
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?

~~~
ultrafez
Have a look at this: [http://lightpack.tv/](http://lightpack.tv/)

------
joering2
If it's not yet, this should be a Kickstarter project. $10 per pop and off you
go to raise $1MM!

~~~
WatchDog
It was and it raised 500k.

[https://www.kickstarter.com/projects/woodenshark/lightpack-a...](https://www.kickstarter.com/projects/woodenshark/lightpack-
ambient-backlight-for-your-displays/description)

