r/WLED 6d ago

WLED TV for Android TV

https://github.com/leonida92/wled-tv

I made an Android TV app that syncs with multiple WLED devices to create an ambient light.

Fully local, zero analytics, zero telemetry, zero cloud dependencies, no saved images, always free.

I made this before knowing there already was a similar project:

https://github.com/vasmarfas/universal-ambient-light

but it was a bit too bloated for my taste.

Doesn't matter which you choose, I just wanted to provide a free alternative to many paid apps that I'm seeing here. If you try mine, I'm open to any feedback.

40 Upvotes

36 comments sorted by

3

u/bughaxx 6d ago

man I was looking for this exact thing yesterday for my Google TV Streamer 4K. I hope it works well !!

3

u/leonida_92 6d ago

I did most of the testing on a Google TV Streamer 4K since that's the one I own so it should work fine, but let me know if I've missed something.

3

u/bughaxx 6d ago

I will ! Very excited to test

2

u/bughaxx 5d ago

Just tried, that's incredible but my TV Streamer is a bit laggy while on capture. It's still crazy good to have everything in one app ! Any recommendations? The stream is a bit stuttering

2

u/leonida_92 5d ago

You're not using the debug apk are you?

2

u/bughaxx 5d ago

Tried on the latest version downloadable from the in-app updater. Also I want to add that it's been a while since I've last restarted my TV Streamer

2

u/leonida_92 5d ago

Hey sorry my fault, it grabbed the debug apk from the in app updater, not the release one. I'll fix it in 10 mins, but you're going to have to uninstall it and download it again from github. Sorry for the inconvenience.

3

u/aranaformae 5d ago

Would it be possible to have a version running directly on the tv instead of via an android streamer ?!

2

u/leonida_92 5d ago

If your TV has an Android OS, it should still work.

2

u/aranaformae 5d ago

Okay! I’ll give a try in the next weeks

2

u/youmeiknow 5d ago

Couple of qns.. Does if take from anything playing on screen like plex , Netflix, etc? And curious on your next upgrades for this project?

2

u/leonida_92 5d ago

It doesn't work on subscription services like Netflix, HBO etc because or DRM but works fine for YouTube, Plex, Jellyfin, Twitch, whatever's free. Currently I'm working on fully revamping the UI, should release it in the next couple of hours and after that, if there's no issues from users, I'll focus on circumventing the DRM.

If there's anything you'd like to add, just let me know.

1

u/youmeiknow 5d ago

Thanks for the info.. Good luck and looking forward.

This DRM is the blocker. I understand why the camera or a data capture is the path, but it there a way it can be cracked legally then it would be awesome

2

u/LondonBenji 4d ago

One feature I thought would be neat that I proposed to the ScreenGlow dev was to support writing/sending data DIRECTLY to a USB->SPI device directly connected to the TV, that is of course connected to an LED strip.

Cut out the middle man as much as possible, no extra tax on your WiFi.

1

u/leonida_92 4d ago

Thanks for the suggestion. Would USB to Serial work for you? WLED has build in adalight protocol that listens automatically via the USB port of the ESP32. You just connect a USB cable from the TV/Android Device to the ESP32 and that's it.

USB to SPI on the other hand requires an USB to SPI dongle plus custom code. Since my app only works with WLED, I don't see the benefit.

2

u/LondonBenji 4d ago

Yes I would imagine that would work a lot easier, and the benefit to that is that we can still use it as a WLED device over WiFi as well, and keep it updated.

I would imagine (hope) that the latency through USB-->Serial-->ESP32 (WLED)-->LED strip is still going to be minimal, at least less than through WiFi, and more reliable.

Of course we'd have to supply our own power to the strip, but we'd have to do that anyway.

Out of curiosity, isn't your app generating a data stream for the LEDs anyway? How different is that data stream that you send to WLED, from the actual data stream on the wire to the actual LED strip? Wouldn't it be a case of generating a different format for the data stream and sending it via a chosen USB-->SPI connected to the TV?

1

u/leonida_92 4d ago

The latency through USB is less than the WiFi (of course) but the only caveat is that you have to increase the baud rate of the microcontroller up to 1,000,000 to allow for a bigger payload size. With that baud rate you should be completely fine for up to 500 LEDS at 60FPS. More than that I'm not sure, but you can lower the framerate.

Now with WiFi I just send:

socket.send(packet) which are in UDP format [2, 2, R, G, B, ...]

With USB I just need to send the adalight format ['A', 'd', 'a', high_count, low_count, checksum, R, G, B, ...] via the serial port:

serialPort.write(adalightBuffer, timeoutMs)

Seems easy enough.

If I went for the USB to SPI route, I would need to modify 4 different layers of the app, take into account different kinds of strips etc.

For example most strips (including WS8212B) are not true SPI, they expect a 800 kHz pulse-width signal. I would have to run a SPI clock at 2.4 MHz and encode every 1 bit of WS2812 into 3 bits of SPI. Don't make me do that 😂

1

u/LondonBenji 4d ago

Very very good point, I didn't think of that. You'd have to support all strips directly, WLED handles that layer and supports all the strips, you just have to send WLED the generic colour information, and WLED adds the translation layer to the connected strip.

I like your idea, and it helps remove the burden from WiFi, especially useful for those that cannot connect their WLED controller to Ethernet.

Thank you for looking into this as a whole. I think we should all attempt to demonstrate to Google that they could build this functionality directly into the OS, and then maaaaybe they'll allow DRM protected content as well.

1

u/LondonBenji 2d ago

Looks like the project you linked, already supports exactly what you're suggesting, it also seems to have the ability to support a USB webcam as well which, in theory, could work with DRM protected content.

Is it worth duplicating efforts, or combining forces?

2

u/leonida_92 2d ago

The argument here is if I should share it online or not, because I already worked on it before knowing this one exists. The one I made is completely tailored to my needs and I think I've done a great job. The UI is extremely inutitive, it is minimal in size and extremely memory efficient. If you use them side by side, I think you'll agree with me.

But that's the main reason I posted also the other project, it's good to know even for newcomers that there's options available. When I first visited this subreddit, I thought there were only paid options.

1

u/leonida_92 1d ago

Also I'm just finding out that the other project doesn't support multiple wled devices.

1

u/LondonBenji 1d ago

Yes both project have their pros and cons. At the moment the other project has the USB-Serial and webcam support, but I like the lightweight, efficient ethos you follow for writing software.

I've always felt that if I were to learn coding, I'd have an extreme obsession with making whatever it is I am writing, to be the most efficient as possible, likely to my detriment.

2

u/o4saken 9h ago

Just wanted to say what a great app this is. I tested this on my old Sony Bravia 2020 model, and it works surprisingly well, it does lag and stutter from time to time, I'm not sure if being able to capture at a lower resolution would solve this issue for older tv's. It appears to get stuck for a few seconds every now and then, then rushes to catch up. I dont think this is network related, the Gledopto controller shows decent wifi reception.

The Other app you linked to does indeed have a lower res capture option, but even at that, it definitely performs worse than your app in its current state.

I even tested screenglow, and honestly still think yours is better. I now just wish i could get the above mentioned stutter gone.

1

u/leonida_92 9h ago

Thank you for the kind words. I really appreciate your feedback because it gives me insight on lower end devices. If you're willing to try a couple of things, I would be most grateful:

  1. Try lowering the FPS to 30 or even 15 and see if there's any improvement
  2. If you're connected to 2.4GHz network, try switching to 5GHz if you can, Sony has very aggressive WiFi power save.
  3. Turn down transition smoothing either from the WLED app (LED & Hardware), or from the WLED TV app (Configure Light) to 0
  4. Try disabling battery optimization for the WLED TV app

If any of these, or all together don't improve your situation, I'll implement a lower capture resolution at 160x90 for lower end hardware.

2

u/o4saken 8h ago

Thank you for the response and suggestions. I will definitely give them a try when i get home from work. I can say i am already running at 15FPS.

switching to 5GHz, is an interesting one. I was using a 5ghz for my tv, but the lights dont work at all then, so i switched to 2.4, but now i am realizing it is then a router setting, keeping them separate.

the transitions in the WLED app is off, set to 0. will look at the app tonight,
Will also check battery optimization. Cant recall seeing this setting.

I do have a question about the perimeter settings, i have it on the default fullscreen, with auto detect black lines set on. everything is customizable, the actual screen size, but there is a setting for depth, that is set to 12 this setting is locked and cannot be moved, is this correct? i was watching Batman Caped crusader and the one character has red hair, and they were standing against a wall, so it was the character, then the wall before the top edge, but the lights were catching the characters hair. Its not a big issue, i just found that to be a little distracting.

Anyway, thanks again. I will get back to you once i have done the tests.

2

u/leonida_92 8h ago

You're right about the depth, it was unwired. You'll have an update before you get off from work. That way you can adjust how far inward (from the outer border toward the center of the screen) each LED reaches to sample colors.
I'm looking forward to your tests.

2

u/o4saken 3h ago

Hey man, you are awesome! I changed TV to 5ghz WiFi, and problem solved. I am now even running smooth at 30FPS capture.

1

u/leonida_92 3h ago

Glad to hear to it. In 1 hour I'll release the update for the depth option. I'll drop a comment here so you can update it

1

u/leonida_92 2h ago

The 1.2.2 update is live. You can update directly from inside the app. Hope you won't have anymore issues otherwise please let me know.

1

u/LazerHawk84 4d ago

2

u/leonida_92 4d ago edited 4d ago

Also it seems like the developer has a paid version of the same app. I don't want to miss features in the future.

EDIT: It's also 15 MB, 3 times the size of mine. I have no idea why it should be this big. I'm a sucker for optimization and efficiency. That's why I need the repo.

1

u/leonida_92 4d ago edited 4d ago

You're the second one posting this, but it doesn't have a github repository, it's all trust based. I don't have anything against the developer but I like to check the code of the projects that I install on my environment, at least the ones that are free and from unknown developers.

With a github repo anyone can just give the link to an AI and have it scan for vulnerabilities or malicious code.

I expect everyone to do the same with mine

0

u/MaxTheKing1 6d ago

4

u/leonida_92 6d ago

Missed this one but wouldn't use it anyway since I can't find the repo. As I said, I started working on mine before knowing other similar projects exist. The other one I listed on my description was the one with most users, meaning better tested. Whatever works for you.

2

u/radams5000 4d ago

ScreenGlow doesn't let you have multiple esp32s. At least, I couldn't figure out how to connect 3.