light sensor is not read ? (Lucid, MacbookPro 6.2)

Bug #626079 reported by Robert Biloute
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mactel Support
Invalid
Low
Bernhard Froemel

Bug Description

Hello,

I have a macbook pro 6.2 with lucid 64 bits (installed following this: https://help.ubuntu.com/community/MacBo … ucid#Video) and I try to read the output of light sensors in order to smartly control the screen and keyboard light.

1st question: It seems this functionnality did exist on previous ubuntu versions, right ?

2nd question: I should just have to read the 'light' file which contains the output of light sensors:
~$ cat /sys/devices/platform/applesmc.768/light
(0,0)

The trouble is this file always contains this (0,0), whatever the ambient light conditions are..

Nevertheless:

Code:

~$ dmesg|grep apple
[ 4.496393] apple 0003:05AC:0237.0001: input,hidraw0: USB HID v1.11 Keyboard [Apple Inc. Apple Internal Keyboard / Trackpad] on usb-0000:00:1a.7-1.2/input0
[ 4.499260] apple 0003:05AC:0237.0002: hidraw1: USB HID v1.11 Device [Apple Inc. Apple Internal Keyboard / Trackpad] on usb-0000:00:1a.7-1.2/input1
[ 4.502979] apple 0003:05AC:8242.0003: hiddev96,hidraw2: USB HID v1.11 Device [Apple Computer, Inc. IR Receiver] on usb-0000:00:1d.7-1.2/input0
[ 8.198273] applesmc: Apple MacBook Pro 6 detected:
[ 8.198275] applesmc: - Model with accelerometer
[ 8.198277] applesmc: - Model with light sensors and backlight
[ 8.198278] applesmc: - Model with 18 temperature sensors
[ 8.199332] applesmc: device has already been initialized (0xe0, 0xf.
[ 8.199334] applesmc: device successfully initialized.
[ 8.200274] applesmc: 2 fans found.
[ 8.203250] input: applesmc as /devices/platform/applesmc.768/input/input10
[ 8.203395] applesmc: driver successfully loaded.
[ 25.056833] applesmc: light sensor data length set to 10
[ 64.788156] applesmc: wait status failed: 5 != 0
[ 80.741403] applesmc: wait status failed: 4 != 0
[ 144.690224] applesmc: wait status failed: 5 != 1
[ 224.599671] applesmc: wait status failed: 5 != 1

(full output of this command in the attached file)

So it seems the system is recognizing light sensors ?

On the other hand:

Code:

:~$ sensors
applesmc-isa-0300
Adapter: ISA adapter
Left side :2585 RPM (min = 2000 RPM)
Right side :2574 RPM (min = 2000 RPM)
TB0T: +42.5°C
TB1T: +42.5°C
TB2T: +37.2°C
TC0C: +60.0°C
TC0D: +61.5°C
TC0P: +62.0°C
TC1C: +62.0°C
TG0D: +61.0°C
TG0P: +57.0°C
TG0T: +61.5°C
TMCD: +62.0°C
TP0P: +67.5°C
TPCD: +75.0°C
Th1H: +53.8°C
Th2H: +52.8°C
Tm0P: +70.2°C
Ts0P: +35.5°C
Ts0S: +47.2°C

here no light sensors..

I also tried:

Code:

~$ hal-find-by-capability --capability light-sensor --verbose
Found 0 device objects of capability 'light-sensor'

Revision history for this message
Robert Biloute (robertbiloute) wrote :
Revision history for this message
Bernhard Froemel (froemel) wrote :

I own the same model and my light sensor is working (a little light, more light and no ambient light):

> # cat /sys/devices/platform/applesmc.768/light
> (15,0)
> # cat /sys/devices/platform/applesmc.768/light
> (29,0)
> # cat /sys/devices/platform/applesmc.768/light
> (0,0)

This model only has a single light sensor on the left side; that's why the second number is always zero.

The sensors command only lists those parameters that are recognized by lm-sensors which does not seem to know about the ambient light sensor class.

Also, HAL only knows about light if you provide an interface to applesmc. It seems to be already done here: http://bitmath.org/code/hal-applesmc/

So the question is: does the light sensor work on OSX? At first glance there is no difference between our machines and setup including the reported kernel messages. For your reference, I run both, applesmc and pommed, as available in the PPA repository (ppa:mactel-support/ppa):

pommed-1.33-mactel1~lucid1
applesmc-dkms-0.16.1~0ubuntu1~mactel1~lucid

Revision history for this message
Robert Biloute (robertbiloute) wrote :

Yes the light sensor work on OSX
I also checked I had 'pommed-1.33-mactel1~lucid1' and 'applesmc-dkms-0.16.1~0ubuntu1~mactel1~lucid' installed.
When I check processes running, I have 'pommed' and 'applesmc-led'

Revision history for this message
Robert Biloute (robertbiloute) wrote :

Now it is working, though it doesn't seem really sensitive.. seems to be linked with a macos update about firmware I have just been installing

Changed in mactel-support:
importance: Undecided → Low
assignee: nobody → Bernhard Froemel (froemel)
Revision history for this message
Bernhard Froemel (froemel) wrote :

Ok, good!
I close this for now as invalid and make a comment on the help pages to ensure latest firmware updates are installed. If you or someone else ever has this issue (again) we'll reopen it and hopefully either you or someone else with this issue is able to solve it. In my case, the light readings never failed right from the start - and I use Linux on my MBP almost exclusively.

Changed in mactel-support:
status: New → Invalid
Revision history for this message
Robert Biloute (robertbiloute) wrote :

update: the problem is back again today, always (0,0) in the 'light' file.. no idea why.
I found another ubuntu mac user on the french ubuntu forum that had the same problem when I posted my first message here, I will try to ask him if it is still the case.

Revision history for this message
AzN1337c0d3r (azn1337c0d3r) wrote :

The light sensor on my MBP 6,2 appears to be using the webcam, not any light sensor inside the laptop itself.

Here are my results from shining my flashlight hotspot at the webcam from 1 feet away. The first result is off, the second result is low, the third result is high.

hocheung20@ho-MBP-Ubuntu:~$ cat /sys/devices/platform/applesmc.768/light
(6,0)
hocheung20@ho-MBP-Ubuntu:~$ cat /sys/devices/platform/applesmc.768/light
(37,0)
hocheung20@ho-MBP-Ubuntu:~$ cat /sys/devices/platform/applesmc.768/light
(255,0)

Revision history for this message
Νίκος Αλεξανδρής (nikos.alexandris) wrote :

It appears but it does not. It uses the light sensor which is on the left from the webcam ;-). I had to clean my dusty display to see it :-p. And it works for me too ...was playing yesterday a bit with it. Cheers, Nikos

Revision history for this message
AzN1337c0d3r (azn1337c0d3r) wrote :

Ahh, you are correct, it's the little spot by the webcam. Well it appears that the sensor is working in my case, but my F5 and F6 keys do not appear to be adjusting the keyboard backlight. My problem probably has to do with pommed so has nothing to do with this bug.

Revision history for this message
alexcastanaza (dacastanaza) wrote :

Should the backlight change according to the ambient light with pommed (as it is in mac os x)?
If it should, then I am affected by this bug, because in mac os x the screen backlight changes with the ambient light, but in ubuntu 10.10 64 bit it does not.

Revision history for this message
Alex Murray (alexmurray) wrote :

No Ubuntu does not try to control the backlight based on the ambient brightness.

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.