Skip to content

LED delay on HyperHDR ambilight #5575

Open

Description

@withay

What happened?

I updated to WLED 16 on my HyperHRD ambilight (WLED on an ESP32, HyperHDR on a Pi) and the leds lag behind the video about a full second.

To Reproduce Bug

I just updated to 16 and noticed immediately.

Expected Behavior

Prior to the update, the leds reacted to the video almost simultaneously.

Install Method

Binary from WLED.me

What version of WLED?

WLED 16.0.0

Which microcontroller/board are you seeing the problem on?

ESP32

Relevant log/trace output

Anything else?

I rolled back to 15.3 and it is working correctly again.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. softhack007 commented on May 7, 2026

    @softhack007
    Member

    @withay can you measure the ping time from your PI to the WLED instance? Part of the delay may be network latency 🤔

  2. withay commented on May 7, 2026

    @withay
    Author

    No video playing:

    PING 10.69.0.xxx (10.69.0.xxx) 56(84) bytes of data.
    64 bytes from 10.69.0.125: icmp_seq=1 ttl=255 time=16.1 ms
    64 bytes from 10.69.0.125: icmp_seq=2 ttl=255 time=8.36 ms
    64 bytes from 10.69.0.125: icmp_seq=3 ttl=255 time=13.5 ms
    64 bytes from 10.69.0.125: icmp_seq=4 ttl=255 time=9.84 ms
    64 bytes from 10.69.0.125: icmp_seq=5 ttl=255 time=15.1 ms
    64 bytes from 10.69.0.125: icmp_seq=6 ttl=255 time=9.71 ms
    64 bytes from 10.69.0.125: icmp_seq=7 ttl=255 time=7.07 ms
    64 bytes from 10.69.0.125: icmp_seq=8 ttl=255 time=5.84 ms
    64 bytes from 10.69.0.125: icmp_seq=9 ttl=255 time=9.49 ms
    64 bytes from 10.69.0.125: icmp_seq=10 ttl=255 time=10.2 ms

    --- 10.69.0.xxx ping statistics ---
    10 packets transmitted, 10 received, 0% packet loss, time 9014ms
    rtt min/avg/max/mdev = 5.835/10.518/16.075/3.191 ms

  3. withay commented on May 7, 2026

    @withay
    Author

    That was with it off, this is with a movie playing:

    PING 10.69.0.xxx (10.69.0.xxx) 56(84) bytes of data.
    64 bytes from 10.69.0.125: icmp_seq=1 ttl=255 time=5.61 ms
    64 bytes from 10.69.0.125: icmp_seq=2 ttl=255 time=10.7 ms
    64 bytes from 10.69.0.125: icmp_seq=3 ttl=255 time=4.30 ms
    64 bytes from 10.69.0.125: icmp_seq=4 ttl=255 time=8.60 ms
    64 bytes from 10.69.0.125: icmp_seq=5 ttl=255 time=13.8 ms
    64 bytes from 10.69.0.125: icmp_seq=6 ttl=255 time=11.8 ms
    64 bytes from 10.69.0.125: icmp_seq=7 ttl=255 time=25.2 ms
    64 bytes from 10.69.0.125: icmp_seq=8 ttl=255 time=18.7 ms
    64 bytes from 10.69.0.125: icmp_seq=9 ttl=255 time=27.8 ms
    64 bytes from 10.69.0.125: icmp_seq=10 ttl=255 time=45.5 ms

    --- 10.69.0.xxx ping statistics ---
    10 packets transmitted, 10 received, 0% packet loss, time 9013ms
    rtt min/avg/max/mdev = 4.301/17.198/45.528/11.994 ms

  4. DedeHai commented on May 7, 2026

    @DedeHai
    Collaborator

    There were several reports about this on discord. Since the ESP has only a single frame buffer the data must be piling on the sender side. I saw no such delays using DDP.

  5. DedeHai commented on May 7, 2026

    @DedeHai
    Collaborator

    The real question is where does the data get stuck and why

  6. softhack007 commented on May 7, 2026

    @softhack007
    Member

    In theory - as ESPAsyncE131 is based on AsyncUDP - it's possible that UDP packets queue up on the esp32 side.

    However this could only happen when

    • the sender is faster (framerate) than the receiving esp32 can handle
    • the udp/network input queue was already very full (congestion) when starting real-time mode
    • the esp32 is too busy with other tasks (WiFi ? RMT interrupts?) so the AsyncUDP task is staved of CPU time
    • "Use main segment only" might cause slowdowns in the "realtime receive" mode
    • priority inversion (lower prio task hogs on a resource need by a higher prio task)

    I don't think that any of these were newly introduces in 16.0.0. In case that a classic ESP32 shows these problems, it could be something deep in the newer arduino-esp32/esp-idf frameworks because these were upgraded on classic ESP32.

  7. softhack007 commented on May 7, 2026

    @softhack007
    Member

    @coderabbitai with respect to #5575 (comment) : what is the AsyncUDP packet queue size? Was the queue size changed between WLED 16.0.0 and WLED 0.15.4 ?

  8. coderabbitai commented on May 7, 2026

    @coderabbitai
    Contributor
    🧩 Analysis chain

    🏁 Script executed:

    #!/bin/bash
    # Search for AsyncUDP queue size references in WLED codebase
    rg -rn "queue" --include="*.h" --include="*.cpp" -i | grep -i "udp\|async\|e131\|ddp" | head -60
    
    # Search for any AsyncUDP config or queue size defines
    rg -rn "ASYNC_UDP\|asyncudp\|AsyncUDP" --include="*.h" --include="*.cpp" -i | head -60
    
    # Check platformio.ini or similar for framework versions
    cat platformio.ini 2>/dev/null | head -80 || true
    
    # Check for any queue size defines related to UDP
    rg -rn "queue_size\|QUEUE_SIZE\|UDP_QUEUE\|udp_queue" --include="*.h" --include="*.cpp" --include="*.ini" -i | head -40
    

    Length of output: 4915


    🏁 Script executed:

    #!/bin/bash
    # Fix rg commands - use -g for glob patterns
    rg -rn "queue" -g "*.h" -g "*.cpp" | grep -i "udp\|async\|e131\|ddp" | head -60
    
    # Search for AsyncUDP references
    rg -rn "AsyncUDP" -g "*.h" -g "*.cpp" | head -40
    
    # Check git tags related to versions
    git tag | grep -E "v?0\.15\.4|v?16\.0" | head -20
    
    # Check platformio.ini for arduino-esp32 framework version
    grep -i "platform\|framework\|arduino" platformio.ini | head -40
    
    # Look for library dependencies - ESPAsyncE131, AsyncUDP versions
    cat wled00/library.json 2>/dev/null || true
    find . -name "library.json" | head -10 | xargs grep -l "AsyncUDP\|E131" 2>/dev/null | head -5
    find . -name "*.ini" | xargs grep -l "AsyncUDP\|ESPAsyncE131\|e131" 2>/dev/null | head -5
    
    # Check lib_deps in platformio.ini
    grep -A 100 "lib_deps" platformio.ini | head -60
    

    Length of output: 5716


    🌐 Web query:

    AsyncUDP esp32 arduino packet queue size CONFIG_LWIP_UDP_RECVMBOX_SIZE
    

    💡 Result:

    What CONFIG_LWIP_UDP_RECVMBOX_SIZE actually controls

    In ESP-IDF/lwIP, CONFIG_LWIP_UDP_RECVMBOX_SIZE is the maximum number of received UDP packets that lwIP will queue (“mailbox”) per UDP netconn/socket (i.e., for the netconn / BSD sockets layers). If packets arrive faster than your app reads them, this queue can fill and packets will be dropped. Espressif’s Kconfig help text describes it as the max cached UDP packets per UDP socket. (docs.espressif.com)

    Does it affect Arduino AsyncUDP?

    Usually, no. Arduino-ESP32’s AsyncUDP uses lwIP’s raw UDP API (udp_pcb + udp_recv) and then forwards packets into its own FreeRTOS queue, so CONFIG_LWIP_UDP_RECVMBOX_SIZE (netconn mailbox) isn’t the knob that limits AsyncUDP buffering. (github.com)

    The real AsyncUDP “packet queue size” (Arduino core)

    In current arduino-esp32 AsyncUDP.cpp, the internal queue is created as:

    • xQueueCreate(32, sizeof(lwip_event_packet_t *))

    So the AsyncUDP packet event queue depth is 32 (unless your core version differs). (github.com)

    How to change either one (practical notes)

    • In Arduino IDE with the precompiled core, changing sdkconfig/sdkconfig.h in the core tree generally won’t change these options in the binaries you’re using. (espressif-docs.readthedocs-hosted.com)
    • To increase buffering for AsyncUDP, you typically must patch/rebuild the Arduino core (change the 32 in AsyncUDP.cpp) or build Arduino as an ESP-IDF component and set options there. (github.com)
    • To increase buffering for BSD sockets / WiFiUDP-style code, you’d change CONFIG_LWIP_UDP_RECVMBOX_SIZE in an ESP-IDF build (trade-off: more RAM; potentially better throughput). (espressif-docs.readthedocs-hosted.com)

    Citations:


    🏁 Script executed:

    #!/bin/bash
    # Check git tags for WLED versions
    git tag | sort | tail -30
    
    # Check esp32 platform version in platformio.ini
    grep -A 5 "\[esp32\]" platformio.ini | head -30
    
    # Get the esp32 platform/arduino-esp32 version
    grep -i "espressif32\|arduino-esp32\|platform_esp32\|esp32_idf" platformio.ini | head -20
    
    # Check what version was used in 0.15.x tag
    git show v0.15.4:platformio.ini 2>/dev/null | grep -i "espressif32\|platform_esp32\|arduino-esp32" | head -20 || \
    git show 0.15.4:platformio.ini 2>/dev/null | grep -i "espressif32\|platform_esp32\|arduino-esp32" | head -20
    
    # Check what version is used in 16.0.0 tag  
    git show v16.0.0:platformio.ini 2>/dev/null | grep -i "espressif32\|platform_esp32\|arduino-esp32" | head -20 || \
    git show 16.0.0:platformio.ini 2>/dev/null | grep -i "espressif32\|platform_esp32\|arduino-esp32" | head -20
    

    Length of output: 1223


    🌐 Web query:

    arduino-esp32 AsyncUDP queue size history change xQueueCreate 32
    

    💡 Result:

    In espressif/arduino-esp32’s AsyncUDP library, the internal receive-task queue length has been hard-coded to 32 (_udp_queue = xQueueCreate(32, sizeof(...))) and, based on the repo history, it was already 32 when AsyncUDP was first added and remains 32 on master today. The more recent AsyncUDP changes (e.g., making the UDP task stack size configurable) did not change this queue length. [1] [2] [3]

    Sources:
    [1] Current master AsyncUDP.cpp showing xQueueCreate(32, ...)
    [2] Initial AsyncUDP add (commit a59eafb, Jun 27, 2018) showing xQueueCreate(32, ...)
    [3] Commit message for a59eafb indicating “Add initial AsyncUDP”


    🏁 Script executed:

    #!/bin/bash
    # List all tags to find the right tag name
    git tag | sort
    
    # Check esp32 platform details for 0.15.4
    git show v0.15.4:platformio.ini 2>/dev/null | grep -i "esp32_idf\|espressif32\|tasmota\|arduino-esp32\|idf" | head -30
    
    # Check esp32 platform details for v16.0.0
    git show v16.0.0:platformio.ini 2>/dev/null | grep -i "esp32_idf\|espressif32\|tasmota\|arduino-esp32\|idf" | head -30
    
    # Also check the full esp32_idf section for both tags
    git show v0.15.4:platformio.ini 2>/dev/null | grep -A 10 "esp32_idf_V" | head -40
    git show v16.0.0:platformio.ini 2>/dev/null | grep -A 10 "esp32_idf_V" | head -40
    

    Length of output: 0


    🏁 Script executed:

    #!/bin/bash
    # List GitHub releases to find the right tag names
    gh release list --repo wled/WLED --limit 20
    
    # Get platformio.ini content at tag v0.15.4
    gh api repos/wled/WLED/contents/platformio.ini?ref=v0.15.4 --jq '.content' | base64 -d | grep -i "esp32_idf\|espressif32\|tasmota\|arduino-esp32\|idf" | head -20
    
    # Get platformio.ini content at tag v16.0.0
    gh api repos/wled/WLED/contents/platformio.ini?ref=v16.0.0 --jq '.content' | base64 -d | grep -i "esp32_idf\|espressif32\|tasmota\|arduino-esp32\|idf" | head -20
    
    # Get esp32_idf_V section details from both
    echo "=== 0.15.4 ==="
    gh api repos/wled/WLED/contents/platformio.ini?ref=v0.15.4 --jq '.content' | base64 -d | grep -A 5 "esp32_idf_V\b" | head -30
    
    echo "=== 16.0.0 ==="
    gh api repos/wled/WLED/contents/platformio.ini?ref=v16.0.0 --jq '.content' | base64 -d | grep -A 5 "esp32_idf_V\b" | head -30
    

    Length of output: 3896


    @softhack007 Here's what I found:

    AsyncUDP packet queue size

    The AsyncUDP implementation in arduino-esp32 does not use CONFIG_LWIP_UDP_RECVMBOX_SIZE (the lwIP netconn mailbox). Instead, it uses lwIP's raw UDP API and forwards packets into its own internal FreeRTOS queue, created as xQueueCreate(32, sizeof(lwip_event_packet_t *)).

    So the AsyncUDP packet queue depth is 32 entries.

    Was it changed between WLED 0.15.4 and 16.0.0?

    The queue size itself was not changed — it has been hard-coded to 32 since AsyncUDP was first added to arduino-esp32 in 2018 and remains 32 today.

    However, there was a significant underlying framework change between these two releases for the classic ESP32:

    Release Classic ESP32 framework
    WLED v0.15.4 Aircoookie's fork of arduino-esp32 @ 1.0.6.4 (based on ESP-IDF 3.x)
    WLED v16.0.0 Tasmota Arduino Core 2.0.18 (based on ESP-IDF 4.4.8)

    This is a major ESP-IDF jump (3.x → 4.4.8) for classic ESP32. While the AsyncUDP queue depth is the same, the underlying lwIP stack, FreeRTOS task scheduler, and WiFi driver all changed substantially — any of which could affect the timing behavior you're investigating.

    Practical implications

    • If the 32-slot AsyncUDP queue fills up (e.g. when the ESP32 is CPU-starved by RMT/WS2812 DMA or WiFi tasks), incoming E1.31 packets will be silently dropped at the lwIP→FreeRTOS handoff, but this behaviour would exist in both versions.
    • The new IDF 4.4.8 WiFi driver and lwIP stack may have different interrupt/task priority interactions with the rest of the WLED workload compared to IDF 3.x — this is worth investigating as a root cause.
    • Increasing the queue beyond 32 would require patching/rebuilding the arduino-esp32 core, which is not trivial with a pre-built Tasmota platform zip.
  9. added this to the 16.0.0 beta milestone on May 9, 2026
  10. djexplode6 commented on May 20, 2026

    @djexplode6

    Can confirm this exact issue, cause and resolution. (Reverting back to 15.3).
    I also use esp32 wled for xLights Christmas display using DDP. Should I expect the same lag on units running 16?

  11. netmindz commented on May 20, 2026

    @netmindz
    Member

    @djexplode6 reverting back isn't a resolution 😉

    Can you try the _V4 bin of 0.15 to see if that also has the issue or not please

  12. djexplode6 commented on May 21, 2026

    @djexplode6

    Can you try the _V4 bin of 0.15 to see if that also has the issue or not please

    The v4 bin runs fine as well.

  13. netmindz commented on May 21, 2026

    @netmindz
    Member

    @coderabbitai if the V4 build with 0.15 doesn't hand the issue that would exclude the major IDF version change

  14. coderabbitai commented on May 21, 2026

    @coderabbitai
    Contributor

    @netmindz — that's an excellent deduction and you're right. If the V4 build of 0.15 (which already uses IDF 4.x via Tasmota platform) works without the lag, then the IDF major version jump (3.x → 4.x) is effectively ruled out as the cause.

    This narrows the root cause to one (or both) of:

    1. WLED application-level code changes introduced between 0.15 and 16.0 — something in how realtime/E1.31/DDP receive, frame processing, or task scheduling was modified.

    2. Tasmota platform version drift — from the platformio.ini comparison:

      • WLED v0.15.4 (_V4): platform-espressif32 @ 2022.12.02
      • WLED v16.0.0: platform-espressif32 @ 2025.02.10

      That's ~2 years of ESP-IDF 4.x point releases, sdkconfig changes, lwIP tuning, and WiFi driver updates within the same major IDF version. The IDF version bump within 4.x (e.g. 4.4.x → 5.x or changed sdkconfig defaults) could still be a contributor.

    The most actionable next step would be to bisect the WLED application changes between 0.15 and 16.0 related to E1.31/realtime handling, since that's the variable most directly in the WLED team's control.

  15. 14 remaining items

  16. softhack007 commented on May 27, 2026

    @softhack007
    Member

    So the more focused question for WLED 16.0 vs 0.15 becomes: did any new lock acquisition paths get introduced in the E1.31/DDP realtime receive handler that would cause the async_udp task to spend more time blocked?

    @coderabbitai please compare the relevant paths of the 0.15.x branch to the current code in main. List changes and assess if they are likely to contribute to the problems observed by our users.

  17. softhack007 commented on May 27, 2026

    @softhack007
    Member

    @softhack007 were you able to reproduce this issue? Does normal WLED sync (DDP) use UDP as well?

    @DedeHai looks like indeed we need to reproduce this on our development setups. I can't remember seeing any such DDP delays during develpment.

    @withay @tomiko23lol please upload the cfg.json and presets.json files from your esp32 boards here. We'll need these files for trying to reproduce your issues.

  18. coderabbitai commented on May 27, 2026

    @coderabbitai
    Contributor
    🧩 Analysis chain

    🏁 Script executed:

    #!/bin/bash
    # First, find relevant files that handle E1.31/DDP/realtime on both branches
    echo "=== Files in wled00/ related to E1.31/DDP/realtime on main ==="
    gh api repos/wled/WLED/contents/wled00?ref=main --jq '.[].name' | grep -iE "e131|ddp|realtime|udp|recv|notifier|sync"
    
    echo ""
    echo "=== Files in wled00/ related to E1.31/DDP/realtime on 0.15.x ==="
    gh api repos/wled/WLED/contents/wled00?ref=0.15.x --jq '.[].name' | grep -iE "e131|ddp|realtime|udp|recv|notifier|sync"
    
    echo ""
    echo "=== All files in wled00/ on main ==="
    gh api repos/wled/WLED/contents/wled00?ref=main --jq '.[].name'

    Length of output: 1686


    🏁 Script executed:

    #!/bin/bash
    # Also look at what changed between 0.15.x and main in realtime handling using git diff via GitHub compare API
    gh api "repos/wled/WLED/compare/0.15.x...main" --jq '.files[].filename' | grep -iE "e131|ddp|realtime|udp|notif|sync|wled\.cpp|json\.cpp|bus|strip" | head -40

    Length of output: 549


    🏁 Script executed:

    #!/bin/bash
    # Find the right tag for 0.15.x
    gh api repos/wled/WLED/tags --jq '.[].name' | grep -E "0\.15\.|v0\.15\." | head -10
    
    # Also check branches
    gh api repos/wled/WLED/branches --jq '.[].name' | grep -E "15\." | head -10

    Length of output: 377


    🏁 Script executed:

    #!/bin/bash
    # Fetch e131.cpp from main
    echo "=== e131.cpp (main) ==="
    gh api repos/wled/WLED/contents/wled00/e131.cpp?ref=main --jq '.content' | base64 -d
    
    echo ""
    echo "=== udp.cpp (main) ==="
    gh api repos/wled/WLED/contents/wled00/udp.cpp?ref=main --jq '.content' | base64 -d

    Length of output: 63473


    🏁 Script executed:

    #!/bin/bash
    echo "=== e131.cpp from v0.15.4 ==="
    gh api repos/wled/WLED/contents/wled00/e131.cpp?ref=v0.15.4 --jq '.content' | base64 -d
    
    echo ""
    echo "=== udp.cpp from v0.15.4 ==="
    gh api repos/wled/WLED/contents/wled00/udp.cpp?ref=v0.15.4 --jq '.content' | base64 -d

    Length of output: 60633


    🏁 Script executed:

    #!/bin/bash
    # Also check setRealtimePixelColor in FX_fcn.cpp on both branches (key difference from setPixelColor)
    echo "=== setRealtimePixelColor in main ==="
    gh api repos/wled/WLED/contents/wled00/FX_fcn.cpp?ref=main --jq '.content' | base64 -d | grep -A 20 "setRealtimePixelColor"
    
    echo ""
    echo "=== setRealtimePixelColor in v0.15.4 ==="
    gh api repos/wled/WLED/contents/wled00/FX_fcn.cpp?ref=v0.15.4 --jq '.content' | base64 -d | grep -A 20 "setRealtimePixelColor"
    
    echo ""
    # Check for strip.show() and strip.trigger() in FX_fcn.cpp on both branches
    echo "=== strip.show() / trigger() context in FX_fcn.cpp main ==="
    gh api repos/wled/WLED/contents/wled00/FX_fcn.cpp?ref=main --jq '.content' | base64 -d | grep -n "suspend\|resume\|mutex\|lock\|semaphore\|xSemaphore\|portMAX" | head -30
    
    echo ""
    echo "=== strip.show() / trigger() context in FX_fcn.cpp v0.15.4 ==="
    gh api repos/wled/WLED/contents/wled00/FX_fcn.cpp?ref=v0.15.4 --jq '.content' | base64 -d | grep -n "suspend\|resume\|mutex\|lock\|semaphore\|xSemaphore\|portMAX" | head -30

    Length of output: 4951



    @softhack007 — here is the full comparison. I found several meaningful differences.


    Summary of changes in the realtime receive path

    1. setRealtimePixel() — gamma correction moved out (both branches)

    v0.15.4 applied gamma correction per-pixel in the receive callback (running in the async_udp task context), then called seg.setPixelColor() or strip.setPixelColor() directly:

    // v0.15.4
    void setRealtimePixel(uint16_t i, byte r, byte g, byte b, byte w) {
      unsigned pix = i + arlsOffset;
      if (pix < strip.getLengthTotal()) {
        if (!arlsDisableGammaCorrection && gammaCorrectCol) {
          r = gamma8(r); g = gamma8(g); b = gamma8(b); w = gamma8(w);
        }
        if (useMainSegmentOnly) {
          Segment &seg = strip.getMainSegment();
          if (pix < seg.length()) seg.setPixelColor(pix, r, g, b, w);
        } else {
          strip.setPixelColor(pix, r, g, b, w);
        }
      }
    }

    main replaced this with a thin wrapper that calls strip.setRealtimePixelColor() → seg.setPixelColorRaw() (for useMainSegmentOnly) or setPixelColor(). Gamma is now deferred to the show() paint phase:

    // main
    void setRealtimePixel(uint16_t i, byte r, byte g, byte b, byte w) {
      unsigned pix = i + arlsOffset;
      strip.setRealtimePixelColor(pix, RGBW32(r,g,b,w));
    }

    Assessment: Per-pixel work in the async_udp task is now slightly less (no gamma). But show() now does that work instead. On its own, this is not a latency cause — but if show() has become slower (e.g. due to CCT, double-buffering, or new mapping), it indirectly affects frame delivery.


    2. strip.show() → strip.trigger() for useMainSegmentOnly — most significant change ⚠️

    v0.15.4 always called strip.show() directly and immediately for every realtime protocol (E1.31, DDP, UDP, Hyperion, TPM2.NET):

    // v0.15.4 – handleNotifications()
    if (e131NewData && millis() - strip.getLastShow() > 15) {
        e131NewData = false;
        strip.show();  // always immediate
    }
    // ...and for WARLS/DRGB/TPM2/Hyperion paths:
    strip.show();  // always immediate

    main replaces this with strip.trigger() whenever useMainSegmentOnly is enabled:

    // main – handleNotifications()
    if (e131NewData && millis() - strip.getLastShow() > 15) {
        e131NewData = false;
        if (useMainSegmentOnly) strip.trigger();  // DEFERRED
        else                    strip.show();     // immediate
    }
    // ...and for WARLS/DRGB/TPM2/Hyperion paths:
    if (useMainSegmentOnly) strip.trigger();
    else                    strip.show();

    strip.trigger() sets _triggered = true and defers the actual show() call to strip.service().


    3. service() loop architecture — coupled to point 2 ⚠️

    v0.15.4: service() always called show() at the end, regardless of whether it was triggered:

    // v0.15.4 FX_fcn.cpp line ~1432
    if (!_suspend) show();

    main: service() only calls show() when doShow = _triggered is true, AND only if the MIN_FRAME_DELAY guard passes:

    // main FX_fcn.cpp
    if (_suspend || elapsed <= MIN_FRAME_DELAY) return;   // ← new guard
    bool doShow = _triggered;
    // ...
    if (doShow && !_suspend) { ... show() ... }
    if (!_suspend) _triggered = false;

    Assessment: If strip.service() is throttled (due to MIN_FRAME_DELAY), suspended, or slower in the new architecture, triggered frames can be delayed or lost. This is the most plausible explanation for the ~1s delay with useMainSegmentOnly enabled — frames accumulate in the pixel buffer waiting for service() to fire.


    4. realtimeOverride check simplified in DDP handler

    v0.15.4:

    if (!realtimeOverride || (realtimeMode && useMainSegmentOnly)) {
        // write pixels
    }

    This allowed pixel data to be processed even when realtimeOverride was active, if already in realtime mode with useMainSegmentOnly.

    main:

    if (!realtimeOverride) {
        // write pixels
    }

    This is simpler but means some packets that were silently processed before are now silently dropped. This could cause partial-frame artifacts rather than stalling, but in edge cases might reduce throughput.


    5. No new mutex/lock acquisitions in the async_udp receive chain

    I found no new mutex, semaphore, or lock acquisitions introduced in the handleDDPPacket() / handleE131Packet() callbacks themselves. The receive path sets e131NewData = true and writes pixel data; no blocking primitive is taken on the hot path.


    Probable root cause of the reported delays

    Symptom Most likely cause
    ~1s delay, otherwise responsive strip.trigger() + deferred service() with useMainSegmentOnly enabled — frames pile up waiting for service() to fire
    2000ms+ pings, WebUI completely unresponsive portMAX_DELAY stall in lwIP tiT task (AsyncUDP queue full), triggered when async_udp is blocked — cause needs more investigation

    The highest-value thing to test: try reproducing with useMainSegmentOnly explicitly disabled. If the delay disappears, the strip.trigger() deferral is the culprit. If the severe stall (@tomiko23lol's case) persists, there is a second independent issue where the async_udp drain is blocked.

  19. softhack007 commented on May 27, 2026

    @softhack007
    Member

    This is the most plausible explanation for the ~1s delay with useMainSegmentOnly enabled — frames accumulate in the pixel buffer waiting for service() to fire.

    @coderabbitai There is no queue involved in the service->show path, only pixel buffer arrays. This explanation might explain slow framerates, but it cannot cause esp32 unresponsiveness or lagging behind.

  20. coderabbitai commented on May 27, 2026

    @coderabbitai
    Contributor

    @softhack007 — you're absolutely right, and I appreciate the correction.

    Pixel buffers are written in-place: each new packet overwrites the same memory locations, so no backlog can ever build up in that path. At worst, strip.trigger() deferral causes frame drops (newer data silently overwrites unshown data), which would manifest as lower effective FPS — but the displayed frame is always at most one service() cycle old. There is no mechanism for accumulated delay there.

    So to revise:

    • The trigger() deferral can only explain reduced framerate (some frames are never shown), not a growing lag or network unresponsiveness.
    • The ~1 second accumulating delay and 2000ms+ ping / WebUI lockup both still lack a clear explanation from the application-side changes I found.

    This brings the analysis back to the network/FreeRTOS layer. The portMAX_DELAY in AsyncUDP's _udp_task_post remains a potential path to full network stall — but as you noted earlier, that flaw pre-existed 16.0. The open question is whether something in the new Tasmota 2.0.18 platform (sdkconfig defaults, WiFi power-save settings, lwIP task priorities, or core affinity of async_udp vs loopTask) changed in a way that makes the queue-full condition now reachable under normal streaming load, whereas it wasn't before.

  21. withay commented on May 27, 2026

    @withay
    Author

    @withay @tomiko23lol please upload the cfg.json and presets.json files from your esp32 boards here. We'll need these files for trying to reproduce your issues.

    presets.json
    cfg.json

  22. softhack007 commented on May 28, 2026

    @softhack007
    Member

    @DedeHai @withay no luck yet with reproducing your delay, sorry.

    I don't have HyperHDR, so i've grabbed the next windows APP at hand that sends DDP - WledVideoSync in my case. The App sends DDP pixel streams at 25 fps. I was using the cfg.json and presets.json from @withay.

    Below is a plot of inter-frame times over ~10 seconds of streaming - measure by the receiving esp32 via millis() for each packet (directly inside the DDP handler).

    Image
    • There is considerable network jitter, but the mean delay is 40ms - exactly 25 FPS as expected. In case of buffer congestion on the esp32 side, i would expect a pattern where lots of frames arrive in short time, or a burst of packets - then nothing for long time - then another burst.

    Other suspicions also not confirmed:

    • no signs of main loop stalling - more than 2000 loops/second while receiving.
    • no signs of WLED sync flood during streaming.
    • no problems with WebUI responsiveness during streaming.

    == > next test (tomorrow) will be with one esp32 sending LEDs to another ESP32 via DDP network output.

  23. softhack007 commented on May 28, 2026

    @softhack007
    Member

    @withay @tomiko23lol there is actually a known problem that only affects esp32 that were upgraded from 0.15.x to 16.0.

    The new espressif framework (inside 16.0) has a newer Filesystem (LittleFS) driver. If you upgrade from 0.15.x and you don't erase your complete device first, the new firmware needs to handle an old filesystem - several users have already reported that WLED 16.0 generally gets very slow in this situation - almost non-responsive in some cases.

    The "fix" was to perform a complete factory reset - a factory reset re-creates the Filesystem and brings it up to the new format expected by espressif's driver.

    • go to "Security & Update Setup" check "Factory reset:", click "save". Warning: All settings and presets will be erased.
    • After reset, you have to re-connect your device to WiFi and re-upload a backup of cfg.json and presets.json.

    several users have confirmed no more delays or lagging after this procedure.

    This is unrelated to DDP/HyperHDR streaming, but its worth a try.

  24. added
    needs investigation
    on Jun 16, 2026
  25. softhack007 commented on Oct 23, 2026

    @softhack007
    Member

    there is a chance that #5932 may fix this problem.

  26. withay commented on Oct 23, 2026

    @withay
    Author

    30. there is a chance that #5932 may fix this problem.

    Heh I think I'll wait until there's at least some confirmation. I haven't touched it since I rolled back and got it working again.

  27. modified the milestones: 16.1, 16.2 on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds investigation

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions