alsa-mixer: Fix jack name comparison v13.99.3
authorTanu Kaskinen <tanuk@iki.fi>
Sun, 4 Oct 2020 10:18:16 +0000 (13:18 +0300)
committerArun Raghavan <arun@arunraghavan.net>
Fri, 30 Oct 2020 16:55:39 +0000 (16:55 +0000)
HDMI jacks are configured like this:

    [Jack HDMI/DP]
    append-pcm-to-name = yes

The pa_alsa_jack.name field is then "HDMI/DP" and pa_alsa_jack.alsa_name
is set to "HDMI/DP,pcm=3 Jack" or similar. If we compare the name fields
of HDMI paths, they appear to use the same jack element even though they
are different in reality, so all HDMI ports got incorrectly assigned to
the same availability group.

src/modules/alsa/alsa-mixer.c

index 345132f57602b4dd3cc57a2c4a49ca51fc7d7d9d..0631790523b3edc18b3c99bfb3f560e7aea5f726 100644 (file)
@@ -4311,7 +4311,7 @@ static void profile_set_set_availability_groups(pa_alsa_profile_set *ps) {
                 PA_LLIST_FOREACH(j2, p2->jacks) {
                     if (!j2->has_control || j2->state_plugged == PA_AVAILABLE_NO)
                         continue;
-                    if (pa_streq(j->name, j2->name)) {
+                    if (pa_streq(j->alsa_name, j2->alsa_name)) {
                         j->state_plugged = PA_AVAILABLE_UNKNOWN;
                         j2->state_plugged = PA_AVAILABLE_UNKNOWN;
                         found = p2->availability_group;