[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] alsa: ucm: Fix spurious mixer path removal on initial profile set

PulseAudio Marge Bot (@pulseaudio-merge-bot) gitlab at gitlab.freedesktop.org
Sun Mar 19 21:24:48 UTC 2023



PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio


Commits:
3e038c6d by Hector Martin at 2023-03-19T21:22:32+00:00
alsa: ucm: Fix spurious mixer path removal on initial profile set

The code that removes the mixer path if probing fails can be called in
the path that sets a non-off device profile on hotplug *before*
card->active_profile is updated, which results in spuriously removing
the mixer path. By this point, context->ucm->active_verb would be set
to the same as the profile name, so we can use that instead to avoid
the issue.

On Apple Silicon machines with the UCM profiles in the Asahi Linux repo,
this manifests as the headphones jack having hardware volume controls
*only* if PA is started with headphones connected and until they are
disconnected. Hotplugs end up triggering the bad codepath, and it falls
back to software volume (which is particularly a problem when the
hardware volume happens to be very low or 0 at that point).

Fixes: a9cc1373e2a7 ("alsa: ucm - update the mixer path also after volume probe")
Signed-off-by: Hector Martin <marcan at marcan.st>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/752>

- - - - -


1 changed file:

- src/modules/alsa/alsa-ucm.c


Changes:

=====================================
src/modules/alsa/alsa-ucm.c
=====================================
@@ -1454,8 +1454,11 @@ void pa_alsa_ucm_add_ports(
      * pa_alsa_ucm_port_data.path, which is not cleared by probe_volumes() if
      * the path gets removed, so we have to call update_mixer_paths() here to
      * unset the cached path if needed. */
-    if (card->active_profile)
-        update_mixer_paths(*p, card->active_profile->name);
+    if (context->ucm->active_verb) {
+        const char *verb_name;
+        verb_name = pa_proplist_gets(context->ucm->active_verb->proplist, PA_ALSA_PROP_UCM_NAME);
+        update_mixer_paths(*p, verb_name);
+    }
 
     /* then set property PA_PROP_DEVICE_INTENDED_ROLES */
     merged_roles = pa_xstrdup(pa_proplist_gets(proplist, PA_PROP_DEVICE_INTENDED_ROLES));



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/3e038c6d88129feeb7deaac6d853b5451170d288

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/3e038c6d88129feeb7deaac6d853b5451170d288
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20230319/91e1b82b/attachment.htm>


More information about the pulseaudio-commits mailing list