Skip to content

Commit

Permalink
ipc4: Ensure pipeline component directions are synchronized
Browse files Browse the repository at this point in the history
This patch addresses an issue where audio output could be silent due to
the direction property of pipeline components not being set. The added
code ensures that if the source component's direction is unset but the
sink's direction is set, or vice versa, the direction is copied from the
set component to the unset one.

This synchronization of the direction property guarantees that the
pipeline's data flow is correctly established, allowing the
`pipeline_for_each_comp` function to traverse and process all components
as intended, thus resolving the silent audio output problem.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
  • Loading branch information
tmleman committed Mar 28, 2024
1 parent 41bdc0c commit b4cb1eb
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/ipc/ipc4/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,36 @@ static struct ipc_comp_dev *pipeline_get_host_dev(struct ipc_comp_dev *ppl_icd)
struct ipc *ipc = ipc_get();
int host_id;

/**
* @brief Synchronize the direction property between source and sink components.
*
* If the source component's direction is not set but the sink's direction is,
* this block will copy the direction from the sink to the source component and
* mark the source's direction as set. This ensures that the pipeline's flow
* direction is consistent and correctly configured for the traversal process.
*/
if (!ppl_icd->pipeline->source_comp->direction_set &&
ppl_icd->pipeline->sink_comp->direction_set) {
ppl_icd->pipeline->source_comp->direction =
ppl_icd->pipeline->sink_comp->direction;
ppl_icd->pipeline->source_comp->direction_set = true;
}

/**
* @brief Synchronize the direction property between sink and source components.
*
* If the sink component's direction is not set but the source's direction is,
* this block will copy the direction from the source to the sink component and
* mark the sink's direction as set. This ensures that the pipeline's flow
* direction is consistent and correctly configured for the traversal process.
*/
if (!ppl_icd->pipeline->sink_comp->direction_set &&
ppl_icd->pipeline->source_comp->direction_set) {
ppl_icd->pipeline->sink_comp->direction =
ppl_icd->pipeline->source_comp->direction;
ppl_icd->pipeline->sink_comp->direction_set = true;
}

if (ppl_icd->pipeline->source_comp->direction == SOF_IPC_STREAM_PLAYBACK)
host_id = ppl_icd->pipeline->source_comp->ipc_config.id;
else
Expand Down

0 comments on commit b4cb1eb

Please sign in to comment.