[pulseaudio-discuss] [PATCH v2] alsa-mixer: Cache failure to open inputs/output mappings
Tanu Kaskinen
tanuk at iki.fi
Tue Sep 25 10:23:34 PDT 2012
On Mon, 2012-09-24 at 16:50 +0200, David Henningsson wrote:
> @@ -4301,6 +4310,8 @@ void pa_alsa_profile_set_probe(
> if (ps->probed)
> return;
>
> + broken_mappings = pa_hashmap_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
> +
> PA_HASHMAP_FOREACH(p, ps->profiles, state) {
> uint32_t idx;
>
> @@ -4311,8 +4322,21 @@ void pa_alsa_profile_set_probe(
> profile_finalize_probing(last, p);
> p->supported = TRUE;
>
> + PA_HASHMAP_FOREACH(m, broken_mappings, state2) {
> + const char* inout = NULL;
> + if (p->output_mappings && pa_idxset_get_by_data(p->output_mappings, m, NULL) == m)
> + inout = "output";
> + else if (p->input_mappings && pa_idxset_get_by_data(p->input_mappings, m, NULL) == m)
> + inout = "input";
> + if (inout) {
> + pa_log_debug("Skipping - will not be able to open %s:%s", inout, m->name);
> + p->supported = FALSE;
> + break;
> + }
> + }
I think this is not right. A mapping can have both directions, and I
think it's possible that one direction works and one doesn't. This code
will disable both directions if only one direction is broken.
--
Tanu
More information about the pulseaudio-discuss
mailing list