ipc4: fix pause issue with windows audio player

(1) IPC4 does not need mixer workaround.
(2) trigger pipeline in release state for pause-running case

Signed-off-by: Rander Wang <rander.wang@intel.com>
This commit is contained in:
Rander Wang 2021-12-14 15:58:17 +08:00 committed by Liam Girdwood
parent 56784a9e29
commit f8451fd8b1
2 changed files with 31 additions and 25 deletions

View File

@ -293,27 +293,6 @@ static int mixer_trigger_common(struct comp_dev *dev, int cmd)
int dir = dev->pipeline->source_comp->direction;
int ret;
/*
* This works around an unclear and apparently needlessly complicated
* mixer state machine.
*/
if (dir == SOF_IPC_STREAM_PLAYBACK) {
switch (cmd) {
case COMP_TRIGGER_PRE_RELEASE:
/* Mixer and everything downstream is active */
dev->state = COMP_STATE_PRE_ACTIVE;
break;
case COMP_TRIGGER_RELEASE:
/* Mixer and everything downstream is active */
dev->state = COMP_STATE_ACTIVE;
break;
default:
break;
}
comp_writeback(dev);
}
ret = comp_set_state(dev, cmd);
if (ret < 0)
return ret;
@ -551,6 +530,27 @@ static int mixer_trigger(struct comp_dev *dev, int cmd)
mixer_source_status_count(dev, COMP_STATE_PAUSED))
return PPL_STATUS_PATH_STOP;
/*
* This works around an unclear and apparently needlessly complicated
* mixer state machine.
*/
if (dir == SOF_IPC_STREAM_PLAYBACK) {
switch (cmd) {
case COMP_TRIGGER_PRE_RELEASE:
/* Mixer and everything downstream is active */
dev->state = COMP_STATE_PRE_ACTIVE;
break;
case COMP_TRIGGER_RELEASE:
/* Mixer and everything downstream is active */
dev->state = COMP_STATE_ACTIVE;
break;
default:
break;
}
comp_writeback(dev);
}
ret = mixer_trigger_common(dev, cmd);
if (ret < 0)
return ret;

View File

@ -227,11 +227,17 @@ static int set_pipeline_state(uint32_t id, uint32_t cmd)
return IPC4_INVALID_REQUEST;
}
cmd = COMP_TRIGGER_PRE_START;
/* init params when pipeline is complete or reset */
if (status == COMP_STATE_READY) {
cmd = COMP_TRIGGER_PRE_START;
ret = ipc4_pcm_params(host);
if (ret < 0)
return IPC4_INVALID_REQUEST;
} else {
cmd = COMP_TRIGGER_PRE_RELEASE;
}
ret = ipc4_pcm_params(host);
if (ret < 0)
return IPC4_INVALID_REQUEST;
break;
case SOF_IPC4_PIPELINE_STATE_RESET:
if (status == COMP_STATE_INIT) {