-
Notifications
You must be signed in to change notification settings - Fork 318
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
Conversation
param req_dev Requesting component was unused Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
An API for accessing components providing and consuming data from the buffer added Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
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 <marcin.szkudlinski@intel.com>
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 <marcin.szkudlinski@intel.com>
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 <marcin.szkudlinski@intel.com>
There was a problem hiding this 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 */ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
step 5 - make all components use API to access sink/src components linked to buffers