alsa: add firewire latency before we scale with rate

We first add all the latency in the rate of the pcm device and then
convert it to the rate of the graph.

See #4977
This commit is contained in:
Wim Taymans 2025-12-01 12:51:20 +01:00
parent 52f2137397
commit 4152c5d292

View file

@ -2063,8 +2063,6 @@ static void recalc_headroom(struct state *state)
state->headroom = 0;
latency = SPA_MAX(state->min_delay, SPA_MIN(state->max_delay, state->headroom));
if (rate != 0 && state->rate != 0)
latency = SPA_SCALE32_UP(latency, rate, state->rate);
if (state->is_firewire) {
/* XXX: For ALSA FireWire drivers, unlike for other ALSA drivers, buffer size
@ -2072,6 +2070,8 @@ static void recalc_headroom(struct state *state)
*/
latency += state->buffer_frames;
}
if (rate != 0 && state->rate != 0)
latency = SPA_SCALE32_UP(latency, rate, state->rate);
state->latency[state->port_direction].min_rate =
state->latency[state->port_direction].max_rate = latency;