[pulseaudio-discuss] Mic input volume controls

Colin Guthrie gmane at colin.guthr.ie
Thu Dec 9 13:25:24 PST 2010


'Twas brillig, and David Henningsson at 07/12/10 08:35 did gyre and gimble:
> On 2010-12-04 19:09, Colin Guthrie wrote:
>> 'Twas brillig, and David Henningsson at 02/12/10 10:38 did gyre and
>>> Let's play with the idea that we added a configurable "Direction" key to
>>> these profiles that controlled whether we moved up or down to the
>>> nearest step. Wouldn't that help? Then we could have "Mic Boost" first
>>> in chain, then set it to move down rather than up.
>>> Or maybe that we should instead say that if we're above 0 dB, we move
>>> down, and if we're below 0 dB, we move up? Would that make sense?
>>
>> I'm not really sure here. A specific direction key may complicate what
>> is already a rather complicated thing, so if we can possibly do things
>> sensibly without it, then I'd suggest that would be more attractive (if
>> it works reliably enough).
> 
> We want to maximise quality while avoiding digital distortion, that's
> basically the problem in a nutshell. We're assuming (sometimes
> incorrectly; but that's our best guess) that this golden spot will be
> achieved with all sliders at 0 dB.
> 
> I think my approach makes sense, unless I'm missing something: If we're
> aiming for something above 0 dB, let's round down to make sure we avoid
> distortion, and if we're below 0 dB, let's round up to make sure we get
> maximum quality.

I see what you mean here. At present we always pass +1 to the various
alsa functions that take it (e.g. snd_mixer_selem_set_playback_dB()),
but after we adjust for base volume, we may be requesting alsa volumes
of >0dB (e.g. if our base volume is at 30%, then 35% will be a +dB in alsa).

So yeah, I think you are correct here, the rounding needs to factor this
in. It's a pity there is not a fourth option to these calls in alsa
(i.e. in addition to -1, 0, +1) that did "appropriate rounding", but we
can deal with this I guess.

> And then we always start with the control that's closest to the physical
> hardware and work our way in.

I guess so.

> What's in and out here; that's currently determined by the order in
> which PulseAudio reads them in, right? That complicates matters a little
> given the include file structure and so I'm thinking maybe we should add
> a "extremity=<number>" key to the config file? (This is unrelated to the
> direction key suggested previously.) We would then start with the one
> having the highest "extremity" score.

I guess that would allow for a clearer, more deterministic approach.

> Otherwise we would get in trouble if we have a profile with a volume
> control B (with extremity=2), which then includes a file with both
> control A (with extremity=1) and control C (with extremity=3) in the
> same include file.
> 
> I think that would actually make things clearer. What do you think?

While I've never completely grasped absolutely everything in the mixer
profiles stuff, I think you speak sense :)


Cheers

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