mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: improve max-latency property
Half of the buffersize is not enough to support as a max-quantum, we need to divide by (4 * frame_scale) to allow some headroom and account for the DSD scaling. We do the same calculation to suggest a buffer size using the quantum-limit. See #3744
This commit is contained in:
parent
4034e8f3c5
commit
c5b845bc90
1 changed files with 2 additions and 1 deletions
|
|
@ -3535,7 +3535,8 @@ void spa_alsa_emit_node_info(struct state *state, bool full)
|
||||||
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_NODE_DRIVER, "true");
|
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_NODE_DRIVER, "true");
|
||||||
|
|
||||||
if (state->have_format)
|
if (state->have_format)
|
||||||
snprintf(latency, sizeof(latency), "%lu/%d", state->buffer_frames / 2, state->rate);
|
snprintf(latency, sizeof(latency), "%lu/%d",
|
||||||
|
state->buffer_frames / (4 * state->frame_scale), state->rate);
|
||||||
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_NODE_MAX_LATENCY, latency[0] ? latency : NULL);
|
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_NODE_MAX_LATENCY, latency[0] ? latency : NULL);
|
||||||
|
|
||||||
if (state->have_format)
|
if (state->have_format)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue