[Jaunty] MacBook 5.1 keyboard backlight not supported

Bug #337945 reported by Chris Lasher on 2009-03-04
26
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HAL
New
Undecided
Unassigned
Mactel Support
Low
Unassigned
linux (Ubuntu)
Undecided
Unassigned

Bug Description

The keyboard backlight on the MacBook 5.1 is not supported as of Jaunty (Ubuntu 9.04) Alpha 5. This is supported in Intrepid (Ubuntu 8.10) by the Mactel PPA packages hal-applesmc, hid-dkms, and possibly nvidia-bl-dkms, though I installed the nvidia-bl-dkms package for Jaunty.

Chris Lasher (chris.lasher) wrote :
Chris Lasher (chris.lasher) wrote :
description: updated
Changed in mactel-support:
importance: Undecided → Low
P. Dunbar (vigilcode) wrote :

I can manually control keyboard backlight with
echo 255 > /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness
to fully turn on or echo 0 to turn it off... This was after the install of applesmc-dkms.

There does seem to be some oddity traversing the directory structure there as it seems to loop.

My remaining issue is the ability to adjust this value through the Fn keys like we can with the display backlight. Anyone know what is missing to make that work or a workaround to just send 0 or 255 via those F5 and F6 keys?

Jim Rorie (jfrorie) wrote :

I don't know if this is relevant but when I run:

# echo 255 > /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness

I get permission denied. However, I can run:

# echo 255 | sudo tee -a /sys/class/leds/smc::kbd_backlight/brightness

..from the intrepid docs and it works flawlessly.

P. Dunbar (vigilcode) wrote :

I usually sudo -i first then I run the command and you don't get permission denied.
You could also run it the same way as
echo 255 | sudo tee -a /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness

Both work, I like your path better cause its shorter.

P. Dunbar (vigilcode) wrote :

I tried looking at pommed to get this working as well but the current version in the repos (1.25) says:
Unknown Apple machine: MacBookPro5,2

so that's a dead end for now.

Mario Schwalbe (schwalbe) wrote :

since the applesmc module seems to be working, what does
hal-find-by-capability --capability keyboard_backlight
output? at first i got 2 devices, which seems to confuse gnome-power-manager.

additionally,
gnome-power-manager --no-daemon --verbose sometimes gives valuable diagnostics.

ciao,
Mario

P. Dunbar (vigilcode) wrote :

the hal-find-by-capability --capability keyboard_backlight
outputs nothing....
if i try:
hal-device | grep kbd
41: udi = '/org/freedesktop/Hal/devices/leds_smc_kbd_backlight'
  linux.sysfs_path = '/sys/devices/platform/applesmc.768/leds/smc::kbd_backlight' (string)
  info.udi = '/org/freedesktop/Hal/devices/leds_smc_kbd_backlight' (string)
  leds.function = 'kbd_backlight' (string)

then i ran the gnome-power-manager in verbose like you said and while running pressed the F6 and F5 key, here is the output during those key presses:
TI:13:39:38 TH:0x144ea00 FI:gpm-backlight.c FN:conf_key_changed_cb,501
 - unknown key /apps/gnome-screensaver/power_management_delay
TI:13:39:40 TH:0x144ea00 FI:gpm-button.c FN:hal_device_condition_cb,413
 - condition=ButtonPressed, details=kbd-illum-up
TI:13:39:40 TH:0x144ea00 FI:gpm-button.c FN:gpm_button_emit_type,96
 - emitting button-pressed : kbd-illum-up
TI:13:39:40 TH:0x144ea00 FI:gpm-manager.c FN:button_pressed_cb,1029
 - Button press event type=kbd-illum-up
TI:13:39:40 TH:0x144ea00 FI:egg-console-kit.c FN:egg_console_kit_is_active,116
 - no ConsoleKit session
TI:13:39:40 TH:0x144ea00 FI:gpm-manager.c FN:button_pressed_cb,1033
 - ignoring as not on active console
TI:13:39:40 TH:0x144ea00 FI:gpm-srv-screensaver.c FN:button_pressed_cb,167
 - Button press event type=kbd-illum-up
