alsa: use graph rate for rate latency

When we recalculate the headroom we also update the latency in frames.
We should express this latency in the graph rate. This is usually the
rate that is suggested in the target_rate but when we are forcing our
own rate (mostly when using IRQ or when in DSD/IEC mode) we should
ignore that value and use our own rate that we will force instead.

Fixes #4977
This commit is contained in:
Wim Taymans 2025-12-01 14:20:12 +01:00
parent 4152c5d292
commit 4f39329ca9

View file

@ -2036,7 +2036,9 @@ static void recalc_headroom(struct state *state)
uint32_t latency;
uint32_t rate = 0;
if (state->position != NULL)
if (state->force_quantum && !state->following)
rate = state->rate;
else if (state->position != NULL)
rate = state->position->clock.target_rate.denom;
if (state->use_period_size_min_as_headroom)