Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions src/audio/module_adapter/module_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,12 +622,6 @@ module_single_sink_setup(struct comp_dev *dev,
int i = 0;

list_for_item(blist, &dev->bsource_list) {
/* check if the source dev is in the same state as the dev */

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@lyakh this is a special case for the mixin/mixout alone right or is it widely applicable for any connected sink pipeline because of the order in which trigger pipelines with IPC4?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@ranj063 I'm not sure. Definitely it's only possibly with module-adapter components. In our "popular" topologies I only see mixin-out, copier and volume being on the border between two pipelines. Copier isn't using module-adapter, but we could check some volume pipelines. I so far haven't figured out where in volume consumed and produced bytes are updated, will try to figure that out tomorrow. Then I'll add some debugging there and check.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@ranj063 I tested with a capture pipeline like DMIC -> gain.A -> copier.A -> gain.B -> PCM and I don't see any difference with or without this PR so at least it isn't breaking that use-case either

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@ranj063 I know why there was no difference. The difference is that although in one case module_process() is called from module_adapter_simple_copy() with num_input_buffers of num_output_buffers equal to 0, both those parameters are ignored by volume_process()... If I add there something like

	if (!num_output_buffers || !num_input_buffers)
		return 0;

then of course the behaviour changes. But still both possibilities seem to work. Maybe it's because with capture usually you don't have to send data at a constant rate. And also the effect of this PR seems to depend strongly on individual processing modules - how they use those parameters.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ack, I don't think this can work if the adapter makes this call. I think it should be component that handles this logic, and indeed, if it has data in its buffers, it is ACTIVE and there's room in outputs, processing should happen.

if (source_c[i]->source->state != dev->state) {
i++;
continue;
}

comp_get_copy_limits_frame_aligned(source_c[i], sinks_c[0], &c);

if (!mod->skip_src_buffer_invalidate)
Expand Down Expand Up @@ -665,12 +659,6 @@ module_single_source_setup(struct comp_dev *dev,
int i = 0;

list_for_item(blist, &dev->bsink_list) {
/* check if the sink dev is in the same state as the dev */
if (sinks_c[i]->sink->state != dev->state) {
i++;
continue;
}

comp_get_copy_limits_frame_aligned(source_c[0], sinks_c[i], &c);

min_frames = MIN(min_frames, c.frames);
Expand Down