Bug 13934 - cannot unmute sound by press mute button on Thinkpad T500
cannot unmute sound by press mute button on Thinkpad T500
Status: CLOSED CODE_FIX
Product: ACPI
Classification: Unclassified
Component: BIOS
All Linux
: P1 normal
Assigned To: acpi_bios
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-08 20:21 UTC by Pavol Klačanský
Modified: 2010-09-06 21:43 UTC (History)
6 users (show)

See Also:
Kernel Version: 2.6.31-5-generic
Tree: Mainline
Regression: No


Attachments
acpidump (314.24 KB, text/plain)
2009-08-10 11:34 UTC, Pavol Klačanský
Details
hotkey (640 bytes, text/plain)
2009-08-12 18:42 UTC, Pavol Klačanský
Details
patch to add t400 & t500 to white list to expose acpi_osi=Linux to bios (1.07 KB, patch)
2009-08-27 05:17 UTC, Jerone Young
Details | Diff

Description Pavol Klačanský 2009-08-08 20:21:58 UTC
/proc/acpi/ibm/volume status

unmuted:
level:		7
mute:		off
commands:	up, down, mute
commands:	level <level> (<level> is 0-15)

mute buttond pressed:
level:		7
mute:		on
commands:	up, down, mute
commands:	level <level> (<level> is 0-15)

mute button pressed again (does not change to mute: off, but volume up/down change it to off):
level:		7
mute:		on
commands:	up, down, mute
commands:	level <level> (<level> is 0-15)

xev - no event
showkey - no event
kernel logs - no entry

workaround is add "acpi_osi=Linux" to boot parameters

I think, button could generate some event
Comment 1 Zhang Rui 2009-08-10 01:05:03 UTC
please attach the acpidump output.
Comment 2 Pavol Klačanský 2009-08-10 11:34:37 UTC
Created attachment 22660 [details]
acpidump
Comment 3 Henrique de Moraes Holschuh 2009-08-11 16:22:23 UTC
Mute and unmute are handled by the keyboard controller path in the newer Lenovo models like the T500.  Thinkpad-acpi and ACPI can't do much when that happens, as no ACPI notifications are generated.

If you're not receiving the events over the KDC (showkey would show it), that's new behaviour I am not used to.

In fact, I am surprised that acpi_osi=Linux makes a difference, are you using the latest available BIOS and EC firmware?  The BIOS does get that acpi_osi information through the DSDT, so it might make some difference, but still...

The way to disable mute on a ThinkPad traditionally is to press volume up or volume down once.  Mute mutes, volume up/down unmutes.  This might have changed on newer models, but if that's the behaviour you see, then it just means the traditional way of mute/unmute is being used.

Incidently, please attach the result of the command:

grep . /sys/bus/platform/devices/thinkpad_acpi/hotkey*

BTW: The fact tat you can see mute changes in thinkpad-acpi doesn't mean it will be able to change them, although there is a chance it will work.
Comment 4 Pavol Klačanský 2009-08-12 18:41:45 UTC
thanks, I'm basic user (not lowlevel programmer)

that problem is also in MS Vista, but installing driver fixed it

also this is link to driver (it could be useful)

http://www-307.ibm.com/pc/support/site.wss/MIGR-67228.html
Comment 5 Pavol Klačanský 2009-08-12 18:42:23 UTC
Created attachment 22691 [details]
hotkey
Comment 6 Henrique de Moraes Holschuh 2009-08-12 21:29:57 UTC
Well, there is nothing strange in your hotkey config.  We *do* know how to read the Mute status, but generating events from that will require polling (and fixing the driver code too).

Is there a real reason to mess with this?  We'd need to wake up the CPU 10 times per second just to read the mute button.

