Repository navigation
refactor(m5stack-tab5): audio task on the shared I2S TX feed policy (follow-up to #869) - #875
Merged
Merged
Conversation
…codec/i2s_tx_feed.hpp) The follow-up promised in #869: the Tab5 was the one audio BSP still carrying its own copy of the feeding policy from #868. Its playback task now uses espp::i2s_tx_feed::Feeder like the other nine boards (attach_current_task / fill_block / notify_if_block_ready / detach_task), with the ring depth and static_assert taken from the header's constants. No behaviour change: same 12 x 240 ring, 24 ms bounded wait, whole-block writes, stream and trigger level; the Tab5's own specifics (full-duplex RX channel, microphone task, codec setup, frame-aligned producer) are untouched. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DFjjnq3XCTRAXENSxsCxJU
|
✅Static analysis result - no issues found! ✅ |
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
What changed in this PR
Refactors the M5Stack Tab5 audio playback path to use the shared espp::i2s_tx_feed feeding policy (as introduced elsewhere in the repo), removing the Tab5-specific duplicated implementation while keeping behavior consistent.
Changes:
- Replace Tab5-local I2S TX feed policy (whole-block writes, bounded wait, ring sizing) with the shared
espp::i2s_tx_feed::Feeder. - Update playback signaling to use
notify_if_block_ready()and centralize misalignment handling via the feeder. - Use shared DMA ring constants and helper (
ring_outlasts_wait) for the I2S TX ring safety static assert.
| File | Description |
|---|---|
| components/m5stack-tab5/src/audio.cpp | Switches playback task and producer notification logic to the shared I2S TX feeder implementation and constants. |
| components/m5stack-tab5/include/m5stack-tab5.hpp | Replaces per-instance playback state with a shared Feeder member and adds the feeder header include. |
Review effort: Lite
Copilot stopped reviewing on behalf of
finger563 due to an error
November 2, 2026 15:47
…eam warning The shared feeder resets the stream when it finds a partial frame, so the BSP's warning had lost the byte count the old Tab5 code logged. The Feeder now records how many bytes the stream held (misaligned_bytes, additive, no API change for the other boards) and the Tab5 warning reports it together with the partial remainder and the frame size. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DFjjnq3XCTRAXENSxsCxJU
6 of 7 tasks
4 of 6 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Summary
The follow-up promised in #869: the Tab5 was the one audio BSP still carrying its own copy of the I2S TX feeding policy that #868 introduced. It now uses the shared
espp::i2s_tx_feedheader fromcomponents/codeclike the other nine boards.audio_task_callback()isattach_current_task()+fill_block()+ the I2S write; the misaligned-stream reset is reported by the feeder and logged here.play_audio()callsnotify_if_block_ready()after a successful send (send -> notify -> return).static_assertuse the header's constants andring_outlasts_wait()against the Tab5's ownUPDATE_FREQUENCY.detach_task()before stopping the playback task.audio_tx_task_handle_,audio_tx_was_flowing_) are replaced by oneFeeder, and the long explanation block is gone in favour of a pointer at the header.No behaviour change intended: same 12 x 240 ring, same 24 ms bounded wait, same whole-block writes, same stream and trigger level. The Tab5's own specifics (full-duplex RX channel, the microphone task, the ES8388/ES7210 codec setup, the frame-aligned producer) are untouched.
Test plan
components/m5stack-tab5/examplebuilds for esp32p4 (IDF 6.1, component manager off) with no warnings in the touched files🤖 Generated with Claude Code
https://claude.ai/code/session_01DFjjnq3XCTRAXENSxsCxJU