Overclock.net banner

DIY RGB AmbiLight

81K views 233 replies 39 participants last post by  renearts 
#1 ·
I have been looking a bit into how to make these things. It really started with mr. one asking what it would take to make one of these.

It has to work with both games and movies, so my first thought was that it would be simple, just do some DirectX screen captures a bit of processing then hook up some RGB LEDs via USB and it's all good. But unfortunately it's pretty slow to capture the front surface buffer and it's slow to copy surface data from GPU memory to system memory, so it would effect frame rate. Also I ran into all sorts of problems with games on different DirectX versions.

I thought since Fraps works well in capturing the screen it would be straight forward. So I had a closer look at how Fraps actually works, and I'm a bit shocked
weirdsmiley.gif
, it's really nasty
eek.gif
, it injects itself into pretty much every process on the machine to check for when a D3D DLL is loaded and then hooks onto the rendering events. I'm scared of running Fraps now, although I don't think it's every caused me any issues, but it could crash everything.

I did have a go at doing it the Fraps way, but less aggressive and only inject into a specific process (I used Far Cry 3 for testing), then hook into the End Scene event. Kind of works, but not very reliable and it still has impact on FPS performance.

Now I'm considering totally abandoning this approach, unless we got some DirectX experts who knows a much better way of doing it (I'm really not and expert on DirectX, I only know just enough to be dangerous
ninja.gif
)

Anyway, this is the kind of effect I'm after, just bigger and better with support for multiple monitors etc
biggrin.gif
(Without too much performance penalty and not having to buy a Phillips TV)



There are quite a lot of DIY projects out there, but they all seem to suffer from limitations (see bottom of wiki page for links)

http://en.wikipedia.org/wiki/Ambilight

I'm considering doing something totally different. Instead of capturing the screen I would hook into the signal directly, but that it not so simple with high speed DVI, HDMI and DP digital signals, I do have a few ideas though.

Let me know if anyone got some good ideas, maybe I'm trying to solve a problem that has already been solved, that wouldn't be the first time
biggrin.gif
 
See less See more
1 5
#2 ·
I have been thinking about something like this:



Not sure if I'll ever build this, but I'll do some research and experiments and add them to this thread.

If anyone already got a working AmbiLight running on their PC, I'd be very happy to hear about experience with it.
 
#3 ·
i had read some , and what i found is easiest way to do is using ardruino
smile.gif
one guy from tussia sells some assembled pieces and suggesting free software something like boblight
smile.gif
 
#4 ·
Quote:
Originally Posted by mr one View Post

i had read some , and what i found is easiest way to do is using ardruino
smile.gif
one guy from tussia sells some assembled pieces and suggesting free software something like boblight
smile.gif
I had a look at this one http://code.google.com/p/lightpack/, it's probably the same one. But, without knowing for sure, I do believe it suffers from the same limitations as it's code based screen capture. The easy part is controlling the LEDs, the hard part is capturing the screen image without impacting performance. I know I would not use it if it cuts 20-50% of my FPS in games.
smile.gif
 
#5 ·
I have a lightpack system at home, works pretty good for the most part.

There are a few issues though. Many games will not work with it unless in windowed mode, not sure why. Window media center does not work with it either due to some block wmc has for recording on screen content. The software basically take snapshots of little squares (you can place the squares where you want them) then projects that color onto the LED.

Here are some pictures of my lightpack system.



Here I installed it onto the back of a laptop to test the system out.

 
#6 ·
Quote:
Originally Posted by ejohnson View Post

I have a lightpack system at home, works pretty good for the most part.
There are a few issues though. Many games will not work with it unless in windowed mode, not sure why. Window media center does not work with it either due to some block wmc has for recording on screen content. The software basically take snapshots of little squares (you can place the squares where you want them) then projects that color onto the LED.
Here are some pictures of my lightpack system.

Here I installed it onto the back of a laptop to test the system out.
Looks interesting, and whats more interesting is that it work when games in windowed mode
smile.gif
 
#8 ·
Quote:
Originally Posted by ejohnson View Post

I have a lightpack system at home, works pretty good for the most part.
There are a few issues though. Many games will not work with it unless in windowed mode, not sure why. Window media center does not work with it either due to some block wmc has for recording on screen content. The software basically take snapshots of little squares (you can place the squares where you want them) then projects that color onto the LED.
Thanks, good to hear some real experience with that system. I also tried doing the screen capture, some details in the first post, but it's really hard to cover everything. Especially games running full screen, not even considering multiple monitors. When you run them in windowed mode it's simpler to capture. For it to work perfectly I guess it would have to deal with DirectX, OpenGL and GDI.

It looks like your system got 10 LEDs? is that enough for a good effect? I guess that depends on screen size
smile.gif
 
#9 ·
It worked well on a 21 inch lcd, I have not tried it on anything bigger yet though. I have a triple screen setup, but have not had time to play with it due to work, baby, and a failed motherboard.

As soon as I can get everything back up and running and get some time I will hook up all the LEDs to the triple screen and take a video.

Whats also nice with the lightpack software is that it can interface with alienwares LED system to display the on screen stuff onto the keyboard lights.
 
#10 ·
Good timing on this one. I am currently rebuilding mine with some newer components. I run a pretty simple setup with a screen capture written in processing. The code is from the Adalight project. I've delved into lightpack and boblight and honestly didn't see any performance increases. Then again I didn't notice any performance decreases either while running the system.

The physical system is pretty simple just LED strands with WS2801 controllers with an arduino setup. It pushes 60 LEDs in total. I am looking at what it would take to move to a denser LED strand (60/m instead of 30/m) but would need to move to something more powerful than the arduino platform. There are also some issues with multiple screens and how to deal with that. Here is a video of my setup running from awhile back.

I'd love to see what you come up with on the software side. I've been trying to get my hands on a used phillips ambilight pc system and take it apart to see what it is made of. Not much luck with that so far.
 
#11 ·
Quote:
Originally Posted by Kylepdalton View Post

Good timing on this one. I am currently rebuilding mine with some newer components. I run a pretty simple setup with a screen capture written in processing. The code is from the Adalight project. I've delved into lightpack and boblight and honestly didn't see any performance increases. Then again I didn't notice any performance decreases either while running the system.
The physical system is pretty simple just LED strands with WS2801 controllers with an arduino setup. It pushes 60 LEDs in total. I am looking at what it would take to move to a denser LED strand (60/m instead of 30/m) but would need to move to something more powerful than the arduino platform. There are also some issues with multiple screens and how to deal with that. Here is a video of my setup running from awhile back.
I'd love to see what you come up with on the software side. I've been trying to get my hands on a used phillips ambilight pc system and take it apart to see what it is made of. Not much luck with that so far.
Thanks, how compatible is Processing with games, video etc in non windowed mode?

Yeah, the WS2801 RGB LED strips do make life a lot easier
smile.gif
I would hate it if I had to solder one of those little controllers for each LED myself. Alternatively MAX7313 can be used, it will do 64 LEDs with individual intensity (or ~20 RGB LEDs) but it will require a lot more wires.

The Philips PC system does not look that great, it looks more like a scaled down version:



I think the speaker lights would get annoying after some time, but still, it would be interesting to know what approach they are using to make it work.
 
#12 ·
Quote:
Originally Posted by jvjessen View Post

Thanks, how compatible is Processing with games, video etc in non windowed mode?
Yeah, the WS2801 RGB LED strips do make life a lot easier
smile.gif
I would hate it if I had to solder one of those little controllers for each LED myself. Alternatively MAX7313 can be used, it will do 64 LEDs with individual intensity (or ~20 RGB LEDs) but it will require a lot more wires.
The Philips PC system does not look that great, it looks more like a scaled down version:

I think the speaker lights would get annoying after some time, but still, it would be interesting to know what approach they are using to make it work.
From what I remember with my setup I had no problems with any video from vlc, wmc, itunes, or zune. Didn't matter if it was full screen or windowed. For games it is something with different versions of Directx. I want to say that DX9 and 10 games worked fine and some DX11 games worked fine. I'm not that much of a gamer really though so I perhaps I got lucky with my selections.

I would plug it in and do some tests for you but I moved a few weeks ago and in my infinite wisdom connected a 12v power supply to the LED strands frying every third controller.

I've been meaning to look into the code and see what exactly it is doing but haven't had much time to do it. You do take a slight performance hit with screen based capturing but it isn't much. I was running a 965 at 3.8 Ghz and a 6950 and it might have added 5% more workload to the cpu. It really came down to your sampling. If the sample squares are larger then it would take longer to average the pixel values, if they were smaller but you had a lot of them it was more difficult. and how often you want to take a sample. In your first post you mentioned the frame buffer for the system being a potential problem. It is a slight problem but not a big one. I set mine up to sample around 2 times a second but the displayed value was calculated from an average of the last 5 captures. For me if the response was to high it was distracting.
 
#13 ·
Quote:
Originally Posted by Kylepdalton View Post

From what I remember with my setup I had no problems with any video from vlc, wmc, itunes, or zune. Didn't matter if it was full screen or windowed. For games it is something with different versions of Directx. I want to say that DX9 and 10 games worked fine and some DX11 games worked fine. I'm not that much of a gamer really though so I perhaps I got lucky with my selections.
I would plug it in and do some tests for you but I moved a few weeks ago and in my infinite wisdom connected a 12v power supply to the LED strands frying every third controller.
I've been meaning to look into the code and see what exactly it is doing but haven't had much time to do it. You do take a slight performance hit with screen based capturing but it isn't much. I was running a 965 at 3.8 Ghz and a 6950 and it might have added 5% more workload to the cpu. It really came down to your sampling. If the sample squares are larger then it would take longer to average the pixel values, if they were smaller but you had a lot of them it was more difficult. and how often you want to take a sample. In your first post you mentioned the frame buffer for the system being a potential problem. It is a slight problem but not a big one. I set mine up to sample around 2 times a second but the displayed value was calculated from an average of the last 5 captures. For me if the response was to high it was distracting.
Thanks, yeah it's a lot easier if you don't care too much about games running ultra smoothly, during my experiments Video was no problem, but games running eg 60 FPS would have a slow frame each time I sampled, so in smooth scrolling games like e.g. Diablo 3, I would notice it. .. I think averaging would be fastest using the Intel IPP libraries unless it can be done by the GPU or external hardware.

No need to hook it up, but thanks for the offer
smile.gif
.. I'm mostly interested in hearing peoples experience with various systems to get an idea what works and what doesn't. It's interesting that you prefer a slow refresh with many averages, I guess it gets too distracting otherwise, or maybe it's got to do with the size of the area used for averaging.

You should be able to get some new LEDs, the ws2801 based 60 LEDs/m are not that expensive, they even got RGB LEDs with integrated ws2801 now, as long as the code in your hardware supports it, it should not be a problem updating a few meters of those. It's just using the SPI protocol, very simple.
 
#14 ·
Honestly I don't think I've seen any WS2801 60/m strands. Haven't looked very hard either though. I've been warned by a couple people with the Adalight program that the Arduino method will suffer somewhat with the number I am thinking of using. I was looking 6 meters total for the back of my TV so 360 individual lights. It probably isn't a limitation of the Arduino but more so the inefficient coding. The other question I just thought of is whether or not my Zigbees can keep up with it as well. Just something else to test when I get back to working on it.

As far as the refresh rate it may just be personal preference. I take a larger sample area with multiple averaged samples so it doesn't look like fireworks in the background or just that the scene is being projected onto the wall behind. The color changes occur quickly but intensity doesn't. In the end that is simple stuff to change around.
 
#15 ·
Quote:
Originally Posted by Kylepdalton View Post

Honestly I don't think I've seen any WS2801 60/m strands. Haven't looked very hard either though. I've been warned by a couple people with the Adalight program that the Arduino method will suffer somewhat with the number I am thinking of using. I was looking 6 meters total for the back of my TV so 360 individual lights. It probably isn't a limitation of the Arduino but more so the inefficient coding. The other question I just thought of is whether or not my Zigbees can keep up with it as well. Just something else to test when I get back to working on it.
As far as the refresh rate it may just be personal preference. I take a larger sample area with multiple averaged samples so it doesn't look like fireworks in the background or just that the scene is being projected onto the wall behind. The color changes occur quickly but intensity doesn't. In the end that is simple stuff to change around.
You can get the 60 LEDs/m on ebay and probably many other places http://www.ebay.com/itm/1m-60-LED-m-RGB-LED-Light-Strip-5V-WS2811-WS2801-Waterproof-Addressable-Color-/160907739909 (There might be cheaper ones out there)

Don't worry that it says ws2811, it's the same as ws2801, it's just integrated in the LED instead of separate chip to make space for higher density. According to spec the SPI can be run up to 25 MHz, but that is probably not for a long strand, so maybe 5-10 MHz is more realistic. It takes 24 bits per LED (8 bit RGB) so updating 320 LEDs should only take 1-2 ms if the code is efficient, I'm not sure how efficiently it will run on Arduino.

But with that many LEDs you might need to beef up the PSU, at full intensity it would consume something like 10 - 15A.
 
#16 ·
Quote:
Originally Posted by kj1060 View Post

Unforuntately I don't know anything about this subject, but definitely interested to see what you come up with after seeing your other work.
thumb.gif
Thanks, I'm not exactly sure where this project will be heading .. but hopefully something cool comes out of it
biggrin.gif
.
 
#17 ·
I'm no programming genius or hardware guru, but you might look into offloading the entire thing to something like a Raspberry Pi board, and sample the screen using a cheap 640x480 USB webcam. You could sample anything, from a single large screen to a big multi-monitor setup with zero additional software overhead or bottlenecks on the host machine.
 
#18 ·
Quote:
Originally Posted by jvjessen View Post

You can get the 60 LEDs/m on ebay and probably many other places http://www.ebay.com/itm/1m-60-LED-m-RGB-LED-Light-Strip-5V-WS2811-WS2801-Waterproof-Addressable-Color-/160907739909 (There might be cheaper ones out there)

Don't worry that it says ws2811, it's the same as ws2801, it's just integrated in the LED instead of separate chip to make space for higher density. According to spec the SPI can be run up to 25 MHz, but that is probably not for a long strand, so maybe 5-10 MHz is more realistic. It takes 24 bits per LED (8 bit RGB) so updating 320 LEDs should only take 1-2 ms if the code is efficient, I'm not sure how efficiently it will run on Arduino.

But with that many LEDs you might need to beef up the PSU, at full intensity it would consume something like 10 - 15A.
Already have a PSU from another project luckily 5v 25A I believe so I think I'm good on that front. Nice find on the LEDs. Just need a code tweak to put the data and clock on one pin.
 
#19 ·
Quote:
Originally Posted by Kylepdalton View Post

Already have a PSU from another project luckily 5v 25A I believe so I think I'm good on that front. Nice find on the LEDs. Just need a code tweak to put the data and clock on one pin.
Yeah, I was a bit too fast on saying the 2801 and 2811 are exactly the same, 2811 is trickier with single wire SPI, but you can use this library for Arduino, that should make life a lot easier
smile.gif


Sound like you are good on PSU
biggrin.gif
 
#22 ·
#24 ·
I've done a few experiments using my good old breadboard and a small MCU. I don't have any LEDs connected but I've ordered some. I could manually solder some LEDs together, but I don't really have the patience knowing they've already been ordered.

This is what my experimental setup looks like:



It's doing all the capturing and averaging in the external hardware, so it will have no effect on performance. Plus it should work directly with DVD, Bluray, XBOX, PS3 etc. without need for a PC.

It should do 30-50 fps without any problems plus as many averages as it's got enough ram for. For testing, since I don't have any LEDs, I'm sending the image back to PC so I can view what is being captured. This does slow it down a bit, but once I have LEDs there will be no need to do that.

Here a quick video of the captures and averaged image (the small capture window):



Now I just need to wait for the LEDs to arrive.
 
#26 ·
Quote:
Originally Posted by Kylepdalton View Post

How are feeding the signal over? A digital signal or analog? Oh and if you get this to work out you'll have to post up a schematic.
The signal is converted from digital to analog and then back to digital as part of the capture/averaging process, it's much faster doing the averaging that way, using just a small MCU (clocked at 80MHz) for the processing work and LED control. I'll post more details on the inner workings once I get LEDs and a bit further with the project.

It seems to work just fine in any resolution up to, and including, 1080p (I don't own any displays above that resolution, so that's as far as I've been able to test it). It should also work with a standard VGA signal with just a few tweaks. Really high resolutions could probably be done with something more powerful, maybe an ARM Cortex BeagleBoard.
 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top