alsa: strip and add the _alibpref from device names

Strip the _alibpref from the device name, it contains a local counter
to identify the ucm card that should remain internal. We set a flag on
the device to notify of this.

Re-add the _alibpref of the local card to the device name if the
device was flagged.

See #1286
This commit is contained in:
Wim Taymans 2021-06-10 15:36:26 +02:00
parent 283e13629c
commit 1c513464c8
2 changed files with 8 additions and 3 deletions

View file

@ -252,6 +252,9 @@ static void init_device(pa_card *impl, pa_alsa_device *dev, pa_alsa_direction_t
char **d;
for (d = m->device_strings; *d; d++) {
if (pa_startswith(*d, alibpref)) {
size_t plen = strlen(alibpref);
size_t len = strlen(*d);
memmove(*d, (*d) + plen, len - plen + 1);
dev->device.flags |= ACP_DEVICE_UCM_DEVICE;
break;
}