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

Add toggle to prevent pixel color data split across two artnet universes to support certain ArtNet Controller #657

Closed
gllmAR opened this issue Oct 14, 2023 · 2 comments · Fixed by #691
Assignees

Comments

@gllmAR
Copy link

gllmAR commented Oct 14, 2023

Feature request

What problem does this feature solve?

Support for Artnet to SPI/DMX pixel light controller in the family of the BC-204.

Currently, the RGB data format in the HyperHDR software splits pixel color data across two universes which can look as follows:

508:R
509:G
510:B
511:R
512:G
001:B
002:R
003:G
004:B

However, for some ArtNet controllers, the expected formatting requires pixel data to always start at the beginning of a universe which should look like:

508:R
509:G
510:B
511:X not used
512:X not used 
001:R
002:G
003:B
004:R
005:G
006:B

This discrepancy can cause issues with compatibility and expected behavior for specific ArtNet controllers.
Adding a toggle in the GUI to switch between the two data formats would address this problem.

What does the proposed API look like?

A new boolean toggle in the GUI named something like "Prevent Pixel Data Splitting Across Universes" or similar.

How should this be implemented in your opinion?

Add a new boolean toggle in the GUI settings for the ArtNet Controller.
This toggle should be linked to the backend logic that determines the data format for the ArtNet packet.
When the toggle is active, ensure that the data does not split across two universes, following the desired format.

The following code snippet supports the new behavior: (LedDeviceUdpArtNet.cpp)

for (unsigned int ledIdx = 0; ledIdx < _ledRGBCount; ledIdx++)
{
	if (_restartColorIndexAtUniverseIncrement)
	{
		// Check if there's enough space in the current universe for all channels of the next LED
    	if (dmxIdx + _artnet_channelsPerFixture > DMX_MAX)
    	{
        	// Prepare and send the current universe
        	prepare(thisUniverse, _artnet_seq, dmxIdx);
        	retVal &= writeBytes(18 + qMin(dmxIdx, DMX_MAX), artnet_packet.raw);

        	// Move to the next universe and reset the DMX index
        	memset(artnet_packet.raw, 0, sizeof(artnet_packet.raw));
        	thisUniverse++;
        	dmxIdx = 0;
    	}
	}
}

Are you willing to work on this yourself?

Yes,

I would need some insight on how to link the bool logic to the gui and also help to name the variable

btw, amazing software :)

@awawa-dev awawa-dev self-assigned this Nov 7, 2023
@awawa-dev
Copy link
Owner

Hi
Can you test this build? https://github.com/awawa-dev/HyperHDR/actions/runs/6801157923 (branch: artnet ). Please ignore the incorrect new option label in the Artnet driver details, as this will be addressed later in the HyperHDR cumulative patch together with other resources, if this solution works properly.

@gllmAR
Copy link
Author

gllmAR commented Nov 20, 2023

That works! :)

edt_prevent_pixel_data_splitting_across_universes does solve this issues

Tests succeeded:

sending 171 pixels from HyperHDR udpartnet and using QLCplus as artnet monitor
Expected data on the second artnet universe:
when false, 1 data point
when true, 3 data points (1 pixel)

sending 342 pixels from HyperHDR udpartnet and using QLCplus as monitor
Expected data on third universe
when false, 2 data points
when true, 6 data points (2 pixels)

Feel free to close this issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants