acp: add fallback alibpref just in case

Until we are sure that everybody has a recent enough version of
alsa-lib 1.2.5
This commit is contained in:
Wim Taymans 2021-06-07 13:04:03 +02:00
parent 1f85d06317
commit 8132c4e2b4

View file

@ -242,9 +242,13 @@ static void init_device(pa_card *impl, pa_alsa_device *dev, pa_alsa_direction_t
dev->ports = pa_hashmap_new(pa_idxset_string_hash_func, dev->ports = pa_hashmap_new(pa_idxset_string_hash_func,
pa_idxset_string_compare_func); pa_idxset_string_compare_func);
if (m->ucm_context.ucm) { if (m->ucm_context.ucm) {
const char *alibpref; const char *alibpref = NULL;
dev->ucm_context = &m->ucm_context; dev->ucm_context = &m->ucm_context;
if ((snd_use_case_get(impl->ucm.ucm_mgr, "_alibpref", &alibpref) == 0)) { if ((snd_use_case_get(impl->ucm.ucm_mgr, "_alibpref", &alibpref) != 0))
alibpref = NULL;
if (alibpref == NULL)
alibpref = spa_aprintf("_ucm%04X.", impl->card.index);
if (alibpref != NULL) {
char **d; char **d;
for (d = m->device_strings; *d; d++) { for (d = m->device_strings; *d; d++) {
if (pa_startswith(*d, alibpref)) { if (pa_startswith(*d, alibpref)) {