Skip to content

pipeline: fix period frame size calculation - #1773

Merged
jajanusz merged 1 commit into
thesofproject:masterfrom
juimonen:period_fix
Aug 30, 2019
Merged

jajanusz merged 1 commit into
thesofproject:masterfrom
juimonen:period_fix

Conversation

@juimonen

Copy link
Copy Markdown

The period frame size calculation has issues by doing division instead
of multiplication. So fix this by introducing new function for buffer
period frames calculation where we multiply samplerate and
schedule_period and divide by 1000000. Also round up the result.

Signed-off-by: Jaska Uimonen jaska.uimonen@intel.com

Comment thread src/audio/pipeline.c Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

#include <sof/math/numbers.h>

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I thinks it is coming from component.h... so do you want me to include it explicitly to pipeline.h?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

sorry pipeline.c...

@tlauda tlauda Aug 28, 2019 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, the best practice is to include headers explicitly, so you won't be surprised during refactor.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

ok, got it and updated.

The period frame size calculation has issues by doing division instead
of multiplication. So fix this by introducing new function for buffer
period frames calculation where we multiply samplerate and
schedule_period and divide by 1000000. Also round up the result.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
@wwittbrx

Copy link
Copy Markdown
Contributor

I can confirm that this PR fixes bug #1772.

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.

4 participants