Skip to content

Conversation

@serhiy-katsyuba-intel
Copy link
Contributor

@serhiy-katsyuba-intel serhiy-katsyuba-intel commented Oct 13, 2025

This is a follow-up to #10257.

This fixes all occurrences of incorrect use of IPC4_SRC_QUEUE_ID() and IPC4_SINK_QUEUE_ID().

IPC4_SRC_QUEUE_ID() expects buffer as a parameter and returns the queue ID of the module that produces data for that buffer. So from the buffer's point of view, such a module and queue is the source (hence the name IPC4_SRC_QUEUE_ID()), however, from the module's point of view, such a queue is a sink. That, unfortunately, makes it easy to make a mistake
when deciding whether IPC4_SRC_QUEUE_ID() vs. IPC4_SINK_QUEUE_ID() should be used.

Copy link
Contributor

@tmleman tmleman left a comment

Choose a reason for hiding this comment

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

The changes look okay, but please maintain the current standard regarding commit titles and descriptions.

Copy link
Collaborator

@softwarecki softwarecki left a comment

Choose a reason for hiding this comment

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

This PR addresses the same kind of buffer-related confusion we discussed earlier. I still think the sink/source model offers clearer semantics, and I'd prefer separate ID retrieval functions aligned with that approach.

Also, the commit title is missing tags - please update it accordingly.

This is a follow-up to thesofproject#10257.

This fixes all occurrences of incorrect use of IPC4_SRC_QUEUE_ID() and
IPC4_SINK_QUEUE_ID().

IPC4_SRC_QUEUE_ID() expects buffer as a parameter and returns the queue ID
of the module that produces data for that buffer. So from the buffer's
point of view, such a module and queue is the source (hence the name
IPC4_SRC_QUEUE_ID()), however, from the module's point of view, such
a queue is a sink. That, unfortunately, makes it easy to make a mistake
when deciding whether IPC4_SRC_QUEUE_ID() vs. IPC4_SINK_QUEUE_ID() should
be used.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
@serhiy-katsyuba-intel serhiy-katsyuba-intel changed the title Fix queue ID extraction ipc4: Fix queue ID extraction Oct 13, 2025
@serhiy-katsyuba-intel
Copy link
Contributor Author

The changes look okay, but please maintain the current standard regarding commit titles and descriptions.

Updated commit description.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

@serhiy-katsyuba-intel good find, would be good to have this comment near the macro definition to help :)

@lgirdwood lgirdwood merged commit 03044fc into thesofproject:main Oct 22, 2025
38 of 45 checks passed
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.

5 participants