-
Notifications
You must be signed in to change notification settings - Fork 140
Fix IPC4 pipeline trigger #3917
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
Fix IPC4 pipeline trigger #3917
Conversation
b0b45f0 to
7641581
Compare
7641581 to
768141b
Compare
71a5e88 to
b001899
Compare
sound/soc/sof/ipc4-pcm.c
Outdated
| for (i = 0; i < pipeline_info.count; i++) { | ||
| pipeline_widget = pipeline_info.pipelines[i]; | ||
| pipeline = pipeline_widget->private; | ||
| pipeline->state = state; |
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.
So, we still have the separate BE (DAI) pipeline trigger and we handle the non BE (DAI) pipelines in batch mode?
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 if there are multiple BE DAI's, their pipelines will get triggered in the respective BE trigger callbacks. There wouldnt be a batch mode there
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.
In here it does not matter if we have triggered it or not like in case of the pause?
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.
it does matter and if it is triggered it will be in the right state already no?
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 meant the ones newly triggered will need an update to the state and the others will be the same state already. So, no need to check here
|
@ranj063, I have started internal IPC4 daily test plan: 16213 |
b001899 to
a11c35b
Compare
67622a0 to
dcab26a
Compare
These will be used to perform IPC-specific PCM setup/free. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
dcab26a to
462da65
Compare
sound/soc/sof/sof-audio.h
Outdated
| }; | ||
|
|
||
| /** | ||
| * struct snd_sof_pipeline_trigger_info - multi pipeline trigger IPC info |
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.
How this struct is 'multi pipeline trigger IPC info'?
It is more like pipeline path or pipeline list.
In any case, I find it increasingly confusing that snd_sof_widget is sometimes a widget, module, component or a pipeline.
Probably it is really a snd_sof_pipeline_trigger_path? Certainly not IPC info.
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.
And this does not necessarily needs to be valid for paths which consists of more than one pipeline (we always have at least 2 pipelines with IPC4, are they also multi-pipeline?)
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.
yes 2 is multi a well.
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.
In any case, I find it increasingly confusing that
snd_sof_widgetis sometimes a widget, module, component or a pipeline.
a widget is never a pipeline but widget/module/component are all used intrerchageably. There's a pipeline widget which is a widget of type snd_soc_dapm_scheduler.
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.
How this struct is 'multi pipeline trigger IPC info'?
I changed the name to snd_sof_pcm_stream_trigger_info now. hope that makes more sense.
Define the pcm_setup/pcm_free ops for IPC4. Define a new struct snd_sof_pcm_stream_trigger_info and add a new field trigger_info of this type to struct snd_sof_pcm_stream. This will be used to save the list of pipelines that need to be triggered. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
…trigger Add a new flag, skip_during_fe_trigger, to struct sof_ipc4_pipeline to skip triggering pipelines in the FE DAI trigger. Set this flag for the HDA DAI BE pipelines so that their BE pipeline will not be triggered in the FE DAI trigger. Also, move the trigger handling for all commands include START/PAUSE_RELEASE for the HDA DAI's to the backend DAI trigger ops. For the SSP/DMIC/SDW cases, remove the BE DAI trigger as they involve no DMA operations and can be triggered in the FE DAI trigger. This is in preparation to perform batch triggering of all pipelines for the non-HDA case. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Populate the pipeline_info for the PCM stream with the list of pipeline widgets that need to be handled during the PCM trigger. This will be used in the IPC-specific PCM trigger op to trigger the pipelines. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
462da65 to
dd63b11
Compare
Use the list of pipelines in the PCM stream's pipeline info to trigger the pipelines in the right order. Add a helper for triggering pipelines in batch mode that will be used to trigger multiple pipelines at the same time. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
52285a3 to
4abe644
Compare
bardliao
left 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.
This PR LGTM and test result looks good
libinyang
left 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.
LGTM
sound/soc/sof/ipc4-pcm.c
Outdated
| return 0; | ||
|
|
||
| /* allocate data for the pipeline ID's and the count of pipelines to be triggered */ | ||
| data = kzalloc(sizeof(u32) * (pipeline_info->count + 1), GFP_KERNEL); |
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.
data = kzalloc(struct_size(data, pipeline_ids, pipeline_info->count), GFP_KERNEL);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.
this too, can I fix in a fixup?
| */ | ||
| struct snd_sof_pcm_stream_trigger_info { | ||
| uint32_t count; | ||
| struct snd_sof_widget **pipeline_list; |
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'm not good at naming, but would
struct snd_sof_pcm_stream_pipeline_list {
uint32_t count;
struct snd_sof_widget **pipelines;
};
or
struct snd_sof_pipelines_in_pcm_stream {
uint32_t count;
struct snd_sof_widget **pipeline_list;
};
would describe this better?
The reason is that I don't see anything trigger_infoish in the struct
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.
@ujfalusi pipeline_list is the list of pipelines to be triggered. Isn't that good enough? And it is only used in the trigger callback.
plbossart
left 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.
ujfalusi
left 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.
@ranj063, overall this looks great, amazing actually.
I think it is fine to do fixups for the smaller issues since the functionality is not going to be changed, let's get this merged if everyone is OK with it.
|
merging |
tested with thesofproject/sof#6401
FIrst patch is from the previous PR #3914