Skip to content

Conversation

sylvioalves
Copy link
Contributor

@sylvioalves sylvioalves commented Sep 1, 2025

Treat TX underrun as READY instead of ERROR, so DMA can be restarted.
Make START/STOP non-fatal when already in the target state.
Auto-start and flush if data is queued, no-op if idle.
Allow write() to auto-kick TX when in READY.

Treat TX underrun as READY instead of ERROR, so DMA can be restarted.
Make START/STOP non-fatal when already in the target state.
Auto-start and flush if data is queued, no-op if idle.
Allow write() to auto-kick TX when in READY.

Signed-off-by: Sylvio Alves <[email protected]>
Split i2s_esp32_trigger_stream() into smaller helper functions
(handle_start, handle_stop, handle_drain) to reduce complexity
and improve readability. No functional changes.

Signed-off-by: Sylvio Alves <[email protected]>
@sylvioalves sylvioalves force-pushed the bugfix/esp32-i2s-overrun-fix branch from 8d0811e to 1ecd7f1 Compare September 1, 2025 21:04
Copy link

sonarqubecloud bot commented Sep 1, 2025

Copy link
Contributor

@wmrsouza wmrsouza Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sylvioalves, treating TX underrun as READY instead of ERROR goes against what is stated in zephyr/include/zephyr/i2s.h:

enum i2s_state {
...
	/** TX buffer underrun or RX buffer overrun has occurred. */
	I2S_STATE_ERROR,
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants