Skip to content

Commit d87f00d

Browse files
lrgirdwoclaude
andcommitted
audio: fix AMS callback signature in detect_test and wov_arbiter
The ams_msg_callback_fn type is: void (*)(const struct ams_message_payload *const, void *) The on_wov_ctrl() and arb_on_detect() callbacks were written with the old four-argument form (msg_type_id, message, message_size, ctx) which no longer matches the typedef, causing build failures on mtl/tgl/lnl. Also fix the payload field access inside those callbacks: p->payload_size → p->message_length p->payload → p->message Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0a30470 commit d87f00d

2 files changed

Lines changed: 6 additions & 16 deletions

File tree

src/audio/wov_arbiter/wov_arbiter.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,16 @@ static void arb_send_ctrl(const struct comp_dev *dev, uint8_t cmd,
9292
}
9393

9494
/* AMS callback: a WOV detector has fired. */
95-
static void arb_on_detect(const uint32_t msg_type_id,
96-
const void *message,
97-
const uint32_t message_size,
98-
void *ctx)
95+
static void arb_on_detect(const struct ams_message_payload *const p, void *ctx)
9996
{
10097
struct comp_dev *dev = ctx;
10198
struct wov_arb_data *cd = comp_get_drvdata(dev);
102-
const struct ams_message_payload *p = message;
10399

104-
if (message_size < sizeof(*p) ||
105-
p->payload_size < sizeof(struct wov_detect_payload))
100+
if (p->message_length < sizeof(struct wov_detect_payload))
106101
return;
107102

108103
const struct wov_detect_payload *det =
109-
(const struct wov_detect_payload *)p->payload;
104+
(const struct wov_detect_payload *)p->message;
110105

111106
if (det->slot_id >= WOV_ARB_MAX_SLOTS) {
112107
comp_err(dev, "wov_arb: bad slot_id %u", det->slot_id);

src/samples/audio/detect_test.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,21 +207,16 @@ static void ams_notify_arb(const struct comp_dev *dev)
207207
}
208208

209209
/* AMS callback: arbiter is broadcasting a PAUSE or RESUME command. */
210-
static void on_wov_ctrl(const uint32_t msg_type_id,
211-
const void *message,
212-
const uint32_t message_size,
213-
void *ctx)
210+
static void on_wov_ctrl(const struct ams_message_payload *const p, void *ctx)
214211
{
215212
struct comp_dev *dev = ctx;
216213
struct comp_data *cd = comp_get_drvdata(dev);
217-
const struct ams_message_payload *p = message;
218214

219-
if (message_size < sizeof(*p) ||
220-
p->payload_size < sizeof(struct wov_ctrl_payload))
215+
if (p->message_length < sizeof(struct wov_ctrl_payload))
221216
return;
222217

223218
const struct wov_ctrl_payload *ctrl =
224-
(const struct wov_ctrl_payload *)p->payload;
219+
(const struct wov_ctrl_payload *)p->message;
225220

226221
if (ctrl->cmd == WOV_CTRL_CMD_PAUSE) {
227222
if (cd->wov_slot_id != ctrl->active_slot) {

0 commit comments

Comments
 (0)