-
Notifications
You must be signed in to change notification settings - Fork 349
[RFC] topology: set mux/demux parameters with tuples #2345
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
|
driver counterpart: thesofproject/linux#1758 |
lgirdwood
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.
Good find, btw how do we deal with backwards compatibility ?
|
@lgirdwood If I understand my own code correctly (which is not the case always), this PR and and driver counterpart should be "transparent" to old binary blob and new tuples way at least with demux. So kernel is parsing the tuples but sending it as binary blob to FW. So currently there isn't a particular ipc struct for mux, it is still sent with process (effect) ipc struct. |
|
@lgirdwood let's keep this still as RFC for a while...I'd like yours and others comments about the current mux/demux structs, which would be replicated in kernel side... There are now arrays, of which the size is varying depending on platform. Also there are uint8_t for channels and uint32_t for pipeline_id's. Are we going to have like 2 million pipelines?. In kernel/driver side we have ready parsing mostly for uint16 and uint32. So could we just fix the array sizes with max channel count and streamline the variable sizes to uint16 and uin32? |
|
@juimonen pipe and comp id needs the headroom afforded by 32bits, since we will be using the large size to partition the DSP into logical zones, say for different VM guests, safety critical, multi clients, etc |
|
@juimonen sorry it took me a while to understand the problem here. The general direction is correct here but there's a more elegant way to add the mux_stream_data_1/2. Please take a look at the PDM_CONFIG() macro used for DMIC_CONFIG. If you look at the conf file, what you'll see is that you have 2 sets of PDM tuples as below. Can you please follow that example? |
|
@ranj063 yes if you look at muxdemux.m4 in this PR, at least to me it looks exactly like the method used in dmic, so using list to add variable amount of tuples arrays. Did you meant something else? @lgirdwood yes the 32 bit pipeline_id is fine, I meant streamlining the struct so that other members are also uin16 or uint32 so that parsing is easier and we avoid most packing issues. I don't think we help the ipc by defining all types as small as possible? Also I don't like the variable array length based on platform, will look really ugly if exported to kernel side... |
|
@lgirdwood ok, seems that the demux interface is about to change with other current sof PR's, so my rant about the types in demux structs can be ignored. I can modify this PR when the new interface is clear so we would have good topology support. |
@juimonen yes your PR does something similar to the DMIC but in the case of DMIC, you can clearly tell that there are 2 sets of PDM tuple arrays because they are right next to each other with pdm0 and pdm1. Whereas in your case, its hard to tell if there one or more. |
|
@ranj063 yes as I understand how the mux/demux works, you can have 1-8 stream configs so variable amount. It should be clear from sof-demux-pcm521x that we are using 2 arrays for this case. Compared to dmic, the arrays are just defined 1 level up, as it can be something between 1-8 (or actually varying from 1-4 or 1-8 depending on platform) depending how you are connecting the mux. |
Currently all process (effect) component parameters are set with binary blobs. This makes sense with eq's and such where parameters are highly varying in size and readability. So make sof mux/demux component to use tuples as an example of a component having complex parameter structure. This makes it easier to setup new mux parameters from topology. Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
46125a8 to
bb3a66e
Compare
|
updated to use channel map, driver counterpart thesofproject/linux#1800 |
|
@lgirdwood I think @plbossart has an effort to change all ipc structs with var arrays to non-var arrays... So not sure what will happen to the channel_map struct used here. I wanted to made this PR to show how to do the multiple arrays with topology as this is even more complicated as dmic pdm. Anyway if @ranj063 checks this out we could polish the topology parts. Also the bit mask value in channel_map and the Q-format coeffs make the topology still quite "mysterious" as there's no very nice way of describing them. |
|
@juimonen lets collate all these IPC problems and add to the feature request for IPC2.0. This will allow us to track all the opens we have and align on how to fix. |
| define(`N_MUXDEMUX', `MUXDEMUX'PIPELINE_ID`.'$1) | ||
|
|
||
| dnl W_MUXDEMUX(name, mux/demux, format, periods_sink, periods_source, kcontrol_list) | ||
| dnl CH_MAP_COEFF(coeff) |
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.
id, coeff?
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
|
|
||
| dnl CH_MAP(name, id, ext_id, mask) | ||
| define(`CH_MAP', | ||
| ` tuples."word.$1" {' |
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.
did you mean $1 here? or $2?
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 as I understand the $1 is like "name". So it should be the same "name" meaning in both CH_MAP and CHMAP_COEFF as we have actual "id" token member in the other... goes quite confusing otherwise. I'm not totally sure what is actually the meaning of this "word.xxx" syntax, can we actually parse/see that in driver/kernel side? So I copied this from your dmic pdm...
| SOF_TKN_CHANNEL_MAP_INDEX "1401" | ||
| SOF_TKN_CHANNEL_MAP_EXT_ID "1402" | ||
| SOF_TKN_CHANNEL_MAP_MASK "1403" | ||
| SOF_TKN_CHANNEL_MAP_COEFF "1404" |
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 confused by this too. This suggests that sof_ch_map_tokens contains exactly one channel_map_coeff but there could be multiple ones 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.
well it is just the token id for coeff. Yes there can be var array of coeffs in var array of ch_maps (which are in stream map struct). I made an example in sof side with 2 ch_maps with 2 coeffs each...
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 will also split the coeff into a separate set of tokens just like you've done in your linux PR
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.
sorry I didn't get what you mean here..?
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.
Can you comment the tokens too - we should really be doing this for all tokens.
|
|
||
| dnl CH_MAP(name, id, ext_id, mask) | ||
| define(`CH_MAP', | ||
| ` tuples."word.$1" {' |
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.
missing tokens "sof_chmap_tokens"?
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 is included in _mux_data_tuples_w which has the tokens "sof_chmap_tokens"... should I do it somehow differently?
| } | ||
|
|
||
| SectionVendorTokens."sof_chmap_tokens" { | ||
| SOF_TKN_STREAM_MAP_NUM_CH_MAPS "1400" |
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 has to be split into a separate token maybe called sof_mux_demux_token
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 mean sure... So what is the reasoning for this? It could be that the channel maps etc are used elsewhere also than demux only. I mean maybe it would be somehow more clear, but basically we are defining the "parse unit" in the kernel side tuples array definitions, so that could easily combine tuple id's all over and no one would notice...
|
Please resubmit with "main" as PR base branch. |
Currently all process (effect) component parameters are set with binary
blobs. This makes sense with eq's and such where parameters are highly
varying in size and readability. So make sof mux/demux component to use
tuples as an example of a component having complex parameter structure.
This makes it easier to setup new mux parameters from topology.
Signed-off-by: Jaska Uimonen jaska.uimonen@linux.intel.com