[App] libAmbiLight E/F/H

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.

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

[App] libAmbiLight E/F/H

Post by adonis » Mon Jul 09, 2018 12:33 am

AmbiLight for your Samsung TV
Image


Version 2.0 out!!

The lib uses mostly parts 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! ;-)
So, if libScreenShot works for you, this should work too, but one never knows :D

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


    Settings

    H_LEDS amount of your horizontal leds
    V_LEDS amount of vertical leds
    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)
    REVERSE 0 for counter-clockwise-mount 1 for clockwise-mount (if you stand in front of your TV)

    Testing
    To test if everything works fine, modify and execute the following command.

    Code: Select all

    samyGOso -d -T -B -r -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:0
    If all is set up, you should at least see some lights :D

    You can hit CTRL+C to abort the script, make modifications to it and re-run it again until everything works.

    Limitations
    • Currently no support for "gap" on the bottom of the TV
    • If you have issues, that your TV isn't responding. Don't panic. The ambilight_runner.sh has a pause of 1 minutes. You should be able to SSH into your TV ;-)


    Disclosure
    Although I'm a software engineer, I am not experienced with the development of Samsung TV libs, and my C-programming knowledge is on some semi-profi-level.
    I've just put together all the stuff how I think that it could work. So, if someone of higher knowledge may know of some critical problems, please report here.

    Question for devs
    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.


    ToDo
    - Add gap at bottom
    - Grab data exactly from the edges with black-border-detection and user-definable padding

    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 Tue Jul 17, 2018 2:09 pm, edited 13 times in total.

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

Re: [App] libAmbiLight E/F/H

Post by adonis » Fri Jul 13, 2018 10:21 pm

Added optimized version.

User avatar
fluffi444
SamyGO Project Donor
Posts: 558
Joined: Fri Apr 05, 2013 9:55 pm
Location: Germany

Re: [App] libAmbiLight E/F/H

Post by fluffi444 » 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?
TV: UE40ES7000 @ UE40ES8090 - T-ECPDEUC-2022.0 // SamyGO
CI+: Unicam EVO 4 with HD+ (HD02) @ Pacific 4.60
NET: Samba: PC

zoelechat
Official SamyGO Developer
Posts: 8243
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [App] libAmbiLight E/F/H

Post by zoelechat » 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 do NOT receive any PM. Please use forum.

asiersan
SamyGO Project Donor
Posts: 120
Joined: Fri May 09, 2014 1:30 am

Re: [App] libAmbiLight E/F/H

Post by asiersan » Sat Jul 14, 2018 8:17 pm

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: 14
Joined: Tue Dec 19, 2017 8:59 pm

Re: [App] libAmbiLight E/F/H

Post by adonis » Sun Jul 15, 2018 12:15 pm

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: 14
Joined: Tue Dec 19, 2017 8:59 pm

Re: [App] libAmbiLight E/F/H

Post by adonis » Sun Jul 15, 2018 12:17 pm

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: 14
Joined: Tue Dec 19, 2017 8:59 pm

Re: [App] libAmbiLight E/F/H

Post by adonis » Sun Jul 15, 2018 12:34 pm

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
Official SamyGO Developer
Posts: 8243
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [App] libAmbiLight E/F/H

Post by zoelechat » 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 :)
I do NOT receive any PM. Please use forum.

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

Re: [App] libAmbiLight E/F/H

Post by adonis » Sun Jul 15, 2018 12:59 pm

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”