Repository navigation
Conversation
lgirdwood
force-pushed
the
topic/static-pipeline-fixes
branch
from
October 15, 2026 18:25
9084313 to
a0838bc
Compare
softwarecki
reviewed
Oct 29, 2026
| /* Only prepare components currently in READY state */ | ||
| /* Only prepare components currently in READY state that are connected to buffers */ | ||
| if (dev->state == COMP_STATE_READY) { | ||
| if (list_is_empty(&dev->bsource_list) && list_is_empty(&dev->bsink_list)) |
Collaborator
There was a problem hiding this comment.
Could we check this for the sink/source buffer APIs instead of relying on comp_buffer?
Member
Author
There was a problem hiding this comment.
will do, I want everything using the new API too
Member
Author
There was a problem hiding this comment.
Updated and rebased on main:
- Replaced the
dev->bsource_list/dev->bsink_listcheck insof_static_topology_prepare_comps()withsof_static_comp_has_sink_source(), which checksmod->num_of_sources > 0 || mod->num_of_sinks > 0for module adapter components andsource_get_comp_state()/sink_get_state()onsof_audio_bufferhandles for endpoint components. - Added
comp_bind()/comp_unbind()insof_static_topology_init_routes()andsof_static_topology_unwind()sosof_sinkandsof_sourceinterfaces are bound to IPC4processing_moduleinstances beforeprepare(). - Converted
init_buffer_params(),sof_static_topology_unwind(), andsof_static_pipeline_set_sample_rate()to use thesof_sink,sof_source, andsof_audio_bufferAPIs (sink_set_params(),source_set_params(),audio_buffer_reset(),audio_buffer_free(),source_get_frm_fmt(),source_get_channels()).
In sof_static_topology_init(), Stage 7 calls sof_static_topology_init_controls()
which dispatches to sof_static_kcontrol_set() to set initial default control
values. However, sof_static_kcontrol_set() checks for an active topology via:
if (!s_active_topo)
return -ENODEV;
Because s_active_topo was previously assigned only after Stage 7 succeeded,
all initial kcontrol configurations failed with -ENODEV (-19).
Publish s_active_topo prior to running Stage 7 so control lookups succeed,
and ensure s_active_topo is reset to NULL in err_unwind if initialization fails.
Signed-off-by: Liam Girdwood <[email protected]>
… prepare Update the static pipeline loader to use the SOF sink/source and audio_buffer APIs instead of legacy comp_buffer / audio_stream accesses, and skip unrouted components during Stage 6 prepare: 1. In init_buffer_params(), configure stream parameters, frame/valid formats, alignment constants, min_free_space / min_available, and buffer reset via sink_set_params(), source_set_params(), and audio_buffer_reset(). 2. In sof_static_topology_init_routes() (Stage 4), bind buffer sof_sink and sof_source interfaces to producer and consumer components via comp_bind() so IPC4 processing_module instances populate their mod->sources[] and mod->sinks[] tables before module_prepare(). Correspondingly call comp_unbind(), pipeline_disconnect(), and audio_buffer_free() in sof_static_topology_unwind(). 3. In sof_static_topology_prepare_comps() (Stage 6), check whether components have bound sinks/sources via sof_static_comp_has_sink_source() (checking mod->num_of_sources / mod->num_of_sinks for module adapter components and source_get_comp_state() / sink_get_state() for endpoint components) instead of inspecting dev->bsource_list and dev->bsink_list. 4. In sof_static_pipeline_set_sample_rate(), query buffer format and channels via source_get_frm_fmt() and source_get_channels(), update IPC4 module base_cfg rate/IBS/OBS, and refresh sink/source thresholds. Signed-off-by: Liam Girdwood <[email protected]>
lgirdwood
force-pushed
the
topic/static-pipeline-fixes
branch
from
November 1, 2026 20:37
a0838bc to
6cd4592
Compare
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.
Description
This PR fixes two initialization and prepare issues in the declarative static pipeline loader subsystem (
static_pipeline_loader.c), which operates strictly under IPC4 (CONFIG_IPC_MAJOR_4=y):Premature kcontrol initialization order in
sof_static_topology_init():sof_static_topology_init_controls()) dispatches default control values viasof_static_kcontrol_set(), which verifiesif (!s_active_topo) return -ENODEV;.s_active_topowas assigned only after Stage 7 succeeded, causing all initial kcontrol configurations at boot to fail with-ENODEV(-19).s_active_topo = topo;prior to Stage 7, and reset it toNULLinerr_unwindif topology construction fails.Unrouted component prepare failure:
sof_static_topology_prepare_comps()),comp_prepare()is called on all components inCOMP_STATE_READY. For optional or unrouted components declared in a static topology that have no connected buffers (bsource_listandbsink_listboth empty),comp_prepare()fails with-ENOTCONN(-107).Changes
src/audio/pipeline/static_pipeline_loader.c:s_active_topo = topo;before callingsof_static_topology_init_controls(), and clear toNULLon error unwind.list_is_empty(&dev->bsource_list) && list_is_empty(&dev->bsink_list).All static pipeline logic remains strictly IPC4-based with zero IPC3 dependencies.