[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.

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: Sun Jul 15, 2018 12:59 pm 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.
Well I see no reason except something in code. You should make a huge cleanup in lib to see clearer imho, and keep only what you need. Huge beginner white elephant, it was :D
adonis wrote: Sun Jul 15, 2018 12:59 pm So, I don't need all these "hooks" and I also don't need to check if already hooked "_hooked=1" ... etc?
hooks you don't need but _hooked is flag for already injected so better keep.
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 1:16 pm
adonis wrote: Sun Jul 15, 2018 12:59 pm 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.
Well I see no reason except something in code. You should make a huge cleanup in lib to see clearer imho, and keep only what you need. Huge beginner white elephant, it was :D
adonis wrote: Sun Jul 15, 2018 12:59 pm So, I don't need all these "hooks" and I also don't need to check if already hooked "_hooked=1" ... etc?
hooks you don't need but _hooked is flag for already injected so better keep.
I already cleaned everything up ;-) At the beginning I didn't know what I needed and what not... so I left everything. But now... stripped down to the basics ;-)

As I said, when I have some spare-time again, I'll give the loop and "-r" another try ;-)

Many thanks for your advices ... and of course, for libScreenShot ;-)
bobiturboto
SamyGO Project Donor
Posts: 489
Joined: Sun Mar 23, 2014 8:15 pm
Location: Bulgaria

Re: [App] libAmbiLight E/F/H

Post by bobiturboto »

Great job,
Do you think it can be adapted to work with hyperion? I have lightberry and it will be great to make it to work with your lib. I am using rpi1 as controller for the leds



Sent from my D6503 using Tapatalk

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

Re: [App] libAmbiLight E/F/H

Post by adonis »

bobiturboto wrote: Mon Jul 16, 2018 12:01 pm Great job,
Do you think it can be adapted to work with hyperion? I have lightberry and it will be great to make it to work with your lib. I am using rpi1 as controller for the leds



Sent from my D6503 using Tapatalk
Hyperion is a great project. I had OSMC and hyperion running on an RPI previously. Now that I got rid of OSMC (because its slowness bugged me), I bought the MiBox with AndroidTV instead, BUT with that, I lost ambilight. This was also my main motivation for this project.

At first, I wanted to send the data via UDP to the RPi with hyperion, which I already had installed.
But as far as I found out, it's not possible to send UPD data to hyperion. Please correct me if I'm wrong here and missed some information.

But I think, that it puts to much load on the TV-system and network, sending such a huge amount of data (whole screen-capture) every 0.3s. And I don't see any advantages of hyperion over this solution. I mean, hey... the LEDs are changing color... that's the whole point, right? :P :D

Maybe, one day, when I again have some spare-time, and it's deffinitelly on my ToDo-list, I'm going to implement a hyperion-like priority workflow. So that the ESP8288 will be able to receive data via UDP (from the TV) and via websocket, which will allow manual controll of the leds. Stay tuned ;-)
bobiturboto
SamyGO Project Donor
Posts: 489
Joined: Sun Mar 23, 2014 8:15 pm
Location: Bulgaria

Re: [App] libAmbiLight E/F/H

Post by bobiturboto »

Make sense about the traffic, I just wanted to reuse my hardware- ws2801.
Correct me if I am missing something but you are connecting to ESP8266 via wifi?
How much traffic is that?

I have the lightberry hardware and I am getting the video out from the tv and processing it with video grabber.
I am using my rpi like oscam server and for hyperion only so I don't know about putting one more device. However I have video out only from TV tuner for that reason I have asked about hyperion support or any alternative for rpi.
adonis
SamyGO Project Donor
Posts: 49
Joined: Tue Dec 19, 2017 8:59 pm

Re: [App] libAmbiLight E/F/H

Post by adonis »

bobiturboto wrote: Mon Jul 16, 2018 7:44 pm Make sense about the traffic, I just wanted to reuse my hardware- ws2801.
Correct me if I am missing something but you are connecting to ESP8266 via wifi?
How much traffic is that?

I have the lightberry hardware and I am getting the video out from the tv and processing it with video grabber.
I am using my rpi like oscam server and for hyperion only so I don't know about putting one more device. However I have video out only from TV tuner for that reason I have asked about hyperion support or any alternative for rpi.
Sorry, you didn't miss anything :P it's my fault for not being more specific.

So here's the thing.
Imagine if you have 100 leds, you need 100x3 bytes (RGB) of data to controll them. Which is 300 bytes.
Right now, these 300 bytes are calculated on the TV and sent via UDP to the ESP8266, telling it which LED has which RGB value.

hyperion itself has no functionality to receive 300bytes of data, telling it to controll the leds. OK?

So what'd be a theoretical workaround here?

hyperion has a tool called "hyperion-remote". So, when you SSH into your RPi you can execute "hyperion-remote" with some args. One of these args is "-image" (I believe so). Where you can tell hyperion-remote to load an image and it sets the LEDs according to the outer pixels of that image.

Now let's go back to the TV.
The screenCapture (which I use to grab the screen) can only capture an image with a minimum of 96x54 pixels, so this is 96*54*4=20736 bytes (the BMP has 4 bytes for each pixel + 54 bytes for the header), which is around 20kB. For such systems 20kb is HUGE!!
Then you'd have to save that image to the TV, upload it somehow to the RPi (or maybe use RPi to download that image via ftp) and execute the "hyperion-remote".

But this won't last for too long. When you save that image to the TV, the writing process of the file produces a large load on the TV system, which it can't handle. Maybe for about 10 seconds, and that's it... crash!!! (Been there, done that :P )
I just wanted to reuse my hardware- ws2801.
You absolutely can reuse your LED strip, since my firmware for the ESP8266 uses FastLED library which supports ws2801. I've ws2801 myself ;-)
The only thing you need is to invest into the ESP8266 (5 bucks, maybe?!) :P :D and then you just re-plug the data, clock and ground pins of your led strip from the RPi to the ESP8266.
Last edited by adonis on Mon Jul 16, 2018 10:41 pm, edited 2 times in total.
bobiturboto
SamyGO Project Donor
Posts: 489
Joined: Sun Mar 23, 2014 8:15 pm
Location: Bulgaria

Re: [App] libAmbiLight E/F/H

Post by bobiturboto »

Thanks I will follow your suggestion.
Soon I will post my results my TV is F8000
A friend of mine suggest to buy Adapter for NodeMcu Lua ESP8266-12E/12F CH340G WIFI Internet Development Board
Because I can use 5V from my leds power.

Thank you helping me!


Sent from my D6503 using Tapatalk

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

Re: [App] libAmbiLight E/F/H

Post by adonis »

bobiturboto wrote: Mon Jul 16, 2018 10:40 pm Thanks I will follow your suggestion.
Soon I will post my results my TV is F8000
A friend of mine suggest to buy Adapter for NodeMcu Lua ESP8266-12E/12F CH340G WIFI Internet Development Board
Because I can use 5V from my leds power.

Thank you helping me!


Sent from my D6503 using Tapatalk
I've hooked the ESP8266 to the 5V adapter which powers the leds... but psssst... don't tell anyone :P :D
bobiturboto
SamyGO Project Donor
Posts: 489
Joined: Sun Mar 23, 2014 8:15 pm
Location: Bulgaria

Re: [App] libAmbiLight E/F/H

Post by bobiturboto »

Hvala drugar!
Do you think is worth it to map starting or stopping the addon from Remote control or make it smarter to be auto started only after sun down let's say after 20:30?

Sent from my D6503 using Tapatalk

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

Re: [App] libAmbiLight E/F/H

Post by adonis »

bobiturboto wrote: Tue Jul 17, 2018 6:46 am Hvala drugar!
Do you think is worth it to map starting or stopping the addon from Remote control or make it smarter to be auto started only after sun down let's say after 20:30?

Sent from my D6503 using Tapatalk
hehehe... nema na cemu, druze! ;-)

Actually both are good ideas... you could map a key to start it from the remote or modify the ambilight_runner.sh so that it runs automatically, but on each loop to check the time, before executing the script.

Post Reply

Return to “[H] Software”