Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

env~ runs expensive computations occasionally instead of spreading them across callbacks #103

Open
giuliomoro opened this issue Apr 1, 2023 · 1 comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@giuliomoro
Copy link
Contributor

hvcc/generators/ir2c/static/HvSignalEnvelope.c

The inputs are stored in the internal buffer as squared, which is good, but the sum is performed all at once when the result is needed. This will cause a spike in CPU usage instead of having even CPU usage across all audio callbacks which would start causing dropouts while the average CPU usage is still low.

The sum should instead be computed incrementally at every callback. This would require adding a running sum variable per eachwindowSize/period element to the base struct.

I can look into implementing this, posting here ahead of that for any feedback.

@dromer dromer added the help wanted Extra attention is needed label Apr 2, 2023
@dromer
Copy link
Collaborator

dromer commented Apr 2, 2023

I see this code is quite heavily commented and certain assumptions made, so would indeed be good to have some extra eyes in this.

Thnx for reporting.

@dromer dromer added the good first issue Good for newcomers label Aug 9, 2023
@dromer dromer moved this to Todo in Core Improvements Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
Status: Todo
Development

No branches or pull requests

2 participants