[ltp] Re: T61 brightness/volume

Yves-Alexis Perez linux-thinkpad@linux-thinkpad.org
Fri, 04 Apr 2008 08:47:40 +0200


--=-LcDqnZ8P4tSt6orIhv6A
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On jeu, 2008-04-03 at 15:09 -0700, chekov@ucla.edu wrote:
> just following up on my own continuing saga of getting brightness and=20
> volume to work as expected on my T61.
> I have upgraded to kernel 2.6.24.4 and bios 2.0.10

I'm running 2.6.25-rc6 (I tried -rc8 but it seems to have a weird bug at
resume, X doesn't display any widget, really weird). Bios is 2.0.10 too,
and thinkpad-acpi:

corsac@hidalgo: cat /proc/acpi/ibm/driver
driver:         ThinkPad ACPI Extras
version:        0.19-20080229

> I also installed the 1.0.16 version of alsa.  I should warn anyone trying=
=20
> this that the newer alsa modules do not work with the conexant HSF modem=20
> driver, so you have to pick which one you want...

I don't use my modem and have x86_64 anyway, so I don't think it would
work.
>=20
> Sound:  the new alsa driver does give me a new master channel.  however=20
> this does not seem to have any effect on how the volume keys work.  mute=20
> events, which work, are not reflected in alsa mixer settings, and volume=20
> change events still don't work.  I changed the default mixer channel in=20
> gconf from PCM to Master and this had no effect.

I can confirm the master channel, and mute/toggle work on it. But you'll
have to manually bind the keys. I use Xfce so I have added in my
keybindings:

command=3D"amixer set Master 5-" keys=3D"XF86AudioLowerVolume"
command=3D"amixer set Master 5+" keys=3D"XF86AudioRaiseVolume"
command=3D"amixer set Master toggle" keys=3D"XF86AudioMute"

And have configured .Xmodmap accordingly:

keycode 174 =3D XF86AudioLowerVolume
keycode 176 =3D XF86AudioRaiseVolume
keycode 160 =3D XF86AudioMute

I'm not sure the xmodmap part is needed currently, but as it works=E2=80=A6=
=EF=BB=BF
>=20
> Brightness: remains unchanged now that I am running the .17 version of=20
> thinkpad_acpi.  brightness_enable is now an opton which, when on, creates=
=20
> the functional /proc/acpi/ibm/brightness interface, but the keys themselv=
es=20
> don't get mapped to that interface even though they do show up in tpb.

I don't use tpb. The thing is, your thinkpad (T61 with intel card,
right?) shouldn't use the thinkpad-acpi provided brightness handling,
but should use the acpi one. Basically, you need to load =E2=80=9Cvideo=E2=
=80=9D module,
then thinkpad-acpi (without a parameter). You won't have
a /proc/acpi/ibm/brightness nor /sys/class/backlight/thinkpad_screen but
you'll have /sys/class/backlight/acpi_video0 and acpi_video1. (Maybe
only one of them, but I'm not sure on 2.6.24). You want acpi_video1, and
you can output something there, like:

echo 10 > /sys/class/backlight/acpi_video1/brightness

You should be able to use xbacklight too, so you can bind some keys to
xbacklight in your window manager. But gnome-power-manager (or hal) is a
bit borken and won't like having to panels (acpi_video0 and acpi_video1,
see in lshal | grep panel).

In 2.6.25-rc6, I only have one acpi_video0, but it doesn't work. But I
can still use xbacklight after setting the backlight control property to
legacy, using:
xrandr --output LVDS --set BACKLIGHT_CONTROL legacy

I user powersaved for power management, so I hacked it a bit, and when
it receives acpi events corresponding to the brightness up/down keys, it
runs xbacklight as my user, on my $DISPLAY.

On 2.6.25-rc8 there are again two acpi_video# and kernel
BACKLIGHT_CONTROL works again, but as I have resume problems, I didn't
try much.

I have some delays in acpi events handling (when I hit fn+home, the acpi
event is received like one second later) so I don't really use
brightness keys currently, I use moreoften xbacklight directly from
commandline (wich works fine).

If you need the hack I made for powersaved, please ask.

>=20
> I'm still curious what the "right" way to handle this should be.  should =
I=20
> be mapping volume key events to alsa mixer events through acpi or some=20
> other interface?  should I be mapping brightness acpi events to the proc=20
> interface or to xbacklight?  or is this going to work "out of the box" wi=
th=20
> some coming changes I don't know about?

AIUI, it won't work =E2=80=9Cout of the box=E2=80=9D. Not on our thinkpad, =
ever.
AIUI, you have to bind volume control keycodes to keysymbols (via
xmodmap), then bind the keysymbols to a command (via your window
manager).
AIUI, you have to process acpi events (in a way or another) to change
backlight. You can use xbacklight +/- or manage everything yourself in a
script, like:

brightness =3D cat /sys/class/backlight_video1/actual_brightness
new_brightness =3D $brightness+1
echo $new_brightness > /sys/class/backlight_video1/brightness

Hope that help.

Cheers,
--=20
Yves-Alexis

--=-LcDqnZ8P4tSt6orIhv6A
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQBH9c8MTUTAIMXAW64RAmYZAKCwcPlQJdhrxBuoBqx6AxGZ77mNuACfYj5r
BK8ILI57nEyKm+1e9ZVUvlg=
=1Rri
-----END PGP SIGNATURE-----

--=-LcDqnZ8P4tSt6orIhv6A--