Skip to content

alsa: ucm: Fix spurious mixer path removal on initial profile set

Hector Martin requested to merge marcan/pulseaudio:ucm-fix into master

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: a9cc1373 ("alsa: ucm - update the mixer path also after volume probe")

Signed-off-by: Hector Martin

Edited by Hector Martin

Merge request reports