-
Notifications
You must be signed in to change notification settings - Fork 350
[RFC] Demux blob #2594
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
[RFC] Demux blob #2594
Conversation
|
see also this: thesofproject/sof-docs#203 @akloniex FYI, would appreciate your comments. @lgirdwood Thinking and trying out different ways of setting the parameters in mux demux, I'm hesitant to use the enum controls, as at least for me they seems very confusing and we loose some of the demux/mux functionality. So I would go for more "visualized" approach in topology and still try to make the command line generator better... |
xiulipan
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.
Nice patch. Some suggestion to make it more generic.
|
@juimonen I'm currently working on few mux/demux optimizations.
I'll send the PR today, and if we wish, we might go one step further and remove these fields from the interface altogether (for now I'll leave them marked as reserved). That would obviously cause backward incompatibility, but would cleanup the interface - I will not judge which way to go. |
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.
So this will build the initial configuration of the mux/demux ? We still need to build the enum kcontrols.
@akloniex @juimonen can we make these fields "reserved" in the IPC if they have never been used. If they have been used in the past then please add a "_deprecated" suffix and a cooment stating last supported ABI version. |
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.
Comments for the rest of us humans that barely understand M4 would be nice :-)
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 explain what those matrices do? not use if this is a passthrough or a splitter?
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.
thesofproject/sof-docs#203 hope this helps, would be good if you have time to browse it through at some point...
|
@xiulipan @lgirdwood @plbossart @akloniex updated.
|
|
And finally, this is PR is made now so that it should be applied only after #2600, so it takes into account the changed demux structs. |
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.
Can you add more comment on how the matrices configure the mux/demux routing.
tools/topology/m4/utils.m4
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.
Best to use existing convention and use SOF_ABI_PATH
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.
Btw, this path could also be invoked via the command line -I switch if easier.
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.
The path is given to command line system call egrep, so I don't know how to forward it from m4 include... anyway I changed the definition. As the SOF_ABI_VERSION is composed by cmake, at least CI/Docker will find it (when building tools). You can give it from command line now as -DSOF_ABI_FILE= if you want to compile individual demux topology file by hand. Otherwise the macro is empty.
|
I tested it on CML-H with rt711+rt1308+rt715. But somehow there is no output from both speakers. |
|
@bardliao so this latest version would need #2600 as under it. So 2 things:
|
@juimonen No, I will see DSP Panic if I apply #2600. I don't know what did I miss. I will re-test it after #2600 is merged. |
|
@xiulipan @lgirdwood @plbossart @akloniex @bardliao updated.
|
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.
Hi @juimonen since we are aligned that we don't plan to support channel mix features with mux/demux component, how about simplify this like below:
define(matrix1, `ROUTE_MATRIX(1, 0, 1, 2, 3, 4, 5, 6, 7)')
And change the ROUTE_MATRIX macro definition(something like BIT($i) will be good enough)) to be with bit indices inputs(we can use '-1' if it doesn't exist for the corresponding channel).
This will simplify the top level topology files a lot.
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.
@keyonjie are we aligned on that matter ? :)
I really would not want to castrate this component... I'm 99% sure we will need the mix feature very soon in some occasion.
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.
@juimonen per my understanding yes. :)
If we are inheriting the MUX/DEMUX concepts from ALSA, which means N->1 or 1->N only, no mixing concept there. But if we want to innovate a more powerful component here (e.g. named shuffler? I actually proposed this to @plbossart and @lgirdwood in 2017), that is another topic.
The pros for the more powerful one is that it is more generic and we don't need to create many components like mixer/mux/channel_selector, just use this unified one with different configure blob.
The cons with it is that the component may run with lower efficiency(we need to check more bit masks and flags) and not so straightforward to be understood, especially the higher MCPS consuming make me nervous and that's why I voted to remove the mixing fancy feature from it.
@lgirdwood please help chime in this please, if mixing is here, then using mapping mechanism to simplify/optimize the mux component may become impossible since it is not 1chan->1chan mapping anymore, there could be channel accumulation(e.g. chan a = chan b + chan c).
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.
@Keyon yes I know the alsa mux concept and as you said this component is much more.
This should then be converted as official ASoC mux component, which also forces enum controls to user space.
I actually tried to convert this to ASoC mux at some point but stopped on the way, because this was much more versatile. I also remember talking for example with @singalsuo cases that would need more complicated functioning than simple mux.
- We could also do following: use same component as "process" component with full API, as here now.
- Make Asoc mux interface for the same component (restricted usage)
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.
@Keyon and agree with your observations about performance, the optimizations you mention should be done. However, if you don't know what you are doing, you can do very nasty things with all our components, build really strange pipelines that will consume the whole dsp resources.
Thinking of the interface, I really think the visual "routing matrix" is really the most informative with this kind of component. With enum we would have 2^64 different matrices and it is just an example of a component for which the configuration through ALSA controls is just awkward.
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.
@Keyon and agree with your observations about performance, the optimizations you mention should be done. However, if you don't know what you are doing, you can do very nasty things with all our components, build really strange pipelines that will consume the whole dsp resources.
Thinking of the interface, I really think the visual "routing matrix" is really the most informative with this kind of component. With enum we would have 2^64 different matrices and it is just an example of a component for which the configuration through ALSA controls is just awkward.
Agree with that. If we do keep the current mux component design, it is unrealistic to use enum as @lgirdwood mentioned, and your "routing matrix" depicted here is more informative and topology user friendly, thank you for that.
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.
@juimonen @keyonjie we should be aiming for enums (once mixing is removed). The max numbers of enums/options we are looking at are
- demux - 8 source channels on 1 stream to map of 8 sink channels on 8 streams i.e. 8 enums of 64 options
- mux - 8 source channels on 8 streams to 8 sink channels on 1 stream i.e. 8 enums of 64 options max.
In reality we should have less enums and options as 8x8 topologies will be rare.
|
@juimonen Can you rebase to the latest code? There is a conflict on sof-icl-rt711-rt1308-rt715-hdmi.m4. Thanks. |
Bit and byte manipulation macros are needed for building binary blobs, so add them. Add also macro to generate sof_abi_version. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Add macro for binary blob generation for muxdemux. With this macro the stream routing matrix will be easier to visualize and manipulate. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Add mux config to top level topology. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Add mux config to top level topology. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Add mux config to top level topology. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Remove default demux parameters and start using blob defined in top level topology. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Demux default coeffs has been replaced by top level demux configuration, so remove it. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
pipe-demux-playback.m4 is not used by any topology, so remove it. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
|
@bardliao rebased. |
|
Jenkins known issues, Travis looks like a false positive. |
This is a RFC for making mux/demux routing matrix configuration easier as the routing matrix is now "visualized" in m4.