Pipewireパッケージ(ちょっと変更)
Revisión | 896fea62c2072c836e6d821f7bdafe840ce8540e (tree) |
---|---|
Tiempo | 2023-10-09 17:13:43 |
Autor | Wim Taymans <wtaymans@redh...> |
Commiter | Wim Taymans |
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
@@ -390,6 +390,7 @@ static int add_pro_profile(pa_card *impl, uint32_t index) | ||
390 | 390 | pa_proplist_setf(m->output_proplist, "device.profile.pro", "true"); |
391 | 391 | pa_proplist_setf(m->output_proplist, "node.group", "pro-audio-%u", index); |
392 | 392 | pa_proplist_setf(m->output_proplist, "node.link-group", "pro-audio-%u", index); |
393 | + pa_proplist_set(m->input_proplist, "api.alsa.auto-link", "true"); | |
393 | 394 | pa_alsa_close(&m->output_pcm); |
394 | 395 | m->supported = true; |
395 | 396 | pa_channel_map_init_auto(&m->channel_map, m->sample_spec.channels, PA_CHANNEL_MAP_AUX); |
@@ -423,6 +424,7 @@ static int add_pro_profile(pa_card *impl, uint32_t index) | ||
423 | 424 | pa_proplist_setf(m->input_proplist, "device.profile.pro", "true"); |
424 | 425 | pa_proplist_setf(m->input_proplist, "node.group", "pro-audio-%u", index); |
425 | 426 | pa_proplist_setf(m->input_proplist, "node.link-group", "pro-audio-%u", index); |
427 | + pa_proplist_set(m->input_proplist, "api.alsa.auto-link", "true"); | |
426 | 428 | pa_alsa_close(&m->input_pcm); |
427 | 429 | m->supported = true; |
428 | 430 | pa_channel_map_init_auto(&m->channel_map, m->sample_spec.channels, PA_CHANNEL_MAP_AUX); |
@@ -131,6 +131,8 @@ static int alsa_set_param(struct state *state, const char *k, const char *s) | ||
131 | 131 | state->multi_rate = spa_atob(s); |
132 | 132 | } else if (spa_streq(k, "api.alsa.htimestamp")) { |
133 | 133 | state->htimestamp = spa_atob(s); |
134 | + } else if (spa_streq(k, "api.alsa.auto-link")) { | |
135 | + state->auto_link = spa_atob(s); | |
134 | 136 | } else if (spa_streq(k, "latency.internal.rate")) { |
135 | 137 | state->process_latency.rate = atoi(s); |
136 | 138 | } else if (spa_streq(k, "latency.internal.ns")) { |
@@ -3034,7 +3036,7 @@ int spa_alsa_prepare(struct state *state) | ||
3034 | 3036 | spa_list_for_each(follower, &state->followers, driver_link) { |
3035 | 3037 | if (follower != state && !follower->matching) { |
3036 | 3038 | spa_alsa_prepare(follower); |
3037 | - if (!follower->linked) | |
3039 | + if (!follower->linked && state->auto_link) | |
3038 | 3040 | do_link(state, follower); |
3039 | 3041 | } |
3040 | 3042 | } |
@@ -214,6 +214,7 @@ struct state { | ||
214 | 214 | unsigned int htimestamp:1; |
215 | 215 | unsigned int is_pro:1; |
216 | 216 | unsigned int sources_added:1; |
217 | + unsigned int auto_link:1; | |
217 | 218 | unsigned int linked:1; |
218 | 219 | |
219 | 220 | uint64_t iec958_codecs; |