Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Synthio has fixed point overflow errors #10286

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

Open
gamblor21 opened this issue Apr 23, 2025 · 1 comment
Open

Synthio has fixed point overflow errors #10286

gamblor21 opened this issue Apr 23, 2025 · 1 comment
Assignees
Labels
audio bug rp2 Both RP2 microcontrollers
Milestone

Comments

@gamblor21
Copy link
Member

Synthio has one (and likely more) spots where it is possible to overflow the int32_t used as an intermediary while doing fixed point math.

This function multiplies an int32_t by int16_t which can exceed the 32 bit size.

static void sum_with_loudness(int32_t *out_buffer32, int32_t *tmp_buffer32, int16_t loudness[2], size_t dur, int synth_chan) {

There are likely other cases as well.

The probable fix is to add a function to ensure the values are saturated after every calculation.
audiofreeverb does this

static int16_t sat16(int32_t n, int rshift) {

This issue is most likely the cause for #10200.

@gamblor21 gamblor21 added audio bug rp2 Both RP2 microcontrollers labels Apr 23, 2025
@gamblor21 gamblor21 self-assigned this Apr 23, 2025
@gamblor21 gamblor21 added this to the Long term milestone Apr 23, 2025
@gamblor21
Copy link
Member Author

#10288 should have caught most of the cases. Will keep this issue open short term to see if others show up (unless others think we should close it, in case feel free).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audio bug rp2 Both RP2 microcontrollers
Projects
None yet
Development

No branches or pull requests

1 participant