Skip to content

Fix errors in DDP implementation - #3193

Merged
Aircoookie merged 2 commits into
wled:mainfrom
coral:coral/ddp-fix
May 26, 2023
Merged

Aircoookie merged 2 commits into
wled:mainfrom
coral:coral/ddp-fix

Conversation

@coral

@coral coral commented May 2, 2023

Copy link
Copy Markdown
Contributor

I think these values are wrong given the spec.

0x0A in binary is 0b00001010

Spec is:

Bits: C R TTT SSS
C is 0 for standard types or 1 for Customer defined
R is reserved and should be 0.
TTT is data type
000 = undefined
001 = RGB
010 = HSL
011 = RGBW
100 = grayscale
SSS is size in bits per pixel element (like just R or G or B data)
0=undefined, 1=1, 2=4, 3=8, 4=16, 5=24, 6=32

So in this case, 0x0A maps to 010 which means 2, 4 bits per pixel
but really what the constant wants to represent is 24 bits, which should be 110 so 0x0D and 32 bits should be 0x1E

@blazoncek

Copy link
Copy Markdown
Contributor

If this is true then it should be fixed upstream. Please contact @forkineye.

@blazoncek blazoncek added the external Not part of WLED itself - an external plugin/remote etc. label May 2, 2023
@coral

coral commented May 2, 2023

Copy link
Copy Markdown
Contributor Author

@blazoncek

Copy link
Copy Markdown
Contributor

In such case let's see what @Aircoookie has to say.

@blazoncek

Copy link
Copy Markdown
Contributor

Looks like the specs were updated after the change to WLED was made.
I do remember @Aircoookie talking to DDP authors about extending/defining RGBW support.

@coral

coral commented May 2, 2023

Copy link
Copy Markdown
Contributor Author

Looks like the specs were updated after the change to WLED was made. I do remember @Aircoookie talking to DDP authors about extending/defining RGBW support.

Just to state the obvious, this is the spec http://www.3waylabs.com/ddp/ I've been using.

You are right, using waybackmachine https://web.archive.org/web/20200223131548/http://www.3waylabs.com/ddp/ the spec uses a different alignment which tracks. The older spec has a different alignment but even then I'm not sure that the code is valid, the older spec with this aligns to 8 bits per pixel so maybe there was confusion if the spec referred to pixel or channel?

Allow receiving of RGBW DDP with either old or new bits per channel value
@Aircoookie

Copy link
Copy Markdown
Member

Hi! I'm 99% certain that bits per pixel element (like just R or G or B data) in the spec refers to bits per channel, not bits per pixel. Still, great thing you noticed the spec update, we should update the byte to 0x0B for 8 bit per channel RGB and 0x1B for 8 bit per channel RGBW respectively.

@Aircoookie
Aircoookie merged commit 7d84de6 into wled:main May 26, 2023
aenertia pushed a commit to aenertia/WLED that referenced this pull request Aug 18, 2026
* fix DDP spec

* Adjust DDP type byte to latest spec

Allow receiving of RGBW DDP with either old or new bits per channel value

---------

Co-authored-by: Aircoookie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external Not part of WLED itself - an external plugin/remote etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants