Skip to content

audio: buffer: replace notifier events with direct probe callbacks#10720

Open
kv2019i wants to merge 1 commit intothesofproject:mainfrom
kv2019i:202604-replace-notifiers
Open

audio: buffer: replace notifier events with direct probe callbacks#10720
kv2019i wants to merge 1 commit intothesofproject:mainfrom
kv2019i:202604-replace-notifiers

Conversation

@kv2019i
Copy link
Copy Markdown
Collaborator

@kv2019i kv2019i commented Apr 23, 2026

Replace the generic notifier dispatch for buffer produce, consume, and free events with direct function pointer callbacks on struct comp_buffer. The only consumer of this notifier event has been probe.c, so there is really no need to use the notifier framework for this.

This change allows to run more audio modules in user-space, where the notifier framework is not available.

Replace the generic notifier dispatch for buffer produce, consume,
and free events with direct function pointer callbacks on
struct comp_buffer. The only consumer of this notifier event has
been probe.c, so there is really no need to use the notifier framework
for this.

This change allows to run more audio modules in user-space, where
the notifier framework is not available.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Copilot AI review requested due to automatic review settings April 23, 2026 13:38
@kv2019i kv2019i requested review from jsarha and removed request for Copilot, dbaluta, lbetlej, lgirdwood, mmaka1 and plbossart April 23, 2026 13:38
@kv2019i
Copy link
Copy Markdown
Collaborator Author

kv2019i commented Apr 23, 2026

Tested as part of bigger #10558

Copy link
Copy Markdown
Contributor

@jsarha jsarha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is quite Ok, It actually makes the functionality easier to understand. But I would still remove the idle cast.

Comment thread src/probe/probe.c
&probe_cb_produce, 0);
notifier_register(&new_buf_id->full_id, dev->cb, NOTIFIER_ID_BUFFER_FREE,
&probe_cb_free, 0);
struct comp_buffer *probe_buf = (struct comp_buffer *)dev->cb;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cast should not be needed. struct ipc_comp_dev ->cb should be already of struct comp_buffer type. Actually the cast makes the code harder to understand. For awhile I was thinking that some call-back is used in hackis way for something else.


void comp_update_buffer_produce(struct comp_buffer *buffer, uint32_t bytes)
{
struct buffer_cb_transact cb_data = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am not mistaken, here was some piece of code for injection points. That was never functional, so I guess it can go.

Copy link
Copy Markdown
Collaborator

@lyakh lyakh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could also mention in the commit message, that this is valid, because the notification currently is always directed to the same core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants