Skip to content

esp32c6 parlio: 16-lane FastLED.add() floods HWCDC with idempotent driver-registration log lines and corrupts RPC reply stream #2663

Closed

Description

@zackees

Repro

On an ESP32-C6FH4 (USB-Serial/JTAG only, 4 MB embedded flash) running examples/AutoResearch/AutoResearch.ino, calling the parlioStreamValidate RPC with {numLanes: 16, numLeds: 256, iterations: 10} (its default payload) causes the host to lose the JSON-RPC reply before it arrives. The device prints ~80 lines of debug log between request and reply:

[remote] Stored request ID for parlioStreamValidate (id=2)
FastLED.cpp.hpp(620): WARN: FastLED.add(cfg): runtime-selection mode — enrolling every available driver via fl::enableAllDrivers(). For minimum binary size, prefer FastLED.addLeds<CHIPSET, PIN, ORDER,
manager.cpp.hpp(74): ChannelManager::addDriver() - 'BIT_BANG' already registered at priority 0 (idempotent no-op)
manager.cpp.hpp(74): ChannelManager::addDriver() - 'RMT' already registered at priority 2 (idempotent no-op)
manager.cpp.hpp(74): ChannelManager::addDriver() - 'PARLIO' already registered at priority 4 (idempotent no-op)
manager.cpp.hpp(74): ChannelManager::addDriver() - 'SPI' already registered at priority 0 (idempotent no-op)
manager.cpp.hpp(74): ChannelManager::addDriver() - 'UART' already registered at priority -1 (idempotent no-op)
… 15 more identical 5-line blocks (one per remaining lane) …

The host then sees ClearCommError/PermissionError(13, 'The device does not recognize the command.') mid-read, and parlioStreamValidate never returns. On the next attempted write the COM port reports a write failure too.

Same pattern on the parlioEncodeBenchmark follow-up RPC (driver registration runs again).

Root cause

ChannelManager::addDriver() (manager.cpp.hpp:74) emits an INFO-level log on every idempotent no-op. Each call to FastLED.add(cfg) in runtime-selection mode goes through fl::enableAllDrivers(), which re-registers all 5 (BIT_BANG, RMT, PARLIO, SPI, UART) drivers. With 16 lanes that is 80 idempotent re-registrations producing ~80 log lines.

ESP32-C6's HWCDC has a small TX buffer; bursting 80 lines into it faster than the host drains saturates the pipe. On Windows the host sees a USB stall, the CDC pipe gets reset, and subsequent reads/writes fail. The actual JSON-RPC response is lost.

Why this masks parlio timing

parlioStreamValidate exists to verify the chunked-streaming encode + transpose path. With the log-flood masking the reply, every 16-lane test looks like a hang to the host, even when the parlio engine is healthy. This blocks the entire #2548 follow-up validation on ESP32-C6.

Proposed fix

The 'already registered (idempotent no-op)' message is genuinely debug-only — it tells nobody anything useful at runtime. Either:

  1. Demote to DEBUG/TRACE (cheapest). Replace FL_WARN/FL_INFO with FL_DBG in ChannelManager::addDriver() so it's compiled out at CORE_DEBUG_LEVEL ≤ 3.
  2. Suppress when driver count > 1. Only log the first registration of each driver, not every duplicate.
  3. Coalesce in enableAllDrivers(). Have the runtime-selection path register drivers once and short-circuit subsequent calls without going through addDriver() at all.

Workaround used while investigating

ci/boards.py ESP32_C6_DEVKITC_1 build_flags now carry -DCORE_DEBUG_LEVEL=2 -DLOG_LOCAL_LEVEL=ESP_LOG_WARN -DFASTLED_DEBUG=0. That silences the spam and makes parlioStreamValidate reach the host. Lands on branch fix-esp32c6-parlio, not main.

Environment

  • Branch: fix-esp32c6-parlio (commit 5fcddee)
  • ESP32-C6FH4, USB-Serial/JTAG, COM9 on Windows 10
  • arduino-esp32 from pioarduino 55.03.35 (IDF 5.5.1)
  • AutoResearch.ino with ARDUINO_USB_MODE=1 + ARDUINO_USB_CDC_ON_BOOT=1

Activity

  1. zackees commented on Jun 2, 2026

    @zackees
    MemberAuthor

    Resolved by #2498. Verified: origin/master contains merge commit 8d4e8ef; src/fl/channels/manager.cpp.hpp:74 returns duplicate driver registrations through FL_DBG, eliminating the idempotent addDriver warning flood.

  2. moved this from Triage to Done in FastLED Trackeron Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions