mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
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:
commit
c96b3c7f9c
1 changed files with 22 additions and 20 deletions
|
|
@ -1261,28 +1261,30 @@ void pa_alsa_ucm_add_port(
|
|||
|
||||
pa_hashmap_put(ports, port->name, port);
|
||||
pa_log_debug("Add port %s: %s", port->name, port->description);
|
||||
}
|
||||
|
||||
PA_HASHMAP_FOREACH_KV(verb_name, vol, is_sink ? dev->playback_volumes : dev->capture_volumes, state) {
|
||||
pa_alsa_path *path = pa_alsa_path_synthesize(vol->mixer_elem,
|
||||
is_sink ? PA_ALSA_DIRECTION_OUTPUT : PA_ALSA_DIRECTION_INPUT);
|
||||
|
||||
if (!path)
|
||||
pa_log_warn("Failed to set up volume control: %s", vol->mixer_elem);
|
||||
else {
|
||||
if (vol->master_elem) {
|
||||
pa_alsa_element *e = pa_alsa_element_get(path, vol->master_elem, false);
|
||||
e->switch_use = PA_ALSA_SWITCH_MUTE;
|
||||
e->volume_use = PA_ALSA_VOLUME_MERGE;
|
||||
}
|
||||
|
||||
pa_hashmap_put(data->paths, pa_xstrdup(verb_name), path);
|
||||
|
||||
/* Add path also to already created empty path set */
|
||||
if (is_sink)
|
||||
pa_hashmap_put(dev->playback_mapping->output_path_set->paths, pa_xstrdup(vol->mixer_elem), path);
|
||||
else
|
||||
pa_hashmap_put(dev->capture_mapping->input_path_set->paths, pa_xstrdup(vol->mixer_elem), path);
|
||||
data = PA_DEVICE_PORT_DATA(port);
|
||||
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,
|
||||
is_sink ? PA_ALSA_DIRECTION_OUTPUT : PA_ALSA_DIRECTION_INPUT);
|
||||
if (!path)
|
||||
pa_log_warn("Failed to set up volume control: %s", vol->mixer_elem);
|
||||
else {
|
||||
if (vol->master_elem) {
|
||||
pa_alsa_element *e = pa_alsa_element_get(path, vol->master_elem, false);
|
||||
e->switch_use = PA_ALSA_SWITCH_MUTE;
|
||||
e->volume_use = PA_ALSA_VOLUME_MERGE;
|
||||
}
|
||||
|
||||
pa_hashmap_put(data->paths, pa_xstrdup(verb_name), path);
|
||||
|
||||
/* Add path also to already created empty path set */
|
||||
if (is_sink)
|
||||
pa_hashmap_put(dev->playback_mapping->output_path_set->paths, pa_xstrdup(vol->mixer_elem), path);
|
||||
else
|
||||
pa_hashmap_put(dev->capture_mapping->input_path_set->paths, pa_xstrdup(vol->mixer_elem), path);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue