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

Add get buffer ID to sink/src api #8433

Merged
merged 2 commits into from
Nov 22, 2023

Conversation

marcinszkudlinski
Copy link
Contributor

sink/src API should grow to fulfill all requirements

this PR adds stream ID to sink/src api

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.

Code looks good. The commit description is little light on the rationale. Is this enabling something, or is this just moving an attribute to a more correct place?

I'm a bit worried about the conceptual override where sink/src in theory allows to abstract the "id", while current SOF code has pretty specific semantics on the buffer id (e.g. using "IPC4_SINK_QUEUD_ID(buf_id)" macro on it). Nothing wrong with this itself, but I wonder if this is abstracted more (behind src/sink), should we documented the semantics better.

Btw, you have build errors in IPC3 targets in CI.

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.

I like the abstraction.

@@ -185,3 +185,9 @@ size_t sink_get_min_free_space(struct sof_sink *sink)
{
return sink->min_free_space;
}

uint32_t sink_get_id(struct sof_sink *sink)
Copy link
Member

Choose a reason for hiding this comment

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

These should be static inline. There is PR in flow for splitting header directories and we will be able to catch this in the correct folder i.e. for baseFW or module usage.

Copy link
Contributor

Choose a reason for hiding this comment

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

static inline and put it tou sink_api.h and source_api.h accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes. We agreed lately the full sink/src encapsulation is too expensive and all "small" functions should be inline (#8100)

It has been implemented for sink/src as a part of #8365. Till 8365 is merged I prefer to follow the obsolete way to avoid merge conflicts

@marcinszkudlinski
Copy link
Contributor Author

marcinszkudlinski commented Nov 6, 2023

Code looks good. The commit description is little light on the rationale. Is this enabling something, or is this just moving an attribute to a more correct place?

it is extension to current sink/src - we need feature match with current audio stream

I'm a bit worried about the conceptual override where sink/src in theory allows to abstract the "id", while current SOF code has pretty specific semantics on the buffer id (e.g. using "IPC4_SINK_QUEUD_ID(buf_id)" macro on it). Nothing wrong with this itself, but I wonder if this is abstracted more (behind src/sink), should we documented the semantics better.

i'll check if we can return sink/src part of id
by now i found something like this in code - a complete id used:

			j = buf_get_id(source);
			if (j == BASE_CFG_QUEUED_ID)

Btw, you have build errors in IPC3 targets in CI.

working to fix

@@ -47,7 +47,7 @@ extern struct tr_ctx buffer_tr;
#define trace_buf_get_id(buf_ptr) ((buf_ptr)->pipeline_id)

/** \brief Retrieves subid (comp id) from the buffer */
#define trace_buf_get_subid(buf_ptr) ((buf_ptr)->id)
#define buf_get_id(buf_ptr) ((buf_ptr)->stream.runtime_stream_params.id)
Copy link
Collaborator

Choose a reason for hiding this comment

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

is the ID really a runtime parameter? Isn't it persistent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is set once, not modified later. Anyway - in rutime
As it is a common parameter for all streams, no matter how buffers are implemented, so I put it to this container
But you're right, it the name of the container may be somehow misleading, I'll change it

@lyakh
Copy link
Collaborator

lyakh commented Nov 9, 2023

Sorry, I do not understand this PR. The code seems to add a parameter that isn't used apart from for logging ant the description "fulfill all requirements" doesn't really clarify it either. Is logging the only reason to add this?

@marcinszkudlinski
Copy link
Contributor Author

@lyakh ???
see how many times buf_get_id() is used - its close to 50
yes, ID is used in logging, but also many other places - copier, google AEC, probe. Its purpose is to identify the pins the buffer is connected to.
image
the purpose of this PR is to provide access to the ID for components using sink/src interface

@marcinszkudlinski marcinszkudlinski changed the title add get buffer ID to sink/src api [DNM - WIP] add get buffer ID to sink/src api Nov 9, 2023
@lyakh
Copy link
Collaborator

lyakh commented Nov 10, 2023

@lyakh ??? see how many times buf_get_id() is used - its close to 50 yes, ID is used in logging, but also many other places - copier, google AEC, probe. Its purpose is to identify the pins the buffer is connected to. image the purpose of this PR is to provide access to the ID for components using sink/src interface

I mean the second commit - an ID is added to source / sink and it doesn't seem to be used

@marcinszkudlinski
Copy link
Contributor Author

rebase only

@marcinszkudlinski marcinszkudlinski changed the title [DNM - WIP] add get buffer ID to sink/src api Add get buffer ID to sink/src api Nov 20, 2023
@marcinszkudlinski
Copy link
Contributor Author

@lyakh it is used - in a PR mentioned above

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.

PR looks good, but mandatory CI is failing again -> needs to be checked.

runtime_stream_params is a container for all
parameters of a stream
Add an API call to retrieve it

Signed-off-by: Marcin Szkudlinski <[email protected]>
add get buffer ID to sink/src api

Signed-off-by: Marcin Szkudlinski <[email protected]>
@marcinszkudlinski
Copy link
Contributor Author

PR looks good, but mandatory CI is failing again -> needs to be checked.

lets retry - the logs indicates some issues with test setup
rebasing to head again

@marcinszkudlinski
Copy link
Contributor Author

CI is green

@kv2019i kv2019i merged commit c82226e into thesofproject:main Nov 22, 2023
@marcinszkudlinski marcinszkudlinski deleted the sink_src_id branch June 21, 2024 07:30
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