Re: [PATCH] Map volume and brightness events on thinkpads

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Henrique de Moraes Holschuh
Date: Tuesday, October 16, 2007 - 2:12 am

On Mon, 15 Oct 2007, Jeremy Katz wrote:

Look *very* closedly at what HAL is doing on that X31.  If it seems to do
the "right thing" while reporting keys to userspace over the input layer, it
is because HAL is abusing the input layer and using input events in "passive
mode", just to report brightness and volume changes through OSD or somesuch.
Either that, or you have such an old userpace there, that it doesn't react
to input events at all...

I am not exactly against the notion of passive input events (i.e. stuff you
are *not* to act upon other than to give user feedback), but you cannot
deliver them as EV_KEY (you cannot tell those apart from proper "please do
change the brightness/volume/whatever" EV_KEY), and the input subsystem is
not to be used like that according to its maintainer.

So, I want no such behaviour in thinkpad-acpi, please.  There are other ways
to adress the needs of userspace, and they are being implemented (although
slowly, I am sorry about this, but my bandwidth is limited).


It is on IBM thinkpads, were you *really* have a second hardware mixer, that
operates completely independent of the OS and controls the output signal
level for the speakers and headphone (and does NOT control the output signal
level on the audio output on docks and port replicators, etc).

The volume and mute buttons act directly on that mixer (through the
firmware), and thinkpad-acpi can control that mixer fully.  A mixer is a
mixer, and the proper interface to talk to a mixer is an ALSA mixer
interface.

The fact that an IBM thinkpad also lets you know exactly which mixer control
was pressed *on some models* (T4x and newer, X31 and newer, as long as the
latest BIOS is used) does not mean you are to use that to poke on the AC97
mixer controls.   Heavy hint: Windows does NOT touch the AC97 mixer.
Another heavy hint: you need to track the mixer state and filter the events
to reproduce the mixer behaviour, where mute always mutes (not mute/unmute)
and you unmute with a press of one of the volume up/down buttons (which
won't change volume level when unmuting).

And on Lenovo thinkpads, the same level of control is available.  The
difference is that I am not sure if the firmware is always acting on the
mixer automatically on all models and BIOS revisions.  I will ask Lenovo
about it.   This still asks for a mixer interface to control the internal
speaker/headphone mixer, but it *might* ask for input events for volume
up/down/mute in *some* Lenovo models.  Again, this is not something the
patch in question does correctly.


Any thinkpad user that looks at that keyboard and thinks that pressing its
keys is to do anything else than control the volume of the built-in speakers
and headphone output, is already confused.  Blame IBM, if you must... but
that's how things are.  Lenovo may change it... or not.  If they do, I will
adapt the driver to do the right thing: that's why the driver *can* report
volume input events.  So that I can enable it by default should it become
the right thing to do on a given thinkpad model.

And really, you will *not* have me agree that pressing a volume key should
act on both mixers at once, ever.  This reduces by half the dynamic range of
the volume control on a part of the curve (the AC97 mixer has more levels
than the internal mixer).

OSDs for volume should be tied to the ALSA mixers.  One will be provided by
thinkpad-acpi soon.  Heck, I can get it ready for 2.6.24 if you convince
Linus and Len to take it in after -rc1.  Otherwise, it is scheduled for
2.6.25.


They are reported through ACPI events and not by thinkpad-acpi.  Remove the
drivers and watch the ACPI messages.


Empirically testing things without really taking into account the path the
information will travel will not get you the right answers for this problem.
I hope I explained why that happens clearly enough in this mail...

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Map volume and brightness events on thinkpads, Jeremy Katz, (Mon Oct 15, 1:45 pm)
Re: [PATCH] Map volume and brightness events on thinkpads, Henrique de Moraes H ..., (Mon Oct 15, 2:07 pm)
Re: [PATCH] Map volume and brightness events on thinkpads, Arjan van de Ven, (Mon Oct 15, 2:43 pm)
Re: [PATCH] Map volume and brightness events on thinkpads, Henrique de Moraes H ..., (Tue Oct 16, 1:36 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Henrique de Moraes H ..., (Tue Oct 16, 2:12 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Henrique de Moraes H ..., (Tue Oct 16, 2:18 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Matthew Garrett, (Tue Oct 16, 6:00 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Henrique de Moraes H ..., (Tue Oct 16, 7:11 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Matthew Garrett, (Tue Oct 16, 7:21 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Dmitry Torokhov, (Tue Oct 16, 7:27 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Henrique de Moraes H ..., (Tue Oct 16, 7:31 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Matthew Garrett, (Tue Oct 16, 7:40 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Matthew Garrett, (Tue Oct 16, 7:54 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Dmitry Torokhov, (Tue Oct 16, 8:54 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Matthew Garrett, (Tue Oct 16, 8:59 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Henrique de Moraes H ..., (Tue Oct 16, 9:56 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Matthew Garrett, (Tue Oct 16, 11:46 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Matthew Garrett, (Tue Oct 16, 11:53 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Linus Torvalds, (Tue Oct 16, 12:14 pm)
Re: [PATCH] Map volume and brightness events on thinkpads, Matthew Garrett, (Tue Oct 16, 12:20 pm)
Re: [PATCH] Map volume and brightness events on thinkpads, Renato S. Yamane, (Tue Oct 16, 12:23 pm)
Re: [PATCH] Map volume and brightness events on thinkpads, Henrique de Moraes H ..., (Tue Oct 16, 1:02 pm)
Re: [PATCH] Map volume and brightness events on thinkpads, Dmitry Torokhov, (Tue Oct 16, 1:12 pm)
Re: [PATCH] Map volume and brightness events on thinkpads, Dmitry Torokhov, (Tue Oct 16, 1:15 pm)
Re: [PATCH] Map volume and brightness events on thinkpads, Dmitry Torokhov, (Tue Oct 16, 1:19 pm)
Re: [PATCH] Map volume and brightness events on thinkpads, Linus Torvalds, (Tue Oct 16, 1:32 pm)
Re: [PATCH] Map volume and brightness events on thinkpads, Matthew Garrett, (Tue Oct 16, 1:55 pm)
Re: [PATCH] Map volume and brightness events on thinkpads, Dmitry Torokhov, (Tue Oct 16, 2:18 pm)
Re: [PATCH] Map volume and brightness events on thinkpads, Henrique de Moraes H ..., (Tue Oct 16, 11:25 pm)
Re: [PATCH] Map volume and brightness events on thinkpads, Jesse Barnes, (Tue Oct 16, 11:32 pm)
Re: [PATCH] Map volume and brightness events on thinkpads, Henrique de Moraes H ..., (Tue Oct 16, 11:39 pm)
Re: [PATCH] Map volume and brightness events on thinkpads, Dmitry Torokhov, (Wed Oct 17, 8:57 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Matthew Garrett, (Wed Oct 17, 9:28 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Henrique de Moraes H ..., (Wed Oct 17, 10:35 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Dmitry Torokhov, (Wed Oct 17, 11:59 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Henrique de Moraes H ..., (Wed Oct 17, 1:42 pm)
Re: [PATCH] Map volume and brightness events on thinkpads, Dmitry Torokhov, (Thu Oct 18, 7:37 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Henrique de Moraes H ..., (Thu Oct 18, 3:39 pm)
Re: [PATCH] Map volume and brightness events on thinkpads, Dmitry Torokhov, (Tue Oct 23, 8:54 am)
Re: [PATCH] Map volume and brightness events on thinkpads, Henrique de Moraes H ..., (Tue Oct 23, 4:34 pm)