Skip to content

Commit 20c06c4

Browse files
committed
Audio: Set default audio stream align to SOF_FRAME_BYTE_ALIGN
This patch changes the default align from 1 bytes to SOF_FRAME_BYTE_ALIGN that depends on build architecture. It defaults to 4 in generic build and to values 8 and 16 for Hifi3/4 and HiFi5 builds. A macro is defined for frame count align value 1 with name SOF_FRAME_COUNT_ALIGN. It can be used instead of numeric value 1. Modules can use it when there is no specific requirement for frames count constraint. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent ab79b4e commit 20c06c4

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/audio/audio_stream.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ void audio_stream_init(struct audio_stream *audio_stream, void *buff_addr, uint3
5151
audio_stream->addr = buff_addr;
5252
audio_stream->end_addr = (char *)audio_stream->addr + size;
5353

54-
audio_stream_set_align(1, 1, audio_stream);
54+
audio_stream_set_align(SOF_FRAME_BYTE_ALIGN, SOF_FRAME_COUNT_ALIGN, audio_stream);
5555
audio_stream_reset(audio_stream);
5656
}

src/include/sof/common.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@
223223
# define SOF_FRAME_BYTE_ALIGN 4
224224
#endif
225225

226+
/* Default frame-count alignment is 1 */
227+
#define SOF_FRAME_COUNT_ALIGN 1
228+
226229
#ifndef __GLIBC_USE
227230
#define __GLIBC_USE(x) 0
228231
#endif

0 commit comments

Comments
 (0)