Thinkpad Z61m: volume controls control both main and hardware mixer

Bug #355300 reported by Philipp Kern
64
This bug affects 5 people
Affects Status Importance Assigned to Milestone
hotkey-setup (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: acpi-support

By default my Thinkpad's volume controls are wired up to RaiseVolume and LowerVolume. I thought that I did report this bug some releases earlier, or at least subscribe to such a bug report, but well. Point is: Thinkpads have hardware mixers which are also controlled through the hotkeys, and so you get much further down/up with your volume than you want to. On half way it's already mute because the value of each key press is effectively (at least) doubled.

So probably either the hardware mixer should be deactivated or the keys should not emit raise/lower volume events.

Revision history for this message
Philipp Kern (pkern) wrote :

Even worse: mute of course mutes both hardware and software mixer. Of course you lose the nifty volume control overlay window, but Thinkpad Linux users should already be used to that... -_-

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

I can confirm this problem; I thought that this was no longer an issue, but it turns out the reason it wasn't manifesting on my T60 was because I had disabled the hotkey-setup init script for testing purposes. :/

Ideally (IMHO), we would be letting userspace handle the mixer entirely, so that the hotkeys, the GNOME mixer, etc. are all interoperating; but I haven't figured out how to accomplish this yet, need to talk to the thinkpad_acpi maintainer about this. In the meantime, we can certainly change hotkey-setup to not propagate these keys to userspace, as a lesser evil.

affects: acpi-support (Ubuntu) → hotkey-setup (Ubuntu)
Changed in hotkey-setup (Ubuntu):
status: New → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package hotkey-setup - 0.1-23ubuntu10

---------------
hotkey-setup (0.1-23ubuntu10) jaunty; urgency=low

  * Drop the override of the hotkey mask for ThinkPads. This is currently
    used for brightness keys, volume keys, and the ThinkVantage button:
    - the ThinkVantage button is part of the default mask now
    - brightness events are exposed via a different ACPI input device now,
      so don't need to be overridden
    - overriding the volume keys causes double-stepping of the volume,
      because the volume was also being adjusted in the hardware mixer, which
      we can't disable - so we don't want these keys exposed for now.
    LP: #355300.
  * Also drop the thinkpad-keys daemon; a look at the thinkpad-acpi
    source indicates that this will never trigger at present, because
    the hotkey mask from the kernel always includes the
    ThinkVantage/IBMAccess key if the module loads at all, so this is
    dead code and no one is reporting any issues.
  * This leaves only setting of /proc/acpi/video/*/DOS as a function of this
    package. This should be moved to be a kernel default, at which point
    we can drop this package.

 -- Steve Langasek <email address hidden> Sat, 04 Apr 2009 22:49:19 +0000

Changed in hotkey-setup (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Alexander Hunziker (alex-hunziker) wrote :

I'm not sure I'm happy with that fix. It effectively makes the GUI volume control useless, and there's not visual feedback any longer. There should be *one* master mixer, i don't know whether that should be the software or the hardware one, but one's enough. It sounds hackish, but as the hardware mixer can't be disabled, maybe the GUI could reflect the state of the hardware mixer, without actually changing it?

Revision history for this message
Dan Zrobok (zrobok) wrote :

+1, I'm not happy with this fix either.

I still want on screen display for my volume keys. As a Hardy/Ibex user, I just set the (system -> preferences -> sound) Default Mixer Track to something unneeded like CD and it worked around the double-stepping issue. Does the display match the actual volume? Mostly no, but it's within a reasonable ballpark.

Now, I have no visual indication of mute or unmute or anything.

Revision history for this message
DSHR (s-heuer) wrote :

+1

On my Thinkpad X60 I now have no more visual feedback for the volume control keys.

The hardware volume control keys are now complete useless because the mixer applet does not show the correct volume and muting state.

Not really better than it was before IMHO.

Revision history for this message
ikus060 (ikus060-renamed) wrote :

I see many comment like :
There should be only one master mixer.

I need to disagree. As a ThinkPad user, I use my Thinkpad with a dock station. It's would not make any sense to have only one master because it's will control two different output : laptop speaker and dockstation output.

On a ThinkPad dock station there is an audio output that are not control by the hardware mixer, so you need the Software mixer to do the job (like many other desktop computer). It's really useful when you have an external amplifier. In this case, you need the hardware mixer to mute the laptopn speaker.

In other way, using a dock station, you may not have an external amplifier, so you need to change the volume using the hardware mixer.

I think the best it to keep everythink like it's work now, but display a nodification when the hardware volume are change (using a different icon) AND increase the software volume when the hardware volum is at the maximum leve.

Here the scenario describing the expected behavior that should fit every body needs.

Scenario 1 - Using laptop without dock
1.1 User want to increase the volume, so he press the volume up key on laptop
1.2a The system increase the hardware volume if it's not at the maximum level (14)
1.2b The system display a notification for hardware volume (plz use a different icon ).
1.2c The system increase the software volume if the hardware volume is at the maximum level
1.2d The system display a notification for software volume.

1.3 User want to decrease the volume, so he press the volume down key on laptop.
1.4a The system decrease the harware volume only.
1.4b The system display a notification for hardware volume (plz use a different icon ).

1.5 User want to increase the volume, so he press the volume up key on it's external keyboard or external mouse.
1.6a The system increase the hardware volume if it's not at the maximum level (14) - I think this one can be hard to achieved, but less people care about this one.
1.6b The system increase the software volume if the hardware volume is at the maximum level

Scenario 2 - Using laptop on dock station
As it's not possible to detect if the audio ouput on the dockstation is use, we expect it to be use.

2.1 User press the volum key on laptop
2.2b Only the hardware volume are change
2.2b The system display a notification for hardware volume (plz use a different icon ).

2.3 User press the volum key on external keyboard or mouse
2.4 The system display a notification for software volume (plz use a different icon ).

Please, also consider theses bugs :
https://bugs.launchpad.net/ubuntu/+source/hotkey-setup/+bug/51537
https://bugs.launchpad.net/ubuntu/+source/acpi/+bug/272292

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

see bug #357673 opened on notify-osd which has a duplicate now, some other users getting confused to not get notifications about volume change

Revision history for this message
Ilja Pavkovic (ipavkovic) wrote :

+1, I'm not happy with this fix either. I like to have running keys on my thinkpad :)

Revision history for this message
Henrique de Moraes Holschuh (hmh) wrote :
Download full text (3.4 KiB)

The IBM-style ThinkPad volume control is a digital mixer to control the volume of the **built-in** speakers and headphones. Newer Lenovo models (past the T60 second generation) don't have it, instead, they have just a hardware MUTE engine.

It is impossible to deactivate the hardware mixer unless you resort to changes to the firmware (so, it is NOT going to happen).

The IBM-style volume control system is not designed (both from a hardware and a firmware point-of-view) to control anything else than the internal speakers and headphone volume. It does not control the dock's line-out (which doesn't go through the headphone/speakers volume controller (duh!), nor gets the PC speaker signal mixed in). And it doesn't control the main mixer.

It doesn't do any of those things in Windows, either. It never did. What it does have in Windows is a proper OSD system, so users would rapidly learn what the volume buttons are, and how to use them.

Anyway, as I said, the hardware mixer cannot be disabled. The firmware will always adjust the headphone/speaker volume when the volume buttons are pressed. These buttons are NOT generic volume control hotkeys, they are the more user-friendly version of a "volume knob" for the internal speakers and headphone output.

So, to be blunt: you don't have generic volume control keys on your ThinkPads, unless you:

1. Are using a Lenovo hardware-mixer-less ThinkPad that doesn't send events to thinkpad-acpi in the first place (but which also doesn't note that anywhere, so thinkpad-acpi doesn't even know it is running on a thinkpad that lacks the volume notifications). The Lenovo models issue normal keypresses through the KDC for volume up/down (I don't know about MUTE);

OR

2. You have modified the ACPI (and probably the EC) firmware to disable the hardware mixer.

And all the issues one has with volume control in ThinkPads old and new are directly caused by people who wanted so badly to break the ThinkPad volume control model, that they tried to force semantics that are just not applicable to these keys (they are NOT master volume control keys) and to the driver hotkey system (keypress events are NOT an OSD side-channel).

IMO, it is best to look at this in another way: you want to ADD generic volume control keys in your keyboard (because you never had those in the first place!), and you can do just that as long as you stay clear from the few knobs the firmware doesn't let you mess with freely (brightness, volume, thinklight, hibernate). It is not like there is a lack of unassigned _generic_ FN hotkeys in a more modern thinkpad (i.e. any *40 model or newer).

I suggest that fn+insert and fn+delete be mapped to KEY_VOLUME_UP and KEY_VOLUME_DOWN, and fn+pgdn be mapped to KEY_MUTE.

This is simple (it only takes three lines inside a HAL .fdi file), it works just fine (and it will _remain_ working just fine in the future, which is important), and it doesn't suffer from a number of border conditions and issues like more 'elaborate' attempts such as the one suggested by another post of this thread, do.

Of course, this requires unbroken support for KEY_VOLUME_UP, KEY_VOLUME_DOWN and KEY_MUTE in HAL when the events are c...

Read more...

Revision history for this message
Dan Zrobok (zrobok) wrote :

Henrique,

I fail to see how creating a completely new FN-Insert and FN-Delete keys to control volume (when you obviously have three buttons on the top of the keyboard that also control volume) will make things any easier or more straightforward for Thinkpad users.

We've got the three volume keys, lets just figure out the right thing to do with them. The current issue of double stepping is annoying, but the 'fix' as it stands right now is a large step backwards from what we had in Hardy.

Revision history for this message
ikus060 (ikus060-renamed) wrote :

+1
I cannot agree with the proposed solution to map volum up and volum down to FN-Insert and FN-Delete. It's not user friendly at all.

Revision history for this message
Philipp Kern (pkern) wrote : Re: [Bug 355300] Re: Thinkpad Z61m: volume controls control both main and hardware mixer

On Mon, Apr 20, 2009 at 04:11:36PM -0000, Dan Zrobok wrote:
> I fail to see how creating a completely new FN-Insert and FN-Delete keys
> to control volume (when you obviously have three buttons on the top of
> the keyboard that also control volume) will make things any easier or
> more straightforward for Thinkpad users.
>
> We've got the three volume keys, lets just figure out the right thing to
> do with them. The current issue of double stepping is annoying, but the
> 'fix' as it stands right now is a large step backwards from what we had
> in Hardy.

As far as I know it was always flacky over releases, i.e. in one release
you had double stepping, in others you had no OSD. I really, really don't
need a OSD like the Windows one. (Where you also have to control the
master differently, by the way.) I can understand why people fail to see
the hardware mixer in the picture, but double stepping is far more
annoying.

Alas: I can always remap the volume keys in Gnome. Sadly I get XF86WakeUp
for all of Fn+{Ins,Del,PgDn}, so I cannot map master to those.

Ciao,
Philipp Kern

Revision history for this message
Bruno Girin (brunogirin) wrote :

I agree with Dan and ikus060, if we have hardware buttons, we should make them work rather than create a mapping to other keys that are completely unrelated to volume control.

For a new user (and even an experienced one), having to learn that you need to press Fn+Insert or Fn+Delete instead of Volume Up or Volume Down just because you have a ThinkPad will be very confusing and propagate the myth that Linux (or Ubuntu) doesn't support hardware that Windows supports flawlessly.

Revision history for this message
Henrique de Moraes Holschuh (hmh) wrote :

Well, the problem is that you do not have three volume *keys* in your ThinkPad, you have three volume control buttons that are tied to a specific piece of hardware and functionality.

What IBM and the early Lenovo ThinkPads give you is the equivalent of a volume knob for the headphone and internal speakers, only nicer. And anything you do to attempt to get it to act in any other way will always have some sort of drawback, because the hardware and the firmware were engineered to not let you get away with it.

I have explained how the hardware and the firmware works, and that "disabling the hardware mixer" is not going to happen, because it is impossible to do so. These are all facts. They are not up to discussion, because they cannot be disproved or changed in any meaningful way.

And as many people can attest and some have done so even in this bug report, you get absolutely horrid behavior from the headphone output and the internal speakers when you use the volume buttons to _also_ drive the volume of the master AC97/HDA mixer, which causes a bad compound effect on the speakers and headphone volume.

IMO, there is no way those drawbacks should be imposed on users that are using the hardware as it was engineered to be used.

If you have inserted a dummy plug on the headphone jack to silence the internal speakers, and use only line-out (which requires a dock or port replicator in the first place) to get audio signals, fine. One can easily see why you'd want to drive the master AC97/HDA volume as well using the volume buttons in that case. However, I am sure nobody is arguing for that being such a common setup that it deserves to be the default behavior in a driver or in a distro?

Now, if Ubuntu wants to provide easy access to your alternate setup, that'd be fine. Why don't you guys ask for that, instead, and work out a user-friendly way to select alternate platform setups? I certainly am willing to continue providing volume button keypress events in the kernel driver, as long as it is being used sensibly and not causing more problems than it is worth.

Revision history for this message
Henrique de Moraes Holschuh (hmh) wrote :

BTW: Windows and Linux supports the ThinkPad flawlessly as long as Ubuntu is messing with those volume keys.

In fact, the "volume buttons drive the main mixer" is exactly how Windows DOES NOT behave. That has already been said in this bug report, but apparently some people didn't pay attention.

The fact is that the users have wrong expectations of how to use the ThinkPads. The correct way to fix that problem doesn't get anywere close to breaking the volume buttons.

You'd be much better off as far as usability goes if you provided a series of small animations or wordless diagrams to the user the first time he logged in. Those diagrams would display how the volume keys work in a old-style ThinkPad.

Have you ever used a ThinkPad in Windows with the full suite of "ThinkVantage" software installed? That's exactly what IBM and Lenovo do, at least for the docks and bays. I don't know if they have it for the volume keys, but the idea is sound.

Revision history for this message
Henrique de Moraes Holschuh (hmh) wrote :

BTW: Windows and Linux supports the ThinkPad flawlessly as long as Ubuntu is NOT messing with those volume keys.
'
In fact, the "volume buttons drive the main mixer" is exactly how Windows DOES NOT behave. That has already been said in this bug report, but apparently some people didn't pay attention.

The fact is that the users have wrong expectations of how to use the ThinkPads. The correct way to fix that problem doesn't get anywere close to breaking the volume buttons.

You'd be much better off as far as usability goes if you provided a series of small animations or wordless diagrams to the user the first time he logged in. Those diagrams would display how the volume keys work in a old-style ThinkPad.

Have you ever used a ThinkPad in Windows with the full suite of "ThinkVantage" software installed? That's exactly what IBM and Lenovo do, at least for the docks and bays. I don't know if they have it for the volume keys, but the idea is sound.

Revision history for this message
Henrique de Moraes Holschuh (hmh) wrote :

(sorry for the double post)

Revision history for this message
Dan Zrobok (zrobok) wrote :

Henrique,

You are giving technical reasons as to why they should be different. While likely valid, they are missing the point.

A normal user will expect that when a button labelled with an sound icon and an up arrow is pressed, the volume will increase and there will be OSD telling them how close to 'maximum loudness' they are at. All I'm asking for is that the volume keys behave the way thay they did in Hardy/Intrepid. It wasn't perfect, but it was better than current zero visual feedback. You can work around the double-stepping by assigning the default mixer track (Sound settings) to control an output you don't use (say CD).

Right now, when I look at my desktop in Jaunty, i have NO IDEA if the volume is mute or unmute. This leads me to obsessively press the mute button to ensure it really is mute. That's not user friendly behaviour.

Revision history for this message
Henrique de Moraes Holschuh (hmh) wrote :

This is just a reminder that any OSD-related concerns are to be made on bug #357673, please. There is information on that bug report that is not duplicated here.

Revision history for this message
Henrique de Moraes Holschuh (hmh) wrote :

Just to get one point clear and across.

The problem is not how the ThinkPad works (because you cannot change it, and it works just like that in Windows anyway).

It is that the O.S. is failing utterly to convey information to the users in a way that lets them gently (or not) correct their expectations of how the volume keys operate to match the reality of the ThinkPad they're working with.

Fix that. Stop trying to make things horribly complicated (and always subtly incorrect) trying to force the hardware to be something it isn't, and to do something it is not prepared to do.

There are a number of ways of getting an idea across to the users, and IBM must have found one of them, because the volume keys were not on the top list of complains (it was not even in the list AFAIK) of the *millions* of Windows ThinkPad users from the model 600 up to the T43 and first-gen T60 and Z60.

The behavior of the volume changes only changed in Windows for users of the T60 second gen, X61 and Z61. I should know, I got the reports. Before that, it has always been that it would **NOT** touch the main mixer at all.

And all the Windows users had was a simple OSD green bar for volume and muting, and a "quick tour" guide (which I frankly don't recall if it mentioned the volume buttons or not).

If giving the users a supplementary ALSA mixer that they will see changing when they press the keys will be enough, consider it done. If the problem is OSD for that ALSA mixer, see #357673.

If all of that is not enough, it is up to you guys to enhance the desktop environment to do even more hand-holding on this issue and tell the user about the volume keys and how they work outright.

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

Here's my two cents. As a user, I like to have the volume buttons adjust the "hardware" speaker volume and nothing else. I also like to see an OSD showing the speaker volume state. I don't care that they don't change line-out volume when my laptop is plugged into a dock station.

The problem, as I see it, is that most generic volume OSD frameworks (when I say OSD frameworks, I mean the whole handling of the volume buttons. eg GNOME's gnome-settings-daemon) work like this:
1) Wait for a volume key press event.
2) Check the value of the selected ALSA mixer (eg. the one chosen in Ubuntu via System->Prefs->Sound).
3) Change the value/state of the mixer (this is what causes the "two step" volume change since a different volume was already changed in hardware)
4) Display the OSD with the state of the selected ALSA mixer (which, in this case, is not the "hardware"/speaker volume)

The problems: A key press event is needed. They interact, and worse, write to an ALSA mixer.

One solution is to redesign the OSD or make a custom one to work with the thinkpad-acpi driver. An attempt at a redesign (well, really supplementing) of the GNOME one can be read about at
https://bugs.launchpad.net/ubuntu/+source/acpi-support/+bug/51537, http://bugzilla.gnome.org/show_bug.cgi?id=524425, http://ubuntuforums.org/showthread.php?t=966588.
This is a very hacky solution and changes the behaviour of GNOME so that, rather than interacting with an ALSA mixer it reads the volume state from /proc/acpi/ibm/volume and doesn't write anything anywhere. It correctly displays an OSD and doesn't double step the volume. The problems are that it still depends on key presses to start things off and it doesn't fix anything outside of GNOME.

Another solution, as Henrique mentions, is to implement an ALSA mixer for the "hardware" speaker volume. I plopped a patch on the thinkpad-acpi mailing list that does this (at least on my T60). To get this to work with a generic volume OSD, we still need to have key presses to start things off and we also have to prevent the OSD framework from manipulating the volume. I have added a module option to make the ALSA mixer read-only. Once the hotkey mask is manipulated to produce the volume keys and the right mixer is selected in the system preferences, this solution works.

The Thinkpad volume model is inherently at odds with the design of generic volume OSDs. I'd guess that all generic volume OSD frameworks use keypresses and all write to an ALSA driver. So either we have to make a custom OSD for Thinkpads (like in Windows) or concede that something at least slightly hacky must be done. I think the ALSA mixer solution is a good compromise. It does require that the buttons generate keypresses (which Henrique is reasonably against) and making the speaker's ALSA mixer read-only is less than ideal (but I see the ALSA mixer as a bonus way of interacting with the hardware volume anyway). But it means we don't have to customize anything outside of the driver.

Revision history for this message
permafrost91 (permafrost91) wrote :

I have an X60 and the volume keys used to provide flawless feedback up to 8.10. Jaunty has screwed up so many things for me, I'm going to revert back to 8.10.

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.