Using the Apple LED Cinema Display in Ubuntu MATE


Whilst the Apple LED Cinema Display works like a charm using a mini Display Port adapter (make sure to get one that supports the 1.2 standard though), controlling the brightness and using the camera is not that easy. Btw., the sound is awesome as well - thanks to the integrated sub-woofer.

Controlling Brightness

The Apple LED Cinema Display does not have any switches or controls whatsoever. It's always on (thus available for charging your phone) and brightness is controlled via USB. Fortunately there is some code out there to do this: acdcontrol. Download it and unpack it using tar. It's pretty old and does not work out of the box, so some small changes are required for acdcontrol.cpp (line numbers are not completely accurate, download the modified acdcontrol.cpp from here):

Additional lines:

62: const int CINEMA_DISPLAY_27          = 0x9226;

544:   supportedDevices.insert( DeviceId( APPLE, CINEMA_DISPLAY_27,
545:                                      "Apple Cinema HD Display 27\"" ));


Change 255 to 1000 in the following lines:

245:          "      Generally, this parameter may get values in the range [0-1000].\n"
490:        brightness = min( 1000, brightness);


Now build it using make. If everything was successful, try to locate your Apple LED Cinema Display (the device may not - yet - be accessible without root permissions):

sudo ./acdcontrol --detect /dev/usb/hiddev*

In my case, it is found on /dev/usb/hiddev0:

/dev/usb/hiddev0: USB Monitor - SUPPORTED.    Vendor= 0x5ac (Apple), Product=0x9226[Apple Cinema HD Display 27"]

You can now get the current brightness or change it to your needs:

sudo ./acdcontrol /dev/usb/hiddev0
sudo ./acdcontrol /dev/usb/hiddev0 650

Copy acdcontrol to /usr/local/bin to make it available to everyone:

sudo cp acdcontrol /usr/local/bin

Fix Permissions

If - as on my machine - you need root permissions to access /dev/usb/hiddev0, make a constant change using a udev rule. Create (or edit) the file 10-local.rules in /etc/udev/rules.d:

SUBSYSTEMS=="usb", ATTRS{product}=="Apple LED Cinema Display", GROUP="users"

Since I was not member of the users group, I had to add myself to this one as well:

sudo usermod -a -G users konrad

Reboot to make sure this works.

Add Keyboard Shortcuts

In Control Center > Keyboard Shortcuts use the Add button to create two new shortcuts:
  1. Brightness up: /usr/local/bin/acdcontrol /dev/usb/hiddev0 +50
  2. Brightness down: /usr/local/bin/acdcontrol /dev/usb/hiddev0 -- -50
Assign those two new shortcuts two those keys which suit you best. I added them to cmd + F1 and cmd + F2.

Activating the iSight Camera

The Apple LED Cinema Display has an integrated iSight camera. To use it with Linux, you need to use a patched version of Apple's firmware. You can find the firmware using a Google search for appleusbvideosupport site:github.com. The AppleUSBVideoSupport file is located in the Contents/MacOS folder.

For patching and installing the file you need ift-extract. It is available as part of a Ubuntu package:

sudo apt install isight-firmware-tools

Now run the tool to install and patch the firmware driver: 

sudo ift-extract -a ~/Downloads/AppleUSBVideoSupport

The output should look somewhat like this:

** Message: 18:45:28.426: Found firmware signature at offset 0x29C8.
** Message: 18:45:28.437: Firmware extracted successfully in /lib/firmware/isight.fw
** Message: 18:45:28.437: Firmware version 2.38.83 (0x02.0x26.0x53)
** Message: 18:45:28.437: Apply patch 0 : Fix device descriptor
** Message: 18:45:28.437: Apply patch 1 : Fix interface assocation descriptor
** Message: 18:45:28.437: Apply patch 2 : Fix video interface collection
** Message: 18:45:28.437: Apply patch 3 : Fix video streaming device qualifier
** Message: 18:45:28.437: Apply patch 4 : Fix video control interface descriptor
** Message: 18:45:28.437: Apply patch 5 : Fix video streaming interface descriptor
** Message: 18:45:28.437: Firmware patched successfully


Now install a tool for the camera (cheese or Kamoso) and test it:

sudo apt install cheese
cheese

You should now be able to see yourself - done!

Related Topics

Kommentare

Kommentar veröffentlichen

Beliebte Posts aus diesem Blog

Working with OSX El Capitan Mouse Cursors

Hello Manjaro KDE - Instructions Part 1 Done!

Good Bye Ubuntu MATE - Hello Manjaro KDE