P20 mux#10998
Open
piotrhoppeintel wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the mux/demux module to use the SOF sink/source APIs (instead of directly manipulating audio_stream / comp_buffer), as a step toward full pipeline 2.0 adoption.
Changes:
- Extend sink/source APIs with optional
get_state()ops and helper accessors to query connected component state. - Rework mux/demux processing to acquire/commit data via
source_get_data()/sink_get_buffer()and operate on explicit circular-buffer views. - Add a generic helper for computing frames-until-wrap for circular buffers.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/include/module/audio/source_api.h | Adds optional get_state op and source_get_comp_state() helper. |
| src/include/module/audio/sink_api.h | Adds optional get_state op and sink_get_state() helper. |
| src/include/module/audio/audio_stream.h | Adds circ_buf_frames_without_wrap() helper and circular-buffer view structs. |
| src/audio/mux/mux.h | Updates mux/demux processing function signatures for sink/source API + circular buffer views. |
| src/audio/mux/mux.c | Refactors mux/demux process functions to use sink/source API and new state helpers. |
| src/audio/mux/mux_generic.c | Ports generic mux/demux implementations to operate on sink/source API buffers and circular-buffer wrap logic. |
| src/audio/buffers/comp_buffer.c | Implements sink/source get_state() for comp_buffer-backed endpoints. |
| int frames; | ||
| int sink_bytes; | ||
| int source_bytes; | ||
| struct sof_source *source = sources[0]; |
Comment on lines
+252
to
+256
| frames = source_get_data_frames_available(source); | ||
| for (i = 0; i < num_of_sinks; i++) { | ||
| if (sink_get_state(sinks[i]) != dev->state) | ||
| continue; | ||
|
|
Comment on lines
+90
to
+94
| static inline int circ_buf_frames_without_wrap(const void *began, const void *end, | ||
| int sample_bytes, int channels) | ||
| { | ||
| return ((const char *)end - (const char *)began) / sample_bytes / channels; | ||
| } |
Collaborator
|
@piotrhoppeintel I see this still has fixup commits in the series... Is this ready for review (if not, you can submit first as draft and then convert ready-for-review when it's ready for others)? |
Rework the mux module to only use the sink/source api to prepare the SOF for the full transition to pipeline 2.0. Signed-off-by: Piotr Hoppe <piotr.hoppe@intel.com>
Author
|
@kv2019i – It's ready now. Please review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rework the mux module to only use the sink/source api to
prepare the SOF for the full transition to pipeline 2.0.