mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
alsa: use the local alibpref of the card
The _alibpref of the device was created in the session manager and does not match our local _alibpref. Patch the device name with the local _alibpref to make things match. See #1286
This commit is contained in:
parent
23a0f29d48
commit
283e13629c
1 changed files with 9 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ int spa_alsa_init(struct state *state)
|
||||||
|
|
||||||
if (state->open_ucm) {
|
if (state->open_ucm) {
|
||||||
char card_name[64];
|
char card_name[64];
|
||||||
|
const char *alibpref = NULL;
|
||||||
|
|
||||||
snprintf(card_name, sizeof(card_name), "hw:%i", state->card_index);
|
snprintf(card_name, sizeof(card_name), "hw:%i", state->card_index);
|
||||||
err = snd_use_case_mgr_open(&state->ucm, card_name);
|
err = snd_use_case_mgr_open(&state->ucm, card_name);
|
||||||
|
|
@ -44,6 +45,14 @@ int spa_alsa_init(struct state *state)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((snd_use_case_get(state->ucm, "_alibpref", &alibpref) != 0))
|
||||||
|
alibpref = NULL;
|
||||||
|
if (alibpref != NULL) {
|
||||||
|
size_t len = strlen(alibpref);
|
||||||
|
if (len > 4 && strncmp(state->props.device, alibpref, 4) == 0)
|
||||||
|
memcpy(state->props.device, alibpref, len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue