Skip to content

Audio: Fix the default alignment setting - #8351

Merged
kv2019i merged 1 commit into
thesofproject:mainfrom
andrula-song:align
Oct 26, 2023
Merged

kv2019i merged 1 commit into
thesofproject:mainfrom
andrula-song:align

Conversation

@andrula-song

Copy link
Copy Markdown
Contributor

Set the default alignment value after buffer format is set in audio_stream_set_params instead of in audio_stream_init where the buffer format hasn't been set yet.

@andrula-song

Copy link
Copy Markdown
Contributor Author

SOFCI TEST

@andrula-song
andrula-song marked this pull request as ready for review October 24, 2023 01:05
@andrula-song

Copy link
Copy Markdown
Contributor Author

SOFCI TEST

Set the default alignment value after buffer format is set
in audio_stream_set_params instead of in audio_stream_init
where the buffer format hasn't been set yet.

Signed-off-by: Andrula Song <andrula.song@intel.com>

@kv2019i kv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One comment to clarify (see inline).

* set byte_align as 1 means no alignment limit on byte.
* set frame_align as 1 means no alignment limit on frame.
*/
audio_stream_init_alignment_constants(1, 1, buffer);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hmm, it's difficult to confirm this is safe to do. audio_stream_init() is only called once but audio_stream_set_params() is called from many places via buffer_set_params().

Have you checked that we are not overriding alignment info?

Not saying old code is correct. It would look we'd at least need to recalculate runtime_stream_params.align_frame_cnt and align_shift_idx if buffer parameters are changed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

usually, we set alignment info in prepare function(after internal parameter set and verify) for specific component, I checked the src, eq-iir,eq-fir and volume,aria .etc components, they will change the default value to their own setting.
and yes, once the buffer parameters are changed, we do need to recalculate the align info.

@aiChaoSONG

Copy link
Copy Markdown
Collaborator

SOFCI TEST

@kv2019i
kv2019i merged commit 5cc8a6d into thesofproject:main Oct 26, 2023
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