alsa-ucm: fix persistent port names with alsa-lib >= 1.2.5
authorIgor V. Kovalenko <igor.v.kovalenko@gmail.com>
Wed, 30 Jun 2021 19:12:55 +0000 (22:12 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Mon, 12 Jul 2021 10:49:21 +0000 (13:49 +0300)
commit5febac482d2a1c897d10b36933bb74b002840917
tree22d1c5b8e9a9777f9fa20884187bdbbbe47183c3
parent13fd21a9c9a80aab0ea8fae99d54d9a4ee75c188
alsa-ucm: fix persistent port names with alsa-lib >= 1.2.5

Alsa UCM device string can contain private configuration prefix required to make
correct device open call. Private prefix is dynamically generated by UCM manager
depending on internal state. Since pulseaudio sink/source port names currently
contain device string, these may change between runs breaking volume database
and module arguments referring to sink/source.

Fix this by skipping UCM private prefix available via `_alibpref` key while
creating UCM mapping name. Mapping object will still contain unmodified
device string for device open call.

See also https://github.com/alsa-project/alsa-ucm-conf/issues/104

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/598>
src/modules/alsa/alsa-ucm.c