TI:13:39:40 TH:0x144ea00 FI:gpm-backlight.c FN:gpm_backlight_button_pressed_cb,534
 - Button press event type=kbd-illum-up
TI:13:39:40 TH:0x144ea00 FI:gpm-info.c FN:button_pressed_cb,679
 - Button press event type=kbd-illum-up
TI:13:39:40 TH:0x144ea00 FI:gpm-button.c FN:gpm_button_filter_x_events,149
 - Key 238 mapped to key kbd-illum-up
TI:13:39:40 TH:0x144ea00 FI:gpm-button.c FN:gpm_button_emit_type,92
 - ignoring duplicate button kbd-illum-up
TI:13:39:43 TH:0x144ea00 FI:gpm-array.c FN:gpm_array_append,141
 - adding to 0x1614410, x=0, y=97, data=65280
TI:13:39:43 TH:0x144ea00 FI:gpm-array.c FN:gpm_array_append,141
 - adding to 0x1614470, x=0, y=8293, data=65280
TI:13:39:44 TH:0x144ea00 FI:gpm-button.c FN:gpm_button_filter_x_events,149
 - Key 237 mapped to key kbd-illum-down
TI:13:39:44 TH:0x144ea00 FI:gpm-button.c FN:gpm_button_emit_type,96
 - emitting button-pressed : kbd-illum-down
TI:13:39:44 TH:0x144ea00 FI:gpm-manager.c FN:button_pressed_cb,1029
 - Button press event type=kbd-illum-down
TI:13:39:44 TH:0x144ea00 FI:egg-console-kit.c FN:egg_console_kit_is_active,116
 - no ConsoleKit session
TI:13:39:44 TH:0x144ea00 FI:gpm-manager.c FN:button_pressed_cb,1033
 - ignoring as not on active console
TI:13:39:44 TH:0x144ea00 FI:gpm-srv-screensaver.c FN:button_pressed_cb,167
 - Button press event type=kbd-illum-down
TI:13:39:44 TH:0x144ea00 FI:gpm-backlight.c FN:gpm_backlight_button_pressed_cb,534
 - Button press event type=kbd-illum-down
TI:13:39:44 TH:0x144ea00 FI:gpm-info.c FN:button_pressed_cb,679
 - Button press event type=kbd-illum-down
TI:13:39:44 TH:0x144ea00 FI:gpm-button.c FN:hal_device_condition_cb,413
 - condition=ButtonPressed, details=kbd-illum-down
TI:13:39:44 TH:0x144ea00 FI:gpm-button.c FN:gpm_button_emit_type,92
 - ignoring duplicate button kbd-illum-down

P. Dunbar (vigilcode) wrote :

so GPM sees the button press events correctly it appears...
how do we get it communicating with leds_smc_kbd_backlight now to actually bring the backlight on or off?

If anyone would like more output please let me know.

Chris Lasher (chris.lasher) wrote :

I'm curious as to why this worked without manual modification using the Mactel PPA for Intrepid but not for Jaunty. What was provided in that package that's not provided in the Jaunty package?

P. Dunbar (vigilcode) wrote :

My guess is: hal-applesmc - 0.14
is available for intrepid and not Jaunty yet...
But I'm not sure if it can get working without that modification.
And I think I recall reading Henrik isn't working on Jaunty anymore and he created that package for Intrepid.

Ricky Campbell (cyberdork33) wrote :

that and gnome-power-manager I believe.

Jean-Philippe Fleury (jpfle) wrote :

I confirm this bug with Jaunty 64-bit on a MacBookPro4,1. To activate keyboard backlight, I have to use these commands:

$ sudo modprobe applesmc
$ echo 150 | sudo tee /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness

P. Dunbar (vigilcode) wrote :

any ideas here? someone updated the mbp5-1,5-2 jaunty wiki that its working for them. can anyone else confirm this working? It does not work for me and I'm on released Jaunty 64-bit on MBP5,2.

P. Dunbar,

It does not work for me either, as for everyone else I suppose. Also, I don't see anywhere in the wiki [1] a reference in the wiki about the backlit-keyboard F-keys (F5, F6) working.

Cheers, Nikos

[1] https://help.ubuntu.com/community/MacBookPro5-1_5-2/Jaunty

P. Dunbar (vigilcode) wrote :

Install this and it will work: https://edge.launchpad.net/~adamhorden/+archive/ppa/+sourcepub/523564/+listing-archive-extra

I have other issues with it being that now it generally ALWAYS keep the keyboard backlight on. Doesn't seem to effectively utilize the light sensors. I mentioned the issues in this thread: http://ubuntuforums.org/showthread.php?t=1141029 (I am inphektion).

I've sent the email as Mr. Campbell suggested to the mactel support team, haven't heard back yet but has been < 24hrs.

Will update wiki with this info...

P. Dunbar (vigilcode) wrote :

After more searching regarding this same issue seen in Intrepid it seems there was a gnome-power-manager provided in the PPA to help address light-sensor readings adjusting the brightness of keyboard backlight.
I've also tried mucking around in this file /usr/share/hal/fdi/information/10freedesktop/10-applesmc.fdi
and this one /usr/share/hal/fdi/policy/10osvendor/10-macbookpro-utils.fdi

but didn't successfully accomplish anything. These seem to be the main 2 involved though.

P. Dunbar, Thanks a lot for the hint!

The F-keys for the keyboard backlight work the same way like for the display. I still feel however that they are not that _responsive_ as they could/should.

Nikos

Chris Lasher (chris.lasher) wrote :

Nikos, please see Bug 357112. I haven't tried the PPA mentioned above by P. Dunbar, but maybe Bug 357107 and Bug 360177 still apply, too.

Yep, thanks for the information.

* Your description is more than accurate ( with respect to [https://bugs.launchpad.net/bugs/357112 Bug 357112]). I 've just posted a confirmation to attract more attention to the bug.

* The same for [https://bugs.launchpad.net/bugs/357107 Bug 357107].

* About [https://bugs.launchpad.net/bugs/360177 Bug 360177] I'll have to try it another time as I don't have my battery attached (usually).

Nikos

P. Dunbar (vigilcode) wrote :

Yep I can confirm all those bugs too with MBP5,2 Jaunty 64.
There seems to be a common denominator in all them and that is gnome-power-manager. Which i suspect we may need a PPA version of in order to resolve this completely and those other issues.

OK, folks if you stick your ear just below the right speaker (and a bit on the left), right where the woofer lies, you might hear just enough to convince you that the woofer works _also_ under Ubuntu as I did right now. So, I confirm hearing the woofer but... it's so weak as if it's not there at all.

Nikos

Sorry, I just realised that my previous post should go in the "left-speaker" bug :-p
Nikos

Ricky Campbell (cyberdork33) wrote :

The hal-applesmc package in the mactel-support ppa is now updated for jaunty.

This hal interface for the applesmc Linux module is required for the keyboard backlight and adjustment keys to work properly.

Changed in mactel-support:
status: New → In Progress
Jim Rorie (jfrorie) wrote :

Someone updated the community docs to state that pommed now works. I installed it and does work, but there are some differences. #1) The option to swap the default Fn behavior becomes disabled and the suggested configuration for pommed doesn't appear to work. #2) pommed appears to have the keyboard active at the gdm login, which is pretty nice. #3 The keyboard doesn't stay on. It has some type of timeout like I would expect under battery power save. Except that I'm on A/C. Which brings a question. I saw a reference to a "Keyboard" tab under gnome power manager. Do other see this or is that for another models keyboard?

You should not use pommed on these newer macs. It is depreciated.
Instead the driver should be patched.

Ricky

On Jun 21, 2009, at 10:22 AM, Jim Rorie <email address hidden> wrote:

> Someone updated the community docs to state that pommed now works. I
> installed it and does work, but there are some differences. #1) The
> option to swap the default Fn behavior becomes disabled and the
> suggested configuration for pommed doesn't appear to work. #2) pommed
> appears to have the keyboard active at the gdm login, which is pretty
> nice. #3 The keyboard doesn't stay on. It has some type of timeout
> like I would expect under battery power save. Except that I'm on A/C.
> Which brings a question. I saw a reference to a "Keyboard" tab under
> gnome power manager. Do other see this or is that for another models
> keyboard?
>
> --
> [Jaunty] MacBook 5.1 keyboard backlight not supported
> https://bugs.launchpad.net/bugs/337945
> You received this bug notification because you are a member of Mactel
> Support, which is the registrant for Mactel Support.
>
> Status in Hardware Abstraction Layer (HAL): New
> Status in Mactel Support: In Progress
> Status in “linux” source package in Ubuntu: New
>
> Bug description:
> The keyboard backlight on the MacBook 5.1 is not supported as of
> Jaunty (Ubuntu 9.04) Alpha 5. This is supported in Intrepid (Ubuntu
> 8.10) by the Mactel PPA packages hal-applesmc, hid-dkms, and
> possibly nvidia-bl-dkms, though I installed the nvidia-bl-dkms
> package for Jaunty.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~mactel-support
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~mactel-support
> More help : https://help.launchpad.net/ListHelp

Albert Cardona (cardona) wrote :

As of ubuntu 9.10 beta 5, the default driver for the mactel keys doesn't work. But pommez, at least the latest git commit as of today, works almost well -- only F1/F2 for LCD backlight don't work. So whoever is taking care of an update for 9.10, please do so ...

Jeremy Foshee (jeremyfoshee) wrote :

Hi Chris,

This bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? Can you try with the latest development release of Ubuntu? ISO CD images are available from http://cdimage.ubuntu.com/releases/lucid.

If it remains an issue, could you run the following command from a Terminal (Applications->Accessories->Terminal). It will automatically gather and attach updated debug information to this report.

apport-collect -p linux 337945

Also, if you could test the latest upstream kernel available that would be great. It will allow additional upstream developers to examine the issue. Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag. This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text. Please let us know your results.

Thanks in advance.

[This is an automated message. Apologies if it has reached you inappropriately; please just reply to this message indicating so.]

tags: added: needs-kernel-logs
tags: added: needs-upstream-testing
tags: added: kj-triage
Changed in linux (Ubuntu):
status: New → Incomplete
Chris Lasher (chris.lasher) wrote :

This bug can be closed. It was resolved with the release of the nvidia-bl-dkms 0.15 series of packages. Thanks for checking.

Changed in linux (Ubuntu):
status: Incomplete → Fix Released
Alex Murray (alexmurray) wrote :

@Chris: I am pretty sure that nvidia-bl only controls the screen, not the keyboard backlight and hence this bug is still valid (well for me it definitely doesn't fix it)

Changed in linux (Ubuntu):
status: Fix Released → Incomplete
Peter S. (stoto) wrote :

I have a fresh install of 10.4 and the problem still exists. nvidia-bl package fixed my screen backlight control but, i still cant activate my keyboard backlight on my macbook 5.1. I will attach a report.

tags: added: apport-collected

AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.21.
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: stoto 1467 F.... pulseaudio
CRDA: Error: [Errno 2] No such file or directory
Card0.Amixer.info:
 Card hw:0 'NVidia'/'HDA NVidia at 0xd3380000 irq 16'
   Mixer name : 'Realtek ALC889A'
   Components : 'HDA:10ec0885,106b3f00,00100103'
   Controls : 36
   Simple ctrls : 20
DistroRelease: Ubuntu 10.04
HibernationDevice: RESUME=UUID=aae92d04-1f80-4b61-9d49-875a45764097
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100429)
MachineType: Apple Inc. MacBook5,1
NonfreeKernelModules: nvidia wl
Package: linux (not installed)
ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.32-21-generic root=UUID=3771a9cf-1ae6-4479-b3d9-0f7875d4e7df ro quiet splash
ProcEnviron:
 LANG=en_US.utf8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-21.32-generic 2.6.32.11+drm33.2
Regression: No
RelatedPackageVersions: linux-firmware 1.34
Reproducible: Yes
RfKill:
 0: hci0: Bluetooth
  Soft blocked: no
  Hard blocked: no
Tags: lucid needs-upstream-testing
Uname: Linux 2.6.32-21-generic x86_64
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare
dmi.bios.date: 04/27/09
dmi.bios.vendor: Apple Inc.
dmi.bios.version: MB51.88Z.007D.B03.0904271443
dmi.board.asset.tag: Base Board Asset Tag#
dmi.board.name: Mac-F42D89C8
dmi.board.vendor: Apple Inc.
dmi.board.version: Proto
dmi.chassis.asset.tag: Asset Tag#
dmi.chassis.type: 10
dmi.chassis.vendor: Apple Inc.
dmi.chassis.version: Mac-F42D89C8
dmi.modalias: dmi:bvnAppleInc.:bvrMB51.88Z.007D.B03.0904271443:bd04/27/09:svnAppleInc.:pnMacBook5,1:pvr1.0:rvnAppleInc.:rnMac-F42D89C8:rvrProto:cvnAppleInc.:ct10:cvrMac-F42D89C8:
dmi.product.name: MacBook5,1
dmi.product.version: 1.0
dmi.sys.vendor: Apple Inc.

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

Peter S. (stoto) wrote : Lspci.txt

apport information

Peter S. (stoto) wrote : Lsusb.txt

apport information

apport information

apport information

apport information

apport information

Peter S. (stoto) wrote : UdevDb.txt

apport information

Peter S. (stoto) wrote : UdevLog.txt

apport information

apport information

Peter S. (stoto) wrote :

However i am able to control the brightness width the following command:

sudo echo 180 | sudo tee /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness

Where 180 is the brightness, it goes from 0 to 255.

Any way to bind it to the keyboard backlight keys?

Peter S. wrote:
> However i am able to control the brightness width the following command:
>
> sudo echo 180 | sudo tee
> /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness
>
> Where 180 is the brightness, it goes from 0 to 255.
>
> Any way to bind it to the keyboard backlight keys?
>

You might want to try a search for "nomodeset", "kms", "xrandr --output LVDS
--set BACKLIGHT_CONTROL". I have no exact details because the way it works has
changed a lot recently. Still, there might be a way forward there.

Or, you could install pommed.

Henrik

Peter S. (stoto) wrote :

I found a solution:

I made a script, with that i can control the brightness:

stoto@stoto-laptop:~$ cat backlight.sh
#!/bin/bash

$act
act=`cat /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness`
echo $1
case "$1" in
 inc)
  if [[ $act -lt 255 ]]; then
   act=$((act+5))
   echo $act | tee /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness
  fi
 ;;

 dec)
  if [[ $act -gt 4 ]]; then
                        act=$((act-5))
                        echo $act | tee /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness
                fi
 ;;

 *) echo "Usage: inc or dec"
 ;;
esac

Save the script somewhere. I saved in my home, and made a symlink to /bin/backlight.sh but its optional
I binded it to the brightness control keys in:

System -> Preferences -> Keyboard Shortcuts

Make 2 Custom shortcuts with the add button:
-BrightnessUp, command: /bin/backlight.sh inc
-BrightnessDown, command: /bin/backlight.sh dec

This is only working if you have access to the brightness control file. Putting sudo in the command won't work, it works with gksudo, but then you will have massive amounts of windows popping up when you hold the brightness control key.

So the best solution i found:
sudo chmod 777 /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness

It works like a charm.

Peter S. (stoto) wrote :

I had to make a little modification for the script so it will work after reboot too:

stoto@stoto-laptop:~$ cat backlight.sh
#!/bin/bash

if [ `ls -al /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness | awk {'print $1'}` != -rwxrwxrwx ]; then
 gksudo chmod 777 /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness
fi

$act
act=`cat /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness`
echo $1
case "$1" in
 inc)
  if [[ $act -lt 255 ]]; then
   act=$((act+5))
   echo $act | tee /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness
  #else
   #notify-send -t 50 "Keyboard backlight is on maximum!"
  fi
 ;;

 dec)
  if [[ $act -gt 4 ]]; then
                        act=$((act-5))
                        echo $act | tee /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness
  #else
   #notify-send -t 50 "Keyboard backlight is off."
                fi
 ;;

 *) echo "Usage: inc or dec"
 ;;
esac

The else and the notify-send is commented out, because of a bug in notify-osd package. This bug causes notify-osd to ignore the timeout settings.

Peter S. (stoto) wrote :

I attached the script.

Henrik Rydberg (rydberg) wrote :

Thank you! Many roads to Rome.

This bug was filed against a series that is no longer supported and so is being marked as Won't Fix. If this issue still exists in a supported series, please file a new bug.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: Incomplete → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers