• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Pipewireパッケージ(ちょっと変更)


Commit MetaInfo

Revisión896fea62c2072c836e6d821f7bdafe840ce8540e (tree)
Tiempo2023-10-09 17:13:43
AutorWim Taymans <wtaymans@redh...>
CommiterWim Taymans

Log Message

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

Cambiar Resumen

Diferencia incremental

--- a/spa/plugins/alsa/acp/acp.c
+++ b/spa/plugins/alsa/acp/acp.c
@@ -390,6 +390,7 @@ static int add_pro_profile(pa_card *impl, uint32_t index)
390390 pa_proplist_setf(m->output_proplist, "device.profile.pro", "true");
391391 pa_proplist_setf(m->output_proplist, "node.group", "pro-audio-%u", index);
392392 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");
393394 pa_alsa_close(&m->output_pcm);
394395 m->supported = true;
395396 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)
423424 pa_proplist_setf(m->input_proplist, "device.profile.pro", "true");
424425 pa_proplist_setf(m->input_proplist, "node.group", "pro-audio-%u", index);
425426 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");
426428 pa_alsa_close(&m->input_pcm);
427429 m->supported = true;
428430 pa_channel_map_init_auto(&m->channel_map, m->sample_spec.channels, PA_CHANNEL_MAP_AUX);
--- a/spa/plugins/alsa/alsa-pcm.c
+++ b/spa/plugins/alsa/alsa-pcm.c
@@ -131,6 +131,8 @@ static int alsa_set_param(struct state *state, const char *k, const char *s)
131131 state->multi_rate = spa_atob(s);
132132 } else if (spa_streq(k, "api.alsa.htimestamp")) {
133133 state->htimestamp = spa_atob(s);
134+ } else if (spa_streq(k, "api.alsa.auto-link")) {
135+ state->auto_link = spa_atob(s);
134136 } else if (spa_streq(k, "latency.internal.rate")) {
135137 state->process_latency.rate = atoi(s);
136138 } else if (spa_streq(k, "latency.internal.ns")) {
@@ -3034,7 +3036,7 @@ int spa_alsa_prepare(struct state *state)
30343036 spa_list_for_each(follower, &state->followers, driver_link) {
30353037 if (follower != state && !follower->matching) {
30363038 spa_alsa_prepare(follower);
3037- if (!follower->linked)
3039+ if (!follower->linked && state->auto_link)
30383040 do_link(state, follower);
30393041 }
30403042 }
--- a/spa/plugins/alsa/alsa-pcm.h
+++ b/spa/plugins/alsa/alsa-pcm.h
@@ -214,6 +214,7 @@ struct state {
214214 unsigned int htimestamp:1;
215215 unsigned int is_pro:1;
216216 unsigned int sources_added:1;
217+ unsigned int auto_link:1;
217218 unsigned int linked:1;
218219
219220 uint64_t iec958_codecs;