Skip to content

Commit fe3ea09

Browse files
committed
ipc4: use fixed-width types in ipc4_audio_format
struct ipc4_audio_format used bare enum members. On ARM EABI targets (e.g i.MX95 Cortex-M7) the toolchain defaults to -fshort-enums, which shrinks the enum-typed members. This makes host-supplied channels_count/valid_bit_depth be on the wrong offset. Fix this by using fixed uint32_t type instead of enums. Note that the same struct on the Linux kernel side uses uint32_t so this patch also aligns ipc4_audio_format structs on FW side / Host side. Signed-off-by; Daniel Baluta <daniel.baluta@nxp.com>
1 parent 73c674a commit fe3ea09

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/include/module/ipc4/base-config.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ enum ipc4_stream_type {
115115
};
116116

117117
struct ipc4_audio_format {
118-
enum ipc4_sampling_frequency sampling_frequency;
119-
enum ipc4_bit_depth depth;
118+
uint32_t sampling_frequency; /* enum ipc4_sampling_frequency */
119+
uint32_t depth; /* enum ipc4_bit_depth */
120120
uint32_t ch_map;
121-
enum ipc4_channel_config ch_cfg;
121+
uint32_t ch_cfg; /* enum ipc4_channel_config */
122122
uint32_t interleaving_style;
123123
uint32_t channels_count : 8;
124124
uint32_t valid_bit_depth : 8;
125-
enum ipc4_sample_type s_type : 8;
125+
uint32_t s_type : 8; /* enum ipc4_sample_type */
126126
uint32_t reserved : 8;
127127
} __attribute__((packed, aligned(4)));
128128

0 commit comments

Comments
 (0)