You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(esp32s3/i2s): guard show() timeout, bound DMA waits, and protect deferred groups - #5500
ChannelEngineI2S::show(): Check waitForReady() return value; if timed out, drop the newly enqueued frame and release its isInUse() flags instead of overwriting active mTransmittingChannels/mChipsetGroups. Mark ALL enqueued channels (including deferred timing groups 1..N) setInUse(true) upfront before starting group 0.
ChannelEngineI2S::poll(): Never report DriverState::READY while mTransmittingChannels is non-empty and mPeripheral->isBusy() is true; release channels cleanly when mPeripheral is null or all groups complete.
Bounded DMA waits: Replace unbounded spin loops in ~ChannelEngineI2S() and beginTransmission() (both reinit and transmit waits) with bounded mPeripheral->waitTransmitDone(2000), releasing resources and channel isInUse() flags cleanly on timeout/destruction.
prepareScratchBuffer() & beginTransmission(): Reject >16 channels (preventing mStrips[16] OOB), guard overflow and mScratchBuffer.resize() OOM, avoid null-pointer memcpy on empty channels, and free mBuffers[0] if mBuffers[1] allocation fails.
Verification
bash lint passed on all 3 modified files.
bash test channel_driver_i2s --debug passed (ASAN/LSAN/UBSAN), including a new regression test for multi-group isInUse() protection, stuck-busy show() drop, and non-hanging destructor cleanup.
CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.
Parsing warnings: 1
Validation error: Unrecognized key: "enabled" at "reviews.pre_merge_checks"
If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Change in examples/Blink per target. The left number is this PR's image flash / attributed RAM in bytes; the colored delta is the change from the merge base (red ↑ is larger, green ↓ is smaller, Same is unchanged).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes item #8 from #5492.
Summary
ChannelEngineI2S::show(): CheckwaitForReady()return value; if timed out, drop the newly enqueued frame and release itsisInUse()flags instead of overwriting activemTransmittingChannels/mChipsetGroups. Mark ALL enqueued channels (including deferred timing groups 1..N)setInUse(true)upfront before starting group 0.ChannelEngineI2S::poll(): Never reportDriverState::READYwhilemTransmittingChannelsis non-empty andmPeripheral->isBusy()is true; release channels cleanly whenmPeripheralis null or all groups complete.~ChannelEngineI2S()andbeginTransmission()(both reinit and transmit waits) with boundedmPeripheral->waitTransmitDone(2000), releasing resources and channelisInUse()flags cleanly on timeout/destruction.prepareScratchBuffer()&beginTransmission(): Reject >16 channels (preventingmStrips[16]OOB), guard overflow andmScratchBuffer.resize()OOM, avoid null-pointermemcpyon empty channels, and freemBuffers[0]ifmBuffers[1]allocation fails.Verification
bash lintpassed on all 3 modified files.bash test channel_driver_i2s --debugpassed (ASAN/LSAN/UBSAN), including a new regression test for multi-groupisInUse()protection, stuck-busyshow()drop, and non-hanging destructor cleanup.