[Sound-open-firmware] Commit c80270e7e49 (" ipc: structures should all be aligned on 4 bytes") causes issues on i.MX8

Daniel Baluta daniel.baluta at nxp.com
Tue May 11 17:20:22 CEST 2021


> It looks like the uint64_t on the sof_ipc_stream_position are not
> aligned on 8 bytes (with the packing, there are 7 * uint32_t before
> them) and the ARM compiler is expecting a 8 byte alingment for uint64 ?

> I'm not sure why this is showing up now as the "packed" attribute would
> force the uint64_t to be aligned on 4 bytes instead of 8 here.

> Btw, have you tried setting aligned(8) here ? or tried removing the
> aligned(4) for stream_posn ?

I have tried setting aligned(4) on the Linux kernel header:

--- a/include/sound/sof/stream.h
+++ b/include/sound/sof/stream.h
@@ -143,6 +143,6 @@ struct sof_ipc_stream_posn {
        uint64_t timestamp;     /**< system time stamp */
        uint32_t xrun_comp_id;  /**< comp ID of XRUN component */
        int32_t xrun_size;      /**< XRUN size in bytes */
-}  __packed;
+}  __packed __aligned(4);

It works fine with this.




More information about the Sound-open-firmware mailing list