openshwprojects / OpenBK7231T_App

Open source firmware (Tasmota/Esphome replacement) for BK7231T, BK7231N, BL2028N, T34, XR809, W800/W801, W600/W601, BL602 and LN882H
https://openbekeniot.github.io/webapp/devicesList.html
1.4k stars 245 forks source link

RGB LED Strip flickering during effects (with DDP) #1325

Closed h3ndrik closed 2 days ago

h3ndrik commented 3 weeks ago

While displaying color changing effects, the RGB LEDs flicker constantly while the colors change.

Since we have no effects (yet) on device, I'm sending some color changes and color wheels via ledfx or xLights over the DDP protocol. That works as intended. But there is a very annoying flicker going on constantly.

Steps to reproduce the behavior:

  1. Enable the SM16703P driver
  2. Enable the DDP driver
  3. Send some dynamic effects with xLights or ledfx (like a color wheel)
  4. See error, the RGB LEDs flicker while displaying the effect

I think what happens is that in the code of the ddp driver, both the LED_SetFinalRGB() and the SM16703P_setMultiplePixel() actually write RGB data to the LEDs. First one color, and then the correct array. And two writes happen per one UDP packet: https://github.com/openshwprojects/OpenBK7231T_App/blob/54f9129454426ee45df6840c3e515b6176e22c3c/src/driver/drv_ddp.c#L125-L131

openshwprojects commented 3 weeks ago

thx for the fix, I will just point out that "Since we have no effects (yet) on device," is not actually true, we have PixelAnim driver: https://www.elektroda.com/rtvforum/viewtopic.php?p=21101474#21101474

Wolfieeewolf commented 3 weeks ago

I had the same issue with WLED.

You need to not start the LED driver and only start DDP.

Doing that worked for me. I think there is a conflict where WLED is trying to change the LEDs, and the OBK driver is also doing the same thing, and it gets confused, which causes the flicker.