Repository navigation
fix(parlio_rx): accept short frames preceded by a full idle lead - #4663
Conversation
The ESP32-C6 PARLIO_RX oversampling capture (the RX oracle AutoResearch uses for PARLIO TX on C6) discarded any capture with fewer than 64 level runs as a "fragment" of a frame already in flight when the sample window opened. A 1-LED WS2812 frame is 24 bits = 48 runs, so it was always discarded and wait() reported TIMEOUT with zero raw edges (class=zero_capture). PARLIO TX was emitting the frame correctly. A capture is now also whole when the window saw the line idle LOW for longer than the idle threshold before the first HIGH, the same rule that ends a frame. Long captures keep passing on run count alone. Closes #4609 Co-Authored-By: Claude <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: FastLED/FastLED/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe change adds a shared predicate for classifying complete capture frames. The PARLIO RX sampler uses it at idle gaps and preserves the current idle run’s sample count when it rejects a capture fragment. Tests cover run-count and lead-idle conditions. ChangesPARLIO capture completion
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to This change lets the PARLIO receiver accept short frames, such as a single-LED strip, that follow a full idle period. No actionable merge-blocking risk is evident from the supplied review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
…gments Review follow-up. A lone glitch after an idle lead no longer counts as a whole frame (at least 8 HIGH + 7 LOW runs must follow the lead), and the discard branch keeps the idle it measured so the next frame's lead run is not shortened by one idle threshold. Co-Authored-By: Claude <[email protected]>
|
Review follow-up (7ba85e7), from /code-review:
Re-verified on ESP32-C6: |
Root cause
The fault was in the RX side of the test, not in PARLIO TX. On ESP32-C6, AutoResearch checks PARLIO TX with the PARLIO_RX oversampling sampler (
validation::resolveCaptureBackend). RMT TX is checked with RMT RX, which is why the RMT 1-LED frame passed and told us nothing about this path.ParlioRxSampler::processSamples(src/platforms/esp/32/drivers/parlio_rx/parlio_rx_sampler.cpp.hpp,kMinFrameRuns = 64) throws away any capture with fewer than 64 level runs. The rule exists to drop the tail of a frame that was already on the wire when the sample window opened. A 1-LED WS2812 frame is only 24 bits, which is 48 runs, so it was always thrown away.wait()then saw no runs and returnedTIMEOUTwith 0 raw edges, which the harness reports asclass=zero_capture. Two LEDs give 96 runs, which is over the limit, so they passed.Fix
A capture now also counts as a whole frame when the window saw the line idle LOW for longer than the idle threshold (
signal_range_max_ns) before the first HIGH. This is the same rule that already ends a frame. Long captures still pass on run count alone, so the change only accepts more captures and never rejects one that passed before. The decision lives in a pure helper,validation::isWholeCaptureFrameinsrc/fl/channels/validation.h, with a host test intests/fl/channels/validation.cpp.The PARLIO TX engine is unchanged.
Evidence (ESP32-C6, TX GPIO0 -> RX GPIO1 jumper)
Instrumentation. I temporarily changed the sampler to keep the discarded fragment and report it as the raw edge sample. With that change,
--parlio --strip-sizes 1showed a complete, well-formed frame being thrown away on every run:That is a ~2 ms idle lead followed by 47 bit runs: PARLIO TX sent the frame correctly. The instrumentation was removed before this commit.
Before (origin/master):
bash autoresearch esp32c6 --parlio --strip-sizes 1,2:leds=1 FAIL class=zero_capture(RX wait/raw: 1/0),leds=2 PASS.After (this branch):
bash autoresearch esp32c6 --parlio --strip-sizes 1,2,3,100: 1, 2, 3 and 100 all PASS.bash autoresearch esp32c6 --parlio --legacy --strip-sizes 1,2,3,4,100: 1, 2, 3, 4 and 100 all PASS.Hardware runs had #4661 (serial adapter fix) cherry-picked locally because master's adapter breaks AutoResearch RPC on C6. Those changes are not part of this PR.
Tests
bash test validation: pass (new caseOversampled capture accepts a 1-LED frame after idle (#4609))bash test parlio_driver: passbash lint: passCloses #4609
🤖 Generated with Claude Code
Summary by CodeRabbit