Skip to content

UDP on main segment only.#2601

Merged
Aircoookie merged 4 commits intomasterfrom
minseg-udp
Mar 31, 2022
Merged

UDP on main segment only.#2601
Aircoookie merged 4 commits intomasterfrom
minseg-udp

Conversation

@blazoncek
Copy link
Copy Markdown
Contributor

Allow playing UDP live (Hyperion) or realtime (DDP, E1.31, ArtNet) data on main segment only (instead of whole strip).

Comment thread wled00/FX_fcn.cpp Outdated
Comment thread wled00/data/index.js Outdated
function setLor(i) {
var obj = {"lor": i};
// allow canceling live mode (if sender crashes)
if (i===0 && lastinfo.live && ["","Hyperion","UDP"].includes(lastinfo.lm)) { obj.live = false; obj.v = true; }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a good idea, since setLor(0) is supposed to return to live data, not cancel it. It would likely be preferable to exit indefinite (timeout == 65000) live mode on override (1 or 2), as turning off lor will not refresh the LEDs anyways.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know. I mentioned this on Discord. This "hack" allowed me to test cancelling live mode.
If you can figure out where to put "live":false and not obstruct UI I am happy with it.

Comment thread wled00/e131.cpp Outdated
realtimeLock(realtimeTimeoutMs, REALTIME_MODE_DDP);

if (!realtimeOverride) {
if (!realtimeOverride || (realtimeMode && useMainSegmentOnly)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think override should override Live mode if on main seg only too. Otherwise override never functions if set to main segment only.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no "real" need for override in mainseg only if you can cancel live. You can argue that a user may want displaying effects instead of live data on mainseg while not cancelling live streaming (temporary).
This will need a new UI element (perhaps a star in the segment?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just gave me an idea!

Comment thread wled00/json.cpp Outdated
udpn["recv"] = receiveNotifications;

root[F("lor")] = realtimeOverride;
root[F("lor")] = realtimeOverride || (realtimeMode && useMainSegmentOnly);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one should stay of course until UI is adapted to not show the live popup in main seg mode.

Comment thread wled00/json.cpp Outdated
root[F("name")] = serverDescription;
root[F("udpport")] = udpPort;
root["live"] = (bool)realtimeMode;
root[F("mso")] = useMainSegmentOnly; // using main segment only for live
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to do root[F("liveseg")] = useMainSegmentOnly ? strip.getMainSegmentId() : -1;, since that gives more flexibility for us to potentially decouple it from main segment in the future, and the API user saves a step because they do not need to look up state.mainseg.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. We will need to inform Lord-Grey (Hyperion) of the change.

Copy link
Copy Markdown

@dimitrij2k dimitrij2k Apr 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it mean? The LED Grouping Thread got closed. Does it mean Grouping will be possible or is it dead? I currently have 144LED/m stripes on 65“ (636LEDs) and have to use tmp2net. The Problem is, i got a max of 38fps. I hoped of grouping to reach 60fps. I could solder a second wled with two instances, but i hope for the grouping ☺️

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Download and see. 😄

Copy link
Copy Markdown

@dimitrij2k dimitrij2k Apr 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont get it... i flashed the latest v13.2 "Toki" release, activated "main segment only" and nothing happend... still 38 fps... the fps counter in hyperHDR showed me a way higher transferrate (2-3x more fps), but the LEDs just get controlled by 38fps from the ESP32. I hoped that a grouping will increase the rate - but maybe i have to solder a second ESP32 for two instances.... or do you have a nother hint, how i can get more FPS??? i tried to split my 636 LEDs on two different pins - but FPS are still the same. It just increase, when i decrease the amount of LEDs.... my goal are 60FPS with 636LEDs... Ideas? (THX btw. for your nice & hard work!)

btw. What did "main segment only" do?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dimitrij2k Try increasing the Target refresh rate in the bottom of LED settings to 120. What grouping are you using, aka how many LEDs are transmitted?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Aircookie, i already played with the Target refreshrate, but it dont help. The problem is not only the live streaming with the fps. Even the "Effects" in WLED are running with only 38fps.

My Setup: SK6812 RGBW LEDs are running with an ESP32-ETH01 (Cable) to a Asus AX86U Router.

Im using HyperHDR on my LG WebOS (installed on TV). As protocol only tmp2net is working correctly at this moment (because of the LED count). I use as Max PacketSize 642 (for the LED Count + 6). Peak Performance is 38fps.

When i split my LEDs on two Pins (pin 2 = 315 LEDs, pin 3 = 321 LEDs) the 38fps are the same. When i reduce the LED Count in WLED to 400LEDs, i get 60fps... below 400LEDs the fps rise, over 400LEDs the fps decrease.

In HyperHDR i tried a direct LED mapping and Grouping of 10LEDs to 21 Zones (Top/Bottom) and 12 Zones (Left/Right)... but i never reach more then 38fps with my LED Count.

Thanks for your support!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your packet size is too small. And even the largest possible will not hold enough data for all LEDs. It will be fragmented.
At least as I see it from the description.

Comment thread wled00/json.cpp
jsonTransitionOnce = true;
liveEnabled = true; // triggers realtimeLock() below
realtimeLock(65000);
} else {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I like this in principle, but I think there should be more ways to exit indefinite live mode, e.g. turning off and on master power or setting an effect on mainseg if in mainseg only mode. Will think about it a little.

@blazoncek blazoncek linked an issue Mar 28, 2022 that may be closed by this pull request
blazoncek and others added 2 commits March 28, 2022 23:07
Make override work in mainseg mode
Move unfreeze on turn on from UI to JSON parser
Fix mainseg not unfreezing on timeout
@Aircoookie Aircoookie merged commit d2ced93 into master Mar 31, 2022
@Aircoookie Aircoookie deleted the minseg-udp branch March 31, 2022 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LED Grouping for Hyperion (Live) Ambilight

3 participants