From: Takashi Iwai <tiwai@suse.de>
To: Jens Taprogge <jens.taprogge@taprogge.org>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
Matthew Garrett <mjg59@srcf.ucam.org>,
platform-driver-x86@vger.kernel.org,
David Henningsson <david.henningsson@canonical.com>
Subject: Re: [PATCH] [thinkpad-acpi] Add T410s and T420s LED support
Date: Wed, 28 Mar 2012 18:16:59 +0200 [thread overview]
Message-ID: <s5hpqbwwvic.wl%tiwai@suse.de> (raw)
In-Reply-To: <20120324154443.GA1405@endeavour.taprogge.org>
At Sat, 24 Mar 2012 16:44:43 +0100,
Jens Taprogge wrote:
>
> On Fri, Mar 23, 2012 at 11:50:38PM -0300, Henrique de Moraes Holschuh wrote:
> > On Sat, 24 Mar 2012, Jens Taprogge wrote:
> > > I am not sure thinkpad_acpi needs to provide a mixer. I think what is
> >
> > It does, but not on all thinkpads. AFAIK, even the newer ones that are not
> > OEM junk with a thin layer of thinkpad IP added still have a FET mute-gating
> > the speakers, controlled by the EC.
>
> Sorry, I have been imprecise. I am not questioning the need for the
> output mixer. The models I have looked at all feature the EC controlled
> hardware muting. What I was trying to say was that there does not
> necessarily need to be a mixer for the mic to properly report the muting
> state.
>
> >
> > > important is that the user can rely on the LED to be only on if the mic
> > > is muted. The mute key can be handled by userspace as long as the led
> > > always gives the correct information.
> >
> > And as long as it is not in control of the firmware. Otherwise, bad things
> > happen.
> Agreed.
>
> > > The modern laptops are all based on HDA audio. In the BIOS the
> > > different functions of the respective connections are stored. So the
> > > sound layer knows which connection is the internal mic. (An after
> > > analyzing the information provided on the Thinkpads seems to be correct
> > > in this regard.)
> >
> > Have you tested and made sure Lenovo did not mute-gate the MIC through the
> > EC on the better thinkpad lines?
>
> I have tested pressing the mute key as well as switching the LED on the
> T410s and T420s. The mic stays open.
>
> >
> > > So to make sure the LED presents the actual state of the muting it would
> > > be sufficient for ALSA to expose the mixer state to thinkpad_acpi or
> > > better call a callback on changes. To make it applicable to a wider
> > > range of devices one could come up with a design like this:
> > >
> > > #define SND_ENABLED_INTMIC 1 << 0
> > > #define SND_ENABLED_INT_SPEAKER 1 << 16
> > > #define SND_ENABLED_ALLINPUTS 0x0000ffff
> > > #define SND_ENABLED_ALLOUTPUTS 0xffff0000
> > >
> > > /* returns current state or -1 for error */
> > > int snd_register_mute_cb(void (*callback)(int muted, void *private), void *private);
> > > int snd_unregister_mute_cb(void (*callback)(int muted, void *private));
> > >
> > > This would give any other module the ability to receive a notification
> > > when a device is muted. The internal mic is special since the user can
> > > not unplug it. So it gets a defined position in the array. Apart from
> > > that one could use the LED to display if any mic is open.
> >
> > If you're going to do it that way, why not provide LED triggers?
>
> I just did not know about them. Is there a way to prevent userspace
> from changing the trigger -> led association?
>
> Takashi: where would we need to add the LED triggers? In
> core/control.c? Would such a change be acceptable to ALSA?
Well, in the style above, you can't know which device is the mute
stuff bound with. What if you have a USB device in addition, for
example?
I'm not sure whether such a hard-binding in the kernel side is
inevitably necessary. And, if it is, then we shouldn't expose the
control to user-space. Or, just let user-space, such as PulseAudio,
working on it.
(Cc'ed David, who mentioned about micmute stuff in other threads.)
thanks,
Takashi
prev parent reply other threads:[~2012-03-28 16:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-22 23:49 [PATCH] [thinkpad-acpi] Add T410s and T420s LED support Jens Taprogge
2012-03-23 19:39 ` Henrique de Moraes Holschuh
2012-03-23 19:43 ` Matthew Garrett
2012-03-23 20:07 ` Jens Taprogge
2012-03-23 23:38 ` Henrique de Moraes Holschuh
2012-03-24 0:05 ` Jens Taprogge
2012-03-24 2:50 ` Henrique de Moraes Holschuh
2012-03-24 15:44 ` Jens Taprogge
2012-03-28 16:16 ` Takashi Iwai [this message]
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=s5hpqbwwvic.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=david.henningsson@canonical.com \
--cc=hmh@hmh.eng.br \
--cc=jens.taprogge@taprogge.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