Skip to content

Conversation

@kv2019i
Copy link
Collaborator

@kv2019i kv2019i commented Jan 12, 2026

Some minor improvements to make the xrun handling code easier to follow. The current implementation is checking for DAI DMA overrun/underrun conditions both at start of a copy callback (using data from DMA driver dma_get_status()), as well as at end of copy callback (using dma_reload()). There is also two separate mechanisms to report xruns, one specific to IPC4 (CONFIG_XRUN_NOTIFICATIONS_ENABLE) and one common method using component.h interface (comp_underrun() and comp_underrun()).

Add documentation to the xrun helper functions and rename dai_report_xrun() to dai_report_reload_xrun() to better reflect the actual implementation.

Some minor improvements to make the xrun handling code easier to follow.
The current implementation is checking for DAI DMA overrun/underrun
conditions both at start of a copy callback (using data from DMA driver
dma_get_status()), as well as at end of copy callback (using
dma_reload()). There is also two separate mechanisms to report xruns,
one specific to IPC4 (CONFIG_XRUN_NOTIFICATIONS_ENABLE) and one common
method using component.h interface (comp_underrun() and
comp_underrun()).

Add documentation to the xrun helper functions and rename
dai_report_xrun() to dai_report_reload_xrun() to better reflect the
actual implementation.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the readability and documentation of xrun (overrun/underrun) handling code in the DAI Zephyr driver. The changes clarify that xrun detection occurs at two points: during status checks via dma_get_status() and after reload attempts via dma_reload().

Changes:

  • Added comprehensive documentation to xrun detection and reporting helper functions
  • Renamed dai_report_xrun() to dai_report_reload_xrun() to clarify it handles reload-specific xrun reporting
  • Updated all call sites to use the new function name

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants