[App] libAmbiLight E/F/H (MST-only)

Here are software that related with Samsung H series TVs.
Please don't create any new topic here unless you have software to post/release.
Post Reply

adonis
SamyGO Project Donor
Posts: 49
Joined: Tue Dec 19, 2017 8:59 pm

[App] libAmbiLight E/F/H (MST-only)

Post by adonis »

AmbiLight for your Samsung TV
Image

Version 3.0
Features:
- Added black-border detection
Fixes:
- Fixed crashing with H_LEDS and V_LEDS
- Fixed mapping with H_LEDS and V_LEDS


The lib uses partly code of zoelechat's libScreenShot, except that it sends the data via UDP to an ESP8266 controller. So, without zoelechat, this project wouldn't be able - thx man! ;-)

Demo
https://www.youtube.com/watch?v=mOQVHFVH3VQ
Due to the fact that the script does not grab the data exactly from the edges but with some padding (to avoid black borders), therefore it looks like they're a bit offset.

Requirements
  • adressable LED-Controller (WS28x, anything that's supported by FastLED)
  • ESP8266-12E (the one with the USB-port, less headache :D )
  • PSU (power-supply for LED-strip)

Installation
  • Get your LED light mounted and connected correctly and verify that it works with FastLED (use the Blink example)
  • Modify the attached app.ino, especially the LEDS and WiFi-settings
  • upload app.ino to the ESP8266
  • Copy libAmbilight.so to the libSo directory (usually /mnt/opt/privateer/usr/libso
  • Modify 99_100_AmbiLight.init to your needs (see section "Settings")
  • Copy 99_100_AmbiLight.init to /mnt/etc/init.d (CAUTION!!! Test first that everything works fine, before you procede to this step)
If you experience strange color, try setting the FastLED color-ordering, to a different one (like RGB, BGR, etc...).

Code: Select all

FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, BGR>(leds, NUM_LEDS);
Settings

H_LEDS amount of your horizontal leds (only on one side, top or bottom)
V_LEDS amount of vertical leds (only on one side, left or right)
SERVER_IP IP of the ESP8266
SERVER_PORT Port on which the ESP8266 operates (default 5050)
OFFSET Shift the LED data by this number (positive numbers only, max size of led-strip), generally the led-data starts at the bottom right corner (if you stand in front of your TV)
SLEEP (default: 1) the higher the value, the slower LED-change - increase this to 2 or 3 if you experience crashes
REVERSE set this option if LEDs are in reversing order

Testing
The log-output can be found under /dtv/AmbiLight.log (this is only populated in testing mode)
Use the example image, attachted here and cast it to your TV.
Modify and execute the following command.

Code: Select all

samyGOso -d -T -B -l /mnt/opt/privateer/usr/libso/libAmbiLight.so H_LEDS:36 V_LEDS:18 SERVER_IP:192.168.1.32 SERVER_PORT:5050 OFFSET:17 REVERSE TEST
You may need to delete REVERSE and/or COLOR.
If all is set up, you should at least see some lights :D

or with ALT
not working yetShow

Code: Select all

samyGOso -d -T -B -l /mnt/opt/privateer/usr/libso/libAmbiLight.so H_LEDS:36 V_LEDS:18 SERVER_IP:192.168.1.32 SERVER_PORT:5050 OFFSET:17 REVERSE TEST ALT

Limitations
  • Currently only MST-devices supported
  • Currently no support for "gap" on the bottom of the TV
Donation
Since I do stuff like this as a hobby - feel free to donate :-)


ToDo
- Modify ESP8266 firmware to be controllable via smartphone

Source code
https://gitlab.com/ad-on-is/samsung-ambilight
You do not have the required permissions to view the files attached to this post.
Last edited by adonis on Thu Oct 08, 2020 10:42 am, edited 32 times in total.
adonis
SamyGO Project Donor
Posts: 49
Joined: Tue Dec 19, 2017 8:59 pm

Re: [App] libAmbiLight E/F/H

Post by adonis »

Added optimized version.
User avatar
fluffi444
SamyGO Project Donor
Posts: 568
Joined: Fri Apr 05, 2013 9:55 pm
Location: Germany

Re: [App] libAmbiLight E/F/H

Post by fluffi444 »

Even if I do not use this right now I want to leave a thanks for your work! Sounds promissing!
Thanks for your work and even more for sharing it!

Do you have an experience if the 0.3 sec injecting will put to much load on the system?
TV: UE40ES7000 @ UE40ES8090 - T-ECPDEUC-2022.0 // SamyGO
CI+: Unicam EVO 4 with HD+ (HD02) @ Pacific 4.60
NET: Samba: PC
zoelechat
SamyGO Moderator
Posts: 8615
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [App] libAmbiLight E/F/H

Post by zoelechat »

adonis wrote: Mon Jul 09, 2018 12:33 am Right now I'm using a bash-script to inject with samyGOso every 0.3 seconds. Is there a better way to use a loop in the code itself? I tried doing so, but It only sends the data of the first screen captured.
You can make a resident lib, even if you "hook nothing" :)
I do NOT receive any PM. Please use forum.
asiersan
SamyGO Project Donor
Posts: 157
Joined: Fri May 09, 2014 1:30 am

Re: [App] libAmbiLight E/F/H

Post by asiersan »

I must try, i would bougth leds etc... . Thanks



Enviado desde mi iPhone utilizando Tapatalk
Samsung 55HU7500L
Samsung 40F6500
Samsung 32K5570SU
adonis
SamyGO Project Donor
Posts: 49
Joined: Tue Dec 19, 2017 8:59 pm

Re: [App] libAmbiLight E/F/H

Post by adonis »

Updated version. Now officially v1.0 :P
- Added support vor clockwise and counter-clockwise mount
- Optimized code for better performance
- Runs now at 0.2s with no overload after some time, TV hangs, so use 0.3s instead
- Added demo-video
Last edited by adonis on Sun Jul 15, 2018 9:15 pm, edited 3 times in total.
adonis
SamyGO Project Donor
Posts: 49
Joined: Tue Dec 19, 2017 8:59 pm

Re: [App] libAmbiLight E/F/H

Post by adonis »

fluffi444 wrote: Fri Jul 13, 2018 10:33 pm Even if I do not use this right now I want to leave a thanks for your work! Sounds promissing!
Thanks for your work and even more for sharing it!

Do you have an experience if the 0.3 sec injecting will put to much load on the system?
I've optimized the code now, and I'm injecting with 0.2s
0.3 doesn't put to much load, although 0.2 does, so it crashes after a while (2-3 hours). Need to investigate further.
Also, I've measured the FastLED script and it takes 0.24s for the LEDs to fade from one state to another, so IMHO no need to go lower here.
Last edited by adonis on Sun Jul 15, 2018 9:23 pm, edited 2 times in total.
adonis
SamyGO Project Donor
Posts: 49
Joined: Tue Dec 19, 2017 8:59 pm

Re: [App] libAmbiLight E/F/H

Post by adonis »

zoelechat wrote: Fri Jul 13, 2018 10:42 pm
adonis wrote: Mon Jul 09, 2018 12:33 am Right now I'm using a bash-script to inject with samyGOso every 0.3 seconds. Is there a better way to use a loop in the code itself? I tried doing so, but It only sends the data of the first screen captured.
You can make a resident lib, even if you "hook nothing" :)
I will give it a try, when I find some spare-time again :-D
But as of now, with optimised code, it works better than expected ;-)

Do you think there's an advantage when injecting as resident compared to the current in- and deject script?
zoelechat
SamyGO Moderator
Posts: 8615
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [App] libAmbiLight E/F/H

Post by zoelechat »

You'd save init and deinit time of each injection, not easy to quantify but probably noticeable when so often (in addition to avoid possible unstability cause).
Nothing more than inject -r and a loop inside lib needed, it's almost ready I'd say :)
I do NOT receive any PM. Please use forum.
adonis
SamyGO Project Donor
Posts: 49
Joined: Tue Dec 19, 2017 8:59 pm

Re: [App] libAmbiLight E/F/H

Post by adonis »

zoelechat wrote: Sun Jul 15, 2018 12:50 pm You'd save init and deinit time of each injection, not easy to quantify but probably noticeable when so often (in addition to avoid possible unstability cause).
Nothing more than inject -r and a loop inside lib needed, it's almost ready I'd say :)
At the very first beginning, I tried the loop, but it only received the frameBuffer that it grabbed on injection... it did not update. Therefore I wrote the bash-script.
Although, I must admit, that I did not inject with "-r", so I don't know if that was the problem, or not.
Nothing more than inject -r and a loop inside lib needed
So, I don't need all these "hooks" and I also don't need to check if already hooked "_hooked=1" ... etc?

Post Reply

Return to “[H] Software”