[pulseaudio-discuss] [PATCH 4/4] alsa-mixer: Attempt to detect and then drop redundant paths in the path set.

Colin Guthrie gmane at colin.guthr.ie
Mon Jul 4 01:45:59 PDT 2011


'Twas brillig, and David Henningsson at 04/07/11 08:19 did gyre and gimble:
> On 2011-07-03 14:48, Colin Guthrie wrote:
>> So really the path to be nuked should also have a volume_use of OFF, and
>> all it's other volume_uses should be OFF too...
>>
>> Should there be anything else checked? The other variations are the
>> "required" flag, the mask and the override_map. Are these relevant for
>> the working out which one to nuke?
> 
> I think we have different ideas to how this should be solved in the
> first place: Your idea is to check for equality and if so drop the one
> with least priority, my idea is to check for subset and if so drop the
> one that is the subset of another (and ignore priority).

Well that was my original thought, but that's just because it was sunny
outside and this was the last bit of the puzzle and I didn't really
think about it much :D

> Given some thought, I believe the "subset" idea would solve this case as
> well, if you consider "off" and "zero" being subsets of "merge". (And
> that makes sense, really: if an element is "merge", you can set it to
> both "off" and "zero" by moving the slider to the corresponding place.)

Right, that seems OK for volume_use, but what about the others? Do we
just state that any enumerations we encounter have to be equal for our
"subset off" comparison to succeed? I guess the same for switches?

Obviously if any volume, switch or enumeration is IGNORE, then we don't
check further for that element type.

if (switch_use != IGNORE) {
  // Do switch subset case...
  // Inheritance order  SELECT > ON > MUTE > OFF
  if (!subset_test) {
    is_subset = FALSE;
    break;
  }
}

if (volume_use != IGNORE) {
  // Do switch subset case...
  // Inheritance order  CONSTANT > MERGE > ZERO > OFF
  if (!subset_test) {
    is_subset = FALSE;
    break;
  }
}

if (enumeration_use != IGNORE) {
 // Just check to see if the two enumeration options are the same.
 if (!the_same) {
    is_subset = FALSE:
    break;
 }
}


In the case of switches are OFF and MUTE subsets of ON? Is ON a subset
of SELECT?

Or is it just MUTE is a subset of OFF with ON and SELECT just sets in
their own right (no more subsetting).

With volume is MERGE a subset of CONSTANT?

I'm just trying to get it straight in my head as I'm not super familiar
with all the numerous and varying alsa kcontrol stuff as you, so being
able to get a clear understanding of the rules will allow me to actually
implement the algorithm!


Col




-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


More information about the pulseaudio-discuss mailing list