If you want to use the older polling support to check, read the driver documentation to get the scan code for the MUTE key (I don't recall it right now), and set that bit on hotkey_source_mask and hotkey_mask.   You also need to use input-kbd or some other utility to assign a KEY_<something> event to that key.
Comment 7 Jerone Young 2009-08-27 05:16:03 UTC
This problem is the same one seen with the T61 (which is what the T500 proceeded). The way around this is Lenovo has check in the BIOS (that they shouldn't do, but no fixing it now) that will change the Mute key to send Linux a key press. Makes things work great.

So the best way to go about this is to add T500 to the white list. Will attach patch.
Comment 8 Jerone Young 2009-08-27 05:17:10 UTC
Created attachment 22870 [details]
patch to add t400 & t500 to white list to expose acpi_osi=Linux to bios
Comment 9 Henrique de Moraes Holschuh 2009-08-27 15:50:53 UTC
Hmm, to whom should I reassign it?  It doesn't belong to me anymore, since it has nothing to do with thinkpad-acpi...
Comment 10 Jerone Young 2009-08-28 14:00:34 UTC
Not sure. some involved with ACPI I would guess. Plan to have a flood of patches like this one pretty much all recent Lenovo Thinkpads to handle this mute issue.

I believe they build Thinkpad bioses from the same base. All share the same code path when it comes to this mute key stuff.

Can follow via:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/281732
Comment 11 Jerone Young 2009-08-31 02:53:44 UTC
@Henrique
     This can possibly be fixed in thinkpad-acpi .. maybe. At least under Windows you have the same issue, they way you get around it is  you have to install the thinkpad hotkey software (which I assume just polls to see if the mute has been pressed)

     Though seems Lenovo is aware of how bad it is at least. Though EVERYONE would just like them to send a mute key press by defualt. Though they do have Linux friendlessness for it, it's just not how the kernel community likes it. Hopefully can get Lenovo to do the right thing in the future. Otherwise the white list of thinkpads will keep growing with every release of thinkpads.
Comment 12 Zhang Rui 2009-08-31 06:56:50 UTC
this is an _OSI problem.
I think Len should take over this. :p
Comment 13 Henrique de Moraes Holschuh 2009-08-31 13:38:38 UTC
@Jerone:

I beg to differ.  We would like an *EVENT*, so that we can deliver it to the audio subsystem to tell it "hey, the mixer state has changed, please check it", instead of wasting CPU resources and power by doing *SLOW* IO to the CMOS NVRAM chip at 10Hz to figure it out.   If _OSI=Linux is required to get that event, that's exactly what we need to do.

We DO NOT want it to send a keypress at *all*.  We want it to mute, and we want to know it was done.  We also want to know when the laptop unmuted, for obvious reasons.

KEY_MUTE coming from the keyboard is just utterly useless on a thinkpad.  If they had to rape Windows for it to work there, that explains a lot...  the older thinkpads didn't need any hotkey drivers to do the right thing, be it in Linux, Windows, Novell, DOS, FreeBSD, or whatever other obscure OS you wanted to run on them.

Jerone, I'd be thankful if you could send me a note after one or two months, when I should be a lot less stressed, to get in touch with Lenovo about it. I may be able to stop the "need for whitelist" madness for future models, but I need to study the ACPI DSDTs in detail and without a box to test it on, it won't be nearly as easy.
Comment 14 Zhang Rui 2009-09-03 06:03:40 UTC

(In reply to comment #13)
> 
> If _OSI=Linux is required to get that event,
> that's exactly what we need to do.
>
> Jerone, I'd be thankful if you could send me a note after one or two months,
> when I should be a lot less stressed, to get in touch with Lenovo about it. I
> may be able to stop the "need for whitelist" madness for future models, but I
> need to study the ACPI DSDTs in detail and without a box to test it on, it
> won't be nearly as easy.

So for now, patch in comment #8 should be the proper workaround, right?
Comment 15 Jerone Young 2009-09-03 06:21:01 UTC
@Zhang I have a list of these patches for diffrent Thinkpads actually on the ubuntu-kernel mailing list. here see thread "Fix Mute button functionality on Lenovo Thinkpads"   :

https://lists.ubuntu.com/archives/kernel-team/2009-August/thread.html

They will be submitted upstream soon (or you can grab them now).
Comment 16 Pavol Klačanský 2009-09-05 06:14:27 UTC
Hmm, but when I use acpi_osi=Linux, then speaker "puck" (sound like acoustic click) after command "aplay /home/pk/Plocha/samples/smrt.wav" or playbeck song in rhythmbox, but only at first run
Comment 17 Jerone Young 2009-09-05 06:45:06 UTC
@Pavol
  That is odd. That also sounds like a software issue. What thinkpad are you using. Others with the T500 using acpi_osi=Linux have not seen this issue. Also I don't notice it on any of the thinkpads I have around. You may want to try a different distro & kernel to see if you are still seeing this issue.
Comment 18 Pavol Klačanský 2009-09-05 08:31:10 UTC
ARCHLINUX is wainting in dock :-D
but I must on it isntall alsa, ok, I send report

of course I have T500
Comment 19 Pavol Klačanský 2009-09-05 16:48:13 UTC
this problem is not in Archlinux, It's issue of ubuntu or pulseaudio
Comment 20 Jerone Young 2009-09-07 03:20:14 UTC
@Pavol
     It's odd you are seeing this. Also you want to update your bios to the latest version. It's not an issue with Ubuntu as no one else is seeing this. This could be an issue with the audio driver if it is the case.

     I don't have a T500, though others with T500 have not seen this issue. Not seeing this on a T400.
Comment 21 Pavol Klačanský 2009-09-11 12:33:43 UTC
I try update bios (I've updated latest in June)
Comment 22 Pavol Klačanský 2009-09-11 17:05:03 UTC
I have latest version
Comment 23 Len Brown 2009-11-25 04:41:33 UTC
T400/T500 DMI patch in comment #8 applied to acpi tree.

bad Lenovo
Comment 24 Len Brown 2009-12-09 19:37:38 UTC
patch in comment #23 shipped in linux-2.6.32

closed
Comment 25 Pavol Klačanský 2010-09-06 21:42:47 UTC
can it be fixed, because blacklisting is kind of workaround :/

Note You need to log in before you can comment on or make changes to this bug.