From 6bf42e9bcdc019894f9335efa510c849294f9396 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 28 Aug 2023 12:43:38 +0200 Subject: [PATCH] alsa: refuse quantum/rate changes when driving irq based --- spa/plugins/alsa/alsa-pcm.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index cddb0b64d..6589fb5c7 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -2205,8 +2205,15 @@ static inline int check_position_config(struct state *state) if (SPA_UNLIKELY(state->position == NULL)) return 0; - target_duration = state->position->clock.target_duration; - target_rate = state->position->clock.target_rate; + if (state->disable_tsched && state->started && !state->following) { + target_duration = state->period_frames; + target_rate = SPA_FRACTION(1, state->rate); + state->position->clock.target_duration = target_duration; + state->position->clock.target_rate = target_rate; + } else { + target_duration = state->position->clock.target_duration; + target_rate = state->position->clock.target_rate; + } if (SPA_UNLIKELY((state->duration != target_duration) || (state->rate_denom != target_rate.denom))) {