Skip to content

audio: pipeline: fix control init order and unrouted component prepare in static pipeline - #11315

Draft
lgirdwood wants to merge 2 commits into
thesofproject:mainfrom
lgirdwood:topic/static-pipeline-fixes
Draft

lgirdwood wants to merge 2 commits into
thesofproject:mainfrom
lgirdwood:topic/static-pipeline-fixes

Conversation

@lgirdwood

@lgirdwood lgirdwood commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

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):

  1. Premature kcontrol initialization order in sof_static_topology_init():

    • Stage 7 (sof_static_topology_init_controls()) dispatches default control values via sof_static_kcontrol_set(), which verifies if (!s_active_topo) return -ENODEV;.
    • s_active_topo was assigned only after Stage 7 succeeded, causing all initial kcontrol configurations at boot to fail with -ENODEV (-19).
    • Fix: Publish s_active_topo = topo; prior to Stage 7, and reset it to NULL in err_unwind if topology construction fails.
  2. Unrouted component prepare failure:

    • In Stage 6 (sof_static_topology_prepare_comps()), comp_prepare() is called on all components in COMP_STATE_READY. For optional or unrouted components declared in a static topology that have no connected buffers (bsource_list and bsink_list both empty), comp_prepare() fails with -ENOTCONN (-107).
    • Fix: Skip components without any buffer connections in the stage 6 prepare loop.

Changes

  • src/audio/pipeline/static_pipeline_loader.c:
    • Set s_active_topo = topo; before calling sof_static_topology_init_controls(), and clear to NULL on error unwind.
    • Skip prepare on components where list_is_empty(&dev->bsource_list) && list_is_empty(&dev->bsink_list).

All static pipeline logic remains strictly IPC4-based with zero IPC3 dependencies.

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 <lgirdwood@gmail.com>
In sof_static_topology_prepare_comps() (Stage 6), comp_prepare() is
called on all components in COMP_STATE_READY. For optional or unrouted
components declared in a static topology that currently have neither
source buffers nor sink buffers attached (both bsource_list and bsink_list
are empty), comp_prepare() fails with -ENOTCONN (-107).

Skip components that have no buffer connections in the stage 6 prepare loop.

Signed-off-by: Liam Girdwood <lgirdwood@gmail.com>
@lgirdwood
lgirdwood force-pushed the topic/static-pipeline-fixes branch from 9084313 to a0838bc Compare October 15, 2026 18:25
@lgirdwood lgirdwood changed the title audio: pipeline: fix IPC3 support and control init in static pipeline audio: pipeline: fix control init order and unrouted component prepare in static pipeline Oct 15, 2026
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.

1 participant