MacBook Pro 7,1 Ubuntu 10.10 (Maverick Meerkat)

This page aims to describe the steps needed, to fully enable all features of the MacBookPro 13.3 (MBP 7,1) when using Ubuntu 10.10, Maverick Meerkat.

Much of this page (even the formatting, I admit) is just taken from the guide for Lucid, so thank you to the contributor of that page. My goal is to make this specialized to Maverick and update a couple of the guides and fixes that worked and were documented for Lucid.

Please note that before going through any of the suggested fixes for this hardware, or installing any additional drivers, please make sure you RUN UPDATE MANAGER first and apply all updates to the system.

IconsPage/terminal.png You can find out what model you have by typing at the terminal:

sudo dmidecode -s system-product-name


  • If you have a different model, please go here and find the right wiki.

Overview

Anything not mentioned here probably already works out of the box. If not, please refer to the Ubuntu Apple Users forum.

IconsPage/ok.png (works out-of-the-box)
IconsPage/ok.png IconsPage/info.png (works, with remarks)
IconsPage/warning.png (needs manual install)
IconsPage/dont.png (won't work)
IconsPage/question.png (not yet documented)

Basic Installation Instructions

Common things about installing and maintaining Ubuntu on Intel-based Macs: Intel CPU-based Macintosh Generic Installation Instructions.

Most 7,1 models come with 4GB of RAM, which the default kernel on the 32-bit edition of Ubuntu cannot fully utilize. Both the CD and DVD installers of Ubuntu will automatically download and install the PAE enabled kernel if they detect more than 3 Gb of available memory, however the PAE kernel packages are not present on the CD. If you do not have an Ethernet cable connected when installing, Ubuntu will recognize less than 3GB of RAM. However, you can use the following command to install the PAE kernel afterwards:

sudo apt-get install linux-generic-pae linux-headers-generic-pae

Package Support for Intel Macs

You need some modules from the MactelSupportTeam/PPA :

sudo add-apt-repository ppa:mactel-support && sudo apt-get update

The mactel PPA modules needed on Ubuntu on this MBP are applesmc-dkms (driver for light sensor, temperatures, fans and keyboard backlight), mbp-nvidia-bl-dkms (driver for the LCD panel backlight) and pommed (daemon to control them all).

Sensors

The program lmsensors detects the sensors, however it does not know what they are yet. But coretemp will allow lm-sensor to detect the others sensors, the rotation speed of the fan and the GPU temperature.

sudo modprobe coretemp

Then add coretemp to the list of modules loaded during the boot process:

sudo gedit /etc/modules

It is highly recommended to use the fan controller daemon that is included in the mactel-support ppa called macfanctl. After enabling the ppa as shown above you can add this tool with the following command:

sudo apt-get install macfanctld

After installation you there is a config file located at /etc/macfanctl.conf. The default configurations seems to work well.

Suspend

Can work without problem.

However if this is not working (either suspend doesn't work by closing the lid or from the menu option) or you find that the screen brightness is set to 0 after resume (which can make you believe that your system has hanged) then do the following:

sudo cp /usr/lib/pm-utils/defaults /etc/pm/config.d/defaults
sudo gedit /etc/pm/config.d/defaults

Change the lines:

# HIBERNATE_RESUME_POST_VIDEO="no"
# SUSPEND_MODULES=""
# ADD_PARAMETERS=""
# DROP_PARAMETERS=""

to:

HIBERNATE_RESUME_POST_VIDEO="yes"
SUSPEND_MODULES="mbp-nvidia-bl"
ADD_PARAMETERS="--quirk-reset-brightness"
DROP_PARAMETERS="--quirk-none"

and reboot

Screen

Set brightness manually

You can set your brightness manually using values from 0 (minimum - no backlight) to 15 (maximum):

echo 15 |sudo tee /sys/class/backlight/mbp_backlight/brightness

Set brightness using F1 and F2

Installing mbp-nvidia-bl-dkms and pommed enables the control of the screen backlight with the keyboard keys F1 and F2. With current latest nvidia drivers (260.19.06-0ubuntu1) you also have to do the following to enable F1 and F2.

Edit /etc/modules:

sudo gedit /etc/modules

and add the following line to the end of the module

mbp-nvidia-bl

Now you need to edit the xorg.conf file:

sudo gedit /etc/X11/xorg.conf

Find the Device Section for the Nvidia driver and add this line to the end of the section:

        Option          "RegistryDwords" "EnableBrightnessControl=1"

The block should now look like this:

Section "Device"
        Identifier      "Default Device"
        Driver  "nvidia"
        Option  "NoLogo"        "True"
        Option          "RegistryDwords" "EnableBrightnessControl=1"
EndSection

Reboot and enjoy!

Colors

MacBook Pros can use a program called xcalib to emulate the screen coloring calibration of OS X:

sudo apt-get install xcalib

sudo mount -t hfsplus /dev/sda2 /mnt
#(this mounts the mac partition [/dev/sda2] on /mnt)

sudo mkdir /etc/xcalib
sudo cp /mnt/Library/ColorSync/Profiles/Displays/* /etc/xcalib

Then, do an ls /etc/xcalib and note the name of the profile (for the next step).

Finally, add the following line to the end of either /etc/gdm/Init/Default (for standard Ubuntu/Gnome) or /etc/kde4/kdm/Xsetup (for Kubuntu/KDE), before the final "exit" statement:

/usr/bin/xcalib "/etc/xcalib/<insert name of profile here>"

Restart X by logging out and logging back in, or typing sudo /etc/init.d/gdm restart and your Mac OS X color profile will load as X starts.

Battery

This is kind of irrelevant, the biggest obstacle to battery life is usage, and everyone uses it differently. However, on a similar usage pattern, battery life is 30% to 50% lower than on Mac Os X (3-4h instead of 6h).

Ethernet

Works without problems, but get crazy regarding the power management:

WARNING, this broke my wired connection, apply only if necessary.

sudo gedit /etc/modprobe.d/blacklist.conf

and add at the end of the file:

blacklist forcedeth

Reboot

Run

gksudo gedit /etc/default/grub

and change the line

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

to

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash reboot=pci"

Now, on the terminal run

sudo update-grub

Finally, ask the computer to shutdown, then complete the shutdown by pressing the power button during five seconds when the shutdown process is stuck, wait few more seconds until the hard drive stop spinning and power it on again. Now it should work normally.

Touchpad

Coming soon. This section will document a newish project that enables the multitouch functions fully, including two-finger click and drag.

$ sudo add-apt-repository ppa:mactel-support && sudo apt-get update
$ sudo apt-get install bcm5974-dkms xserver-xorg-input-synaptics

--

Additional notes on touchpad:

Works. Side vertical scrolling is enabled by default, but two-finger scrolling and horizontal scrolling can be enabled through the mouse preferences. Single click works as expected (tap or press); right click is a tap or press with two fingers, and middle click (paste) is a tap or press with three fingers, and click and drag is a tap/click and slide. Swiping works as well, three finger swipe up is "back", three finger swipe down is "forward".

The touchpad by default (as described above) uses 'tap-to-click'. 'tap-to-click' doesn't work well for many people because the touchpad is so large and it is easy to palm or graze the touchpad which can be quite distracting.

The easiest thing to do is simply disable 'tap-to-click'. Go to System/Preferences/Mouse, click the Touchpad tab, then uncheck 'Enable mouse click with Touchpad'. With this configuration, when doing click and drag operations you will have to lift your finger and reclick if you reach the edge of the touchpad.

This situation can be improved by using the xf86-input-multitouch driver and bcm5974-dkms kernel driver from the mactel PPA. The multitouch driver has no configuration at this time and you cannot disable 'tap-to-click' via System/Preferences/Mouse. People can try the one in ppa:jdstrand/ppa, which is the driver from the mactel ppa with #define use_tapping 0 set in src/memory.c (and on Lucid also with a backported mtdev library). Once 'tap-to-click' is disabled and the bcm5974 and multitouch drivers are enabled, click and drag operations become clicking and holding at the bottom of the touchpad with one finger, and then using another finger to perform the drag (eg, to move a window, put the cursor on the title bar, click and hold with your thumb and then use your index finger to move the window). One, two and three finger clicks all work as expected (ie, one finger = left click, two finger = right click and three finger = middle click).

To enable the multitouch drivers, run this in a console:

sudo apt-get install xf86-input-multitouch bcm5974-dkms

Then add this to xorg.conf:

Section "InputClass"
    MatchIsTouchpad "true"
    Identifier "Multitouch Touchpad"
    Driver "multitouch"
    MatchDevicePath "/dev/input/event*"
EndSection

Then reboot (so that the new bcm5974 kernel module is loaded and X is restarted).

Disable touchpad while typing

To disable touchpad when typing launch current command on login:

$ syndaemon -i 2 -t -d 

NOTE: In Lucid and later, xorg is partially configured via snippets in /usr/{lib,share}/X11/xorg.conf.d. In particular, the synaptics configuration may override your multitouch configuration if you put the above into the xorg.conf.d directory. To ensure that the multitouch configuration is not overridden, it is recommended that the above be added to the /etc/X11/xorg.conf file (usually created when configuring the nvidia driver, but can also be created to have only the above snippet) which takes precedence over the xorg.conf.d snippets. Some forums documentation suggests that the MatchDevicePath "/dev/input/event*" is not needed, but in practice if the xserver-xorg-input-all package is installed (the default in Ubuntu) the synaptics driver could be picked up instead (as seen in /var/log/Xorg.0.log). The above snippet makes sure that the multitouch driver is loaded for all touchpad devices on the system.

FireWire

Works out of the box.

Video

You can enjoy 3D acceleration by using the nVidia proprietary driver which can be retrieved in the Ubuntu Additional Drivers menu. This operation will change the screen resolution appearing at every boot and shutdown of your laptop. If you want to get back the right resolution do as follow:

Install v86d

sudo apt-get install v86d

Edit GRUB configuration file

sudo gedit /etc/default/grub

Add to the line...

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

The following:

nomodeset video=uvesafb:mode_option=1280x800-24,mtrr=3,scroll=ywrap

If you already applied the previous modifications on this line you should get:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset video=uvesafb:mode_option=1280x800-24,mtrr=3,scroll=ywrap reboot=pci"

Close it and edit initramfs configuration file:

sudo gedit /etc/initramfs-tools/modules

Add at the end of the file,

uvesafb mode_option=1280x800-24 mtrr=3 scroll=ywrap

Close it and launch the following command,

echo FRAMEBUFFER=y | sudo tee /etc/initramfs-tools/conf.d/splash

Update GRUB,

sudo update-grub

Update initramfs,

sudo update-initramfs -u

--

Bug: There is a known issue with the video on this model. When watching video there may be lines when watching video. If you have this issue, please see Bug #681465 - nvidia-current - Video has horizontal lines on Nvidia GeForce 320M which affects both nvidia-current (closed source) and nouveau (open source).

regarding buggy display:

untested but: you may try downloading and compiling the latest nvidia drivers from their site, which includes kernel module and libraries. The ubunutu package I have gives me a splash that says "beta" on the bottom. the version at nvidia is 260.19.29 for amd64.

You may also try compiling older drivers (256.x 19x.x). 260 and 256 drivers contain features specifically for GF100 "FERMI" nvidia GPU's, and the chip here is an older GT200 "TESLA" architecture chip so a 19x type driver could be worth trying if the newer drivers continue to have issues.

Lucid packaged a 192.x driver, so you can check to see if the bug is present on lucid for this macbook.

using nvidia's driver will mean that you have to recompile the display driver every time there is a kernel upgrade. That can be automated with a script placed in /etc/kernel/postinst.d:

#/bin/sh

#symlink to driver, wherever,

DRIVER=/external_sw/src/nvidia/nvidia-driver 
                            
if [ -e /lib/modules/$1/kernel/drivers/video/nvidia.ko ] ; then
    echo "NVIDIA driver already exists for this kernel." >&2
else
    echo "Building NVIDIA driver for kernel $1" >&2
    sh $DRIVER --ui=none --accept-license --no-questions --no-nouveau-check --force-update -k $1  2>1 > /var/log/nvidia_istallation_output.log

    if [ -e /lib/modules/$1/kernel/drivers/video/nvidia.ko ] ; then
        echo "   SUCCESS: Driver installed for kernel $1" >&2
    else
        echo "   FAILURE: See /var/log/nvidia-installer.log" >&2
    fi
fi

exit 0

this is not my script, but I cannot find who to credit. check the options of the nvidia-driver script to ensure they are right and function correctly.

if you don't mind proprietary solutions (and you don't, if you are using an nvidia driver) you could consider a free version of software which applies security patches to the running kernel without the need for a kernel installation or reboot, leaving only non-security kernel upgrades to worry about. I think it's inappropriate to name a product but it's easy to find.

HFS+

  • Read Only: Confirmed working out of the box.
  • Read/Write: It is necessary to disable journal:
    1. Login macos and open a terminal.
    2. Identify the partition.
    3. Run diskutil to disable journaling.

$ mount
/dev/disk0s2 on / [...]
$ sudo diskutil disableJournal force /dev/disk0s2
Journaling has been disabled for volume [...] on disk0s2

Keyboard

If you want to invert the Control and Command keys to have the same configuration as Mac OS X you can create the following file:

# gedit ~/.xmodmap

and copy the following into it

!
! xmodmap script to swap right control & right command key
!

! remove both keycodes (to which Control_L & Super_L is attached)
!     from previous modifier map
remove control   = Control_L
remove mod4      = Super_L Hyper_L

! swap keysyms
keysym Control_L = Super_L Hyper_L
keysym Super_L   = Control_L

! re-add both keycodes to respective modifier maps
add    control   = Control_L
add    mod4      = Super_L Hyper_L

! ***** end of source *****

Close this file. Now you can activate it with

# xmodmap ~/.xmodmap

Next time you will boot and get to the desktop you will have to choose if this configuration has to loaded at every boot.

External Monitor

Nouveau drivers (which ship with Ubuntu by default) do not support external monitor Bug #681555. For external monitor to work, the nVidia binary driver needs to be installed (System > Administration > Additional Drivers).

With the latest nVidia drivers installed, the Mini Display Port and adapters work out of the box.

To enable a cycle displays function (which is handy if you do a lot of presentations) you can use disper and a small script to switch through the modes "LCD/External/extend over LCD+Ext./Clone"

Install disper:

sudo add-apt-repository ppa:disper-dev/ppa
sudo apt-get update && sudo apt-get install disper

create a script called /usr/bin/display_mode_switcher.sh

status_folder="~/.display_mode_switcher/"
status_file_name="status.txt"
status_file=$status_folder$status_file_name
if (cat $status_file); then
 echo "Swtichting display mode.."
else
 echo "No status file found. Creating "$status_file
 mkdir -p $status_folder
 echo "0" > $status_file
fi

status=$(cat $status_file)
if [ "$status" -eq "0" ]; then
 echo 1 > $status_file
 disper -s
elif [ "$status" -eq "1" ]; then
 echo 2 > $status_file
 disper -S
elif [ "$status" -eq "2" ]; then
 echo 3 > $status_file
 disper -e
elif [ "$status" -eq "3" ]; then
 echo 0 > $status_file
 disper -c
else
 echo 0 > $status_file
 disper -s
fi

make the script executable for everyone

sudo chmod ugo+rx-w /usr/bin/display_mode_switcher.sh

If you have compiz running use "CCSM->commands" to assign display_mode_switcher.sh to Fn+F3. Alternatively you can use "System->preferences->keyboard shortcuts" or add it to .xmodmap as explained in the keyboard section.

Wireless

In the Ubuntu Additional Drivers menu you can choose a wireless driver. There is a free and a proprietary driver. The proprietary driver is known as working, also with WPA2. You can have difficulties to activate it before general updates have been performed so manage to get a wired connection to make this initial updates:

sudo apt-get update
sudo apt-get dist-upgrade

Free

Haven't tried this yet.

Proprietary

The proprietary driver currently yields high latency and low bandwidth due to power management problems but there are two workarounds for this issue. Turning off power-management and compiling the latest Broadcom drivers.

Note: Although some report success with either of these solutions independently, user bdentremont finds that the Ubuntu current driver (from package kcmwl-kernel-source, v. 5.60.48.36) is not responsive to the iwconfig state nor is the new driver entirely satisfactory on battery. Rather, installing the latest (5.100.82.38) driver, as detailed in the second solution, improves responsiveness to Ubuntu's desired power management state, improving wireless when plugged-in by default. While performance on battery remains poor by default, it can now be improved by issuance of the iwconfig command as outlined in the first solution.

Turn off power-management

The default power management state was causing frames to be dropped which in turn caused very high latency. I addressed this by turning off power management on the wireless interface. This probably has a negative effect on battery life but I would prefer a network connection that performs well.

You can disable power management manually by running the following command:

/sbin/iwconfig eth1 power off

REMEMBER: You have to unplug the power cable before using the command given above, because it'll automatically switch to the default power management state after unplug or plug the power cable. The script below will also only work, if you boot your system only with battery.

You can automate this by placing a script named wireless in /etc/pm/power.d:

!/bin/sh
# /etc/pm/power.d/wifipower
# Matt's Macbook Pro 7,1 wifi power adjuster
#
# I've found that turing off power management fixes performance problems with the
# BCM4322 802.11a/b/g/n Wireless Controller found in the Macbook Pro 7,1
#

/sbin/iwconfig eth1 power off

Make sure to make the script executable:

sudo chmod +x /etc/pm/power.d/wifipower

Compile latest Broadcom Drivers

If you would like to have a stable connection w/out the downside of more power-consumption, you have to compile the latest Broadcom driver. The latest driver is much more efficient than the older one. You will get a stable connection, less disconnects and much more throughput. As written in the Readme.txt, you have to download the latest driver from the Broadcom homepage, compile it and copy it to the kernel-specific destination.

Download the latest driver here and save it to your prefered location. Separate source code is available for 32-bit and 64-bit. Instructions below have been tried for both (note the difference in tarball name for 64-bit).

Now "cd" to that location (here "dev") and extract the package.

cd dev
tar -xvzf hybrid-portsrc_x86_32-v5_100_82_38.tar.gz
cd hybrid

and compile the driver.

make

Finaly, we have to rmmod the current module, copy the new one to the destination and load it.

cp wl.ko /lib/modules/`uname -r`/updates/dkms/wl.ko.new
cd /lib/modules/`uname -r`/updates/dkms/
rmmod wl
mv wl.ko wl.ko.orig
mv wl.ko.new wl.ko
depmod
modprobe wl

Wifi will work a few seconds after loading the wl module. You will have to repeat that workaround with every kernel-update!

Bluetooth

Works after installing bluetooth package from mactel PPA repository. Restart after install to get bluetooth working.

sudo apt-get install btusb-dkms

Webcam

The Webcam, which is called iSight, works out of the box. You can test it using cheese or any other of your choice.

Sound

From the terminal, type:

   gksudo gedit /etc/modprobe.d/alsa-base.conf

Add the following line to the end of the file.

   options snd-hda-intel model=mbp55

Save and close the file, then reboot.

Front speakers is initially muted and need to be unmuted,

alsamixer

Then use the key M to mute/unmute the channels front speaker and surround. You can also mute S/PDIF and S/PDIF-D channels if you don't use a digital cable, this will save battery.

My alsamixer settings were not restored after reboot. This caused the S/PDIF to come back in an enabled state after every boot. To make it stay off I did the following:

Muted S/PDIF using alsamixer

Issued the following command:

sudo /sbin/alsactl store 0

Then I added a new startup application using Startup Applications under the System -> Preferences menu. I used the following settings in Startup Applications Preferences:

Click Add
Name: Restore Alsa State
Command: /sbin/alsactl restore
Comment: Turn off Optical Out

Now the optical audio out will turn off when you login.

Microphone

The microphone is muted out of the box. Go to System-->Preferences-->Sound-->Input and either move the slider to 100%. You can snap your finger or speak in front of your laptop to see the capture bar moving and adjust it if needed.

If you are using skype, don't forget to turn off automatic volume adjustment in skype program: Options > Sound Devices > Allow Skype to automatically adjust my mixer levels

Note: On the 13 inch MacBook Pro, there is only one 3.5 mm jack, gathering stereo and microphone functionality. If you are using an iPhone headset, the sound output will be switched to the headset automatically, but the headset microphone will not work. The microphone integrated in the computer chassis is the only option at the moment.

Apple Remote Control

For my purposes I have this mostly working. I can move forwards and backwards through a presentation and start/stop video etc. The setup steps for previous versions helped in getting there, as did the LIRC documentation.

Firstly install and setup the Infrared Remote Control:

sudo apt-get install gnome-lirc-properties

I actually found that installing this through the Ubuntu Software Center worked, whilst trying to do it on the command line didn't for me. Once it's installed start it from System > Preferences > Infrared Remote Control. The setup options are somewhat obvious and the Auto-Detect worked for me.

To confirm that everything is working open a terminal and run irw. Pressing remote buttons should give output like:

user@user-laptop:~$ irw
0000000087ee8107 00 FORWARD Apple_A1156
0000000087ee810d 00 VOLDOWN Apple_A1156
0000000087ee810d 01 VOLDOWN Apple_A1156
0000000087ee8108 00 BACKWARD Apple_A1156
0000000087ee810b 00 VOLUP Apple_A1156
0000000087ee810d 00 VOLDOWN Apple_A1156
0000000087ee810d 01 VOLDOWN Apple_A1156
0000000087ee8102 00 MENU Apple_A1156
0000000087ee8104 00 PLAY Apple_A1156

Now, for my purposes I wanted to bind these buttons to keyboard actions. Right and Left keys work fine for cycling through a presentation, space for play/pause in VLC etc. To achieve this I installed irxevent:

sudp apt-get install irxevent

This needs to be running for the events to be captured so I set it up to start at system startup. For the inital testing I just started it in a terminal.

The last step is to create a ~/.lircrc file to configure the remote actions. In the end my ~/.lircrc file ended up looking like this:

begin
    prog = irxevent
    button = PLAY
    config = Key space CurrentWindow
end

begin
    prog = irxevent
    button = FORWARD
    config = Key Right CurrentWindow
end

begin
    prog = irxevent
    button = BACKWARD
    config = Key Left CurrentWindow
end

begin
    prog = irxevent
    button = MENU
    config = Key Escape CurrentWindow
end

This doesn't do anything with the volume buttons, but I haven't looked into that yet and it shouldn't be too hard.

If you want to know what the key events are look at the local file here.

If you want the buttons to control specific applications you need to look into setting up irexec.


CategoryMac




IconsPage/users.png
Please update this page, if you have figured out anything, that is not mentioned here!



IconsPage/users.png
The MactelSupportTeam is about to restructure and reorganize the documentation for Intel-based Macs. If you are interested in helping, please visit our team page for information. For all Mactel wikis, there is a starting place here. There is also a thread about planning the Mactel docummentation going on.




CategoryMac CategoryHardware CategoryXwindowSystem

MacBookPro7-1/Maverick (last edited 2013-12-14 02:45:11 by knome)