Repository navigation
[RFC]selector: validate params in the params callback and fix prepare call… #1070
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Source/sink params (depends on pipe direction) won't be set at this point, so your code won't work correctly. Selector component should overwrite next components' params, so it needs those in/out channels count parameters.
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.
@tlauda yes you are right about this. I think we should set this in prepare() instead of params. Then the source/sink params would already be set.
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.
@ranj063 Getting in/out channels based on the connected components is not a great idea. The purpose of the selector component is to force the change. Let's assume that we have playback pipeline and in the middle of the pipeline we have the component, which only requires 1 channel. We would put selector before that component to get that 1 channel, but how the selector would know that it should change the out channels? Params from the host would set the host format, so basically all the components would have e.g. 2 channels.
In the long term we should think about changing component API to have something like in and out format for every comp. With such API your change would be valid and expected.
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.
@tlauda params from the host would change the channels but if a component knows it only needs 1 channel, it will ignore the channel from the host params and set it to 1 anyway.
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.
@ranj063 Such component can support multiple formats and 1 channel on input can be just for specific topology. With your approach we transfer responsibility to that component instead of selector, which would require for that component to have additional custom field anyway.
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.
@tlauda what custom field would that be? Take the detect component for example, it knows that it only needs 1 channel. and the selector can use this information from the detect comp.
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.
@ranj063 I'm thinking more about generic case, where you have components, which can work for every channel configuration, but for specific topology they require specific channel number. One of the components in the topology needs to decide, that the channels number must be reduced.
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.
@ranj063 @tlauda Regarding component input parameters: one of the component design assumptions was that output channel ID (index) will be selected in the topology w/o requirement to have a dedicated app (the latter could be supported as an optional/ additional configuration channel)
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.
@ranj063 I'll second @tlauda statement that "In the long term we should think about changing component API to have something like in and out format for every comp" for every component in and out. A classic example is a preprocessing component with AEC that accepts on the 1st input 1-4 channels from mics and 2nd one 1-2 channels of reference signal from playback path. I assume that component can be compiled for platform specific configuration.