Re: [PATCH v3] thinkpad-acpi: Improve hardware volume controls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, May 14, 2011 at 2:41 PM, Henrique de Moraes Holschuh
<hmh@xxxxxxxxxx> wrote:
> On Sat, 14 May 2011, Andrew Lutomirski wrote:
>> I think that on Windows on everything older than X220, pressing mute
>> unconditionally mutes the sound, so it's a nice way to tell the system
>> "don't make noise, regardless of what current settings are."
>
> Yay, so the thinkpads have been un-dumbeddown.  I love uplifting!
>
>> The behavior I implemented reads the default from BIOS so that we do
>> the right thing (or at least the thing that Lenovo intended) on all of
>
> Does the BIOS have a setup "control" for the user to chose MUTE behaviour?

Not that I can find.

Bad news, though: the SAUM control is different on the X200.  The settings are:

0: latching mode.  (mute unconditionally mutes but does not send any keystroke)
1: same as 3?
2: software mode.  (mute sends e020, which is standard for a mute button)
3: weird. (mute sends e060 and does not seem to affect the mute state)

So, two differences from x220.  First, toggle is screwy and there
seems to be no point in using it.  Second, latching mode does not send
any keystroke.

I suspect that 0 was always the default and 2 was the value that got
programmed if OSI=Linux, and 1 and 3 were just some random garbage.
Then, when the X220 was designed with a light, the designers wanted
toggle mode and repurposed an unused value.  So it's probably safe to
assume that 0 and 2 will remain at least similarly-behaving in future
models.

There are a few possible things to do:

1. Read HAUM at startup.  If it's 0, assume that only latching mode
and software mute are valid.  If it's 2 (as it is on the X220), then
assume that toggle is valid as well.

2. On some or all models that have SAUM, read the initial state to
figure out what the default should be, then call SAUM(2) and just
emulate the mute button in software.

Benefits of the former:
 - It's easy
 - No regressions :)

Benefits of the latter:
 - X200 gets ALSA notifications when the volume changes.
 - Toggle is available on all recent models.
 - We can emulate toggle a little better than the EC does: holding
down the mute button really shouldn't flip it back and forth rapidly.

Downsides of the latter:  if the kernel dies in such a way that it's
making noise, the mute button won't shut it up.

In either case, I think we should write the initial value back to
hardware on module unload so we don't get confused if we get loaded
again.


I'll email the pulseaudio list and ask what they want to do about the
mixer.  Ignoring it is fine, if slightly confusing on models without a
light.  (But then we've behaved that way on everything except the
three models in the OSI=Linux list forever.)

--Andy

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
ibm-acpi-devel mailing list
ibm-acpi-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel



[Index of Archives]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite Photos]     [Yosemite Advice]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux