mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
alsa: report extra latency for FireWire drivers
Based on testing, ALSA FireWire drivers introduce additional latency determined by the buffer size. Report that latency. Pass device.bus to the node, so it can recognize firewire.
This commit is contained in:
parent
3cb2c93c48
commit
e8d739fdd7
3 changed files with 14 additions and 2 deletions
|
|
@ -1005,6 +1005,8 @@ int spa_alsa_init(struct state *state, const struct spa_dict *info)
|
|||
state->num_bind_ctls = i;
|
||||
|
||||
/* We'll do the actual binding after checking the card exists */
|
||||
} else if (spa_streq(k, SPA_KEY_DEVICE_BUS)) {
|
||||
state->is_firewire = spa_streq(s, "firewire");
|
||||
} else {
|
||||
alsa_set_param(state, k, s);
|
||||
}
|
||||
|
|
@ -2052,6 +2054,13 @@ static void recalc_headroom(struct state *state)
|
|||
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
|
||||
* XXX: contributes extra latency (as of kernel 6.16).
|
||||
*/
|
||||
latency += state->buffer_frames;
|
||||
}
|
||||
|
||||
state->latency[state->port_direction].min_rate =
|
||||
state->latency[state->port_direction].max_rate = latency;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue