[pulseaudio-discuss] [PATCH] volumes: Implement options to bypass the base volume system.
Colin Guthrie
gmane at colin.guthr.ie
Fri Sep 9 01:43:57 PDT 2011
'Twas brillig, and David Henningsson at 09/09/11 04:58 did gyre and gimble:
> On 09/08/2011 10:30 PM, Colin Guthrie wrote:
>> When the underlying hardware (typically ALSA) reports that the dB
>> volume ranges to to a value>0dB, a 'base volume' is automatically
>> added. This system allows the user to utilise the full range of the
>> underlying hardware controls (ranging from PA_VOLUME_MIN to
>> PA_VOLUME_NORM) but still get informed, via UI clues, as to the point
>> the hardware reports as 0dB (i.e. the point at which your sound should
>> be unmodified).
>>
>> Sadly, this system does not work for some users. Sometimes the range
>> where the volume remains below the underlying 0dB point is very small
>> (e.g. from 0 to 20%). In this scenario, things are made very awkward for
>> users as the active range they typically want to adjust is so small.
>
> Hm. If I understand the problem correctly, the problem is that the user
> does not want to see the volume slider ranging from PA_VOLUME_MIN to
> PA_VOLUME_NORM, but something different. This sounds very much like the
> PA_VOLUME_UI_MAX thing.
Not quite, but kinda. I guess it depends how you visualise the issue.
PA_VOLUME_NORM is defined as our 100% aka 0dB
This patch basically adds the option to optionally align our 0dB with
ALSA's.
At present, if alsa ranges, e.g. from -20dB to +10dB, then our 0dB will
be alsa's +10dB, and the UI will indicate a base volume in via a tick
mark in the GUI at -10dB.
With the new option tuned on, our 0dB and alsa's 0dB are the same point
on the slider.
> Let me suggest a different solution. Drop both this and
> PA_VOLUME_UI_MAX, and replace it with something more configurable. For
> every port, let the user configure the range they want to be able to
> set, so that they can set an arbitrarily range, both within and outside
> the limits of what the hardware volume supports.
Ultimately, you could express this configuration as something the user
would want to define themselves - i.e. define the "0dB" point and define
the maximum volume to show in UIs (rather than hard code
PA_VOLUME_UI_MAX). This isn't a bad idea at all. We have had other
requests from users to allow them to adjust the range available so it
would kinda kill two birds with one stone.
As device-restore is already storing stuff on a per-port basis these
days, it wouldn't be difficult to implement storage for this.
That said, it's probably quite late in the day to do this kind of
hacking for v1.0.
> I'm not sure exactly how to best store this information (udev rules?
> gconf? per-user volume database?) but my point is to have this
> information on Port level rather than card level or global level.
Seeing as we already have a per-port keyed database, I'd say the
device-restore database is a good candidate.
>> Added to the above scenario, if the user has flat volumes enabled they
>> will also get this limited range within application volume controls.
>>
>> This particular scenario has prompted some applications to implement
>> their own work arounds to this problem and scale the whole volume range
>> they expose to the base volume when flat volumes are enabled. This
>> means that the scale the user sees inside the application will be
>> different to e.g. the scale given by panel applet volume controls,
>> OSD displays+volume keys and full blown mixers GUIs.
>>
>> This inconsistency in applications is what has prompted this feature.
>> It allows users to choose whether or not they want to expose the base
>> volume and get the full range of h/w control (as currently), or whether
>> they would prefer to honour the 0dB of the underlying h/w and set
>> that to our 0dB point (aka 100%). UIs which honour PA_VOLUME_UI_MAX will
>> still offer the user some of the additional range their h/w supports
>>> 0dB.
>>
>> The behaviour remains unchanged by default and users will have to set
>> the feature manually in daemon.conf. The option is split so the user can
>> choose to apply it separately for sinks (where the problem is most
>> visible) and sources.
>
> For sources, in particular microphone inputs, the base volume is usually
> very low. On a typical HDA the volume might range between -30dB to +60
> dB and usually you want to set it to something like +20 dB. My USB
> headset actually ranges from +16 dB to +29 dB, so 0 dB is not even
> settable through hw controls.
This is why I left the option separated for sinks and sources. I think
it makes sense much more on sources than it does on sinks.
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