Skip to content

Commit 3ce3bc3

Browse files
ujfalusibroonie
authored andcommitted
ASoC: SOF: ipc4-pcm: Invalidate the stream_start_offset in PAUSED state
When the final state is SOF_IPC4_PIPE_PAUSED, it is possible that the stream will be restarted (resume or start) in which case we need to update the offset from the firmware. Cc: [email protected] # 6.8 Signed-off-by: Peter Ujfalusi <[email protected]> Reviewed-by: Kai Vehmanen <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 55ca6ca commit 3ce3bc3

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

sound/soc/sof/ipc4-pcm.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,19 @@ static int sof_ipc4_trigger_pipelines(struct snd_soc_component *component,
437437
}
438438

439439
/* return if this is the final state */
440-
if (state == SOF_IPC4_PIPE_PAUSED)
440+
if (state == SOF_IPC4_PIPE_PAUSED) {
441+
struct sof_ipc4_timestamp_info *time_info;
442+
443+
/*
444+
* Invalidate the stream_start_offset to make sure that it is
445+
* going to be updated if the stream resumes
446+
*/
447+
time_info = spcm->stream[substream->stream].private;
448+
if (time_info)
449+
time_info->stream_start_offset = SOF_IPC4_INVALID_STREAM_POSITION;
450+
441451
goto free;
452+
}
442453
skip_pause_transition:
443454
/* else set the RUNNING/RESET state in the DSP */
444455
ret = sof_ipc4_set_multi_pipeline_state(sdev, state, trigger_list);

0 commit comments

Comments
 (0)