Repository navigation
audio: host: reload DMA when partial_size is non zero #8743
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -449,8 +449,20 @@ static int host_copy_normal(struct host_data *hd, struct comp_dev *dev, copy_cal | |
| comp_dbg(dev, "host_copy_normal()"); | ||
|
|
||
| copy_bytes = host_get_copy_bytes_normal(hd, dev); | ||
| if (!copy_bytes) | ||
| if (!copy_bytes) { | ||
| if (hd->partial_size != 0) { | ||
| if (stream_sync(hd, dev)) { | ||
| ret = dma_reload(hd->chan->dma->z_dev, hd->chan->index, 0, 0, | ||
| hd->partial_size); | ||
| if (ret < 0) | ||
| comp_err(dev, "dma_reload() failed, ret = %u", ret); | ||
|
|
||
| hd->partial_size = 0; | ||
| } | ||
| } | ||
|
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. This seems to duplicate the logic at the end of the functions, so how about instaed: And let the existing code to call dma_reload at the end of the function.
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. @dnikodem Ack, so above won't work with CONFIG_HOST_DMA_RELOAD_DELAY_ENABLE=y and if we get repeated calls copy_bytes==0 (stream is ending). So back to original version (with just the commit message clarified) is ok to me |
||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| cb(dev, copy_bytes); | ||
|
|
||
|
|
||
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 commit message, the git commit prefix should refer to the component changed, i.e. here "audio: host: ".
Could you explain a bit in which case this happens. "src" -> resampler case?
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.
Kai, thanks for feedback.
Regarding the commit message, I will make a correction to specify the component as "audio: host."
Regarding the scenario in which this could happen:
This condition typically occurs at the end of a stream, where the last data chunk does not meet the condition for reload DMA buffer (e.g., large buffers), leaving a non-zero partial_size.