-
Notifications
You must be signed in to change notification settings - Fork 349
Improve logs on xruns #7736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Improve logs on xruns #7736
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1597,6 +1597,13 @@ int dai_zephyr_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun | |
| samples = MIN(samples, src_samples); | ||
| } | ||
|
|
||
| /* return if nothing to copy */ | ||
| if (!samples) { | ||
| comp_warn(dev, "dai_zephyr_copy(): nothing to copy, dd->total_data_processed %llu", dd->total_data_processed); | ||
| dma_reload(dd->chan->dma->z_dev, dd->chan->index, 0, 0, 0); | ||
| return 0; | ||
| } | ||
|
|
||
| /* limit bytes per copy to one period for the whole pipeline | ||
| * in order to avoid high load spike | ||
| * if FAST_MODE is enabled, then one period limitation is omitted | ||
|
|
@@ -1619,13 +1626,6 @@ int dai_zephyr_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun | |
| comp_warn(dev, "dai_zephyr_copy(): Copy_bytes %d + free bytes %d < period bytes %d, possible glitch", | ||
| copy_bytes, free_bytes, dd->period_bytes); | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, we do skip the glitch detection as well. This has no functional impact, but will affect debugging as the buffer avail/free state is not printed out when we do run out. |
||
| /* return if nothing to copy */ | ||
| if (!copy_bytes) { | ||
| comp_warn(dev, "dai_zephyr_copy(): nothing to copy"); | ||
| dma_reload(dd->chan->dma->z_dev, dd->chan->index, 0, 0, 0); | ||
| return 0; | ||
| } | ||
|
|
||
| /* trigger optional DAI_TRIGGER_COPY which prepares dai to copy */ | ||
| ret = dai_trigger(dd->dai->dev, dev->direction, DAI_TRIGGER_COPY); | ||
| if (ret < 0) | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome addition. Might be good to add also data on the sink/src_samples status, providing hints whether we are not copying because of pipeline not providing/consuming data, or because of the DAI side. But can be done in later PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on the contrary, I would suggest add less characters as possible, if there is an error here, we already get the information, we can add more information personally in local build, add too much debug related code will eventually make 1.9MB exhausted, then have to split out modules as loadable modules, then maybe more bugs will come.