Repository navigation
perf(parlio): #2548 enable eager-queue by default — encode/TX now interleaved - #2565
Conversation
…erleaved PR #2564 added FL_PARLIO_EAGER_QUEUE as opt-in (default OFF) out of caution about the IDF queue chaining behaviour. The user's stated goal for this work line is that encoding *should* be interleaved with TX by default — verified that the feature does that cleanly, so flipping the default to ON. ### Measured on ESP32-P4 v1.3 (16-lane × 256-LED WS2812B) OFF (previous default): steady_avg_total = 16 995 µs steady_avg_show = 9 439 µs ← encode + driver setup BEFORE TX steady_avg_wait = 7 556 µs ← TX (matches 7 680 µs floor) ON (this PR, new default): steady_avg_total = 12 920 µs (-24 %) steady_avg_show = 11 277 µs ← TX runs in background DURING show() steady_avg_wait = 1 643 µs ← only TX tail remains when wait() is called `wait_us` collapsing from 7.6 ms → 1.6 ms is the proof of interleaving: TX is now running concurrently with show()'s post-submit work (FastLED bookkeeping for 4096 LEDs + remaining engine ring submission) instead of starting after show() returns. ### Disable instructions If a specific chipset + IDF version combination shows WS2812 glitches from the inter-buffer DMA chaining (the original ~20 µs gap concern from `calculateBufferByteCount()`), set: -DFL_PARLIO_EAGER_QUEUE=0 …to revert to the conservative one-submit-per-txDone pattern. Refs #2548. Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR enables ChangesEager-queue default and documentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
✨ 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 |
…p_rom_printf (#2581) ### 1. parlio_engine.cpp.hpp — gate eager-queue PR #2565 turned eager-queue on by default to overlap encode with TX. That works correctly for frames that FIT entirely in the engine's 3-buffer ring — encoding completes before any TX submit, the loop drains `mRingCount` to 0, IDF chains them via DMA descriptors, all good. But for LARGER frames (long LED strips that exceed the ring's capacity) the engine relies on chunked streaming: `populateDmaBuffer` encodes one chunk per ring slot in `beginTransmission()`, leaves `mNextByteOffset < mTotalBytes`, and expects `txDoneCallback` → `workerIsrCallback` to encode + submit the rest as TX drains. Eager-queue's "drain mRingCount to 0" pattern corrupts this: - After eager-queue, mRingCount = 0 but IDF still has buffers in flight. - txDoneCallback for buffer 0 sees count = 0 AND bytes_transmitted < total, takes the "ring empty but more data pending" branch. - That branch sets mHardwareIdle = true and mTransmitting = false even though IDF is currently transmitting buffer 1 — corrupting the state machine. Fix: only fire the eager-queue loop when `mNextByteOffset >= mTotalBytes` (i.e., the whole frame is already encoded). For streaming frames, fall back to the existing one-submit-per-txDone pattern. Verified on P4 v1.3 16-lane × 256-LED (fits in ring): steady_avg_total = 12 431 µs steady_avg_show = 10 817 µs steady_avg_wait = 1 613 µs ← TX still overlaps with show() Same numbers as PR #2565 — the fits-in-ring path is preserved. Large- frame streaming path now no longer trips the broken state machine. ### 2. esp_rom_printf checker Adds `ci/lint_cpp/esp_rom_printf_checker.py` to the custom-checker chain. Flags any raw `esp_rom_printf(...)` call in `src/`, `examples/`, or `tests/`. Suppress with `// ok esp_rom_printf - <reason>` on the same line for legitimate cases. Applied opt-out comments to the existing 36 legitimate uses: - `src/platforms/esp/32/drivers/usb_serial_jtag_esp32_idf.hpp` (17): USB-Serial-JTAG driver bootstrap, runs before logging is up. - `src/platforms/esp/32/detail/io_esp_jtag_or_uart.hpp` (2): same. - `examples/AutoResearch/AutoResearchParlioEncode.h` (10) and `AutoResearchWave8Expand.h` (7): boot-time bench output to COM25 (testSimd RPC routing blocked by #2541). Smoke-tested: a fake `esp_rom_printf` violation in a temp .cpp file is correctly flagged; the same line with the opt-out comment is not. Rationale (in checker docstring): esp_rom_printf bypasses FastLED's logging infrastructure, blocks on a slow peripheral, and was creeping into general code as a workaround for #2541. The opt-out keeps the legitimate bootstrap callers explicit. Refs #2548, #2565. Co-authored-by: Claude Opus 4.7 <[email protected]>
Summary
PR #2564 added
FL_PARLIO_EAGER_QUEUEas opt-in (default OFF) out of caution about the IDF queue chaining behaviour. The user's directive for this work line is that encoding should be interleaved with TX by default. Verified the feature does that cleanly — flipping the default to ON.Verified on ESP32-P4 v1.3 (16-lane × 256-LED WS2812B)
steady_avg_total_ussteady_avg_show_ussteady_avg_wait_uswait_uscollapsing from 7.6 ms → 1.6 ms is the canonical proof of interleaving: TX is running concurrently withshow()'s post-submit work (FastLED bookkeeping for 4096 LEDs + remaining engine ring submission) instead of starting aftershow()returns.Disable instructions
If a specific chipset + IDF version combination shows WS2812 glitches from the inter-buffer DMA chaining (the original ~20 µs gap concern from
calculateBufferByteCount()), set:…to revert to the conservative one-submit-per-txDone pattern.
Test plan
bash lint --cppcleanBENCH_VERIFY total=12920 show=11277 wait=1643confirms interleavingRefs #2548, #2564.
🤖 Generated with Claude Code
Summary by CodeRabbit
-DFL_PARLIO_EAGER_QUEUE=0if needed)