You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Build failure when using -D WLED_ENABLE_DMX builds with led output #4298
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
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?
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.
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
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
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 )
@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
@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.
@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.
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-gcc5440f6a2arduino-esp32 v1.0.xCPU: ESP32-D0WDQ5 rev.3, 2 core(s), 240 MHz.FLASH: 4 MB, Mode 3 (DOUT), speed 40 MHz.heap 312560JSON buffer allocated: 32767PIN ALLOC: Pin 1 successfully allocated by 0x89.PIN ALLOC: 0x00000000000002.PIN ALLOC: Pin 2 successfully allocated by 0x8A.PIN ALLOC: 0x00000000000006.Registering usermods ...heap 279724Reading configReading settings from /wsec.json...JSON buffer locked. (3)JSON buffer released. (3)JSON buffer locked. (1)Reading settings from /cfg.json...Heap before buses: 277408Removing all.Maximum LEDs on a bus: 256Digital buses: 1PIN 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/0LED buffer size: 2304BHeap after buses: 272416PIN ALLOC: Pin 0 successfully allocated by 0x85.PIN ALLOC: 0x00000000010007.Starting usermod config.JSON buffer released. (1)heap 272372Initializing stripLoading custom palettesheap 272168Usermods setupheap 272168Defaulf WiFi used.AdainitServerheap 217080initIRheap 217080Initial 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 : 0x3ffb1e90A2 : 0x00000000 A3 : 0x00060c20 A4 : 0x4008e847 A5 : 0x3ffb1eb0 A6 : 0x00050c23 A7 : 0x3ffb8058 A8 : 0x800825a2 A9 : 0x3ffb1e70A10 : 0x0000024f A11 : 0x00000000 A12 : 0x0000024f A13 : 0x00001180 A14 : 0x00000003 A15 : 0x00060c23 SAR : 0x0000000a EXCCAUSE: 0x0000001cEXCVADDR: 0x00000040 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xffffffff ELF file SHA256: 0000000000000000Backtrace: 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...
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
@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 ) .
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
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.
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.
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.
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
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.
Activity
softhack007 commentedon Nov 21, 2024
@dosipod thanks, interesting find
This message was actually not added by me 🤔
@blazoncek do you remember why you've added this error?
Does DMX output require I2S ?
blazoncek commentedon Nov 21, 2024
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.
dosipod commentedon Nov 21, 2024
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
netmindz commentedon Nov 22, 2024
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
dosipod commentedon Nov 22, 2024
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
dosipod commentedon Nov 22, 2024
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 )
dosipod commentedon Nov 22, 2024
@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
blazoncek commentedon Nov 22, 2024
@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.
dosipod commentedon Nov 22, 2024
@blazoncek When I enabled debug there was nothing useful , might be you could give that a shot
softhack007 commentedon Nov 22, 2024
@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 commentedon Nov 22, 2024
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...
softhack007 commentedon Nov 22, 2024
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
dosipod commentedon Nov 22, 2024
@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
13 remaining items
mxklb commentedon Sep 9, 2025
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.
mbuzina commentedon Nov 1, 2025
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!
softhack007 commentedon Nov 4, 2025
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.
softhack007 commentedon Nov 4, 2025
As we are talking about DMX Serial output (not DMX serial in), There might be some buffer congestion problems.
strip.getPixelColor(i)so it should not interfere with the SEGMENT system.--> 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:
Serial.end()while there is still data in the driver's buffer.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 likeif (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.
netmindz commentedon Nov 8, 2025
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
[-]Crashes when using -D WLED_ENABLE_DMX builds with led output[/-][+]Build failure when using -D WLED_ENABLE_DMX builds with led output[/+]softhack007 commentedon Nov 8, 2025
@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.
fix for wled#4298 - no conflict with DMX output
fix for wled#4298 - no conflict with DMX output
Merge pull request #5097 from netmindz/no-dmx-ar-conflict_0_15
Merge pull request #5096 from netmindz/no-dmx-ar-conflict
fix for wled#4298 - no conflict with DMX output
Merge pull request wled#5096 from netmindz/no-dmx-ar-conflict