Commit Graph

112 Commits

Author SHA1 Message Date
Frank
49130c9ec9 (chores) cleanup some compiler warnings
* switch-cases that fall through
* potential buffer overflow in improv.cpp
* potentially uninitialized variables in FX.cpp
* potential array out-of-range on segment::col[]
* minor optimization: only apply gamma correction when result is needed
* tag some possibly unused variables with   [[maybe_unused]]
2026-03-11 13:54:58 +01:00
Frank
fa30c39a38 bugfix: prevent array bounds violations due to short WS payload data
Guard against zero-length binary payloads before dereferencing data[0] or data[1]
2026-03-01 22:33:29 +01:00
Frank
a1555c43a0 move ws LEDs preview buffer into PSRAM
* set DYNAMICBUFFER_USE_PSRAM in build_flags => enable PSRAM support in AsyncWebServerWLED
2026-02-20 15:26:03 +01:00
Frank
80b906999b requestJSONBufferLock() variable timeout
* default timeout = 1800ms
* reduced timeout for ws (300ms)
2025-12-30 01:57:46 +01:00
Frank
02d23b3316 fixing some compiler warnings
signed vs. unsigned, deprecated functions, printf parameter size mismatch
2025-12-17 00:03:18 +01:00
Frank
47f96fdd4a post-merge adjustments 2025-11-14 19:51:17 +01:00
Damian Schneider
9b6ce948f2 Adding DDP over WS, moving duplicate WS-connection to common.js (#4997)
- Enabling DDP over WebSocket: this allows for UI or html tools to stream data to the LEDs much faster than through the JSON API.
- first byte of data array is used to determine protocol for future use
- Moved the duplicate function to establish a WS connection from the live-view htm files to common.js
- add better safety check for DDP: prevent OOB reads of buffer
2025-11-14 19:42:50 +01:00
Frank
36648d1936 hot path optimization: make gamma correction inline
* make sure that gamma LUT is always initialized
* remove some unnecessary safety checks
* make gamma8() inline, for more speed
* use fast unGamma8 for preview
* add super-fast unGamma8 for HUB75 - old function lost 3-10 fps, this version does not reduce fps at all *grins*
2025-11-10 23:17:16 +01:00
Frank
7b3b6b45a1 fix preview flickering when sending out DDP or art-net
BusNetwork stores original colors (not modified by global brightness), so `restoreColorLossy(strip.getPixelColor(i), stripBrightness);`  was actually restoring brightness twice when running network output. This lead to preview flickering.
2024-12-19 23:18:25 +01:00
Frank
0dd036cdce AR: trying to improve coexistence with HUB75
Hub75 is very memory hungry. So we try to make a bit more RAM available
* use 16bit samples when compiling with HUB75 support --> 3KB saved
* avoid using aPLL (HUB75 needs it)
* move audio buffers from BSS (always allocated) to heap (only allocated when FFTtask runs) --> 10Kb saved
* suspend live preview for 6 seconds when out-of-memory
2024-10-13 23:06:50 +02:00
Frank
559d86256c live preview speedup 2024-09-28 02:56:46 +02:00
Frank
2aa0d47036 adding getPixelColorRestored()
similar to getPixelColor, but returns the original pixel without brightness adjustments.

* getPixelColorRestored is used by segment::sPC and segment::gPC
* getPixelColor is still used by ABL (auto brightness limiter)
2024-09-28 02:43:12 +02:00
Frank
0ca3f136b1 ws error printing improvement
* limit to 3 messages per second
* print size when alloc failed
2024-09-28 02:06:48 +02:00
Will Miles
9103f6a4df Update for new AsyncWebSocketBuffer
Eliminate the extra indirection and allocate shared buffers directly.
2024-06-26 21:08:21 +02:00
Frank
2510292d1a ws preview: better handling of RGBW
avoid over-saturation in preview
2024-06-24 18:04:18 +02:00
Frank
1cd18e7f08 Live preview: faster handling of "off" 2024-05-10 19:22:41 +02:00
Frank
70a5d8b843 a few more compile-time infos about enabled/disabled features
helps to understand what you'll get
2024-05-04 01:16:45 +02:00
Frank
019cafc5e0 report out-of-memory situations to the user 2024-04-16 19:10:46 +02:00
cschwinne
aff4de34b4 WS logic: No resending, improved ESP8266 stability
Update ESP8266 core to 3.1.2
2024-04-09 14:15:06 +02:00
Frank
7ae38649ad post merge
MM specific adjustments
2024-02-23 10:24:26 +01:00
Blaz Kristan
c9611bde73 JSON buffer lock error messages
Reduce wait time for lock to 100ms
2024-02-23 09:49:26 +01:00
Frank
8905992a89 code spell checking - part4 (MM specific) 2023-12-15 00:14:57 +01:00
Frank
ced03f1f08 code spell checking - part1 (core)
I've found a code spellchecker, so this is what can be corrected easily. Changes are only affecting comments, readme and a few user-visible strings. So no functional impact expected.
2023-12-14 22:05:55 +01:00
Ewoud
b88e7825b8 Populate nodes stability improvements and preview efficiency imprvements 2023-10-25 16:01:50 +02:00
Ewoud
0092e49eb3 GFX/Preview done right if > 4096 pixels + unlimited virtual pixels in 2d 2023-10-24 16:58:35 +02:00
Frank
92e64b797a 8266 hotfix: solving connectivity problems
* it seems that `WiFiUDP.flsuh()` does something completely different from 8266, and  its actually causing WLED to stall on UI calls. So not usable on 8266.
* fixing a few compiler warnings about "comparing signed and unsigned"

NB: its a hotfix, we have to check if there are other problems on 8266. Also its definitely ugly, but it helps as a band aid.
2023-08-22 22:55:05 +02:00
Frank
8e678ffa5e allow gamma corrected preview without gamma corrected LEDs 2023-08-05 00:06:58 +02:00
Frank
f010adfe24 experimental: preview with gamma correction
.... actually we undo gamma adjustments, because screens (laptop, pad, etc) will apply their own gamma corrections.

Activate in LED settings: "Use Gamma correction for preview"

Colors in WLED are sometimes gamma corrected, sometimes not. This change tries to make the best out of the color mess, but its still not working properly in all configurations.
2023-08-04 22:03:53 +02:00
Frank
5f55f91ff0 debug message cleanup
changed some non-critical USER_PRINT debug messages into DEBUG_PRINT
2023-07-14 16:17:42 +02:00
Frank
9243b90345 max is faster than MAX 2023-07-13 21:14:43 +02:00
Frank
99def6458f live view: more updates in non-fastpath builds 2023-07-13 21:11:33 +02:00
Frank
c22c92e3af preview at full brightness
* reverts global brightness in preview
* can NOT revert brightness reductions from auto brightness limiter.
2023-07-10 18:29:16 +02:00
Frank
4d64efa5cb sendLiveLedsWs: don't kick clients
... on low memory conditions, as a lot of UI communication depends on web-sockets (thanks @ewoudwijma for pointing this out).
2023-06-04 17:11:26 +02:00
Ewoud
d8bc5e2bce Dynamic Peek framerates 🎉 2023-05-29 22:54:23 +02:00
Ewoud
4197f98afe package.json and cdata.js: set urls to MoonModules
index.js: add logging (temp) and improve segment view redrawing
wled00.ini: add lps (temp)
wledserver.cpp: show client request done after its done
ws.cpp: show websocket events (temp?)
2023-05-25 21:50:43 +02:00
Frank
63e63ad156 minor speedup for liveview and websockets
it seems that getFreeHeap() needs some time, and blocks other tasks until completion.
sendDataWS() does not need ESP.getFreeHeap() results on esp32.
2023-05-21 21:01:23 +02:00
Frank
72f7f9c555 fix 8266 compile error
*hrmpf* 8266 does not support C++ try-catch and exceptions.
2023-05-15 21:38:23 +02:00
Frank
6d23eb6874 improve robustness when heap is low
* customMappingTable: allocate using calloc instead of new (new will throw exception if nor enough heap)
* fixing a few minor memory leaks
* ws.cpp: catch out-of-memory in sendLiveLedsWs
* ws.cpp: change interval to 80ms (120 ws very slow...)
2023-05-15 21:15:24 +02:00
Frank
7d0e627e14 some effect optimizations
* getpixelcolor: attribute pure - it reads memory, but does not write
* some optimizations for SEGMENT.blur() and SEGMENT.fadeToBlackBy()

* FX.c:pp remove double calls to blur() and fade_out()
* FX.cpp: SEGMENT.setUpLeds() added to effects, to enable LED buffering (safe some time because getPixelColor does not need to access NeopixelBus)

* a few other optimizations to safe time and avoid "expensive" operations
* set I2C bus speed to 400kHz (default is 100Khz)

* a few other small optimizations and tweaks
* pio: esp32 V4 builds use "patch5" toolchain version, which contains a few bugfixes especially for memory management.
2023-05-03 20:33:23 +02:00
Frank
e1cadbc337 (experimental) reduced websocket frequency
fastpath: reduced websocket frequency, to have more time for physically attached LEDs.

fingers crossed that this won't break anything....
2023-04-30 21:00:28 +02:00
Frank
40c96c14f5 a bunch of smaller speedups to core functions
*  make local functions "static"
* use fast_ int types where possible
* use native min/max instead of MIN/MAX macros. Macros evaluate each parameter TWICE!!
* adding __attribute__((pure)) and __attribute((const)) to help the compiler optimize
* ws.cpp: reduce max "live leds" in fastpath mode
2023-04-30 18:41:30 +02:00
Ewoud
753f5621d1 ws sendLiveLedsWs: no skiplines to show large matrices uncompressed 2023-04-06 11:49:16 +02:00
Ewoud
5991aa8624 UI/GFX improvements 2023-03-27 20:41:53 +02:00
Ewoud
9b25b6d8c6 Changes in Debug messages 2023-03-27 20:26:03 +02:00
Frank
f52e706c95 minor improvements for debugging
* Info page: status of Serial (can be disconnected on new MCUs), and owner of RX/TX pins
* improved handling of Serial (don't write if not connected)
* added min available stack size to debug output (esp32 only)
* webserver show remaining stack size
* webserver: show string buffer usage
2023-03-25 21:10:15 +01:00
Ewoud
8485be27f2 Merge remote-tracking branch 'upstream/main' into mdev 2023-03-21 11:39:30 +01:00
Blaz Kristan
08e2bfe9a2 Scale 2D peek for large matrices. 2023-03-18 18:22:31 +01:00
Ewoud
9f282f831e GEQ: even distribution of bands and small changes
FX.cpp: GEQ: even distribution of bands
FX_fcn: tiny change
wled.cpp: setupMatrix also if loadedledmap != 0
ws.cpp: replace getLengthTotal by width * height (for ledmaps)
2023-03-11 13:59:23 +01:00
Ewoud
d8f625beea show only ledmap pixels, show bus lengths in segment visualization
index.js: segment visualization:
- max width if no pc
- don't show nr if only one segment
- Ledmap nr color depending on bus output

FX_2Dfcn.cpp / FX_fcn.cpp
- don't show ledmap -1 pixels

json.cpp: add busses.length to outputs

ws.cpp: peek back to strip.gPC only
2023-02-14 17:22:58 +01:00
Ewoud
476105a267 Add serpentine to default peek + version date 2023-02-13 19:14:11 +01:00