[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] 2 commits: alsa-mixer: Set availability groups once per card
Arun Raghavan
gitlab at gitlab.freedesktop.org
Fri Oct 30 17:00:41 UTC 2020
Arun Raghavan pushed to branch master at PulseAudio / pulseaudio
Commits:
eee8292a by Tanu Kaskinen at 2020-10-30T16:55:39+00:00
alsa-mixer: Set availability groups once per card
Previously they were set once per mapping, which caused the numbering to
restart from 1 for every mapping, so ports were incorrectly assigned to
the same group.
- - - - -
daf3a3c4 by Tanu Kaskinen at 2020-10-30T16:55:39+00:00
alsa-mixer: Fix jack name comparison
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.
- - - - -
1 changed file:
- src/modules/alsa/alsa-mixer.c
Changes:
=====================================
src/modules/alsa/alsa-mixer.c
=====================================
@@ -4276,28 +4276,42 @@ fail:
}
/* the logic is simple: if we see the jack in multiple paths */
-/* assign all those jacks to one availability_group */
-static void mapping_group_available(pa_hashmap *paths)
-{
- void *state, *state2;
- pa_alsa_path *p, *p2;
- pa_alsa_jack *j, *j2;
+/* assign all those paths to one availability_group */
+static void profile_set_set_availability_groups(pa_alsa_profile_set *ps) {
+ pa_dynarray *paths;
+ pa_alsa_path *p;
+ void *state;
+ unsigned idx1;
uint32_t num = 1;
- PA_HASHMAP_FOREACH(p, paths, state) {
+ /* Merge ps->input_paths and ps->output_paths into one dynarray. */
+ paths = pa_dynarray_new(NULL);
+ PA_HASHMAP_FOREACH(p, ps->input_paths, state)
+ pa_dynarray_append(paths, p);
+ PA_HASHMAP_FOREACH(p, ps->output_paths, state)
+ pa_dynarray_append(paths, p);
+
+ PA_DYNARRAY_FOREACH(p, paths, idx1) {
+ pa_alsa_jack *j;
const char *found = NULL;
bool has_control = false;
+
PA_LLIST_FOREACH(j, p->jacks) {
+ pa_alsa_path *p2;
+ unsigned idx2;
+
if (!j->has_control || j->state_plugged == PA_AVAILABLE_NO)
continue;
has_control = true;
- PA_HASHMAP_FOREACH(p2, paths, state2) {
+ PA_DYNARRAY_FOREACH(p2, paths, idx2) {
+ pa_alsa_jack *j2;
+
if (p2 == p)
- break;
+ break;
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;
@@ -4318,6 +4332,8 @@ static void mapping_group_available(pa_hashmap *paths)
if (!found)
num++;
}
+
+ pa_dynarray_free(paths);
}
static void mapping_paths_probe(pa_alsa_mapping *m, pa_alsa_profile *profile,
@@ -4368,8 +4384,6 @@ static void mapping_paths_probe(pa_alsa_mapping *m, pa_alsa_profile *profile,
PA_HASHMAP_FOREACH(p, ps->paths, state)
pa_hashmap_put(used_paths, p, p);
- mapping_group_available(ps->paths);
-
pa_log_debug("Available mixer paths (after tidying):");
pa_alsa_path_set_dump(ps);
}
@@ -5103,6 +5117,8 @@ void pa_alsa_profile_set_probe(
pa_hashmap_free(used_paths);
pa_xfree(probe_order);
+ profile_set_set_availability_groups(ps);
+
ps->probed = true;
}
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/compare/a9c6d43b7ca3ffceab31bc3819903ee8c5de70c5...daf3a3c4b08c89aa658353764c5237f0a4bef9f7
--
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/compare/a9c6d43b7ca3ffceab31bc3819903ee8c5de70c5...daf3a3c4b08c89aa658353764c5237f0a4bef9f7
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/20201030/512aa982/attachment-0001.htm>
More information about the pulseaudio-commits
mailing list