Skip to content

Build failure when using -D WLED_ENABLE_DMX builds with led output #4298

Closed

Description

@dosipod

What happened?

EDIT: If we allow builds with both DMX and AR then we see crashes

When compiling -D WLED_ENABLE_DMX and the audio usermod is also included ( it is there by default now ) you would get the error
image

Compile is fine if the audio usermod is disabled
I have no dmx fixture to verify functionally afterword but just helping someone with the compile so not sure that is expected or not

To Reproduce Bug

Use -D WLED_ENABLE_DMX on 15.0-b7

Expected Behavior

No failure

Install Method

Self-Compiled

What version of WLED?

0.15.0-b7 (build 2410270)

Which microcontroller/board are you seeing the problem on?

ESP32

Relevant log/trace output

No response

Anything else?

No response

Code of Conduct

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

Activity

  1. softhack007 commented on Nov 21, 2024

    @softhack007
    Member

    @dosipod thanks, interesting find

    This message was actually not added by me 🤔

    20241121_192028

    @blazoncek do you remember why you've added this error?
    Does DMX output require I2S ?

  2. added
    confirmed
    on Nov 21, 2024
  3. blazoncek commented on Nov 21, 2024

    @blazoncek
    Contributor

    I no longer remember why, but it was definitely intentional.
    As DMX is not a default feature I would assume that the person compiling would understand the message and remove audioreactive usremod from compilation.
    This is true for some other compile settings as well.

  4. dosipod commented on Nov 21, 2024

    @dosipod
    ContributorAuthor

    netmindz mentioned that when using dmx that the unit might be not used for anything else even led output ( I see the unit crashes when i use led output ) so might be the case its dmx only unit

  5. netmindz commented on Nov 22, 2024

    @netmindz
    Member

    DMX output is just serial output so I don't think it's a conflict but perhaps more an issue of lack of CPU time

  6. dosipod commented on Nov 22, 2024

    @dosipod
    ContributorAuthor

    I went back to v0.14.4 to compare and the audio usermod seems to be working fine with dmx out enabled
    and I do not see any issue when enabling led output so must be a reason for the change on 15.0-b7

  7. dosipod commented on Nov 22, 2024

    @dosipod
    ContributorAuthor

    The behavior we see is as follows ( before we try softhack fix ) :

    A) On 14.4 with dmx out enabled and AR included :
    A.1) Enabling AR does not seem to cause any issue at least for audio sync .
    A.2) Setup of led output also works fine with dmx out (Proxy Universe set to 0 then fps is very low)
    and (Proxy Universe set to 1 then fps is normal ) ,we can change Proxy Universe back and forth without any issue

    B) On 15.0-b7 with dmx out enabled and AR disabled :
    If you setup led output and try to change Proxy Universe from 1 to 0 then you will see a crash ( not enabled debug yet to keep changes to minimum )

    [06:49:49]Rebooting...
    [06:49:49]ets Jun  8 2016 00:22:57
    [06:49:49]
    [06:49:49]rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    [06:49:49]configsip: 0, SPIWP:0xee
    [06:49:49]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    [06:49:49]mode:DOUT, clock div:2
    [06:49:49]load:0x3fff0030,len:1184
    [06:49:49]load:0x40078000,len:12784
    [06:49:49]load:0x40080400,len:3032
    [06:49:49]entry 0x400805e4
    [06:49:50]Ada
    [06:49:50]Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
    [06:49:50]Core 1 register dump:
    [06:49:50]PC      : 0x400813d7  PS      : 0x00060c30  A0      : 0x800e92d3  A1      : 0x3ffb1ec0  
    [06:49:50]A2      : 0x3f000000  A3      : 0x00060c20  A4      : 0x4008e90f  A5      : 0x3ffb1ee0  
    [06:49:50]A6      : 0x00050c23  A7      : 0x3ffb8058  A8      : 0x00000081  A9      : 0x3ffb1ea0  
    [06:49:50]A10     : 0x000001fa  A11     : 0x00000000  A12     : 0x000001fa  A13     : 0x0000d100  
    [06:49:50]A14     : 0x00000003  A15     : 0x00060c23  SAR     : 0x0000000a  EXCCAUSE: 0x0000001c  
    [06:49:50]EXCVADDR: 0x000000e5  LBEG    : 0x40002390  LEND    : 0x4000239f  LCOUNT  : 0x00000000  
    [06:49:50]
    [06:49:50]ELF file SHA256: 0000000000000000
    [06:49:50]
    [06:49:50]Backtrace: 0x400813d4:0x3ffb1ec0 0x400e92d0:0x3ffb1ee0 0x40118dd8:0x3ffb1f40 0x40119302:0x3ffb1f90 0x401390fd:0x3ffb1fb0 0x4008c172:0x3ffb1fd0
    [06:49:50]
    [06:49:50]Rebooting...
    [06:49:50]ets Jun  8 2016 00:22:57
    [06:49:50]
    [06:49:50]rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    [06:49:50]configsip: 0, SPIWP:0xee
    [06:49:50]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    [06:49:50]mode:DOUT, clock div:2
    [06:49:50]load:0x3fff0030,len:1184
    [06:49:50]load:0x40078000,len:12784
    [06:49:50]load:0x40080400,len:3032
    [06:49:50]entry 0x400805e4
    [06:49:51]Ada
    [06:49:51]Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
    [06:49:51]Core 1 register dump:
    [06:49:51]PC      : 0x400813d7  PS      : 0x00060c30  A0      : 0x800e92d3  A1      : 0x3ffb1ec0  
    [06:49:51]A2      : 0x3f000000  A3      : 0x00060c20  A4      : 0x4008e90f  A5      : 0x3ffb1ee0  
    [06:49:51]A6      : 0x00050c23  A7      : 0x3ffb8058  A8      : 0x00000081  A9      : 0x3ffb1ea0  
    [06:49:51]A10     : 0x000001f8  A11     : 0x00000000  A12     : 0x000001f8  A13     : 0x0000d100  
    [06:49:51]A14     : 0x00000003  A15     : 0x00060c23  SAR     : 0x0000000a  EXCCAUSE: 0x0000001c  
    [06:49:51]EXCVADDR: 0x000000e5  LBEG    : 0x40002390  LEND    : 0x4000239f  LCOUNT  : 0x00000000  
    [06:49:51]
    [06:49:51]ELF file SHA256: 0000000000000000
    [06:49:51]
    [06:49:51]Backtrace: 0x400813d4:0x3ffb1ec0 0x400e92d0:0x3ffb1ee0 0x40118dd8:0x3ffb1f40 0x40119302:0x3ffb1f90 0x401390fd:0x3ffb1fb0 0x4008c172:0x3ffb1fd0
    [06:49:51]
    [06:49:51]Rebooting...
    
  8. dosipod commented on Nov 22, 2024

    @dosipod
    ContributorAuthor

    @softhack007 I can still see the crash now even after the fix by just setting led output with 256 leds with dmx enabled build . So seems the whole dmx is busted but I am going to leave this be as I have no fixture nor a real interest in DMX but still if you need us to test the crash part then that we could do

  9. blazoncek commented on Nov 22, 2024

    @blazoncek
    Contributor

    @dosipod please use exception decoder when posting crash dumps. Without it they are almost meaningless.
    The only usable information from this crash dump is that it is caused by invalid pointer.

  10. dosipod commented on Nov 22, 2024

    @dosipod
    ContributorAuthor

    @blazoncek When I enabled debug there was nothing useful , might be you could give that a shot

  11. softhack007 commented on Nov 22, 2024

    @softhack007
    Member

    @dosipod could you upload a cfg.json just before you change Proxy Universe from 1 to 0 ?
    I'm not very familiar with DMX out, and was not able to reproduce the crash yet.

  12. softhack007 commented on Nov 22, 2024

    @softhack007
    Member

    Update: I've managed to bring my esp32 into a boot loop with DMX out enabled , and one output with 256 leds
    I even removed audioreactive and espNow, and its still boot-looping. The crash location looks random, not sure what's going on...

    ---WLED 0.15.0-b7 2410270 INIT---
    
    esp32 v3.3.6-16-gcc5440f6a2
    arduino-esp32 v1.0.x
    
    CPU:   ESP32-D0WDQ5 rev.3, 2 core(s), 240 MHz.
    FLASH: 4 MB, Mode 3 (DOUT), speed 40 MHz.
    heap 312560
    JSON buffer allocated: 32767
    PIN ALLOC: Pin 1 successfully allocated by 0x89.
    PIN ALLOC: 0x00000000000002.
    PIN ALLOC: Pin 2 successfully allocated by 0x8A.
    PIN ALLOC: 0x00000000000006.
    Registering usermods ...
    heap 279724
    Reading config
    Reading settings from /wsec.json...
    JSON buffer locked. (3)
    JSON buffer released. (3)
    JSON buffer locked. (1)
    Reading settings from /cfg.json...
    Heap before buses: 277408
    Removing all.
    Maximum LEDs on a bus: 256
    Digital buses: 1
    PIN ALLOC: Pin 16 successfully allocated by 0x82.
    PIN ALLOC: 0x00000000010006.
    Successfully inited strip 0 (len 256) with type 22 and pins 16,255 (itype 23). mA=55/0
    LED buffer size: 2304B
    Heap after buses: 272416
    PIN ALLOC: Pin 0 successfully allocated by 0x85.
    PIN ALLOC: 0x00000000010007.
    Starting usermod config.
    JSON buffer released. (1)
    heap 272372
    Initializing strip
    Loading custom palettes
    heap 272168
    Usermods setup
    heap 272168
    Defaulf WiFi used.
    
    Ada
    initServer
    heap 217080
    initIR
    heap 217080
    Initial connect or forced reconnect.
    Defaulf WiFi used.
    initConnection() called.
    Access point disabled (init).
    Connecting to WLAN2...
    Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
    Core 1 register dump:
    PC      : 0x40081437  PS      : 0x00060c30  A0      : 0x800e8e0f  A1      : 0x3ffb1e90
    A2      : 0x00000000  A3      : 0x00060c20  A4      : 0x4008e847  A5      : 0x3ffb1eb0  
    A6      : 0x00050c23  A7      : 0x3ffb8058  A8      : 0x800825a2  A9      : 0x3ffb1e70
    A10     : 0x0000024f  A11     : 0x00000000  A12     : 0x0000024f  A13     : 0x00001180  
    A14     : 0x00000003  A15     : 0x00060c23  SAR     : 0x0000000a  EXCCAUSE: 0x0000001c
    EXCVADDR: 0x00000040  LBEG    : 0x400014fd  LEND    : 0x4000150d  LCOUNT  : 0xffffffff  
    
    ELF file SHA256: 0000000000000000
    
    Backtrace: 0x40081434:0x3ffb1e90 0x400e8e0c:0x3ffb1eb0 0x40119db8:0x3ffb1f10 0x4011a2e2:0x3ffb1f90 0x4013b339:0x3ffb1fb0 0x4008c2a2:0x3ffb1fd0
      #0  0x40081434:0x3ffb1e90 in Segment::progress() const at wled00/FX_fcn.cpp:1549
      #1  0x400e8e0c:0x3ffb1eb0 in Segment::handleTransition() at wled00/FX_fcn.cpp:1549
          (inlined by) WS2812FX::service() at wled00/FX_fcn.cpp:1322
      #2  0x40119db8:0x3ffb1f10 in WLED::loop() at wled00/bus_manager.h:122
      #3  0x4011a2e2:0x3ffb1f90 in loop() at wled00/wled_main.cpp:23
      #4  0x4013b339:0x3ffb1fb0 in loopTask(void*) at C:/Users/frank/.platformio/packages/framework-arduinoespressif32@src-e9b1fbd6563a55e19ddae15e1fc09589/cores/esp32/main.cpp:23
      #5  0x4008c2a2:0x3ffb1fd0 in vPortTaskWrapper at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)
    
    Rebooting...
    
  13. softhack007 commented on Nov 22, 2024

    @softhack007
    Member

    I can create a crash on a freshly wiped esp32. just by installing a build with DMX out enabled, then setting one led output (ws2812b) with 256 leds, and toggleling DMX output (Proxy Universe to 1), then rebooting.

    I think we should understand what's happening before releasing 0.15.0-RC1

  14. dosipod commented on Nov 22, 2024

    @dosipod
    ContributorAuthor

    @dosipod could you upload a cfg.json just before you change Proxy Universe from 1 to 0 ? I'm not very familiar with DMX out, and was not able to reproduce the crash yet.

    @softhack007 Not sure you still need that as the unit like you noticed would crash by just setting up led output if dmx out is enabled in the build ( I never changed any other setting so it is fresh serial install ) .

    dmx_out_crash_fresh_wled_cfg.json

    I am starting to think there could be other areas and specially usermods that might cause crashes as it seems a lot of changes are not tested as it is not possible to test on all different types of devices with all the available configuration options and usermods , that is without releasing for the masses to test so it is really hard decision to make

  15. 13 remaining items

  16. added this to the 0.15.2 milestone on Feb 22, 2025
  17. mxklb commented on Sep 9, 2025

    @mxklb
    Contributor

    Usecase: I use WLED DMX output to trigger DMX lights (RGBW+Dimmer) with WLED UI. Doing so, each DMX light acts like a LED pixel. Mostly just using WLED sync feature on a master controller (DMX output instance is slave). This is great if you have LED setup and want to sync your DMX lights to it. In general DMX lights are triggered by DMX consoles, and WLED can be triggered by DMX console as well, this is fine.. but the real interesting usecase is, if you don't have DMX console but WLED with DMX output. So it's possible to trigger DMX lights and LEDs together/synced by simple using WLED UI.

    In the past (WLED <= v0.14.1) this was working, nevertheless if audioreactive usermode is enabled. Because I updated all my (none DMX output) boards to >= v0.15.x, I'd like to update DMX output board aswell, but sadly this isn't working any more :(

    Because WLED sync doesn't work well between AR and none AR versions, as well as different WLED versions lacks sync for some effects, it's best to use consitent WLED versions on all controllers. Nevertheless because of this issue I can't provide a DMX output version running v0.15.x.

    My workaround actually is to stick to 0.14.1 until this AR & DMX Output issue is fixed.

    P.S. And/or live with mismatching sync behaviour due to this WLED version mismatch.

  18. mbuzina commented on Nov 1, 2025

    @mbuzina

    Is a fix for this in the work? I want to build a small dmx controller using wled and having audio reactive in it would be great!

  19. softhack007 commented on Nov 4, 2025

    @softhack007
    Member

    Is a fix for this in the work? I want to build a small dmx controller using wled and having audio reactive in it would be great!

    I think audioreactive is not the problem, at least if you use classic esp32, or esp32-S3. Audioreactive runs on the second core in a separate task, and it uses 3-10ms of CPU for each FFT run, so less than 30% CPU load caused by AR.

  20. softhack007 commented on Nov 4, 2025

    @softhack007
    Member

    As we are talking about DMX Serial output (not DMX serial in), There might be some buffer congestion problems.

    • handleDMXOutput(); is called in the WLED main loop
    • The function collects data for DMX, going over all pixels (which could be A LOT of pixels). It uses strip.getPixelColor(i) so it should not interfere with the SEGMENT system.
    • dmx.write() and dmx.update() try to push everything out to the serial driver.

    --> I found an old note that DMX output sometimes causes watchdog resets. This is a smoking gun of timing problems.
    --> educated guess: the serial driver has a buffer; if the buffer is full then Serial.write() and Serial.flush() will wait until there is space available again.

    One problem could be that "blasting out everything in one shot" - basically "while(have_pixels()) do Serial.write();" - is simply taking too long, and the esp32 task watchdog timer finally ends that misery with a nice crash.

    Other ideas:

    • are internal buffers managed correctly by the DMX code? Overwriting buffer bounds could also lead to "spurious" crashes in other parts, because data in RAM gets overwritten at random.
    • Is the serial port driver used correctly? You should never do Serial.end() while there is still data in the driver's buffer.
    • are we sure that strip.getPixelColor(i) is not called in the wrong moment, for example when busses are re-initializing?
    • handleDMXOutput() currently doesn't have any rate limiting, it might run too often while there is actually no change to any LEDs. Something like if (millis() - last_time < strip.getFrameTime()) return; could help to align dmx output rates with LEDs rendering times.

    Disclaimer: I don't have any DMX hardware. So everything I write is purely from trying to understand source code.

  21. netmindz commented on Nov 8, 2025

    @netmindz
    Member

    If we have established it's not an AR issue, can we remove the line that blocks and start a fresh issue about DMX Output?

    @softhack007

  22. changed the title [-]Crashes when using -D WLED_ENABLE_DMX builds with led output[/-] [+]Build failure when using -D WLED_ENABLE_DMX builds with led output[/+] on Nov 8, 2025
  23. softhack007 commented on Nov 8, 2025

    @softhack007
    Member

    @netmindz yes, sure

    Technically there is nothing "shared" between DMX code and AR code. AR runs the main audio code in a separate task on core 0. The only "interference" is that a small part of AR runs in the WLED main loop (usermods.loop()). This part is not time critical, however it could be that audiorective effects are lagging behind when DMX outputs hogs on the CPU.

  24. added 2 commits that reference this issue on Nov 17, 2025
  25. added a commit that references this issue on Nov 29, 2025
  26. added a commit that references this issue on Dec 15, 2025
  27. added 2 commits that reference this issue on Aug 18, 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

    backburnerbugconfirmed

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions