Adalight with Lightpack
Moderators: adafruit_support_bill, adafruit

Adalight with Lightpack

by misake on Thu Dec 01, 2011 5:50 am

Lightpack is a cross platform ambient lighting program I came across while researching writing an almost identical program.

Main site with most upto date code (Russian)
http://code.google.com/p/lightpack/

English translated version but older code
http://code.google.com/p/light-pack/

While looking through the source code noticed that the author recently added Adalight support, so I made a local clone, compiled and tested. It does indeed work right out the box.

Why do we care?
It compiles cross platform using QT for the Gui.
It is written in C++ and compiles to a binary, from my tests it runs significantly faster than the Adalight processing code, but not yet quite as fast as Boblight (it is on the todo list).
Support for DX9 games under windows (DX9+ and OpenGL on todo list)
It comes with an API which supports other languages, Python, .Net possibly Java and Processing (Also includes examples).
Support for multiple profiles and quick switching between them.
It has a nice shiny icon and gui.
Modular code, so should be easy to extend.

At this time the released binaries do not contain the Adalight code, so if you want to play, head over to the Russian page, make a local clone of the repository (use commandline banned or TortoiseHg on Windows and avoid making a Cloned Google Code project until you intend to contribute back code.)

The code, comments, readmes, compilation and installation instructions are all in English and fairly straight forward. The program its self defaults to the OS language. A debug build is slightly slower than a release build, but significantly larger due to the debug QT libs, so unless you are profiling for performance improvements you probably want to make a release build, which is easiest done from inside the QT Creator.

Remember this is not released code, so you will probably find some bugs, for example my current build sometimes crashes when I change profile.

If you are unable to compile a working binary, don't worry, I'm sure there will be a released build soon.

Since this is so close to the software I was intending to write, I will instead be trying to contribute back as many useful features as possible, however it does look like most of my ideas are already a work in progress on at least one of the branches.
misake
 
Posts: 14
Joined: Sun Nov 06, 2011 1:52 pm

Re: Adalight with Lightpack

by Taifuuni on Thu Dec 01, 2011 5:28 pm

Wow, nice find. Tested this and almost hit 80FPS with winapi fullscreen. Brightness and gamma controls are also nice. With 1ms light change it took almost 25% of cpu power. When using anything above 30ms, it took as little as ~3% of my cpu.
Taifuuni
 
Posts: 15
Joined: Fri Oct 28, 2011 11:05 am

Re: Adalight with Lightpack

by guyleonard on Mon Dec 05, 2011 5:59 pm

Certainly interesting! Compiled on windows easily - I had to install both the QT SDK and the QT Libraries and ensure both directories were in my PATH variable. Also, it didn't much like compiling in a folder with a space in its name, so I dropped it in C:\ and it worked fine for compiling there.

However, I don't see either of your massive FPS rate gains though. I get barely 5 FPS more than I do in processing! And that is with "Slowdown grab" set to '1ms'. Any higher and it slows to a crawl. Furthermore, I get even less for FPS when I change the "Capture source" option to Qt - and even less with the "Each widget" option (about 2FPS) - but about the same using "D3D9". So, it stays with "WinAPI (Full screen)" or I just go back to processing and the adalight libraries.

A further 'issue' is, I have to click "Expert mode" on and change the setting under the "Dev tab" for "USB send data only if colors change" to off, otherwise (I think) with the latest Arduino code it puts the lights to sleep as there is no data input if I'm looking at a non animated source (website/pdf/etc)...fine if you don't mind it idling but I prefer it still to be on.

I think I might put linux on this machine over the weekend and see if I get any different FPS rates compared to Windows 7x64.
guyleonard
 
Posts: 5
Joined: Thu Nov 24, 2011 7:03 pm

Re: Adalight with Lightpack

by vputz on Tue Dec 27, 2011 11:05 am

Out of curiosity, what did you use for compilation? I've been interested in trying this, but they seem in no hurry to make another release build, and days of my Windows software development are long gone, so I only have access to Cygwin/gcc or mingw32 for compilation, and I wasn't sure if either would work.

Alternatively, if the executable isn't large, any chance one of you could just ship me yours? I'm curious to see how much of a difference it makes.
vputz
 
Posts: 61
Joined: Mon May 03, 2010 4:43 am

Re: Adalight with Lightpack

by pburgess on Tue Dec 27, 2011 12:26 pm

I heard from the developer recently. A new release will likely be out soon, with Adalight support in the pre-built binaries. I'll make another post when that happens. Exciting stuff!
User avatar
pburgess
 
Posts: 2590
Joined: Sun Oct 26, 2008 1:29 am

Re: Adalight with Lightpack

by misake on Wed Dec 28, 2011 9:08 am

Taifuuni wrote:With 1ms light change it took almost 25% of cpu power. When using anything above 30ms, it took as little as ~3% of my cpu.


The main site links to a Russian blog with tips for optimal performance, from using google translate it seems to suggest that you adjust the delay to get you around 14 fps or what ever you find least noticeable/ distracting, for me it is around 20 - 25 fps which uses ~15% cpu on my humble HTPC. I haven't yet had time to see if I can make any speed improvements to the source code.

guyleonard wrote: I had to install both the QT SDK and the QT Libraries and ensure both directories were in my PATH variable.


You can copy the required dlls to your Lightpack.exe directory and delete the rest, thus avoiding adding to your PATH, those would be, libgcc_s_dw2-1.dll, mingwm10.dll, QtCore4.dll, QtGui4.dll and QtNetwork4.dll. Alternativly you can download an existing binary from the project page and just swap out your new executable. Also using the mingw bundled with the QT SDK should include everything in its PATH.

guyleonard wrote:However, I don't see either of your massive FPS rate gains though. I get barely 5 FPS more than I do in processing!


It does seem largely dependant on the system, on my HTPC the processing performance hit is drastic enough to effect video play back where light pack works fine, however on my main machine performance is similar for both. However the extra capture options and easier support for D3D games is a nice addition.

guyleonard wrote:I have to click "Expert mode" on and change the setting under the "Dev tab" for "USB send data only if colors change" to off


I get the impression that most of these "Expert mode" features are in there for developer testing purposes and will eventually get a home on one of the main tabs.

vputz wrote:Out of curiosity, what did you use for compilation? ... I only have access to Cygwin/gcc or mingw32 for compilation, and I wasn't sure if either would work.


The QT SDK uses mingw to compile, I found it easiest to load the project into the QT creator and build from there.
I have also compiled from mingw, but I used the version bundled with the QT SDK to avoid worrying about libs.

pburgess wrote:A new release will likely be out soon.


Fantastic, though I should hurry up and see if I can contribute any significant speed improvements or features.
misake
 
Posts: 14
Joined: Sun Nov 06, 2011 1:52 pm

Re: Adalight with Lightpack

by smajor on Wed Jan 04, 2012 3:58 pm

On the russian site (http://code.google.com/p/lightpack/) there is a fresh release. Adalight support on win binaries too.
(the program is english, like on the english site, you just have to find the download button :lol: )

Seems like I have to get me an Adalight :wink:
Adalight with Lightpack config generator: http://tvgloria.hu/ rgb channel coefs, assembly dimensions calculator :), 'no monitor stand space', sensitive area custom size, reorder and counterclockwise, overlap, 21:9
new address http://tvgloria.hu/
smajor
 
Posts: 17
Joined: Mon Dec 26, 2011 3:58 pm

Re: Adalight with Lightpack

by smajor on Sat Jan 07, 2012 2:20 pm

I've made a precise profile for 1360x768 res with 25 pixels.
If others do it with other resolutions, it should get into lightbox releases, so it can be used without further annoyment. (right after install)
Attachments
1360-768_25.ini
Lightpack profile for Adalight (1360x768 25 pixel)
(5.66 KiB) Downloaded 160 times
Adalight with Lightpack config generator: http://tvgloria.hu/ rgb channel coefs, assembly dimensions calculator :), 'no monitor stand space', sensitive area custom size, reorder and counterclockwise, overlap, 21:9
new address http://tvgloria.hu/
smajor
 
Posts: 17
Joined: Mon Dec 26, 2011 3:58 pm

Re: Adalight with Lightpack

by smajor on Sat Jan 21, 2012 9:42 am

My lightpack config generator, especially for using with the adalight:
http://sanya.tarhelyszolgaltato.eu/
Built in graphic visualizer :) for checking the numbers instantly.
Single and multimonitor configs supported.
Feel free to comment!
Adalight with Lightpack config generator: http://tvgloria.hu/ rgb channel coefs, assembly dimensions calculator :), 'no monitor stand space', sensitive area custom size, reorder and counterclockwise, overlap, 21:9
new address http://tvgloria.hu/
smajor
 
Posts: 17
Joined: Mon Dec 26, 2011 3:58 pm

Re: Adalight with Lightpack

by swissarmy on Mon Jan 23, 2012 7:43 am

The newest Lightpack software ver. 5.8.6

windows:
http://code.google.com/p/lightpack/down ... e&can=2&q=

linux:
http://code.google.com/p/lightpack/down ... p&can=2&q=

Now you set brightness for each area (red, green & blue separately) and set a shortcut for ON/OFF lights.
swissarmy
 
Posts: 41
Joined: Sat Jan 07, 2012 7:57 am

Re: Adalight with Lightpack

by MudHolland on Sun Feb 05, 2012 5:08 pm

I made a few clips with the LEDs and the use of lightpack:

http://www.youtube.com/watch?v=iJynZeLCY-U
http://www.youtube.com/watch?v=kqTsB3aA8ZM
MudHolland
 
Posts: 26
Joined: Thu Oct 06, 2011 8:29 am

Re: Adalight with Lightpack

by swissarmy on Tue Feb 07, 2012 6:02 am

swissarmy
 
Posts: 41
Joined: Sat Jan 07, 2012 7:57 am

Re: Adalight with Lightpack

by smajor on Tue Feb 07, 2012 6:07 am

Nice, Guys! :) Cheers, both of You! :)
Would You attach Your profiles, please?
Adalight with Lightpack config generator: http://tvgloria.hu/ rgb channel coefs, assembly dimensions calculator :), 'no monitor stand space', sensitive area custom size, reorder and counterclockwise, overlap, 21:9
new address http://tvgloria.hu/
smajor
 
Posts: 17
Joined: Mon Dec 26, 2011 3:58 pm

Re: Adalight with Lightpack

by MudHolland on Tue Feb 07, 2012 7:58 am

Very nice swissarmy! Very, very nice!

I have a few question:

- how far away from the wall are your LEDs?
- how did you attach the LEDs to your tv?
- how far from the edge of your tv did you stick the LEDs?
MudHolland
 
Posts: 26
Joined: Thu Oct 06, 2011 8:29 am

Re: Adalight with Lightpack

by swissarmy on Tue Feb 07, 2012 8:01 am

My profiles are done with smajor's config generator and tweaked by me because my lcd isn't entirely flat at the back, has speakers at the bottom so it needed some changes (e.g. on corners) in order to get uniform backlight.

They are all 1366x768.
Attachments
1366_768_4_3.ini
(5.72 KiB) Downloaded 142 times
1366_768_21_9.ini
(5.72 KiB) Downloaded 125 times
1366_768_16_9.ini
(5.71 KiB) Downloaded 188 times
swissarmy
 
Posts: 41
Joined: Sat Jan 07, 2012 7:57 am