Wrong handling of volume buttons on IBM Thinkpad notebooks

Bug #51537 reported by Piotr Gawrysiak
46
This bug affects 6 people
Affects Status Importance Assigned to Milestone
gnome-control-center
Won't Fix
Unknown
acpi-support (Ubuntu)
Fix Released
Undecided
Unassigned
gnome-control-center (Ubuntu)
Invalid
Low
Ubuntu Desktop Bugs
gnome-settings-daemon (Ubuntu)
Invalid
Low
Ubuntu Desktop Bugs
hotkey-setup (Ubuntu)
New
Undecided
Unassigned

Bug Description

Most IBM / Lenovo Thinkpads have hardware volume control with apropriate buttons above the keyboard (volume up, down and mute). Gnome in Ubuntu is configured in such a way, that the keypresses are trapped (this is correct), apropriate volume window is displayed (correct) and Gnome volume control is modified. Last step is actually wrong - the keys in Thinkpads control the volume hardware directly, so every keypress turns the volume up/down regardless of sound card settings (in Ubuntu case - this would be Alsa mixer). Current behaviour results in volume being changed twice - for example if I press the volume up button, I get volume reduction via Gnome sound mixer plus volume reduction via hardware control. Effectively this creates an exponential (and not linear as it should be) volume change. In short - it is very difficult to control volume, especially relatively quiet sounds, with volume keys only.

The "patch" solution is to decouple Gnome mixer from hardware buttons. Of course it could be done manually, by deleting apropriate key actions in System->Preferences->Keyboard shortcuts, but this also disables windows showing volume. A better thing (but more complex) would involve reading /proc/acpi/ibm/volume and displaying the volume window according to this value at each volume button keypress.

I tested this on T21, T42 and Thinkpad 600. I guess only some R series notebooks (R31 etc.) would not be affected, as these do not have hardware mixer.

Steps to reproduce:
1. Press hardware volume key (eg. volume up) on a Thinkpad
2. Observe the volume change - it is changed in hardware mixer (correct) and in Gnome volume control (incorrect)

Revision history for this message
Mika Fischer (zoop) wrote :

I can confirm this. I also find the behaviour iritating. As an additional bug I have the problem that the volume bar decreases faster than it should and increases slower than it should.
That means that if you decrease the volume the bar is at 0% even when there is still sound to hear. Press "Volume Down" again a few times and the sound is *really* muted.
Same thing about "Volume Up". When the voule is at its loudest the bar is only at 50%.

I have an IBM ThinkPad R40 2722-CDG but I could also reproduce this problem on an R50 of a friend of mine.

Revision history for this message
André Rüdiger (andreruediger-deactivatedaccount) wrote :

I can confirm this on my T42p running up to date Edgy. Any ideas or workarounds? I'd love to provide additional information to fix this in Edgy.

Revision history for this message
Andreas Ntaflos (daff) wrote :

I, too, can confirm this on my Thinkpad T41p and an up-to-date Edgy.

Is there a way to disable this behaviour and just rely on the hardware mixing capabilities of our Thinkpads?

Revision history for this message
Tony Yarusso (tonyyarusso) wrote :

Confirm for a T43p on Edgy and Feisty. This also leads to weird cases where turning up the gnome volume all the way via the slider won't make it go all the way up, and one has to use the key to go all the way to the top, and then bring it back down from there.

Revision history for this message
Piotr Gawrysiak (pgawrysiak) wrote :

Just confirmed also on T42 on Feisty. I guess that it probably affects all relatively recent Thinkpads :(

Revision history for this message
Andreas Ntaflos (daff) wrote :

Please see bug #76091 for a workaround on this problem.

Revision history for this message
André Rüdiger (andreruediger-deactivatedaccount) wrote :

Works now for me running feisty@T42p.

Revision history for this message
Cracychip (kjell-skogsrud) wrote :

i can confirm this problem running feisty on R60

Revision history for this message
Max Rabkin (max-rabkin) wrote :

I get this in Gutsy on a ThinkPad Z60m, running Kubuntu.

Revision history for this message
Ali Sheikh (asheikh) wrote :

The proposed work-around above only works on Kubuntu. I can confirm the bug on Gutsy running on IBM Thinkpad T60p. This bug is a big nuisance and should be fixed.

Revision history for this message
Janne (janne-nivala) wrote :

I can confirm this on a Thinkpad T41 / Kubuntu Gutsy.

Revision history for this message
aw614 (aw614) wrote :

i just downloaded tpb from synpatic on my r31 and my volume and brightness keys are working again, it delets the ubuntu desktop and hotkeys and installs tpb and so far it works, has a blue indicator on the bottom for volume brightness and the thinklight

Revision history for this message
4lorne (4lorne) wrote :

I have a patched version of gnome-control-center on my ppa. You can read about it in, http://ubuntuforums.org/showthread.php?t=496180

The code can be found in my LaunchPad Bzr branches.

Please include this or something like it into the repositories.

Revision history for this message
4lorne (4lorne) wrote :

This is still an issue in Hardy's beta.

In the new gnome, the volume keys are handled in the gnome-settings-daemon package. Attached is a patch for the package which works similarly to the one I did for gutsy. It'd be nice if it, or something similar, got incorporated.

With the patch, adding the key /apps/gnome_settings_daemon/hwvol with the string value 'thinkpad' makes the OSD show the hardware volume and doesn't change the software volume.

Revision history for this message
Ryan Waldroop (ryan.waldroop) wrote :

Haha, I was just about to file a bug for the opposite of this one. I thought that the way this was working in Gutsy was correct. Up-to-date hardy beta appears to be working "properly" now -- when I press the volume keys on my T41, the hardware volume goes down, but the gnome volume applet stays at 100%.

Adding the tpb package gives a visual representation of what the hardware is doing, but I miss the old way (with the gnome-like volume slider appearing at the bottom), since that's the way it was when I started using Ubuntu and my Thinkpad. :(

Does 4lorne's patch add the gnome slider again when pressing the volume keys?

Also, the Keyboard Shorcuts application (gnome-keybinding-properties) will no longer (since my upgrade from gutsy to hardy beta 1) accept an entry for the Access IBM button. I used it in gutsy to launch a terminal, but now when I try to map the key it doesn't even register and give a number.

Revision history for this message
4lorne (4lorne) wrote :

Hey Ryan,

Yeah. That's what my patch does. When you push the volume buttons it checks the hardware volume found at /proc/acpi/ibm/volume and displays it on the screen while doing nothing to the software volume.

Aside from not looking as nice as the gnome display, the other bad thing with the tpb package is that it polls the hardware which keeps the laptop from entering lower power states.

Revision history for this message
Sebastien Bacher (seb128) wrote :

thanks for your work, would be nice to get comments from upstream though, could you send the changes on bugzilla.gnome.org?

Revision history for this message
4lorne (4lorne) wrote :
Revision history for this message
Emil Sit (emilsit) wrote :

Having some on-screen display update of volume change would definitely be nice. I can confirm that on an X40 (2371GHU) running Hardy Beta+updates, the volume keys cause updates in /proc/acpi/ibm/volume but no change on the volume applet. I can't seem to get any keycodes out of the volume or ThinkVantage/AccessIBM key ( using Keyboard Preferences, acpid, or xev). I did not want to install tpb b/c it removes hotkey-support and ubuntu-desktop.

Revision history for this message
Sebastien Bacher (seb128) wrote :

one gnome task is enough

Changed in gnome-control-center:
assignee: nobody → desktop-bugs
importance: Undecided → Low
status: New → Invalid
Changed in gnome-settings-daemon:
assignee: nobody → desktop-bugs
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Emil Sit (emilsit) wrote :

FWIW, volume keys (and screen brightness changing) on my X40 now show status with Gnome, without the need for tpb; however the volume setting behaves as described by the original reporter.

Revision history for this message
Masakazu Chou (mgdesigner) wrote :

I can confirm this ,too. Mine is thinkpad R31.Originally I am used to 7.04. All thinkpad special keys worked fine,but they don't be functioned any more after upgrading to 7.10 even 8.04 beta.

Revision history for this message
4lorne (4lorne) wrote :

So I think the discussion at http://bugzilla.gnome.org/show_bug.cgi?id=524425 has finished.

A patch was initially committed... then rejected. It was concluded that the real solution is for the thinkpad-acpi kernel driver to create an ALSA mixer for the volume level. I agree with this. However, this isn't going to happen until 2.6.25 (at the earliest, and it seems a bit unlikely now).

Would it be possible to get the patch implemented in the ubuntu package as a stop-gap solution for Hardy?

Revision history for this message
Sebastien Bacher (seb128) wrote :

upstream had concerned about the change creating issues and the hardy freeze is this week, I don't think we should push it now

Revision history for this message
Bill (hudacek) wrote :

Confirmed on T60p, 2007-AD1. Patched gnome-control-center mentioned by 4lorne (see http://ubuntuforums.org/showthread.php?t=496180) worked very well for me.

I hope 4lorne will provide updated Hardy packages, since the fix for thinkpad-acpi won't be ready anytime soon...!

Revision history for this message
prokher (prokher) wrote :

And what about Access IBM button? It still doesn't work. I can't even get keycode using xev. How can I handle this? I'w like to run gnome terminal by pressing Access IBM button as it was previousely worked on gusty.

Changed in gnome-control-center:
status: Unknown → Fix Released
Revision history for this message
wes (ttdlx1989) wrote :

prokher, that is a different issue. In this case, the buttons are handled incorrectly, while your case, it's not detected at all. You should be looking at bug #217504 https://bugs.launchpad.net/bugs/217504

On another note, interestingly, after reinstalling alsa, my buttons work correctly, even without the patch. It doesn't appear to be an artifact from the above bug, as xev detects it, I get an OSD, and I can rebind the key.

Revision history for this message
Sebastien Bacher (seb128) wrote :

not a GNOME bug upstream, upstream says the drivers need to be changed rather than adding special cases to the software

Changed in gnome-settings-daemon:
status: Triaged → Invalid
Revision history for this message
wes (ttdlx1989) wrote :

driver problem has been confirmed, and it's going to be fixed, except it's in 2.6.25. Which means it won't make it into ubuntu until hardy+1. I suppose backports could take care of it...

Changed in gnome-control-center:
status: Fix Released → New
Changed in gnome-control-center:
status: New → Won't Fix
Revision history for this message
4lorne (4lorne) wrote :

The bug still exists in Intrepid. :(

Revision history for this message
Chris Bainbridge (chris-bainbridge) wrote :

No OSD updates bug may be related to bug #198197 which in turn may be related to a bunch of ACPI hotkey related bugs.

Revision history for this message
Loïc Minier (lool) wrote :

I'm reassigning from acpid to acpi-support as the Thinkpad buttons scripts are in the latter.

Revision history for this message
Steve Langasek (vorlon) wrote :

To the extent that this is an acpi-support problem, the fix is committed now and will be uploaded soon. However, with or without acpi-support, the kernel now synthesizes a keypress event for these buttons due to the mask set in /sys/devices/platform/thinkpad_acpi/hotkey_mask. The setting of this mask is currently done in the hotkey-setup package; I'm not sure whether we should consider this current mask setting wrong, but that's the next package in the chain, so opening a task there.

Changed in acpi-support:
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package acpi-support - 0.117

---------------
acpi-support (0.117) jaunty; urgency=low

  * Drop acpi_fakekey translations for keys that are correctly handled
    in the kernel input layer:
    - events/ibm-sleepbtn (LP: #306310)
    - events/ibm-lockbtn, thinkpad-lockorbattery.sh
    - events/ibm-hibernatebtn
    - events/lenovo-lockbtn
    - events/ibm-videobtn
    - events/thinkpad-mute, always-mute.sh
    - events/thinkpad-volume-down
    - events/thinkpad-volume-up (LP: #51537)
    - events/thinkpad-thinklight, thinkpad-thinklight.sh
    - events/tosh-brightness-up
    - events/tosh-brightness-down, toshbright.sh
    - events/tosh-mute
    - events/tosh-sleep
    - events/sony-hibernate
    - events/sony-brightness-up, events/sony-brightness-down, sonybright.sh
    - events/thinkpad-brightness-down, events/thinkpad-brightness-up,
      thinkpad-brightness-up.sh, thinkpad-brightness-down.sh
  * Also drop events/thinkpad-zoom, thinkpad-zoom.sh because this key
    isn't working correctly with or without this script and should be
    fixed up in hal.
  * debian/control: document Vcs-Bzr for the package.

 -- Steve Langasek <email address hidden> Mon, 02 Feb 2009 14:28:38 +0100

Changed in acpi-support:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.