-
Notifications
You must be signed in to change notification settings - Fork 325
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
DMIC: eliminate the gain ramping task #5852
Conversation
@juimonen, pls take a look, we need to sync changes with zephyr dai. |
Internal tests are not working properly now. |
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.
Can we simplify and do the ramp at the start of copy() instead of adding another callback ?
|
I think it makes sense here to add copy() to the DAIs (like everything else) and keep the interface simple (and saves an extra call) |
It is just a matter of name, .copy or .pre_copy - would be called anyway at the same moment. The point is - this method does not do any copying, it is a dma/dai job |
Agree, copy() naming does not align with usage today - but soon this call will be updated to the module C API and be called process() and this is a better naming/meaning match. Adding a new API adds a bit more complexity when it comes to the module API and I'd like to avoid and reuse (where good mapping permits). |
@lgirdwood but I should call it |
Yes, call it copy() today - there will be a subsequent update that then renames later and aligns with the module API. |
The capture ramps have been the same for a long time. If something has changed there could be a new bug. But I don't think CI tests the ramp shape, it can only detect no audio or much too silent audio kind of cases. |
Two CI tests failed with a timeout: suspend-resume-with-playback on WHL_UPEXT_HDA_ZEPHYR https://sof-ci.01.org/sofpr/PR5852/build515/devicetest/?model=WHL_UPEXT_HDA_ZEPHYR&testcase=check-suspend-resume-with-playback-5 and ipc-flood on BYT_MB_NOCODEC https://sof-ci.01.org/sofpr/PR5852/build515/devicetest/?model=BYT_MB_NOCODEC&testcase=check-ipc-flood - both supposedly unrelated |
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.
Looks good to me, great work! There's some conflict, so a rebase is needed.
Rerun CI as not expecting a build failure on only 1 platform. |
SOFCI TEST |
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.
@lyakh Documentation of the new copy() method could be improved in the first patch, but otherwise this looks great.
src/include/sof/lib/dai.h
Outdated
@@ -86,6 +86,7 @@ struct dai_ops { | |||
int (*remove)(struct dai *dai); | |||
uint32_t (*get_init_delay_ms)(struct dai *dai); | |||
int (*get_fifo_depth)(struct dai *dai, int direction); | |||
void (*copy)(struct dai *dai); |
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.
A bit of documentation would be nice. In the context of the dmic problem this is easily understandable, but if you zoom out a bit, a copy method with no arguments looks very odd. Copy what and where?
@mmaka1 did you have any comments here - is this OK as part of the path forward to a copier API ? |
Add a DAI copy method to be called before dma_copy(). Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
DAI drivers sometimes need to access the underlying component object. Make this possible by adding a pointer to struct dai_data into struct dai and to struct comp_dev into struct dai_data and by assigning those pointers accordingly. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Currently the DMIC driver uses a separate task to implement its gain ramping. This creates a race during driver clean up. Avoid an additional asynchronous context by performing the ramping in DAI's .copy() context. Use the DAI's .copy() method for that. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
@lgirdwood CI on-device are 2 unrelated suspend -resume failures: https://sof-ci.01.org/sofpr/PR5852/build602/devicetest/?model=TGLU_UP_HDA_ZEPHYR&testcase=check-suspend-resume-5 and https://sof-ci.01.org/sofpr/PR5852/build602/devicetest/?model=WHL_UPEXT_HDA_ZEPHYR&testcase=check-suspend-resume-with-capture-5, checkpatch is complaining about a line, ending in '(' which I agree isn't pretty but looked like the best option in that case to avoid way too long a line |
@mmaka1 ping ? |
Merging since this fixes an issue, we can align to copier APIs incrementally. |
The DMIC driver currently uses a separate task to perform gain ramping on start up. This can be achieved from the
.copy()
context avoiding an additional asynchronous context and races associated with it.