-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC: SOF: ipc4-topology: add copier module type support #3888
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
ASoC: SOF: ipc4-topology: add copier module type support #3888
Conversation
|
Do we have firmware log here? what firmware are you used? |
|
@bardliao As I suggested, the last four dword should be "000000, ffffffff, 0000000, 000000" // invalid node id for non-gtw |
Thanks @RanderWang I will try it. |
Thanks @RanderWang. Your suggestion works with SOF. @plbossart @ranj063 @RanderWang I have an open on this PR. What dapm type should we use for the "module" type copier? It is |
9b949ab to
381bc16
Compare
I think it should be |
|
What's wrong with: snd_soc_dapm_demux, /* connects the input to one of multiple outputs */That's exactly what a copier does, doesn't it? |
@aiChaoSONG We already support copier module for host and dai. We can reuse the existing code if we add its ops in tplg_ipc4_widget_ops. And IMHO, demux is not an effect.
@plbossart In this specific use case, yes. But copier can also simply do format conversion. And I would like to use the same sof_ipc_tplg_widget_ops for both use cases. |
copier can accept 1 input and duplicate to max 4 outputs |
381bc16 to
99f3dd4
Compare
@plbossart the demux we have in SOF need kcontrol data isnt it whereas the copier doesnt it. If we call this type of copier a demux, we'll need to differentiate between the SOF demux component and the copier with UUIDs. I suppose its not so bad but I somehow like the "buffer" type better |
99f3dd4 to
bb134dc
Compare
|
We can't use |
427e0c0 to
abc9f38
Compare
RanderWang
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
|
@plbossart Could you review it? Thanks. |
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.
@bardliao, this "copier module" thing is basically a different configuration of the copier module, right?
We have copier on the DAI side, we have copier on the AIF side and this is somewhere else, likely in the middle.
It is a bit confusing to me at least the fact that we have separate setup and free callbacks for the two other type of copiers (this patch does not adds copier type support, it adds a buffer type of the copier) while you are re-using the AIF copier for the buffer copier.
I think it would be cleaner to just add a new setup and free for the buffer type of copier?
I would probably extend the commit message a bit since this is not obvious a bit.
The "module copier" is as meaningless as it can get, imho. I won't block this PR, but I really feel that it can be done cleaner.
@ujfalusi I asked to merge the set/free for cmodule copier and host copier parts. There was just too much code duplication with separate callbacks |
Yes
Yes
DAI and host copiers have separate setup and free callbacks because the callbacks don't look so similar. snd_soc_dapm_buffer is a dapm widget type and I use it to map to the module copier.
Sure, I will try to explain it more in the commit message.
|
7843ada to
836d4dc
Compare
But a horrible and meaningless name in firmware does no mean it is good, again imho. Codewise I don't have issue with the PR, but I opt to not approve which is not to say that this should not be merged, but to say that I really not on the let's call the buffer (mux/mix/passthrough/conversion) mode of the copier module as module.
Thanks!
|
|
@bardliao copier.module doesnt bring out the essensce of what this copier does. I understand where you're coming from ie the tester interface that uses this name. But if you want to convince reviewers and make it clearer, why not call it copier.module_to_module.blah. That way you know that it is a copier that goes between 2 other modules instead of DAI/host copier that are endpoint copiers |
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.
It seems that for this buffer handling sometimes we use AIF helpers and sometimes DAI tokens. This looks rather weird. It looks rather ad-hoc and could be clarified IMHO
sound/soc/sof/ipc4-topology.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.
why are we using a dai_token_list for something that is not a DAI?
This sounds bad to me, I would guess some tokens apply only for real DAIs and not for internal buffer handling?
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.
why are we using a dai_token_list for something that is not a DAI?
This sounds bad to me, I would guess some tokens apply only for real DAIs and not for internal buffer handling?
Thanks @plbossart change it to host_token_list 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.
why are we using a dai_token_list for something that is not a DAI?
This sounds bad to me, I would guess some tokens apply only for real DAIs and not for internal buffer handling?Thanks @plbossart change it to host_token_list now.
And rename it to common_copier_token_list after chatting with Ranjani.
sound/soc/sof/ipc4-topology.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.
I am a bit lost here, we are trying to reuse the same setup_pcm for AIF and internal buffer handling. So do we need a dma_buffer_size here? what does this mean for an internal buffer. Should this test be moved to line 349 instead?
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 am a bit lost here, we are trying to reuse the same setup_pcm for AIF and internal buffer handling. So do we need a dma_buffer_size here? what does this mean for an internal buffer. Should this test be moved to line 349 instead?
We don't need to get dma_buffer_size from topology. It should be always 0. But we need to allocate available_fmt->dma_buffer_size and it will be used in sof_ipc4_prepare_copier_module https://github.com/thesofproject/linux/blob/topic/sof-dev/sound/soc/sof/ipc4-topology.c#L1358
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.
you should capture this with a comment, this is useful information that explains the code structure.
this can be done with a fixup
836d4dc to
e5171d9
Compare
The corresponding IPC4 module of snd_soc_dapm_buffer widget is module -to-module copier. The module-to-module copier is a buffer-like component with demuxing capabilities. Rename the host_token_list to common_copier_token_list since it will be used by host copier and module-to-module copier. The setup callback is almost the same as sof_ipc4_widget_setup_pcm except the gtw_cfg data, and the free callback is exactly the same as sof_ipc4_widget_free_comp_pcm. To reduce the duplication, the commit reuses the setup and free callbacks. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
e5171d9 to
305aff1
Compare
sound/soc/sof/ipc4-topology.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.
you should capture this with a comment, this is useful information that explains the code structure.
this can be done with a fixup
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.
@bardliao, thank you for the updates, looks great!
|
SOFCI TEST |
|
no regressions beyond known issues, merging |
The corresponding IPC4 module of snd_soc_dapm_buffer widget is module
-to-module copier.
The module-to-module copier is a buffer-like component with demuxing
capabilities.
Rename the host_token_list to common_copier_token_list since it will
be used by host copier and module-to-module copier.
The setup callback is almost the same as sof_ipc4_widget_setup_pcm except
the gtw_cfg data, and the free callback is exactly the same as
sof_ipc4_widget_free_comp_pcm. To reduce the duplication, the commit
reuses the setup and free callbacks.
The topology PR is thesofproject/sof#6329.
@RanderWang @aiChaoSONG @libinyang Could you take a look?