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
4 changes: 1 addition & 3 deletions src/audio/src/src_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,7 @@ bool src_is_ready_to_process(struct processing_module *mod,
struct sof_source **sources, int num_of_sources,
struct sof_sink **sinks, int num_of_sinks)
{
struct comp_data *cd = module_get_private_data(mod);

return src_get_copy_limits(cd, sources[0], sinks[0]);
return sink_get_free_frames(sinks[0]) || source_get_data_frames_available(sources[0]);
Copy link

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

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

The logic appears incorrect. Based on the description, src_get_copy_limits() returns false when BOTH functions return 0, which means it returns true when at least one is non-zero (OR condition). However, for processing to be ready, you typically need BOTH a source with data AND a sink with space available (AND condition). The current OR condition would return true even when the sink is full but source has data, or when sink has space but source is empty.

Suggested change
return sink_get_free_frames(sinks[0]) || source_get_data_frames_available(sources[0]);
return sink_get_free_frames(sinks[0]) && source_get_data_frames_available(sources[0]);

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in fact that was also my doubt about src_get_copy_limits() but @singalsu was sure, that it's correct...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copilot is not perfect :)

}

int src_process(struct processing_module *mod,
Expand Down
Loading