Skip to content

fix(parlio_rx): accept short frames preceded by a full idle lead - #4663

Merged
zackees merged 2 commits into
masterfrom
fix/parlio-single-led
Oct 2, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/parlio-single-led

Conversation

@zackees

@zackees zackees commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

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 returned TIMEOUT with 0 raw edges, which the harness reports as class=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::isWholeCaptureFrame in src/fl/channels/validation.h, with a host test in tests/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 1 showed a complete, well-formed frame being thrown away on every run:

RX wait/raw:      1/48
Raw sample:       L2086875 H625 L625 H562 L625 H625 L625 ... (24 HIGH bit runs)

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 case Oversampled capture accepts a 1-LED frame after idle (#4609))
  • bash test parlio_driver: pass
  • bash lint: pass

Closes #4609

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved capture handling so frames with a sufficiently long idle lead can be recognized as complete, even when they have fewer runs than the usual minimum.
    • Incomplete capture fragments are discarded without losing idle samples needed for the next frame. This helps preserve valid frames and avoid carrying partial data forward.

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]>
@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
.cursorrules — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: FastLED/FastLED/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 70432e62-d3e1-4620-9bd6-6dde2ecc0700

📥 Commits

Reviewing files that changed from the base of the PR and between ec0a0f3 and 7ba85e7.

📒 Files selected for processing (3)
  • src/fl/channels/validation.h
  • src/platforms/esp/32/drivers/parlio_rx/parlio_rx_sampler.cpp.hpp
  • tests/fl/channels/validation.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The 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.

Changes

PARLIO capture completion

Layer / File(s) Summary
Whole-capture validation criteria
src/fl/channels/validation.h, tests/fl/channels/validation.cpp
Adds isWholeCaptureFrame and tests that cover minimum run counts, LOW lead duration, and rejected captures.
PARLIO completion check
src/platforms/esp/32/drivers/parlio_rx/parlio_rx_sampler.cpp.hpp
The sampler checks idle-terminated captures with isWholeCaptureFrame. When a capture is rejected, it clears stored runs and resets first-edge tracking while retaining the current idle run’s sample count.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 7ba85

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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: accepting short PARLIO RX frames that have a full idle lead.
Linked Issues check ✅ Passed Issue #4609 reports that a 1-LED PARLIO frame produces zero capture. The sampler now accepts a short capture when it has a LOW lead longer than the idle threshold and at least one byte after that lead…
Out of Scope Changes check ✅ Passed The changes remain within issue #4609. The new validation helper defines the short-frame rule, the PARLIO RX sampler applies that rule, and the test provides regression coverage. The fragment resynchr…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…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]>
@zackees

zackees commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

Review follow-up (7ba85e7), from /code-review:

  • After an idle lead, at least one byte (1 + 8 HIGH + 7 LOW = 16 runs) must follow. A lone glitch after idle is still discarded and the capture resyncs.
  • The fragment-discard branch now keeps the idle it measured, so the next frame's lead run is not shortened by one threshold.

Re-verified on ESP32-C6: --parlio --strip-sizes 1,2,3,100 all PASS and --parlio --legacy --strip-sizes 1,2,3,4,100 all PASS. bash test validation and bash lint pass.

@zackees
zackees merged commit 696faa1 into master Oct 2, 2026
119 checks passed
@zackees
zackees deleted the fix/parlio-single-led branch November 5, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

PARLIO: a 1-LED strip produces no output (AutoResearch zero_capture) on ESP32-C6

1 participant