Skip to content

Audio: Mux: Fix mistake in frames count handling#7811

Merged
lgirdwood merged 1 commit intothesofproject:mainfrom
singalsu:mux_fix_frames_count_handling
Jun 16, 2023
Merged

Audio: Mux: Fix mistake in frames count handling#7811
lgirdwood merged 1 commit intothesofproject:mainfrom
singalsu:mux_fix_frames_count_handling

Conversation

@singalsu
Copy link
Collaborator

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

@singalsu
Copy link
Collaborator Author

Special thanks to @juimonen for creating #7812 and @lyakh for corrections suggestions.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intention was combine line 570 - 579?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we do this, then we'd some sanity check for frames before processing

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case dev->bsource_list is empty

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, need to handle that.

@singalsu singalsu marked this pull request as ready for review June 16, 2023 07:45
@singalsu singalsu requested a review from fkwasowi as a code owner June 16, 2023 07:45
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>
@singalsu singalsu force-pushed the mux_fix_frames_count_handling branch from 1511859 to f74e6a6 Compare June 16, 2023 08:25
@singalsu singalsu requested review from juimonen and lyakh June 16, 2023 08:29
Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kv2019i kv2019i added the P1 Blocker bugs or important features label Jun 16, 2023
@kv2019i kv2019i requested a review from btian1 June 16, 2023 09:20
@kv2019i
Copy link
Collaborator

kv2019i commented Jun 16, 2023

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is rather odd, why not initialize frame to MAX_INT and do the line 544 unconditionally?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

@lgirdwood
Copy link
Member

@wszypelt @lrudyX this PR is for IPC3 and not tested on Intel CI. Merging.

@lgirdwood lgirdwood merged commit afd86e0 into thesofproject:main Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1 Blocker bugs or important features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

simultaneous playback of multiple streams with MUX component not working with latest sof FW (20-march-2023)

6 participants