-
Notifications
You must be signed in to change notification settings - Fork 349
stop all connected pipelines on XRUNs #4562
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
Conversation
src/audio/host.c
Outdated
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.
Hmm I like to return "ret" more TBH this way we are consistent of always returning the same variable and not magic numbers.
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.
I usually approach this firstly from the PoV of minimalism, secondly of locality. You don't do
int f(void)
{
int ret = 0;
return ret;
}
you just do
int f(void)
{
return 0;
}
I think this is similar. Locality - when I look at that line I immediately know what happens there. With the previous version I have to check 9 lines up to see where ret comes from and whether it was modified in between. So, sorry, no, I prefer this version.
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.
Both approaches can be considered better or worse... I think we should create a macro or enum which maps 0 with some meaningful success constant like in CAVS we have ADSP_SUCCESS. Anyway, if you feel like returning 0 instead of defined ret is more appropriate then OK, this is not critically important tbh.
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.
magic number
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.
any non-zero should do, the value isn't used anyway. I can add a comment.
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.
I see but can't we just assign exact XRUN_BYTES here? Even though currently we treat it as a boolean value at some point we may need exact value - this veriable was defined as 32 bit one so this suggest me that was the original intention.
src/audio/pipeline/pipeline-stream.c
Outdated
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.
there should be a comment informing that fall thru is deliberate
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.
no, in such trivial cases of several case statements following each other with no code between them, no COMPILER_FALLTHROUGH is needed - see line 304 below.
src/audio/pipeline/pipeline-stream.c
Outdated
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.
error message is not logical, "No active pipeline found to continue pipeline processing" maybe?
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.
well, firstly "this error should never happen" (TM), if anyone ever sees it, there's a problem. We could put an assert() there but I don't think we do that for this kind of errors. And no, it isn't processing, it's rather linking. I'll adjust
|
re-tested with Zephyr xrun recipe and found out that a change to my previous PR #4471 conflicted with this one, so I had to account for it. Now actually tested to work again. Before this PR an XRUN looked like: now it looks like Note, how in the new version 2 tasks are completed as a result of the XRUN |
db48ccd to
703d967
Compare
0c99624 to
f1e7af6
Compare
|
@mrajwa could you re-review, please? |
|
@lyakh done, in general it is fine for me, only small concern about the xrun_bytes stored as boolean value instead of exact bytes count. |
@mrajwa well, if that's a problem, I could try to copy the same xrun_bytes value from the original pipeline to all connected ones. It can be done with scanning the list twice - which shouldn't be a performance issue because the list usually consists of 1 or 2 members. But it's kind of ugly. @lgirdwood what do you think? |
To be honest I dont think the host really uses the xrun size within the individual pipelines but uses the host DMA position to determine where to restart the stream. So probably useful for debug, but not useful for host. |
@lgirdwood @mrajwa I've just grepped the sources and I only see |
Can you check IPC4 messages for any fields relating to glitches or xruns. It may be that IPC4 uses a byte or frame value in reporting stream errors and if so we need to keep. |
|
SOFCI TEST |
|
tests have been hanging since last week, kick them again. Also re-tested locally, it still does the right thing |
Fix indentation in edf_schedule.c Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Remove redundant initialisation, re-use the same return statement. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
When an xrun occurs we currently stop the affected pipelines, which also leads to stopping the pipeline task. However, the stream can be using several pipelines, all of which have to be stopped. If not stopped, tasks belonging to those pipelines will continue to be scheduled. This patch collects all connected pipelines and stops them all. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
|
CI showing one CML DUT is not running but other CML DUT is all green. |
with connected pipelines, if an XRUN occurs on one of them, all of them should be stopped