pipeline: params: don't use uninitialized hw_params #5570
Merged
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.
pipeline_comp_hw_params does 2 things, it fetches the hw_params from the
DAI and writes those parameters to buffers. The issue here is that we
walk from host to DAI, so any buffer we see along the way gets set with
uninitialized hw_params as we don't get the params till the end of the
walk. Typically this is not an issue in most pipelines that are linear
as the following call to pipeline_comp_params will overwrite any bad
values in the buffer params. Not good practice but not harmful. The
problem arises when components such as the demux or SRC which pass flags
into comp_verify_params receive these bad values. There are edge cases
as a result where the values are not cleared and the buffers end up with
bad data. The result is usually an xrun, in the case of identifying this
bug, the uncleared buffer had 4.6k channels.
Signed-off-by: Curtis Malainey cujomalainey@chromium.org