From 78429137c418372e78e248bf29d3ef6919892451 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Thu, 11 Jun 2026 14:38:26 +0100 Subject: [PATCH 1/2] drc: hifi4: 8-byte align detector average input buffer Force 8-byte alignment on abs_input_array in drc_update_detector_average(). The HiFi4 64-bit AE load/store intrinsics require 8-byte alignment; without it the stack buffer could be 4-byte aligned and trigger misaligned accesses. Signed-off-by: Liam Girdwood --- src/audio/drc/drc_hifi4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/drc/drc_hifi4.c b/src/audio/drc/drc_hifi4.c index b2252058e885..a4c32c0deb15 100644 --- a/src/audio/drc/drc_hifi4.c +++ b/src/audio/drc/drc_hifi4.c @@ -116,7 +116,7 @@ void drc_update_detector_average(struct drc_state *state, int nch) { ae_f32 detector_average = state->detector_average; /* Q2.30 */ - ae_int32 abs_input_array[DRC_DIVISION_FRAMES]; /* Q1.31 */ + ae_int32 abs_input_array[DRC_DIVISION_FRAMES] __attribute__((aligned(8))); /* Q1.31 */ ae_int32 *abs_input_array_p; int div_start, i, ch; ae_int16 *sample16_p; /* for s16 format case */ From d5b01100e8784c3d9085c2b35f4bb6aca17f5c96 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Sat, 13 Jun 2026 14:24:07 +0100 Subject: [PATCH 2/2] up_down_mixer: hifi3: 8-byte align downmix coefficient array downmix16bit_4ch_mono() loads its coeffs[] array with AE_L16X4_X, an aligned 64-bit HiFi load that requires 8-byte alignment. The uint16_t stack array is only 2-byte aligned, so the compiler may place it on a 4-byte boundary and trigger a misaligned access. Force 8-byte alignment to match the intrinsic's requirement. Signed-off-by: Liam Girdwood --- src/audio/up_down_mixer/up_down_mixer_hifi3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/up_down_mixer/up_down_mixer_hifi3.c b/src/audio/up_down_mixer/up_down_mixer_hifi3.c index 259cf5128b9f..87540d02e8e3 100644 --- a/src/audio/up_down_mixer/up_down_mixer_hifi3.c +++ b/src/audio/up_down_mixer/up_down_mixer_hifi3.c @@ -1247,7 +1247,7 @@ void downmix16bit_4ch_mono(struct up_down_mixer_data *cd, const uint8_t * const uint32_t idx3 = get_channel_index(cd->in_channel_map, 2); uint32_t idx4 = get_channel_index(cd->in_channel_map, 3); - uint16_t coeffs[4] = {cd->downmix_coefficients[idx1], + uint16_t coeffs[4] __attribute__((aligned(8))) = {cd->downmix_coefficients[idx1], cd->downmix_coefficients[idx2], cd->downmix_coefficients[idx3], cd->downmix_coefficients[idx4]