[alsa-devel] Exposing the ThinkPad HW mute switch to ALSA?

Andy Lutomirski luto at amacapital.net
Tue Oct 7 16:44:35 CEST 2014


On Oct 7, 2014 6:20 AM, "Henrique de Moraes Holschuh" <hmh at hmh.eng.br> wrote:
>
> On Tue, 07 Oct 2014, Takashi Iwai wrote:
> > At Tue, 7 Oct 2014 17:25:13 +1100,
> > Grant Diffey wrote:
> > > so I have a really dumb question.
> > >
> > > Why can't the controls be mapped as HCI rather than a soundcard? given
> > > there's no audio production capability here only a control capability.
> > >
> > > Also this seems to be how they end up functioning on a modern system they
> > > get bound to pulse which remaps them to whatever's 'active'
> > >
> > > Why does everyone say that this is a soundcard when it's really a keyboard
> > > (from my pov)
> >
> > thinkpad_acpi actually mutes the sound on some models, at least the
> > old ones, independently from the sound chip mute state.  That's why it
> > was implemented as the sound card object initially.
>
> That's how the hardware works, really.  One AC97 audio channel is routed to
> a digital volume chip, and from there to the console headphone jack, and to
> the built-in speakers.  line-out is not routed through this chip, and AFAIK
> MIC/line-in is not routed through either this chip _or_ a separate mute
> gate, either.
>
> The EC controls this digital volume chip directly, it is independent from
> the AC97 mixer.  The default behaviour cannot be changed in earlier
> thinkpads, and trying to change it in later thinkpads (they're supposed to
> have a legacy mode that is the same as the older models) doesn't work very
> well.
>
> Line-out and MIC are controlled only by the AC97 mixer in the older models
> with digital volume control.
>
> In newer-but-not-newest thinkpads, there are two mute gates, one for MIC,
> and another for the speakers/headphones.  The EC controls those.  All volume
> control is in the HDA mixer.
>
> In the newest thinkpads, I think there's only a MIC mute gate controlled by
> the EC, and everything else is in the HDA mixer.
>
> And depeding on the EC operating mode and thinkpad model, the volume hotkeys
> might interact with the mute state (unmuting on first press when it is
> mute).
>

On newish thinkpads (at least X60-X220, and I think this works on the
latest models as well), we can disable all of this and make the mute
button be a regular button if we want.  Getting the mute LED to DTRT
might be tricky, but modern userspace can probably do it.

This is almost certainly the approach that does something sensible
with the least code written.  We would just check for HAUM/SAUM on
startup and, if available, set SAUM to "software control only",
force-unmute the mute circuit, force the volume to full, and disable
the fake soundcard.

--Andy

> --
>   "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


More information about the Alsa-devel mailing list