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(i2s-spi): retain active frame after DMA timeout - #5481
When a second I2S SPI show times out waiting for the previous DMA transfer, drop the queued frame and preserve the active transfer. This prevents buffer growth in the next frame from deinitializing the peripheral while it is still moving data. Normal completion releases the active frame and the following show can transmit.
The host regression fails before the fix when a larger frame displaces the active frame. It passes after the fix and verifies recovery on the next show. The focused ASan/UBSan test and changed-file C++ lint passed. Full host C++ validation is running. The attached ESP32-C6 and LPC devices do not provide the classic ESP32 I2S SPI path.
Summary by CodeRabbit
Bug Fixes
When a display update reaches its wait limit while a transfer is still active, the ongoing transfer and active frame remain intact. Further updates do not replace or interrupt the active frame, and a later update can transmit the next frame after the transfer completes.
Tests
Added coverage for active transfers, queued frames, and sending the next frame after completion.
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
No actionable comments were generated in the recent review.
Walkthrough
When DMA remains active after show() reaches its wait limit, the driver now drops queued channels and returns without releasing the active transmission. A unit test checks frame ownership during this state and verifies that a later frame transmits after completion.
Changes: I2S SPI transmission handling
Layer / File(s)
Summary
Timeout handling and frame ownership src/platforms/esp/32/drivers/i2s_spi/channel_driver_i2s_spi.cpp.hpp, tests/unit/platforms/esp/32/drivers/i2s_spi/channel_driver_i2s_spi.cpp
If DMA remains active after the wait limit, show() drops queued channels and returns without clearing the busy state or releasing the transmitting channels. The test checks that the active frame remains in use, the queued frame is not acquired, and a later show() transmits a frame after polling observes completion.
When a second show() times out while DMA is still transmitting, the driver now keeps the active frame and drops the queued one, so a larger next frame can no longer displace the active frame mid-transmission. The unit test covers retention, release on completion, and transmission of the next frame. No merge-blocking risk is identified.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: when a second show() times out waiting on an active DMA transfer, the active frame is retained and the queued frame is dropped. The raw summary confirms the driver cha…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: when a second show() times out waiting on an active DMA transfer, the active frame is retained and the queued frame is dropped. The raw summary confirms the driver change in show() and the added unit test for retaining the active frame. The title is specific and matches the changeset, so it passes.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Fix failing CI checks
Commit to this branch
Create a new PR
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.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 1 remain after this review.
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.
Follow-up to #5356.
When a second I2S SPI show times out waiting for the previous DMA transfer, drop the queued frame and preserve the active transfer. This prevents buffer growth in the next frame from deinitializing the peripheral while it is still moving data. Normal completion releases the active frame and the following show can transmit.
The host regression fails before the fix when a larger frame displaces the active frame. It passes after the fix and verifies recovery on the next show. The focused ASan/UBSan test and changed-file C++ lint passed. Full host C++ validation is running. The attached ESP32-C6 and LPC devices do not provide the classic ESP32 I2S SPI path.
Summary by CodeRabbit