Repository navigation
fix(parlio): size DMA buffers from per-lane input bytes - #2519
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughRing buffer capacity calculation refactored to account for ChangesPARLIO buffer accounting and padding refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes the PARLIO DMA sizing bug found while narrowing #2518. The ring-buffer calculator was treating
maxLedsPerChannel * 3 * dataWidthas the input byte count, but the engine streams byte positions per lane andoutputBytesPerInputByte()already includesdataWidthduring waveform transposition.For the 12 x 256 WS2812B ESP32-P4 case, that oversized the per-buffer capacity to about 590 KB for a 36,996-byte encoded frame. The hot path then zeroed/populated far more memory than needed before each transmission.
Changes
3) instead of3 * dataWidth.Measurements
ESP32-P4 EV, COM25, 12 lanes x 256 WS2812B, pins
2,27,3,26,4,23,5,22,49,21,50,20,FastLED.setMaxRefreshRate(0, false),FastLED.setExclusiveDriver(fl::Bus::PARLIO).Current master baseline from #2518:
Trace before fix:
Final production-code measurement after fix:
The remaining time is dominated by the current single-buffer design: the next
show()waits for the previous PARLIO transfer to finish before channel data can be rewritten, then it encodes current frame channel data and builds the next DMA waveform.Tests
bash test platforms/esp/32/drivers/parlio/parlio_driver --cppPLATFORMIO_SRC_DIR=examples/Blink uv run pio run -e esp32p4bash autoresearch esp32p4 --parlioworking end-to-end on the attached EV board #2510.Fixes #2518.
Summary by CodeRabbit