Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul Art-Net output to be more "professionally" useful #128

Closed
wants to merge 21 commits into from

Conversation

troyhacks
Copy link
Collaborator

Overhauls the Art-Net code to allow outputting to devices which may have multiple outputs and universe mappings, such as the commonly available "H807SA" 8-output Art-Net device.

Also adds support for "Color Order Override" in LED settings to allow the output color order to be changed on the fly within WLED for Art-Net rendering endpoints that don't have native color order remapping functionality. By using the existing color order override functions we can change any or all of the Art-Net output, just like we can with physical LEDs.

When serving as an Art-Net renderer, WLED expects 1 hardware output with as many universes as are needed, in RGB color order. This functionality is maintained with this PR with the default settings.

Where help is needed is adding a parameter for "Hardware Outputs" to the "Art-Net RGB (network)" which will be mapped to hardware_outputs in the overhauled code:

image

(hardware_outputs should default to "1" to maintain compatibility with WLED->WLED Art-Net rendering.)

A big thanks to @softhack007 for pointers on the color order remapping!

@troyhacks
Copy link
Collaborator Author

troyhacks commented Mar 30, 2024

Added missing BRG color order (not that it's likely ever used) and also defaulted BusNetwork to COL_ORDER_RGB - which is what the default is assumed to be with the original code.

For some reason in testing I must have had some other color order defined via regular WS281x LEDs, so this makes things compatible if you have mixed physical and network LEDs or just network LEDs. Color order wasn't supported before for network LEDs, so it was always just blasting out R,G,B,R,G,B...

@softhack007 softhack007 self-requested a review April 3, 2024 16:21
wled00/udp.cpp Outdated Show resolved Hide resolved
@troyhacks troyhacks added the enhancement New feature or request label Apr 15, 2024
@softhack007 softhack007 self-assigned this May 1, 2024
@softhack007
Copy link
Collaborator

softhack007 commented May 7, 2024

Hi @troyhacks I'll add some review comments which are actually "notes to self" meaning i'll implement the changes when I find time. So nothing to do for you right now.

Just one question - there is some code behind "#ifndef ARTNET_TROYHACKS" should we keep that as an official build option, or is that just remaining from tinkering?

@troyhacks
Copy link
Collaborator Author

troyhacks commented May 7, 2024

Just one question - there is some code behind "#ifndef ARTNET_TROYHACKS" should we keep that as an official build option, or is that just remaining from tinkering?

No code. The "undefined" logic sets it up for how WLED should speak Art-Net to another instance of WLED. That's the default.

If that's defined, it just uses my personal Art-Net setup for the H801RS Art-Net receiver that's on my desk. 😁

Saves me swapping back and forth as I'm testing so I don't have to worry about committing a change with the code set to my personal defaults.

@softhack007
Copy link
Collaborator

Where help is needed is adding a parameter for "Hardware Outputs" to the "Art-Net RGB (network)" which will be mapped to hardware_outputs in the overhauled code:

image

(hardware_outputs should default to "1" to maintain compatibility with WLED->WLED Art-Net rendering.)

@ewoudwijma or @netmindz: I'm not good with this JS stuff, can you help out?
@troyhacks hardware_outputs is a single number?

same performance, easier to read
@ewowi
Copy link

ewowi commented May 23, 2024

I can take a look tomorrow.
Just for my understanding what does hardware_outputs do ?

@troyhacks
Copy link
Collaborator Author

troyhacks commented May 23, 2024

So technically with Art-Net hardware you have the concept of outputs and universes per output.

With some hardware this is a fixed number, like you can have 8 outputs and they all have to have the same number of universes.

One universe is 170 RGB LEDs.

If you had 256 LEDs on an output, that's 2 universes - but we need to know the stopping point per output because 2 universes is 340 lights, so the code needs to know to start a new universe at LED 257.

The hardware I use has 6 universes per output, maximum. So it's useful to say "I have 8 outputs with 6 universes per output" but if I were to have different amounts of LEDs on each one, then we need to start at the universe number of the particular output.

@troyhacks
Copy link
Collaborator Author

troyhacks commented May 23, 2024

So technically with Art-Net hardware you have the concept of outputs and universes per output.

With some hardware this is a fixed number, like you can have 8 outputs and they all have to have the same number of universes.

One universe is 170 RGB LEDs.

If you had 256 LEDs on an output, that's 2 universes - but we need to know the stopping point per workout because 2 universes is 340 lights, so the code needs to know to start a new universe at LED 257.

PXL_20240523_174420365.RAW-01.COVER.jpg

This unit has 8 outputs and up to 6 universes per output.

In order to address things correctly, we need to basically know how many universes are on each output, and now many LEDs are assigned to each one.

WLED as an Art-Net renderer just uses as many universes as needed and crosses the outputs accordingly.

This is the reverse, as we need to talk in universes, and how many pixels are on each one.

@troyhacks
Copy link
Collaborator Author

Closing this PR as things have moved on a fair bit past this.

@troyhacks troyhacks closed this Aug 6, 2024
@netmindz
Copy link
Collaborator

netmindz commented Aug 8, 2024

I'm working with upstream to overhaul how the LED settings page works, with Aircoookie#4056 a the first stage. Mentioning here so I have a reference back to improve the Artnet config, once we have a more dynamic UI and delegation of config to the Bus

@troyhacks troyhacks deleted the Art-Net_Improvements branch November 7, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants