Repository navigation
Xrun recover fixes and refactoring -- for both with and without FW internal Xrun recovery. - #851
Conversation
lgirdwood
left a comment
There was a problem hiding this comment.
Needs more detail in commit messages explaining what issue this fixes and how.
Something like this make sense? Currently neither FW internal nor external(ALSA triggered) Xrun recovery works for FW initiated Xrun(please use patch here to verify this issue: keyonjie/sof@755ea15). |
|
@keyonjie no, the detail should be added to each commit message of what and why each patch does alongside the issue it fixes. |
bb0c760 to
1bbd2f9
Compare
|
@lgirdwood updated, please help review. |
lgirdwood
left a comment
There was a problem hiding this comment.
This adds a lot of complexity.
Ideally we need to ensure that the pipeline state is consistent before pipeline_trigger(START) is called. The XRUN handling code should restore the pipeline to be ready for trigger(START).
@lgirdwood do you mean adding pipeline_pre_trigger() is too complex? even without doing prepare for trigger start?
@lgirdwood I got your point here, let me think if I can change to make it work like that. |
70b4298 to
09dea50
Compare
|
@tlauda @lgirdwood rebase and update my PR, please help review. |
09dea50 to
56ecd2a
Compare
There was a problem hiding this comment.
pipeline_prepare is called in pipeline_xrun_recover, so why do we need additional prepare here?
There was a problem hiding this comment.
The pipeline_xrun_recover() may be empty once NO_XRUN_RECOVERY is defined, that means there will be trigger stop and trigger start from host side(no prepare trigger). That's why we need this.
There was a problem hiding this comment.
So it means that rather than empty pipeline_xrun_recover() should at least do prepare call, no matter if its disabled or not. And also you are just triggering prepare here instead of calling pipeline_prepare. Is this also intentional?
There was a problem hiding this comment.
So it means that rather than empty pipeline_xrun_recover() should at least do prepare call, no matter if its disabled or not. And also you are just triggering prepare here instead of calling
yes, that's another choice. I did it in my way as some driver might send prepare IPC in future before trigger start(ALSA do has that at this senario), but ours doesn't at the moment(we haven't added prepare IPC yet actually, you can see in ipc_stream_pcm_params() we only prepare at hw_params IPC at the moment), and this prepare is actually part of the recovery, so I want to add it here to increase the robustness of our FW(to handle with and without prepare IPC before trigger start for recovery).
pipeline_prepare. Is this also intentional?
it was not intentional here, let me change this.
56ecd2a to
925d3d7
Compare
925d3d7 to
9302322
Compare
|
@tlauda updated. |
9302322 to
8e04ce4
Compare
|
@jajanusz @tlauda @slawblauciak cmoka unit test fail issue fixed. |
There was a problem hiding this comment.
This is all fine, except lets move this xrun handling to a different function i..e.
pipeline_handle_xrun_trigger()
{
// return value indicates error, caller can continue or caller should return
}
pipeline_trigger()
{
if (p->in_xrun) {
ret = pipeline_handle_xrun_trigger();
if (ret < 0)
error;
else if (ret > 0)
return ret; // xrun handler handled this no further action needed.
}
.....
}
8e04ce4 to
5c4beae
Compare
There was a problem hiding this comment.
Common condition for both cases, can be checked before switch.
There was a problem hiding this comment.
Already checked inside the function
There was a problem hiding this comment.
You always return 0.
ret = PPL_STATUS_PATH_STOP
There was a problem hiding this comment.
Should be checked against status PPL_STATUS_PATH_STOP.
5c4beae to
4fd4bc9
Compare
|
@tlauda your comments addressed and PR updated. |
There was a problem hiding this comment.
@keyonjie does the state transition diagram need updated in the component header ?
There was a problem hiding this comment.
correct, let me update it.
4fd4bc9 to
09ea37a
Compare
|
@lgirdwood @tlauda updated. |
When trigger xrun arrives, we will reset the component state to be READY, which means prepare will needed before we can recover. Update state machine diagram and cmoka unit test cases also. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
At xrun, we will try internal recovery(if we have), if recovering fails(or no internal recovery existed), we need to stop the periodic scheduling. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Once FW initiated xrun happens, the pipeline will be stopped(via pipeline_xrun()) first internally, here add logic to ignore any extra trigger_stop from host, and do prepare for xrun recovery before we can really trigger it start. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
This series will fix #902 (FW initiated Xrun recovery)
Currently neither FW internal nor external(ALSA triggered) Xrun recovery works for FW initiated Xrun(please use patch here to verify this issue: keyonjie@755ea15).
This series fix them(verified on UP^2), details please refer to commits.
dai: do re-config after prepare from xrun
pipeline: add pipeline_pre_trigger() for before pipeline real trigger
pipeline: stop pipeline at xrun if no internal xrun recovery