Repository navigation
MUX: Generic Mux component implementation. - #1275
Conversation
tlauda
left a comment
There was a problem hiding this comment.
Initial review.
Many changes not related to mux implementation need to be extracted to separate PR.
65185e1 to
49f10ea
Compare
|
@akloniex there are also some CI failures to fix too. |
8f4cc68 to
cd7b61f
Compare
| union { | ||
| mux_func mux; | ||
| demux_func demux; | ||
| }; |
There was a problem hiding this comment.
@akloniex I think we should remove the union and replace it with one function. Then we can simplify a bunch of other duplicated code. see my other comments
| } | ||
|
|
||
| return NULL; | ||
| } |
There was a problem hiding this comment.
if we only have one function in the comp_data, we can pass the mode, and pick the appropriate function instead of 2 separate functions which have the exact same logic
| ret = -EINVAL; | ||
| goto err; | ||
| } | ||
| } else { |
There was a problem hiding this comment.
same here remove duplication and pass mode to get_processing_function()
|
@akloniex also the mux_process and demux_process functions seems to mirrored code. Is there a way we can use one function and set the source/sink based on mode. might be worth giving it a try. |
| uint8_t mask[PLATFORM_MAX_CHANNELS]; | ||
| }; | ||
|
|
||
| typedef void(*mux_func)(struct comp_dev *dev, struct comp_buffer *sink, |
There was a problem hiding this comment.
If this is a public API header (looks like), do those functions prototypes need to be exposed?
There was a problem hiding this comment.
This is public API header, and these functions do not need to be exposed, you're correct.
These functions are meant to be used by mux privately, althought, my thought process behind exposing these was to provide interface, used in mux.c file (which handles all general component duties) and implemented in mux_generic.c file (and to be implemented using hifi functions).
I could add another, private, header to provide the interface, but thought that it would look much cleaner the way it is right now.
But I won't fight for it if you think that hiding these details in private header or by calling extern functions would work better.
|
So is this supposed to be "processing component" or "mux" from alsa and topology perspective? check what we did for e.g. with selector... this will effect the implementation on the driver side. If it is "processing" it is easier. With general "mux" component we have to think more carefully what is the control interface etc... |
|
still to emphasize, we should not just use binary control always if it makes thing easier. Currently it is also cumbersome as we need an alsa control for it (even though it is not ever used). With eq's it is natural because we are sending variable length coefficients and it makes no sense to define fixed filter coefficients (length wise). If mux is for general use we should define the parameters with tuples in topology. |
Isn't the naming the other way around? I mean a muxer has multiple inputs and single output. |
|
@juimonen |
|
corresponding ABI change in driver: |
3c3b409 to
b7fc384
Compare
31d19ec to
7d2b058
Compare
It's good, I'll just keep as Request changes until #1383 will be merged. |
|
@lgirdwood I just need more reviews in #1383 ;) |
|
@lgirdwood BTW IMO it's bad idea to split dependency into another PR, because it causes mess like this one. If it's not that big it's better to just make it another commit in the same PR, this way you have something+it's dependency in 1 place and in the end it looks the same in git history. It would be problematic only if you have super long conversations mixed when some of texts are for original PR and some for dependency. |
Mux component implementation. Support for mux and demux operation modes, channel routing and summation with saturation. Mux component can operate in 2 modes: demux - with single input stream and multiple output streams (up to MUX_MAX_STREAMS) mux - with multiple input streams and single output stream It can also work with 1:1 I/O in both modes to act as channel router / summator. It is configured via binary blob specifying channel routing using bitmasks. In case of demux mode every output stream has an array of bitmasks, one mask per channel, specifying which of the input channels should be used to compose it. Similarly for mux, each input stream has bitmask for each of it's channels to specify to which output channel it contributes. Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
We need to remind and reinforce "master first" policy, too... And, corresponding patch in the driver repository has thesofproject/linux#870 has been merged, so ping @tlauda @mmaka1 |
Mux component implementation. Support for mux and demux operation
modes, channel routing and summation with sturation.
Signed-off-by: ArturX Kloniecki arturx.kloniecki@linux.intel.com
Mux component can operate in 2 modes:
It can also work with 1:1 I/O in both modes to act as channel router / summator.
It is configured via binary blob specifying channel routing using bitmasks.
In case of demux mode every output stream has an array of bitmasks, one mask per channel, specifying which of the input channels should be used to compose it.
Similarly for mux, each input stream has bitmask for each of it's channels to specify to which output channel it contributes.