From 1282feb26ec76026bd54c7754915d61e9ab7965b Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Mon, 27 Sep 2021 19:33:56 -0700 Subject: [PATCH] component: reorder the switch case in comp_get_requested_state() Pipeline trigger is now handled as part of the pipeline task. Keeping the PRE_START/PRE_RELEASE as the last options in the switch case to get the current component state results in task taking taking too long during PRE_START leading to an xrun with the first copy in the pipeline task. Move the PRE_START/PRE_RELEASE options as the first cases to fix this. Signed-off-by: Ranjani Sridharan --- src/include/sof/audio/component_ext.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/include/sof/audio/component_ext.h b/src/include/sof/audio/component_ext.h index 837fc90d355a..c929b4bb08a5 100644 --- a/src/include/sof/audio/component_ext.h +++ b/src/include/sof/audio/component_ext.h @@ -281,6 +281,10 @@ static inline int comp_get_requested_state(int cmd) int state = COMP_STATE_INIT; switch (cmd) { + case COMP_TRIGGER_PRE_START: + case COMP_TRIGGER_PRE_RELEASE: + state = COMP_STATE_PRE_ACTIVE; + break; case COMP_TRIGGER_START: case COMP_TRIGGER_RELEASE: state = COMP_STATE_ACTIVE; @@ -296,10 +300,6 @@ static inline int comp_get_requested_state(int cmd) case COMP_TRIGGER_RESET: state = COMP_STATE_READY; break; - case COMP_TRIGGER_PRE_START: - case COMP_TRIGGER_PRE_RELEASE: - state = COMP_STATE_PRE_ACTIVE; - break; } return state;