AppleGmuxBacklight

Details

On some models of Apple computers the ACPI-standard interfaces for backlight adjustment have no effect on the screen brightness. Another interface has been identified to adjust the backlight via the gmux ACPI device. Various patched drivers are available to use the gmux for brightness adjustments, but we'd like to get support included in Ubuntu by default.

We are therefore providing a patched version of the apple_bl driver which includes support for the gmux backlight interface for testing on a wide variety of Apple hardware. If you have an Apple model with a built-in display (e.g. MacBook or iMac), please follow the instructions below to install the patched driver, then add your test results to the table at the bottom of this page.

Note that if brightness adjustments already work for your machine then the gmux backlight interface probably is not going to work. Testing on these machines would still be appreciated, however.

Thanks for your help!

Driver Installation

The patched driver is available via PPA if you are running Oneiric or Precise. If you've installed another driver for your backlight, you should temporarily remove this driver before installing this driver for testing.

Use the following commands to subscribe to the PPA and install the driver.

  • sudo add-apt-repository ppa:sforshee/apple-bl-gmux
    sudo apt-get update
    sudo apt-get install apple-gmux-dkms

NOTE: If you previously installed apple-bl-gmux-dkms from this PPA, you be prompted to remove this package when installing apple-gmux-dkms. Please answer yes when prompted, and then reload the apple_bl module by running sudo modprobe -r apple_bl; sudo modprobe apple_bl.

Then to start using the driver you can either reboot, or else use the following commands to reload the driver.

  • sudo modprobe -r apple_gmux
    sudo modprobe apple_gmux

Testing

Once the driver is installed, please use the steps below to test both the ACPI-standard and gmux backlight interfaces, then add your results to the table at the bottom of this page. If you are booting with the acpi_backlight=vendor option, you will need to temporarily remove this option in order to test the standard ACPI backlight interfaces.

After you've started using the test driver, first check what gmux version your machine has by running

  • dmesg | grep gmux

If the gmux was detected, you should see a line similar to the following. Note the gmux version number to record with your test results.

  • apple_gmux: Found gmux version 1.9.35

Next, run the following command to see which backlight interfaces have been detected.

  • ls /sys/class/backlight

You should see at a minimum a directory named acpi_video0. You may also see a directory named gmux_backlight; if you do not see this directory then your machine does not have the gmux device in ACPI. Perform the following steps on each of the acpi_video0, gmux_backlight, and apple_backlight interfaces.

  1. Run cd /sys/class/backlight/<interface> for the backlight interface you are testing.

  2. Run cat max_brightness to get the maximum brightness value supported by the interface. Your range of valid brightness levels is 0 to max_brightness. Note: It's suggested that you do not set your brightness to lower than 5% of max_brightness, as it is possible to set the brightness so low that you can not longer see what is displayed on the screen.

  3. Run cat brightness to see the current brightness level.

  4. Select a new brightness value. This should be significantly different than the current value so that you can see whether or not the brightness changes, but again not lower than 5% of max_brightness. Once you've selected a value, run echo <value> | sudo tee brightness to write the value to the driver. Note whether or not the backlight level changes. If desired, you can then write the original value back to restore the brightness level.

Results

Please add your results to the following table, keeping the table sorted alphabetically by machine name. If you don't know your machine name, it can be obtained by running sudo dmidecode -s system-product-name. For any backlights that did not show up in /sys/class/backlight, enter N/A in that column.

Machine

gmux version

acpi_video0 works?

apple_backlight works?

gmux_backlight works?

iMac12,2

N/A

Y

Y

N/A

MacBook Air 4,1

N/A

Y

N/A

N/A

MacBook Pro 5,1 (Note 1)

1.7.3

N/A

Y

Y

MacBook Pro 5,1

1.7.3

N

Y (BIOS boot only)

Y (EFI boot only)

MacBook Pro 5,5

N/A

N/A

N/A

N/A

MacBook Pro 6,2

1.9.33

N/A

Y

Y

MacBook Pro 7,1

N/A

N/A

N

N/A

MacBook Pro 8,1

N/A

Y

N/A

N/A

MacBook Pro 8,2

1.9.35

N

N/A

Y

MacBook Pro 8,3

1.9.36

N

?

Y

MacBook Pro 10,1

N

N

N

N

Notes

Note 1: MacBook Pro 5,1

Booted Ubuntu 11.10 amd64 using rEFIt. The apple_backlight driver appears and works, as does gmux_backlight. The acpi_video0 driver does not appear. Most interestingly, the apple_backlight driver does not allow full display brightness to be achieved! By using gmux_backlight, I was able to make the display noticably brighter than with the apple_backlight driver. (The apple_backlight range is 0–15, while gmux_backlight goes from 0–77978.) Unfortunately, the rest of Ubuntu doesn't know how to use the gmux_backlight driver, so every time Ubuntu adjusts the backlight brightness (when logging in or resuming from suspend mode, or switching back from battery to line power, or even using the hot keys), my nice, bright screen is slightly dimmed. I have to echo the real maximum value to the gmux_backlight brightness file to regain full brightness. Will Ubuntu be able to use gmux_backlight for all backlight control, so I can use the full brightness range without manually writing to the brightness file all the time? —colinb <colin at gibibit dot com>

Note 2: iMac 12,2

Installed Ubuntu 12.04 LTS on this machine. The apple_backlight module that came with the OS worked fine on the primary monitor. The backlight on the secondary 27" Thunderbolt display was not adjustable, and the apple_gmux module didn't seem to find any backlight devices. I did notice that the display brightness changes automatically based on the ambient light in the room; shining a flashlight directly on the camera/light sensor at the top of the thunderbolt display caused the screen to become brighter.

Kernel/AppleGmuxBacklight (last edited 2012-10-20 09:45:34 by ajvdvegt)