Skip to content

Commit

Permalink
audio: dai-zephyr: Add state change on DAI trigger
Browse files Browse the repository at this point in the history
Currently, the DAI component's state is not updated on
dai_trigger() operation, which leads to pipeline_comp_copy()
skipping the dai_copy() operation (since the DAI component
never transitions to the ACTIVE state). To fix this, add
a state transition in dai_comp_trigger_internal(). Also,
make sure not to trigger the DAI component if already in
the requested state.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
  • Loading branch information
LaurentiuM1234 authored and lgirdwood committed Mar 8, 2024
1 parent 87558f8 commit 76c0595
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/audio/dai-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,11 @@ static int dai_comp_trigger_internal(struct dai_data *dd, struct comp_dev *dev,

comp_dbg(dev, "dai_comp_trigger_internal(), command = %u", cmd);

#ifdef CONFIG_IPC_MAJOR_3
if (dev->state == comp_get_requested_state(cmd))
return PPL_STATUS_PATH_STOP;
#endif /* CONFIG_IPC_MAJOR_3 */

switch (cmd) {
case COMP_TRIGGER_START:
comp_dbg(dev, "dai_comp_trigger_internal(), START");
Expand Down Expand Up @@ -1161,6 +1166,17 @@ static int dai_comp_trigger_internal(struct dai_data *dd, struct comp_dev *dev,
break;
}

#ifdef CONFIG_IPC_MAJOR_3
/* TODO: investigate why making this IPC version-agnostic
* breaks some Intel tests and check if doing so would be
* possible (or even make sense) on Intel platforms.
*
* See issue #8920 for details.
*/
if (!ret)
return comp_set_state(dev, cmd);
#endif /* CONFIG_IPC_MAJOR_3 */

return ret;
}

Expand Down

0 comments on commit 76c0595

Please sign in to comment.