Repository navigation
ipc: multidai abi - #2258
ipc: multidai abi#2258slawblauciak wants to merge 2 commits into
Conversation
079576f to
d4f3d2b
Compare
plbossart
left a comment
There was a problem hiding this comment.
I can't figure out what the benefits of this PR are and why we would introduce a new IPC.
|
@slawblauciak The concept is to put/link physical dai configs to the new virtual dal config, right? My question is what is format used for? Shouldn't we use the format of each physical dais? |
If we have separate formats for each DAI, I suppose MultiDAI would be responsible for conversion? |
d4f3d2b to
e7de251
Compare
|
Changes applied. The code is now back to the initial proposal. |
No, I don't think that we have different format for each DAI use case for now. However, I don't think we have to convert the format to a single format. To me, they are still two separate DAIs. We just want to enable them at the same time. |
e7de251 to
8a2a8f4
Compare
|
Changes applied partially. Rest of the code will need to be changed to follow. |
8a2a8f4 to
8b5aeca
Compare
|
@lgirdwood just realized, the way I made it doesn't allow us to have multiple formats in a single config, since those are not part of the flex array. Is that okay? |
Sorry not, following, what do you mean by multiple formats ? Do you mean a single (SSP) DAI with multiple HW formats or do you mean multiple different DAIS with different formats ? @plbossart I would expect us to be able to send an array of DAI configs that can target multiple DAIs with multiple HW config formats/clocks/modes, although our initial use case is a single DAI with multiple configs (i.e. SSP0 with config 0 (L/R I2S stereo), SSP0 with config 1 (TDM mode, 4 channels)... |
I'd like support multiple DAIs of the same type but with the same list of formats each. |
|
In order to have the ability to support multiple formats in a single IPC (the same way we support multiple configs in a single IPC) we'd need to have those formats also in a separate flex array. But then, we're literally duplicating the fields in a single struct. That makes the ABI far more confusing, because then it gets all kinds of blurry as to which field is to be actually used here. |
8b5aeca to
427a4ad
Compare
d74dd48 to
4ca124b
Compare
|
Applied changes and rebased. |
lgirdwood
left a comment
There was a problem hiding this comment.
Should be 2 commits, one for IPC changes and the other for passing config index API updates.
plbossart
left a comment
There was a problem hiding this comment.
I could use more explanations on specific points below.
There was a problem hiding this comment.
I am a bit lost here.
The sof_ipc_dai_config already contains a 'sof_ipc_dai_base_params'.
So in the multi-dai case, is the baseline ignored?
Also in the size of this array determined by 'num_dais'?
There was a problem hiding this comment.
The base params inside of sof_ipc_dai_config is for the DAI you're directly communicating with.
The base params inside of the multidai is for the children of the multidai. And yes, the size is determined by num_dais.
To explain a bit more what's going on here:
The union of arrays contained within sof_ipc_dai_config contain structures, which don't convey basic DAI information (dai type and index). So those need to be passed separately. That's the reason behind the additional base params array.
There was a problem hiding this comment.
let's take the example of a multi-dai SounDwire/ALH case.
The dai_config would contain
hdr
base_params (multi_DAI type + index)
So then the multidai array should contain the ALH information for each child DAI, right?
The problem is that I don't see anything ALH-related in the multi_dai_params...only a stream_map and a base_params (which can only mean individual DAI and type). Where would the ALH stream_id passed?
There was a problem hiding this comment.
As I understood from the previous discussion, ALH related params would be in the flex array of the parent struct, which is in sof_ipc_dai_config.
To be specific: the first element of that flex array in this case would be the sof_ipc_dai_multidai_params. And directly after that, the very next members would be the children for multidai, namely sof_ipc_dai_alh_params.
There was a problem hiding this comment.
sorry, I don't get how this would work.
You don't have an array of unions, you have a union of arrays.
I don't think you can make the type of structure vary between array elements?
There was a problem hiding this comment.
I'm pretty sure you can, since from the standpoint of the compiler, all union members have a size of 0 anyway. So, the union is purely cosmetic, serving as a template for the code. Now that I think about this, the union doesn't do anything at all here, might as well get rid of it.
True, another way would be to have an array of unions, but I fear this is gonna cause some issues in the long run, because of varying padding that we're gonna end up with between the elements of the array. So, elements might no longer be after each other in the memory, and the space between them might change everytime somebody modifies the size of the largest member.
There was a problem hiding this comment.
Honestly, the more I think about this, the more I realize that there's no good way of actually having multiple configs for different DAI types in a single IPC.
- As you mentioned, having a union of flex arrays suggests we can only have 1 type, doing otherwise is indeed bad practice.
- Having a flex array of unions has padding issues I mentioned earlier.
- Having multiple flex arrays, without a union also doesn't smell right
I'd honestly abandon those efforts at this point and revert to the initial proposal: not touching the DAI config, simply adding a new DAI config member with its own union of flex arrays, limited to a single type.
There was a problem hiding this comment.
@lgirdwood @plbossart can we come to an agreement on this one?
There was a problem hiding this comment.
@slawblauciak is the sticking point the unions or the ALH ? I defer to @plbossart for all ALH and Soundwire stuff.
There was a problem hiding this comment.
It's the unions. I don't think it's sane to try to pack all the different configurations into a single IPC inside of sof_ipc_dai_config. As I mentioned, I'd rather do this by the book and just do as in the initial proposal: a new union member in sof_ipc_dai_config, one that would have its own, similar union, except of flex arrays.
There was a problem hiding this comment.
are you positive that this change is compatible with the previous solution? I haven't checked the sizes and it's hard to see with the diff format.
There was a problem hiding this comment.
Yeah. I ran tests on our side as well.
4ca124b to
9dfb803
Compare
This change extends the existing sof_ipc_dai_config IPC to add an array of DAI-specific configurations, as opposed to having only one. Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
Introduces configuration IPC ABI for the MultiDAI. MultiDAI is a new logical DAI type responsible for allocation of multiple physical child DAIs and transparently managing them, routing the audio data. Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
9dfb803 to
ddbed05
Compare
|
Is this PR active? |
|
Ah, nope, it is not. |
Introduces configuration IPC ABI for the MultiDAI
MultiDAI is a new logical DAI type responsible for allocation of multiple physical child DAI and transparently managing them, routing the audio data.
Signed-off-by: Slawomir Blauciak slawomir.blauciak@linux.intel.com