alsa: add api.alsa.auto-link option

Add an option to automatically use snd_pcm_link when the follower clock
is matching the driver. Only set this to true in pro-audio and when
nodes are scheduled together.

See #3556
This commit is contained in:
Wim Taymans 2023-10-09 10:10:46 +02:00
parent 0dfa05117b
commit 896fea62c2
3 changed files with 6 additions and 1 deletions

View file

@ -131,6 +131,8 @@ static int alsa_set_param(struct state *state, const char *k, const char *s)
state->multi_rate = spa_atob(s);
} else if (spa_streq(k, "api.alsa.htimestamp")) {
state->htimestamp = spa_atob(s);
} else if (spa_streq(k, "api.alsa.auto-link")) {
state->auto_link = spa_atob(s);
} else if (spa_streq(k, "latency.internal.rate")) {
state->process_latency.rate = atoi(s);
} else if (spa_streq(k, "latency.internal.ns")) {
@ -3034,7 +3036,7 @@ int spa_alsa_prepare(struct state *state)
spa_list_for_each(follower, &state->followers, driver_link) {
if (follower != state && !follower->matching) {
spa_alsa_prepare(follower);
if (!follower->linked)
if (!follower->linked && state->auto_link)
do_link(state, follower);
}
}