Audio: Mux: Fix mistake in frames count handling#7811
Audio: Mux: Fix mistake in frames count handling#7811lgirdwood merged 1 commit intothesofproject:mainfrom
Conversation
src/audio/mux/mux.c
Outdated
There was a problem hiding this comment.
@singalsu do you think we should move this check for active state to the module adapter copy and only have active source buffers in the input_buffers? then we can simply iterate over the list of input_buffers[i].size to find the MIN and set the size for all input buffers after processing as well
There was a problem hiding this comment.
intention was combine line 570 - 579?
There was a problem hiding this comment.
I think it's a good idea and would help the clients. Could we do such fix later since it impacts many components and use this way as quick fix?
src/audio/mux/mux.c
Outdated
There was a problem hiding this comment.
if we do this, then we'd some sanity check for frames before processing
There was a problem hiding this comment.
in case dev->bsource_list is empty
There was a problem hiding this comment.
Yep, need to handle that.
The source frames count need to be checked from every active input_buffers[n].size). Similarly in consuming the source buffers it needs to be updated to every mod->input_buffers[n].consumed. Fixes: thesofproject#7308 Fixes: c399624 ("Audio: Mux: Convert mux and demux to module adapter") Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1511859 to
f74e6a6
Compare
kv2019i
left a comment
There was a problem hiding this comment.
Minor nit we should use "Closes: #abc" to refer to bugs and issues in the commit.
But this is critical for v2.6, so let's not change for that. Looks good for me.
|
P1 as this is needed for SOF2.6 . Please review. |
| if (frames) | ||
| frames = MIN(frames, input_buffers[j].size); | ||
| else | ||
| frames = input_buffers[j].size; |
There was a problem hiding this comment.
this is rather odd, why not initialize frame to MAX_INT and do the line 544 unconditionally?
There was a problem hiding this comment.
@plbossart This was in previous version of the patch, but bsource_list may be empty in which case we'd end up with frames==MAX_INT
The source frames count need to be checked from every active input_buffers[n].size). Similarly in consuming the source buffers it needs to be updated to every
mod->input_buffers[n].consumed.
Fixes: #7308