alsa: relax the max latency requiremen

Our max latency is based on the buffer_size / 2, one part is playing and
another part is filling.
This commit is contained in:
Wim Taymans 2022-01-12 17:20:42 +01:00
parent c40f2ac245
commit 50ce9a794f
2 changed files with 2 additions and 2 deletions

View file

@ -68,7 +68,7 @@ static void emit_node_info(struct state *this, bool full)
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_MEDIA_CLASS, "Audio/Sink");
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_NODE_DRIVER, "true");
if (this->have_format) {
snprintf(latency, sizeof(latency), "%lu/%d", this->buffer_frames / 4, this->rate);
snprintf(latency, sizeof(latency), "%lu/%d", this->buffer_frames / 2, this->rate);
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_NODE_MAX_LATENCY, latency);
}
this->info.props = &SPA_DICT_INIT(items, n_items);

View file

@ -69,7 +69,7 @@ static void emit_node_info(struct state *this, bool full)
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_MEDIA_CLASS, "Audio/Source");
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_NODE_DRIVER, "true");
if (this->have_format) {
snprintf(latency, sizeof(latency), "%lu/%d", this->buffer_frames / 4, this->rate);
snprintf(latency, sizeof(latency), "%lu/%d", this->buffer_frames / 2, this->rate);
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_NODE_MAX_LATENCY, latency);
}
this->info.props = &SPA_DICT_INIT(items, n_items);