-
Notifications
You must be signed in to change notification settings - Fork 350
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
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 |
|---|---|---|
|
|
@@ -192,6 +192,17 @@ void pipeline_schedule_triggered(struct pipeline_walk_context *ctx, | |
| } | ||
| pipeline_schedule_copy(p, 0); | ||
| } | ||
| break; | ||
| case COMP_TRIGGER_XRUN: | ||
| list_for_item(tlist, &ctx->pipelines) { | ||
| p = container_of(tlist, struct pipeline, list); | ||
| if (!p->xrun_bytes) | ||
| /* | ||
| * the exact number of xrun bytes is unused, | ||
| * just make it non-0 | ||
| */ | ||
| p->xrun_bytes = 1; | ||
|
||
| } | ||
| } | ||
|
|
||
| irq_local_enable(flags); | ||
|
|
||
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
you just do
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
retcomes 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.