linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lutomirski <luto@mit.edu>
To: Matthew Garrett <mjg59@srcf.ucam.org>, Dmitry Torokhov <dtor@mail.ru>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
	ibm-acpi-devel@lists.sourceforge.net,
	platform-driver-x86@vger.kernel.org, linux-input@vger.kernel.org
Subject: Re: [RFC PATCH] thinkpad-acpi: Improve hardware volume controls
Date: Thu, 12 May 2011 10:50:54 -0400	[thread overview]
Message-ID: <BANLkTikX7mMu2me6+O1e-Ub=Cbzerd=J3Q@mail.gmail.com> (raw)
In-Reply-To: <20110512143912.GA28141@srcf.ucam.org>

[Hi, Dmitry -- there's an input layer question in here for you]

On Thu, May 12, 2011 at 10:39 AM, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> On Thu, May 12, 2011 at 10:24:10AM -0400, Andrew Lutomirski wrote:
>> On Thu, May 12, 2011 at 9:48 AM, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
>> > It looks like SAUM was introduced with the *61 machines, and it's
>> > identical from then on.
>>
>> I wonder the machines with SAUM are the same as the machines on which
>> pressing mute generates an i8042 keystroke instead of an HKEY.  If so,
>> it looks like there's some code (or at least comments) in
>> thinkpad_acpi that mention doing the right thing when the HKEY mute
>> event in generated (e.g. the driver won't send KEY_MUTE to the input
>> layer), so something like my patch along with removing the _OSI(Linux)
>> hack for the newer models might make everything work right.
>
> I think so. The machines we have in the OSI blacklist all appear to have
> the SAUM method, so I think we can take your patch and drop the
> blacklist. Good work!
>
>> Still, someone who has an older laptop should test it, because all I
>> can do is pretend I carefully inspected all the possible code paths.
>
> I can't see any way this would cause problems, except in the case where
> the method exists but doesn't do anything. I'd be surprised if that's a
> real problem.
>
>> (Even if it works, don't apply this patch for 2.6.40 as it stands
>> because the ALSA change notification on KEY_MUTE is crap and should at
>> least ignore key release events.)
>
> Are you working with the ALSA people on that?

I don't think I need help from ALSA.  I just need to stop telling ALSA
that the volume changes twice every time that mute is pressed.  I'll
send v3 out in the next day or two with the fix.

I do, however, have a question for the input people.  Dmitry: Lenovo
makes laptops which are kind enough to tell us that the volume changed
by sending a keystroke over the atkbd-based keyboard.  (wtf!)  I've
modified the thinkpad-acpi driver to register an input handler to
catch those events coming from the keyboard and send them to ALSA
where they belong.  But if there's a keyboard grab, it won't work.
Would you accept a patch to the input layer to allow filters (or maybe
just filters that specifically request it) to run even if there's a
grab?

Without a change to the input layer, if someone grabs the keyboard
then the volume controls will start getting screwed up.  If X grabs
the keyboard it's even worse because pulseaudio will start getting
extra confused and preventing that is the whole point of this patch.

(Yes, it's gross, but the way around it I can see would be to inject a
custom ACPI method, and that still might not be enough to prevent
userspace from seeing a keystroke that it's really not supposed to
see.  And IMHO custom ACPI methods are even worse than input filters.)

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

       reply	other threads:[~2011-05-12 14:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bf402af225e7005f052a8ccf92962efa48cbe703.1304979290.git.luto@mit.edu>
     [not found] ` <20110512134827.GA26159@srcf.ucam.org>
     [not found]   ` <BANLkTimmrM4HMATSbsYzz6kh=e9hrfAZmg@mail.gmail.com>
     [not found]     ` <20110512143912.GA28141@srcf.ucam.org>
2011-05-12 14:50       ` Andrew Lutomirski [this message]
     [not found]         ` <BANLkTikX7mMu2me6+O1e-Ub=Cbzerd=J3Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-12 15:39           ` [RFC PATCH] thinkpad-acpi: Improve hardware volume controls Dmitry Torokhov
2011-05-12 19:33             ` Andrew Lutomirski
2011-05-12 20:42               ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTikX7mMu2me6+O1e-Ub=Cbzerd=J3Q@mail.gmail.com' \
    --to=luto@mit.edu \
    --cc=dtor@mail.ru \
    --cc=hmh@hmh.eng.br \
    --cc=ibm-acpi-devel@lists.sourceforge.net \
    --cc=linux-input@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).