Skip to content

Conversation

@lyakh
Copy link
Collaborator

@lyakh lyakh commented Feb 19, 2025

Move ASRC filter coefficients and some DRC functions to DRAM

Mark non-performance critical code with the __cold attribute.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
memory.h is required for __cold and __cold_rodata, add it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Copy link
Contributor

@jsarha jsarha left a comment

Choose a reason for hiding this comment

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

LGTM

/* Reset coefficients for possible exit with error. */
src_obj->filter_length = 0;
src_obj->num_filters = 0;
src_obj->polyphase_filters = NULL;
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this was never needed for anything else but to potentially find bugs where the filter is accessed uninitialized. For that purpose it could still be valid there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jsarha it is now inside the asrc_free_polyphase_filter() function and I think it can be needed when called from asrc_set_fs_ratio()

@lyakh
Copy link
Collaborator Author

lyakh commented Feb 19, 2025

because of #9845 I cannot run-time test this, so perhaps it's better to not merge it before it's been tested

@lyakh
Copy link
Collaborator Author

lyakh commented Feb 21, 2025

Waiting for thesofproject/linux#5335 to be merged

@lgirdwood
Copy link
Member

@lyakh @singalsu can this be non draft now dependencies are merged ?

@lyakh lyakh marked this pull request as ready for review February 26, 2025 07:15
comp_dbg(dev, "asrc_free()");

rfree(cd->buf);
asrc_release_buffers(cd->asrc_obj);
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you explain why is this needed? Is sram much smaller?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, its smaller/faster.

@lgirdwood
Copy link
Member

@lyakh can you check CI, looks like valgrind has picked up something in testbench test.

Free SRAM by moving ASRC coefficients to DRAM and only copying the
single required array on demand.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
@lyakh
Copy link
Collaborator Author

lyakh commented Mar 4, 2025

@lgirdwood lgirdwood merged commit 901aeb3 into thesofproject:main Mar 4, 2025
44 of 49 checks passed
@lyakh lyakh deleted the asrc branch March 4, 2025 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants