From 0a631d61e64f0c1d8db0b62f1696590e16672d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Tue, 1 Oct 2024 22:41:48 +0200 Subject: [PATCH] acp: do not overwrite properties of PCM with that of the card The properties of the card might overwrite those of the PCM. For example, the cards's `alsa.id` will be set on the PCM too since 37a51533e02b89 ("acp: add more properties for the card"). To avoid that, call `pa_alsa_init_proplist_card()` first in `pa_alsa_init_proplist_pcm_info()` instead of last. See #4135 --- spa/plugins/alsa/acp/alsa-util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spa/plugins/alsa/acp/alsa-util.c b/spa/plugins/alsa/acp/alsa-util.c index 1b1aa3104..9c4638f1b 100644 --- a/spa/plugins/alsa/acp/alsa-util.c +++ b/spa/plugins/alsa/acp/alsa-util.c @@ -1020,6 +1020,9 @@ void pa_alsa_init_proplist_pcm_info(pa_core *c, pa_proplist *p, snd_pcm_info_t * pa_assert(p); pa_assert(pcm_info); + if ((card = snd_pcm_info_get_card(pcm_info)) >= 0) + pa_alsa_init_proplist_card(c, p, card); + pa_proplist_sets(p, PA_PROP_DEVICE_API, "alsa"); if ((class = snd_pcm_info_get_class(pcm_info)) <= SND_PCM_CLASS_LAST) { @@ -1048,9 +1051,6 @@ void pa_alsa_init_proplist_pcm_info(pa_core *c, pa_proplist *p, snd_pcm_info_t * pa_proplist_setf(p, "alsa.device", "%u", snd_pcm_info_get_device(pcm_info)); - if ((card = snd_pcm_info_get_card(pcm_info)) >= 0) - pa_alsa_init_proplist_card(c, p, card); - sync_id = snd_pcm_info_get_sync(pcm_info); pa_proplist_setf(p, "alsa.sync.id", "%08x:%08x:%08x:%08x", sync_id.id32[0], sync_id.id32[1], sync_id.id32[2], sync_id.id32[3]);