Merge branch 'alsa-ucm-multi-verb-hw-volumes' into 'master'

alsa-ucm: Set up hardware volumes again on duplicate port additions

See merge request pulseaudio/pulseaudio!840
This commit is contained in:
Alper Nebi Yasak 2025-11-08 18:59:39 +03:00
commit 1ce1b261cf

View file

@ -1261,11 +1261,14 @@ void pa_alsa_ucm_add_port(
pa_hashmap_put(ports, port->name, port); pa_hashmap_put(ports, port->name, port);
pa_log_debug("Add port %s: %s", port->name, port->description); pa_log_debug("Add port %s: %s", port->name, port->description);
}
data = PA_DEVICE_PORT_DATA(port);
PA_HASHMAP_FOREACH_KV(verb_name, vol, is_sink ? dev->playback_volumes : dev->capture_volumes, state) { PA_HASHMAP_FOREACH_KV(verb_name, vol, is_sink ? dev->playback_volumes : dev->capture_volumes, state) {
if (pa_hashmap_get(data->paths, verb_name))
continue;
pa_alsa_path *path = pa_alsa_path_synthesize(vol->mixer_elem, pa_alsa_path *path = pa_alsa_path_synthesize(vol->mixer_elem,
is_sink ? PA_ALSA_DIRECTION_OUTPUT : PA_ALSA_DIRECTION_INPUT); is_sink ? PA_ALSA_DIRECTION_OUTPUT : PA_ALSA_DIRECTION_INPUT);
if (!path) if (!path)
pa_log_warn("Failed to set up volume control: %s", vol->mixer_elem); pa_log_warn("Failed to set up volume control: %s", vol->mixer_elem);
else { else {
@ -1284,7 +1287,6 @@ void pa_alsa_ucm_add_port(
pa_hashmap_put(dev->capture_mapping->input_path_set->paths, pa_xstrdup(vol->mixer_elem), path); pa_hashmap_put(dev->capture_mapping->input_path_set->paths, pa_xstrdup(vol->mixer_elem), path);
} }
} }
}
port->priority = priority; port->priority = priority;