PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio
Commits: 38905a09 by Igor V. Kovalenko at 2021-04-19T14:48:36+00:00 alsa-mixer: Allow selected fallback mappings in all profile sets When fallback mapping is selected all subsequent profile sets containing selected mapping are ignored. When there are only e.g. fallback input mappings available, admitted profile set will only contain one profile with selected first input fallback mapping and no outputs, and rest of profiles will only contain outputs and no inputs. When there are only fallback input and output mappings, there will be no profiles admitted at all. Fix this by making sure that selected first fallback input or output mapping is actually allowed to exist in all probed profile sets. Note while this change allows selected fallback mappings to be found in duplex configuraitons, probing fallbacks still can fail if there is more than one input fallback and first one (selected) does not work in duplex configurations. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/539> - - - - - 1 changed file: - src/modules/alsa/alsa-mixer.c Changes: ===================================== src/modules/alsa/alsa-mixer.c ===================================== @@ -5151,6 +5151,7 @@ void pa_alsa_profile_set_probe( pa_alsa_profile **pp, **probe_order; pa_alsa_mapping *m; pa_hashmap *broken_inputs, *broken_outputs, *used_paths; + pa_alsa_mapping *selected_fallback_input = NULL, *selected_fallback_output = NULL; pa_assert(ps); pa_assert(dev_id); @@ -5173,11 +5174,16 @@ void pa_alsa_profile_set_probe( uint32_t idx; p = *pp; - /* Skip if fallback and already found something */ + /* Skip if fallback and already found something, but still probe already selected fallbacks. + * If UCM is used then both fallback_input and fallback_output flags are false. + * If UCM is not used then there will be only a single entry in mappings. + */ if (found_input && p->fallback_input) - continue; + if (selected_fallback_input == NULL || pa_idxset_get_by_index(p->input_mappings, 0) != selected_fallback_input) + continue; if (found_output && p->fallback_output) - continue; + if (selected_fallback_output == NULL || pa_idxset_get_by_index(p->output_mappings, 0) != selected_fallback_output) + continue; /* Skip if this is already marked that it is supported (i.e. from the config file) */ if (!p->supported) { @@ -5269,6 +5275,9 @@ void pa_alsa_profile_set_probe( PA_IDXSET_FOREACH(m, p->output_mappings, idx) if (m->output_pcm) { found_output = true; + if (p->fallback_output && selected_fallback_output == NULL) { + selected_fallback_output = m; + } mapping_paths_probe(m, p, PA_ALSA_DIRECTION_OUTPUT, used_paths, mixers); } @@ -5276,6 +5285,9 @@ void pa_alsa_profile_set_probe( PA_IDXSET_FOREACH(m, p->input_mappings, idx) if (m->input_pcm) { found_input = true; + if (p->fallback_input && selected_fallback_input == NULL) { + selected_fallback_input = m; + } mapping_paths_probe(m, p, PA_ALSA_DIRECTION_INPUT, used_paths, mixers); } } View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/38905a096c100e1ab69319a4a2ace984dc7f35ed -- View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/38905a096c100e1ab69319a4a2ace984dc7f35ed You're receiving this email because of your account on gitlab.freedesktop.org.
_______________________________________________ pulseaudio-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/pulseaudio-commits
