Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipeline2.0: add API to access sink/src components linked to a buffer #9530

Merged
merged 5 commits into from
Oct 2, 2024

Conversation

marcinszkudlinski
Copy link
Contributor

step 5 - make all components use API to access sink/src components linked to buffers

param req_dev Requesting component was unused

Signed-off-by: Marcin Szkudlinski <[email protected]>
An API for accessing components providing and
consuming data from the buffer added

Signed-off-by: Marcin Szkudlinski <[email protected]>
A typical action for a component is to check if a
prev/next component exists and is ready to provide/consume data:

if (buf->sink && buf->sink.state == STATE_....)

In pipeline 2.0 it should be done by a state
of sink/src API, but for now a helper for the operation
is provided by this commit.

In case the component does not exists, a special state
COMP_STATE_NOT_EXIST is introduced

Signed-off-by: Marcin Szkudlinski <[email protected]>
This commit makes all components use API for accessing
the previous/next component

pipeline code, like module adapter or ipc helpers was
omitted intentionally

Signed-off-by: Marcin Szkudlinski <[email protected]>
This commit makes all components use API for accessing
the previous/next component

pipeline code, like module adapter or ipc helpers was
omitted intentionally

Signed-off-by: Marcin Szkudlinski <[email protected]>
Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

If this needs an update, the "__unused" attributes can be added, but not a blocker. Otherwise looks good.

The component state renumbering will surprise some developers looking at logs, but there's probably no way to keep the current schema (and it's not THAT big a deal in the end).

#define COMP_STATE_PREPARE 4 /**< Component prepared */
#define COMP_STATE_PAUSED 5 /**< Component paused */
#define COMP_STATE_ACTIVE 6 /**< Component active */
#define COMP_STATE_PRE_ACTIVE 7 /**< Component after early initialisation */
Copy link
Collaborator

Choose a reason for hiding this comment

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

@marcinszkudlinski Any strong reason to reassign the numbers and not add NOT_EXIST at the end? I guess one possibility is some comparisons on state in existing code. I guess this is ok, but yeah, some of us have been staring at the raw component state numbers for years in log files and will need to relearn these new numbers, so not a small change.
UPDATE: there are quite a few "if state > READY" checks in existing code, has to be done like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

UPDATE: there are quite a few "if state > READY" checks in existing code, has to be done like this.

yes, that was the reason

@@ -480,9 +480,10 @@ void comp_update_buffer_produce(struct comp_buffer *buffer, uint32_t bytes)
/* return if no bytes */
if (!bytes) {
#if CONFIG_SOF_LOG_DBG_BUFFER
struct comp_dev *src_component = comp_buffer_get_source_component(buffer);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This would need a "__unused" attribute to not create compiler warnings when buf_dbg() is a no-op.

@lgirdwood lgirdwood merged commit f9b1a1d into thesofproject:main Oct 2, 2024
82 of 88 checks passed
@marcinszkudlinski marcinszkudlinski deleted the pipeline2_0_5 branch October 3, 2024 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants