Skip to topic | Skip to bottom
Home
Main
Main.LinuxHardwareInfoAppleiMac24r1.67 - 30 Apr 2008 - 21:40 - PeterKnaggstopic end

Start of topic | Skip to actions

Apple iMac24

This page is about running Ubuntu on the Apple iMac24 MA456LL (released in September 2006), from the point of view of a Linux user.

It seems to be a good hardware design if you're looking for a very quiet (the various fans are hard to hear), fairly portable (lightweight) desktop machine with a good screen, and have no interest in upgrading the curious-looking hardware. The only upgrade available in the Apple retail stores is to have 2GB memory installed instead of the default 1GB (the upgrade to 3GB memory and the graphics card upgrade are only available "online"). The packing in which the machine is shipped is very well designed, making it convenient for occasionally moving the machine from one place to another.

Apple's pre-installed operating system takes some getting used to, but once you've installed the X11 package (from the included Apple OSX software DVD), enabled "focus-follows-mouse" by typing the following incantation into a Terminal window:

   defaults write com.apple.x11 wm_ffm true
enabled the ssh server (find the checkbox somewhere under the System Preferences for Network), and installed your favorite Free Software applications using the convenient disk images from here, you'll begin to feel a little more at home.

But if you're here, you already know there's no substitute for Free Software, so this page is about using Ubuntu (a GNU/Linux distribution of Free Software) on the iMac.

To display the partitions on your hard drive, the Apple OSX command to use is as follows:

  diskutil list

An introduction to Open Firmware and the Apple boot loader can be found here, thanks to Amit Singh.

Update: Installing Ubuntu Gutsy Gibbon 7.10 on the Apple iMac24

This time around, I partitioned the entire internal drive using the Ubuntu installer. I removed Max OSX completely, as I hadn't been using it while Ubuntu Feisty Fawn was on the machine. Now that Ubuntu is the only operating system on the machine, the system sounds a loud startup musical chord, then takes around 20 seconds (while the screen stays entirely lit in an eery whiteish blue) before it gets into grub. This is quite a lot longer than it used to take. Pressing the D key (to tell the Open Firmware to boot from disk) seems to help speed things up.

Bluetooth in Gutsy

The bluetooth keyboard and mouse now work properly after a reboot, as compared to Ubuntu 7.04. To get them working, I clicked on the gnome Bluetooth Applet (right-click on the blue icon on the top panel, choose Preferences) and my keyboard and mouse now show up in the list of "Bonded devices". To get them to be automatically enabled at boot time, I clicked on the "Add Trust" button (which then puts a little blue "i" icon to the right of the listing, and changes the button text to "Remove Trust"). After that, rebooting finds the keyboard and mouse without any need to switch off and on the keyboard any more.

Audio in Gutsy

The audio patch to alsa unfortunately didn't make it into Ubuntu 7.10 (as of kernel 2.6.22-14). The patch has been incorporated into alsa sources as of alsa-driver-1.0.15rc1, so it will probably be in the next Ubuntu release. The alsa source changes also include work to handle suspend and resume, so that will be something to look forward to.

In the meantime, I used nicfagn's patch (the same patch that worked with Feisty), but the steps to build it are a bit longer:

  sudo apt-get install build-essential fakeroot linux-source
We should now have the linux sources installed, as package linux-source-2.6.22.

There's quite a few steps. Overall, we have to unpack and patch the kernel sources, then set up a configuration file to build them with.

Let's start by unpacking the kernel sources, as follows:

  cd $HOME
  tar jxvf /usr/src/linux-source-2.6.22.tar.bz2
  cd $HOME/linux-source-2.6.22

Now we set up the kernel build configuration file and enable the SND_HDA_INTEL module, as follows:

  cat /boot/config-2.6.22-14-generic|sed 's/# CONFIG_SND_HDA_INTEL is not set/CONFIG_SND_HDA_INTEL=m/' > .config

Next, we patch the kernel driver sources for the snd-hda-intel.ko module:

  cd $HOME/linux-source-2.6.22/sound/pci/hda/
  wget http://www.penlug.org/twiki/pub/Main/LinuxHardwareInfoAppleiMac24/udiff-patch_realtek.txt
  patch < udiff-patch_realtek.txt

We're now ready to launch the kernel build, as follows. Perhaps there's a shortcut, as we only really need to build one module (snd-hda-intel.ko in this case). The machine is very speedy so building the entire kernel package doesn't take too long (less than half an hour).

  cd $HOME/linux-source-2.6.22
  fakeroot make-kpkg --initrd kernel_image modules_image

Once the kernel build has completed, all we need is the snd-hda-intel.ko module. Since the $HOME/linux-source-2.6.22/Makefile has the setting "EXTRAVERSION = .9", we can find the module and copy it into the kernel modules directory as follows:

  cd $HOME/linux-source-2.6.22/debian/linux-image-2.6.22.9/lib/modules/2.6.22.9/kernel/sound/pci/hda/
  cp /lib/modules/$(uname -r)/ubuntu/media/snd-hda-intel/snd-hda-intel.ko snd-hda-intel.ko_safe
  sudo cp snd-hda-intel.ko /lib/modules/$(uname -r)/ubuntu/media/snd-hda-intel

Now we need to install the module. The steps to do this are similar to those shown in the Audio section for Feisty below, basically:

  sudo killall mixer_applet2

  sudo rmmod snd_hda_intel
  sudo rmmod snd_hda_codec
  sudo rmmod snd_pcm_oss
  sudo rmmod snd_mixer_oss
  sudo rmmod snd_pcm
  sudo rmmod snd_seq_dummy
  sudo rmmod snd_seq_oss
  sudo rmmod snd_seq_midi
  sudo rmmod snd_rawmidi
  sudo rmmod snd_seq_midi_event
  sudo rmmod snd_seq
  sudo rmmod snd_timer
  sudo rmmod snd_seq_device
  sudo rmmod soundcore
  sudo rmmod snd
  sudo rmmod snd_page_alloc
  sudo rmmod soundcore

  sudo modprobe snd_hda_intel

Audacity Export as mp3 in Gutsy

You may be wondering where the option to export a project as an mp3 file has gone to now in Gutsy: you need to click on the "Browse for other folders" and click on the "WAV, AIFF, and other uncompressed types" to find the "MP3 Files" option. Then the "Options..." button will show the usual mp3 export options, and clicking the Save button will save the project as an mp3.

Graphics in Gutsy

After enabling the restricted drivers for the Nvidia card, you'll notice that the new Compiz Fusion is enabled by default. It's remarkably stable, compared to Compiz in Feisty, although it interferes with xvmc video playback, so you may prefer to disable it by adding the following line to $HOME/.gnomerc to select the (previously default) metacity window manager. It's somewhat surprising that there isn't a menu option to switch back to the metacity window manager (as there was in Beryl):
  export WINDOW_MANAGER=metacity

Remember to install the settings manager:

  sudo apt-get install compizconfig-settings-manager
The System -> Preferences -> Advanced Desktop Effects Settings is similar to the Beryl settings manager: you can enable and customize lots of effects, as well as learn the keyboard and mouse shortcuts used to invoke the effects. Curiously, the "Exposé" effect (where all of your cluttered windows are neatly "tiled" over the full screen, allowing you to easily pick the one you're looking for) has been renamed to the "Scale" plugin, with the default key binding Shift Alt UpArrow. There is a new effect called "Expo" which shows all of your virtual desktops so that you can quickly pick the one you want. The "Shift Switcher" plugin is a new one, using Apple Tab in a similar way to to how you can use Alt Tab to cycle through your windows, showing them in a sort of 3D gallery. Nice.

The infamous "Black Window Bug" (see the nVidia5200 page) has been fixed in the nVidia kernel module revision 100.14.19 in Ubuntu 7.10 Gutsy Gibbon, which is a nice improvement. The dmesg output shows the nVidia kernel module revision number:

 nvidia: module license 'NVIDIA' taints kernel.
 NVRM: loading NVIDIA UNIX x86_64 Kernel Module  100.14.19  Wed Sep 12 14:08:38 PDT 2007

Framebuffer in Gutsy

For Ubuntu 7.10 (Gutsy Gibbon), the framebuffer is not properly configured to support VESA by the Ubuntu installer, so we need to do a few manual steps.

Basically, just add the following two lines to the /etc/initramfs-tools/modules (the set of modules included in the initial ramdisk) configuration file.

fbcon
vesafb

Then run this command to rebuild the initial ramdisk:

sudo update-initramfs -u

Also, edit /etc/modprobe.d/blacklist-framebuffer and comment out the line blacklisting vesafb so that it will actually be loaded into the kernel during boot:

#blacklist vesafb

Edit /boot/grub/menu.lst and add the following line.

# defoptions=vga=0x346

Run the following command to update the kernel boot line in the grub configuration file:

sudo update-grub

After reboot, you should now see the full boot messages, and have a nice high resolution console font to work with on your virtual terminals (Ctrl Alt F1 through Ctrl Alt F6, Ctrl Alt F7 is where xorg is running). The console is particularly good for reading manual pages.

For more details on framebuffer support with uvesafb (which is a lot faster than vesafb) in the upcoming Ubuntu 8.04 (Hardy Heron), see here.

Jabber in Gutsy

There's a bug in pidgin that prevents XMPP protocol (Jabber) connections from being able to log in. A workaround: If you enter your password in the "Password:" field of the "Basic" tab on the "Modify Account" dialog, and check the "Remember password" box, and save, then pidgin works OK with XMPP (Jabber). The password is stored in the pidgin ~/.purple/accounts.xml configuration file. The bug is fixed in Ubuntu 8.04 (Hardy Heron).

There's also a bug in kopete which prevents outbound conversations from being established, although inbound conversations work fine.

xterm in Gutsy

There seems to be a bug in libXt when running xterm in Gutsy when compiz-fusion is enabled. If you have
*saveLines:     100000
*scrollBar:     true
in your $HOME/XTerm file, xterm occasionally segfaults. A workaround (which still keeps the savelines) is to remove the scrollBar entry.

How I Didn't Install Ubuntu

I didn't have any success (thus far) in trying to boot Ubuntu from an external firewire or USB drive (using elilo and rEFIt), but I did learn that the Apple OSX command to properly partition an external drive goes like this (e.g. for a 114GB drive), assuming you want only one Linux partition and one swap partition:
  diskutil partitionDisk disk1 2 GPTFormat Linux Linux 113G Swap Swap 1G

The result of the above command is as follows:

Started partitioning on disk disk1
Creating Partition Map
 5% ..Formatting Disk                                                                      100% ..
Finished partitioning on disk disk1
/dev/disk1
   #:                   type name               size      identifier
   0:  GUID_partition_scheme                    *114.5 GB disk1
   1:                    EFI                    200.0 MB  disk1s1
   2:   Microsoft Basic Data                    113.0 GB  disk1s2
   3:             Linux Swap                    1.3 GB    disk1s3

Installing Ubuntu

I installed Ubuntu (the Desktop edition for "64bit AMD and Intel computers" ubuntu-7.04-desktop-amd64.iso) on the internal drive instead, using Apple's Microsoft operating system oriented installer called Bootcamp. I'm not sure yet if using Bootcamp is even really necessary for installing Linux, or if I could have just resized the Apple OSX partition of disk0 manually using something like this from an Apple OSX terminal:
  diskutil list
  diskutil resizeVolume /dev/disk0s2 230G   Linux Linux 10G   Swap Swap 1G

Anyways, using Bootcamp was very straightforward, I just followed the Ubuntu 7.04 section of this page. Beware: don't be tempted to use fdisk, as it's not aware of the GPT partition type that the Apple operating system used to partition the internal drive. Just use Ubuntu's graphical partitioning tool from the installer, as described. We're only able to have four primary partitions and no extended partitions, so I used the /dev/sda3 partition as my Ubuntu root partition. At the moment (due to mistakenly using fdisk) I don't have any swap partition, not sure if it would be possible to get hibernate to work by using an external drive for swap.

After installing Ubuntu into the partition in the usual way, to boot into Ubuntu will now involve powering on the iMac while holding down the Option key (marked with alt Option the iMac 24, and with the symbol ⌥ on other Apple keyboards), and then selecting the disk icon labeled Windows. There's unfortunatly no way to change the default boot option. Holding down the Alt key does not work to boot into Ubuntu if you're using a non-Apple keyboard.

Graphics (nVidia GeForce 7300 GT)

The 3D accelerated graphics can be made to work in Ubuntu 7.04 using the proprietary nVidia drivers. To get the graphics working, you open the Restricted Drivers Manager and enable them, then edit the file /etc/X11/xorg.conf and add in the screen's 1920x1200 resolution in the Screen section's Display section for Depth 24, as follows:
        SubSection "Display"
                Depth   24
                Modes           "1920x1200" "1024x768"  "800x600"       "640x480"
        EndSubSection
For high definition video playback using XvMC, there's a few more details, just follow the steps from my nVidia page, they work exactly the same on this nVidia 7300 GT graphics card (with 128MB of GDDR3 SDRAM, using a PCI Express interface) as they do on the older nVidia 5200 card, albiet with considerably more speed.

The Beryl workaround of using Copy Rendering Path for the infamous nVidia black window bug appears to work fast enough, unlike on the nVidia 5200 card where it slows Beryl down too much to be really practical.

Display power management works properly in Ubuntu, so you can set the screen to power down (turns off the backlight, so the screen is completely black) after a set time by going into the System -> Preferences -> Screensaver and clicking on the Power Management button and dragging the slider labeld Put display to sleep when inactive for: to whatever setting suits your needs.

Audio

When booting the iMac from the Ubuntu 7.04 desktop live CD, the audio from the headphone output is very faint and almost inaudible. This Ubuntu Forums thread and launchpad bug and upstream alsa bug (login as guest to view) describe how to get the audio working.

Using the patch kindly posted by nicfagn in the above thread, the headphones, the digital optical output and the builtin speakers work just fine (unplugging the headphones switches on the internal speakers, a very nice touch). The steps I used to test the patch were as follows:

  sudo apt-get install libc6-dev
  cd $HOME
  wget ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.14.tar.bz2
  tar jxvf alsa-driver-1.0.14.tar.bz2

  cd $HOME/alsa-driver-1.0.14/alsa-kernel/pci/hda
  wget http://www.penlug.org/twiki/pub/Main/LinuxHardwareInfoAppleiMac24/udiff-patch_realtek.txt
  patch < udiff-patch_realtek.txt

  cd $HOME/alsa-driver-1.0.14
  ./configure --with-cards=hda-intel
  make

Then I needed to unload the sound modules:

fuser /dev/snd/*
Then kill the mixer_applet2 as follows (and also use kill -9 to kill any other process that's using any of the /dev/snd/* devices):
  sudo killall mixer_applet2
This pops up a message like this:
"Volume Control" has quit unexpectedly
If you reload a panel object, it will automatically
be added back to the panel
                       [Don't Reload]  [Reload]
Don't click anything yet, just leave the popup there, and unload all of the alsa modules:
sudo rmmod snd_hda_intel
sudo rmmod snd_hda_codec
sudo rmmod snd_pcm_oss
sudo rmmod snd_mixer_oss
sudo rmmod snd_pcm
sudo rmmod snd_seq_dummy
sudo rmmod snd_seq_oss
sudo rmmod snd_seq_midi
sudo rmmod snd_rawmidi
sudo rmmod snd_seq_midi_event
sudo rmmod snd_seq
sudo rmmod snd_timer
sudo rmmod snd_seq_device
sudo rmmod soundcore
sudo rmmod snd
sudo rmmod snd_page_alloc
sudo rmmod soundcore

sudo cp -pr /lib/modules/$(uname -r) /lib/modules/$(uname -r)_safe

cd $HOME/alsa-driver-1.0.14
sudo make install-modules

sudo modprobe snd_hda_intel

Now click on the [Reload] button from the earlier popup, to reload the volume control tool back into the panel. Attached the contents of /proc/asound/card0/codec#0 for reference.

The little remote control can now be used to adjust the master volume control in the mixer, by pressing the + and - markings (on the top and bottom of the little circle, in case they've been rubbed off from overuse).

Recording from the built-in microphone at the top of the screen is easiest to do using audacity, after selecting Front Mi (front microphone) using alsamixer -V all, then click on the red circular "record" button in audacity.

  alsamixer -V all
  apt-get install audacity

Using

The Apple manual says that the headphone jack can be used as an optical digital audio output port. Apparently, Sony has been putting this kind of non-standard headphone plug (which has a lens in it) into their minidisc recorders. The headphone jack is described as being an S/PDIF stereo 3.5 mini-phono jack, but this description can be somewhat confusing if you're used to hooking up the S/PDIF inputs to your receiver using just plain mono electrical audio cables ending in a mono RCA plug. Since a single connector is provided to support both the headphone output and the optical digital output connectivity, support of the headphone output and the optical digital output is mutually exclusive. The name of the connector is "Mini-TOSlink", usually you can find optical cables which have a Mini-TOSlink plug on one end and a TOSlink plug on the other end, or you can use a plain TOSlink cable in combination with a TOSlink to Mini-TOSlink converter (the L71BA one, TOS (F) - 3.5mm (M)), or similar. Audio output port selection is automatic. When no device is connected to the output jack, the internal speakers are selected. When an optical cable is connected to the output jack, the optical digital output is selected. When an analog device is connected to the output jack, the headphone output is selected. It is supposedly not possible to simultaneously select or use more than one of these outputs.

The digital optical output works with the above patch in Ubuntu. I tested AC3 passthrough by connecting from the headphone outical output (via a TOSLink cable with a Mini-TOSLink adapter) to the OPT TV/SAT [1] TOSLink input of a Pioneer VSX-D711 receiver.

Playback of a DVD with AC3 passthrough with mplayer worked fine using the -ao alsa -ac hwac3 flags.

To get AC3 passthrough working with xine, I added to the xine configuration file ($HOME/.xine/config) the following line:

audio.output.speaker_arrangement:Pass Through

For music playback via xmms, the default is for the internal speaker to remain active, in addition to the digital optical output, which is convenient. It's also possible to go into the xmms Options -> Preferences and select the ALSA 1.2.10 output plugin [libALSA.so] and click the Configure button, and select HDA Intel: ALC882 Digital (hw:0,1) to have only the digital output enabled.

Wireless keyboard (bluetooth)

The wireless keyboard and mouse combo works in Ubuntu 7.04, thanks to the Ubuntu documentation here and here and here as well as these pages: here and here. The PIN (passcode) for the Mighty Mouse is 0000 here on the Apple support site.

Update: for Ubuntu 8.04 (Hardy Heron) the hidd has been removed, so instead follow this guide to get the mouse and keyboard working.

Look in /var/lib/bluetooth/*/names for the bluetooth addresses of your keyboard and mouse, let's say they're KK:KK:KK:KK:KK:KK and MM:MM:MM:MM:MM:MM respectively. To configure them initially, use these commands.

dbus-send --system --type=method_call --print-reply --dest=org.bluez /org/bluez org.bluez.Manager.ActivateService string:input
dbus-send --system --type=method_call --print-reply --dest=":1.10" /org/bluez/input org.bluez.input.Manager.CreateDevice string:KK:KK:KK:KK:KK:KK
dbus-send --system --type=method_call --print-reply --dest=":1.10" /org/bluez/input/keyboard0 org.bluez.input.Device.Connect
dbus-send --system --type=method_call --print-reply --dest=":1.10" /org/bluez/input org.bluez.input.Manager.CreateDevice string:MM:MM:MM:MM:MM:MM
dbus-send --system --type=method_call --print-reply --dest=":1.10" /org/bluez/input/pointing1 org.bluez.input.Device.Connect

You may need to add the following lines to just before the exit 0 at the end of /etc/init.d/bluetooth (to reset the hci0 device):

  sleep 1 && /usr/sbin/hciconfig hci0 reset
  sleep 1 && /usr/sbin/hciconfig hci0 reset

Then after a reboot, you only need to issue the following command, to get the keyboard to connect. Since the mouse connects happily all by itself after the above commands, one way to get the keyboard to connect would be to enable gdm auto-login, add the following command to a script, then launch the script from a button.

dbus-send --system --type=method_call --print-reply --dest=":1.10" /org/bluez/input/keyboard0 org.bluez.input.Device.Connect

To enable gdm auto-login, just add your username to the [daemon] section of /etc/gdm/gdm.conf-custom configuration file. This is obviously insecure, as no password screen will be presented by gdm, but then anyone can achieve a similar result by inserting an Ubuntu live CD into the slot and rebooting the system.

[daemon]
AutomaticLoginEnable=true
AutomaticLogin=your_username

I also tried using this guide on Ubuntu 8.04 (Hardy Heron), but although it does allow the keyboard to be recognized after booting, the result on the iMac24 was that (if the machine doesn't crash outright) the keyboard tended to randomly miss or repeat keystrokes. The easiest way to test that the effect was occurring was to pause for a second, then quickly press the same key three times. The result was that often only one or two keystrokes would be seen, instead of all three. The symptom also seems to affect the mouse, making it "stagger" instead of moving smoothly.

It might be useful to install the following package, which contains the bluetooth manager for the gnome desktop:

  sudo apt-get install bluetooth bluez-gnome

After installing the bluez-gnome package, restart your desktop session by logging out and logging back in again. This will automatically start the bluetooth applet, which will help you enter the PIN during the bluetooth pairing process. The default PIN for the mouse is 0000.

I found that I needed to switch the mouse and keyboard off then on again for them to work using the bluetooth driver:

  sudo invoke-rc.d bluetooth restart

You can view the output of the command hcitool dev which will give you a listing of Bluetooth devices on your computer, e.g.:

Devices:
        hci0    00:19:E3:EB:D7:A7

You can see more details using hciconfig which looks something like this:

hci0:   Type: USB
        BD Address: 00:19:E3:EB:D7:A7 ACL MTU: 384:8 SCO MTU: 64:8
        UP RUNNING PSCAN ISCAN 
        RX bytes:1389257 acl:84355 sco:0 events:132 errors:0
        TX bytes:1334 acl:41 sco:0 commands:44 errors:0

Then to find the device address of the mouse, I turned the mouse off then on again using the switch that looks like a lens cover (under the mouse) and then I used the following commands:

  hciconfig hci0 up
  hcitool scan

This should show the device address, as follows:

Scanning ...
        MM:MM:MM:MM:MM:MM       Mighty Mouse

You can now retrieve more info about the mouse, using:

  sudo hcitool info MM:MM:MM:MM:MM:MM

this should show something like:

Requesting information ...
        BD Address:  MM:MM:MM:MM:MM:MM
        Device Name: Mighty Mouse
        LMP Version: 1.2 (0x2) LMP Subversion: 0x314
        Manufacturer: Broadcom Corporation (15)
        Features: 0xbc 0x02 0x04 0x38 0x08 0x00 0x00 0x00
                <encryption> <slot offset> <timing accuracy> <role switch>
                <sniff mode> <RSSI> <power control> <enhanced iscan>
                <interlaced iscan> <interlaced pscan> <AFH cap. slave>

Now switch off and on the keyboard (using the switch on the back), and issue the command:

  hcitool scan

This should show the keyboard's device address:

Scanning ...
        KK:KK:KK:KK:KK:KK       Peter Knaggs’s Keyboard

Again, you can fetch the info about the keyboard using:

  sudo hcitool info KK:KK:KK:KK:KK:KK

The above command should show your keyboard something like this (note that it gives the name you used for your keyboard when you initialized it under MAC OSX):

Requesting information ...
        BD Address:  KK:KK:KK:KK:KK:KK
        Device Name: Peter Knaggs’s Keyboard
        LMP Version: 1.1 (0x1) LMP Subversion: 0x7b00
        Manufacturer: Broadcom Corporation (15)
        Features: 0xbc 0x02 0x04 0x00 0x08 0x00 0x00 0x00
                <encryption> <slot offset> <timing accuracy> <role switch>
                <sniff mode> <RSSI> <power control> <AFH cap. slave>

You can connect one device using the command sudo hidd --search, but that will just connect the first device it happens to see. It's better, once you know the device addresses, to connect the keyboard and mouse using their addresses using the command:

  sudo hidd --connect KK:KK:KK:KK:KK:KK
  sudo hidd --connect MM:MM:MM:MM:MM:MM

After that, you should see in dmesg something like this:

  Bluetooth: HIDP (Human Interface Emulation) ver 1.2
  input: Apple Computer, Inc. Mighty Mouse as /class/input/input14
  input: Apple Wireless Keyboard as /class/input/input15

The top right key on the keyboard can now be used to eject the media from the optical drive, and the audio volume controls and audio mute control work from the keyboard. The key marked with the apple symbol acts as the Super key in Beryl. The mouse has a very good precise feel to it, although it takes a little while to get used to the idea that clicking the middle button is the same as clicking the mouse while your finger is on the little scroll wheel, because it feels like you're clicking the whole mouse.

The contents of /proc/bus/input/devices look as follows, for the keyboard and mouse:

I: Bus=0005 Vendor=05ac Product=030c Version=0200
N: Name="Apple Computer, Inc. Mighty Mouse"
P: Phys=00:19:E3:EB:D7:A7
S: Sysfs=/class/input/input14
H: Handlers=mouse3 event4 ts3
B: EV=100007
B: KEY=f0000 0 0 0 0
B: REL=143

I: Bus=0005 Vendor=05ac Product=0208 Version=0110
N: Name="Apple Wireless Keyboard"
P: Phys=00:19:E3:EB:D7:A7
S: Sysfs=/class/input/input15
H: Handlers=kbd event5
B: EV=120003
B: KEY=1000000000007 ff87207ac14057ff febeffdfffefffff fffffffffffffffe
B: LED=1f

The mouse is apparently also capable of horizontal scrolling. Edit your /etc/X11/xorg.conf to add the following:

# Added for Apple Wireless Mouse
Section "InputDevice"
        Identifier      "MightyMouse"
        Driver          "evdev"
        Option          "CorePointer"
        Option          "SendCoreEvents"        "true"
        Option          "Name"  "Apple Computer, Inc. Mighty Mouse"
        Option          "HWHEELRelativeAxisButtons"     "6 7"
        Option          "Buttons"       "8"
EndSection

and in the ServerLayout section, add the MightyMouse like this:

        Inputdevice     "MightyMouse"

Restart the graphical desktop by logging out and issuing the following command (if you're using the gnome display manager):

  sudo invoke-rc.d gdm restart

After that, you can use xev (place the mouse pointer inside the xev window), and see that scrolling the little ball to the left gives "button 6" and scrolling it to the right gives "button 7". Be careful, the defaults for these buttons 6 and 7 in firefox are to jump to the previous and next web pages.

You can change the default setting to scroll the page left and right using Firefox's about:config settings, by changing

mousewheel.horizscroll.withnokey.action   user set integer 2
mousewheel.horizscroll.withnokey.numlines user set integer -1
to
mousewheel.horizscroll.withnokey.action   user set integer 1
mousewheel.horizscroll.withnokey.numlines user set integer 1
To do this, double-click on the value you want to change, and a pop-up window will appear; enter the new value and press Return.

Squeezing the side buttons (quite strongly) gives "button 8". To configure this in Beryl to initiate the window picker effect, go into the "Beryl Settings Manager" and select "Window Management" and select the "Scale" plugin. Under the "Shortcuts" tab, edit the "Bindings" (by clicking on it) for the "Initiate Window Picker" event so that the "Mouse" column contains "Button8".

To get the bluetooth keyboard and mouse to be recognized after you reboot, you need to add hidp to /etc/modules like this:

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

fuse
lp
rtc
sbp2
hidp

and enable bluetooth in /etc/default/bluetooth by changing the HIDD_ENABLED setting to 1 instead of 0 (the default):

HIDD_ENABLED=1

You'll also need to add the device addresses to the HIDD_OPTIONS, like this:

HIDD_OPTIONS="--master --connect KK:KK:KK:KK:KK:KK --connect MM:MM:MM:MM:MM:MM --server"

See Ubuntu Bluetooth Setup page if you run into trouble. I found that after rebooting, it took a little while for the bluetooth mouse to be recognized, but I had to switch off and on the keyboard before it was recognized. Another approach recommended here is to not modify the HIDD_OPTIONS but instead to edit /etc/bluetooth/hcid.conf and add the device addresses there:

device KK:KK:KK:KK:KK:KK {
    name "Peter Knaggs’s Keyboard";
    auth enable;
    encrypt enable;
}
device KK:KK:KK:KK:KK:KK {
    name "Mighty Mouse";
    auth enable;
    encrypt enable;
}

This also works, although after reboot I still need to power off the keyboard and power it back on before it is recognized. After leaving the machine idle for a while, the mouse and keyboard go to sleep: typing a little is sufficient to wake the keyboard back up, and clicking the mouse is needed to wake it up (just moving the mouse isn't sufficient).

Remote Control

The little remote control does work in Ubuntu. By the way, there are little magnets inside the lower right-hand outside edge of the iMac, giving you a place to "hang" the little remote and a quick way to erase your floppy diskettes. You can replace the CR2032 lithium 3V coin battery if it runs out.

Wireless networking

Doesn't work by default. See here where it says: As of this writing the wireless card (Broadcom 4328, pciid 14e4:4328) is unsupported by bcm43xx, the Linux driver for Broadcom wireless cards. To work around this you will have to use ndiswrapper (the Ubuntu documentation for ndiswrapper is here).

Starting at the broadcom 43xx homepage, you can find links to the Ubuntu page in the documentation section. Comparing the lspci output to this page, it's not the same device number (the card version is 4328 instead of 4318), so probably needs some work.

To to use ndiswrapper, it might work by following this or this page.

For what doesn't work: See here for the output of installing the bcm43xx-fwcutter package, using the following command. It prompts you, asking whether you'd like to download the Broadcom firmware (because it can't be shipped as part of the package). Choose [Yes] to proceed. You can also archive the firmware link for the future.

  sudo wget http://boredklink.googlepages.com/wl_apsta.o
  sudo apt-get install bcm43xx-fwcutter

Loading the bcm43xx module doesn't have any effect, though, so let's blacklist the bcm43xx module to avoid any problems, by adding the line blacklist bcm43xx to the end of the file /etc/modprobe.d/blacklist as follows:

echo 'blacklist bcm43xx' | sudo tee -a /etc/modprobe.d/blacklist

OK, so let's instead try the ndiswrapper approach, following this page:

For both 64-bit Ubuntu installations (AMD64) and 32-bit Ubuntu installations (i386), download (from Dell's driver support pages) the R140746.EXE and run the following commands:

  sudo apt-get install ndiswrapper-utils-1.9
  mkdir ~/wireless-driver
  unzip ~/Desktop/R140746.EXE -d ~/wireless-driver
  cd ~/wireless-driver/DRIVER
  sudo ndiswrapper -i bcmwl5.inf
  sudo ndiswrapper -m

The above commands copy the driver into

  /etc/ndiswrapper/bcmwl5/bcmwl5.inf
  /etc/ndiswrapper/bcmwl5/bcmwl564.sys

and they also edit /etc/modprobe.d/ndiswrapper to add the line:

alias wlan0 ndiswrapper

Now if we load the module,

sudo modprobe ndiswrapper

it shows (from dmesg) the following kernel messages:

[14971.172329] ndiswrapper version 1.38 loaded (preempt=no,smp=yes)
[14971.187990] ndiswrapper (link_pe_images:577): fixing KI_USER_SHARED_DATA address in the driver
[14971.191248] ndiswrapper: driver bcmwl5 (Broadcom,10/12/2006, 4.100.15.5) loaded
[14971.191655] ACPI: PCI Interrupt 0000:03:00.0[A] -> GSI 17 (level, low) -> IRQ 17
[14971.191701] PCI: Setting latency timer of device 0000:03:00.0 to 64
[14971.209267] ndiswrapper: using IRQ 17
[14971.755963] wlan0: ethernet device xx:xx:xx:xx:xx:xx using NDIS driver: bcmwl5, version: 0x4640f05, NDIS version: 0x501, vendor: '', 14E4:4328.5.conf
[14971.756061] wlan0: encryption modes supported: WEP; TKIP with WPA, WPA2, WPA2PSK; AES/CCMP with WPA, WPA2, WPA2PSK
[14971.760666] usbcore: registered new interface driver ndiswrapper
[14971.770875] ADDRCONF(NETDEV_UP): wlan0: link is not ready

To check if it's loaded using ndiswrapper -l gives:

bcmwl5 : driver installed
        device (14E4:4328) present

sudo lshw -C network
shows
  *-network
       description: Ethernet interface
       product: 88E8053 PCI-E Gigabit Ethernet Controller
       vendor: Marvell Technology Group Ltd.
       physical id: 0
       bus info: pci@02:00.0
       logical name: eth0
       version: 22
       serial: xx:xx:xx:xx:xx:xx
       size: 100MB/s
       capacity: 1GB/s
       width: 64 bits
       clock: 33MHz
       capabilities: bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=sky2 driverversion=1.13 duplex=half firmware=N/A ip=130.35.48.184 latency=0 link=yes multicast=yes port=twisted pair speed=100MB/s
       resources: iomemory:8a300000-8a303fff ioport:1000-10ff irq:16
  *-network
       description: Wireless interface
       product: Broadcom Corporation
       vendor: Broadcom Corporation
       physical id: 0
       bus info: pci@03:00.0
       logical name: wlan0
       version: 03
       serial: xx:xx:xx:xx:xx:xx
       width: 64 bits
       clock: 33MHz
       capabilities: bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=ndiswrapper driverversion=1.38 firmware=Broadcom,10/12/2006, 4.100.15.5 latency=0 link=no multicast=yes wireless=IEEE 802.11g
       resources: iomemory:8a200000-8a203fff iomemory:8a000000-8a0fffff irq:17

You can use iwlist scan to see if any access points are available in your area. Also checking /proc/interrupts we see that the interrupt for the wireless wlan0 is not shared, which is a good thing:

           CPU0       CPU1
  0:    5784210          0   IO-APIC-edge      timer
  8:          0          0   IO-APIC-edge      rtc
  9:          0          0   IO-APIC-fasteoi   acpi
 14:     253306          0   IO-APIC-edge      libata
 15:          0          0   IO-APIC-edge      libata
 16:    3766662          0   IO-APIC-fasteoi   uhci_hcd:usb4, eth0, nvidia
 17:       1543          0   IO-APIC-fasteoi   wlan0
 18:          0          0   IO-APIC-fasteoi   uhci_hcd:usb3
 19:     355867          0   IO-APIC-fasteoi   uhci_hcd:usb2, ohci1394, libata
 22:       3827          0   IO-APIC-fasteoi   HDA Intel
 23:     106424          0   IO-APIC-fasteoi   uhci_hcd:usb1, ehci_hcd:usb5
NMI:          0          0
LOC:    5783089    5783077
ERR:          0

I've tested that open (non-WEP) wireless works fine (thanks to Deirdre and Rick's CABAL installfest). The iwlist wlan0 scan shows:

iwlist wlan0 scan
wlan0     Scan completed :
          Cell 01 - Address: 00:14:51:75:55:5B
                    ESSID:"deirdre"
                    Protocol:IEEE 802.11g
                    Mode:Managed
                    Frequency:2.412 GHz (Channel 1)
                    Quality:85/100  Signal level:-41 dBm  Noise level:-96 dBm
                    Encryption key:off
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s 
                    Extra:bcn_int=100
                    Extra:atim=0
...
          Cell 03 - Address: 00:03:93:E9:6E:1C
                    ESSID:"deirdre"
                    Protocol:IEEE 802.11g
                    Mode:Managed
                    Frequency:2.412 GHz (Channel 1)
                    Quality:42/100  Signal level:-69 dBm  Noise level:-96 dBm
                    Encryption key:off
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
                    Extra:bcn_int=100
                    Extra:atim=0

and I connected using:

  iwconfig wlan0 essid deirdre
  dhclient -d wlan0

For WEP, going into System -> Administration -> Network is a graphical way to configure the wireless when a WEP key is needed.

Wired networking

Works fine at 100 baseT and gigabit speeds. Note that the Ethernet port is auto-sensing and self-configuring, so you do not need a hub (or a cross-over cable) to connect it directly to another computer.

Firewire and USB

Connecting both external Firewire and USB devices works fine by default, tested with hard drives, a Canon FB630U USB scanner, a Kodak V1253 camera and with various USB flash memory devices.

The internal ATA hard drive can also be accessed using "Firewire Target Disk Mode" by holding down T when booting the iMac24, see here. Target Disk Mode only connects to the master ATA drive on the Ultra ATA bus. Essentially, your iMac24 becomes an external Firewire disk drive, and you can hotplug it into any machine which can access Firewire hard drives.

Virtualization Support

The /proc/cpuinfo does show the lm (long mode, i.e.x86_64 support) and vmx flags (hardware virtualisation support, using the Intel "VT" instruction extensions), but I haven't tested with xen or kvm virtualization in Ubuntu yet. The virtualbox download virtualbox_1.4.0-21864_Ubuntu_feisty_amd64.deb works fine for running virtual machines created on other (32-bit) Ubuntu systems.

  apt-get install libqt3-mt libxalan110 libxerces27 xalan
  wget http://www.virtualbox.org/download/1.4.0/virtualbox_1.4.0-21864_Ubuntu_feisty_amd64.deb
  sudo dpkg -i virtualbox_1.4.0-21864_Ubuntu_feisty_amd64.deb

Edit /etc/group (using sudo vigr if you're familiar with vim) to add your userid to the vboxusers group, then log out and back in to the desktop environment (otherwise your new group membership won't show up in id output, and you won't be able to use virtualbox).

Suspend

Suspend and resume (by pressing the power button on the back of the machine in the lower left corner) works fine (although sound no longer works after resume) in Ubuntu 7.04. I didn't try hibernate in 7.04, due to having no swap partition.

Suspend and resume works OK in 7.10, missing the mouse wheel and sound upon resume (the fix for resume of sound is upstream, not in Ubuntu yet). Hibernate also works OK in Ubuntu 7.10 (tested, now that I have a swap partition).

Video Camera

There's a little video camera built into the top of the screen, which works fine in Ubuntu thanks to the work of Ronald S. Bultje, Johannes Berg and Ivan N. Zlatev.

It's apparently a high-speed USB device. I followed these forum threads to get it to work, and found the second thread the easiest to follow (as it's more recent), but the first thread is worth reading too: thread and thread. There's also a more recent explanation on this gentoo page here.

The driver used is the new all-in-one bundle, with firmware autoloader provided by Ivan N. Zlatev. Having the firmware as part of the download is convenient, so you don't need to have an OSX partition around to be able to extract the firmware.

sudo apt-get install libusb-0.1-4 libusb-dev linux-headers-$(uname -r)
sudo apt-get install ekiga libpt-plugins-v4l2
sudo apt-get install gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse

wget http://files.i-nz.net/projects/linux-kernel/isight/uvcvideo-isight.tar.gz
tar zxvf uvcvideo-isight.tar.gz
cd against-revision-100
make
sudo make install
sudo cp /lib/modules/$(uname -r)/usb/media/uvcvideo.ko /lib/modules/$(uname -r)/./kernel/ubuntu/media/usbvideo/uvcvideo.ko
sudo make install
sudo modprobe uvcvideo trace=15

I used the trace option set to 15 because without it, I was getting only the following in the dmesg output after rebooting, and no /dev/video0 device was appearing.

[32837.522731] uvcvideo: iSight: firmware successfully loaded.
[32837.522738] uvcvideo: Found UVC 0.00 device <unnamed> (05ac:8300)
[32837.522742] uvcvideo: No valid video chain found.
[32837.522764] usbcore: registered new interface driver uvcvideo
[32837.522767] USB Video Class driver (v0.1.0)
[32837.677465] usb 1-4: USB disconnect, address 4

I edited the file /etc/modprobe.d/options and added the line:

  options uvcvideo trace=15

After rebooting with trace set to 15, I got a lot more messages, and the /dev/video0 device appeared:

crw-rw---- 1 root video 81, 0 2007-07-05 20:07 /dev/video0

To display the video from the camera on the screen (this turns on the little green LED to the right of the camera lens, so you know the camera is active), use the following command. Note that this can be handy if you're wondering if an infra-red remote control is working (e.g. if it's batteries are dead): by pointing an IR remote at the camera, you'll be able to use the camera to see the remote's little diode flashing. You can try it with the little Apple remote control.

  gst-launch-0.10 v4l2src ! video/x-raw-yuv,format=\(fourcc\)UYVY,width=640,height=480 ! ffmpegcolorspace ! ximagesink

See the attached dmesg output which shows the tracing from the uvcvideo module after rebooting (and also running the above command to start the video).

If that doesn't work (bug in Gutsy Gibbon), try a lower resolution:

gst-launch-0.10 v4l2src ! video/x-raw-yuv,format=\(fourcc\)UYVY,width=352,height=288 ! ffmpegcolorspace ! ximagesink

Update for Ubuntu 8.04 Hardy Heron

For the upcoming Ubuntu 8.04 Hardy Heron, see launchpad bug 185634 and gentoo bug 203675. There is a helpful guide here written by Étienne Bersac to the iSight firmware tools he is maintaining (based on the work of Ronald S. Bultje).

In case you're curious as to why that page doesn't display in Firefox 3.0b3, it's because the server it's hosted on is sending the wrong MIME Media Type, i.e. it's sending Content-Type: text/html; charset=UTF-8 in the HTTP header instead of Content-Type: application/xhtml+xml. More details are explained here and in mozilla bugs 305873, 419155, 399232 and 327796 -- thanks to Daniel Holbert for the list of bug numbers.

Apparently the steps to get the iSight working for the iMac24 go something like this (I only tested these steps while running the iMac24 from the Ubuntu 8.04 Hardy Heron alpha5 Live CD, as 8.04 is not yet released):

  wget http://ppa.launchpad.net/bersace/ubuntu/pool/main/i/isight-firmware-tools/isight-firmware-tools_1.0.2-0ubuntu0~ppa1_amd64.deb
  sudo dpkg -i isight-firmware-tools_1.0.2-0ubuntu0~ppa1_amd64.deb
Installing the above package prompts you as follows, and it's best to say No.
  Ensure you have access to the AppleUSBVideoSupport driver file. 
  If not disable firmware extraction, you can retry it later. 
  Extract firmware from Apple driver ? 
       <Yes>                          <No>
It's because the installer expects to find the following file /MacOSX/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contentents/MacOS/AppleUSBVideoSupport which is indeed the location of the firmware file, but this location is not for Ubuntu. It is actually a variation of the location of the firmware file on a proprietary operating system provided by Apple Corporation.

In case you don't want to waste time installing such an operating system, you can find the firmware file inside this package, at the location against-revision-*/firmware/AppleUSBVideoSupport.

Use the firmware tools to extract the firmware from the AppleUSBVideoSupport file, alter it by applying three patches and place the result in the file /lib/firmware/isight.fw, as follows.

  wget http://files.i-nz.net/projects/linux-kernel/isight/uvcvideo-isight.tar.gz
  tar zxvf uvcvideo-isight.tar.gz
  cd against-revision-*/firmware
  sudo ift-extract --apple-driver AppleUSBVideoSupport
The resulting output from the ift-extract tool should be:
** Message: Found Mac OS X.4 intel driver
** Message: Firmware extracted successfully in /lib/firmware/isight.fw
** Message: Apply patch 0 : Fix video control interface descriptor
** Message: Apply patch 1 : Fix video streaming interface descriptor
** Message: Apply patch 2 : Fix video streaming device qualifier
** Message: Firmware patched successfully
Next, build the uvcvideo.ko module from the Linux UVC kernel driver sources:
  sudo apt-get install subversion
  svn checkout svn://svn.berlios.de/linux-uvc/linux-uvc/trunk
  cd trunk
  make
  sudo rm /lib/modules/$(uname -r)/ubuntu/media/usbvideo/uvcvideo.ko
  sudo make install
This installs the module as /lib/modules/$(uname -r)/usb/media/uvcvideo.ko.

Now we need to load the firmware, before loading the uvcvideo module. Run the command lsusb and search for the Bus and Device numbers.

(On Gutsy, you might need to use lsusb -d 05ac:8501, to search specifically for the ID 05ac:8501, as the description listed by lsusb only includes the manufacturer, Apple Computer, Inc., and not the device name Built-in iSight [Micron]).

The Bus and Device numbers may change depending on what order the iSight device appears on the USB bus, e.g.:

Bus 005 Device 008: ID 05ac:8501 Apple Computer, Inc. Built-in iSight [Micron]
Then mount the usbfs and load the firmware for the iSight using:
  sudo mount -t usbfs /dev/bus/usb /proc/bus/usb/
  sudo /usr/lib/udev/ift-load -f /lib/firmware/isight.fw -b 005 -d 008
This should give:
  ift-load: Firmware loaded succesfully to 005:008
Note that the lsusb Device ID changes after the firmware loads, presumably because the device needs to reset itself after loading the firmware, and has to re-register with the USB bus.

We should now be able to unload and load the uvcvideo using:

  sudo modprobe -r uvcvideo
  sudo modprobe uvcvideo

The dmesg output shows:

[  924.507213] uvcvideo: Found UVC 1.00 device Built-in iSight (05ac:8501)
[  924.513439] uvcvideo: Failed to query (135) UVC control 1 (unit 0) : -32 (exp. 26).
[ 1014.917312] usbcore: deregistering interface driver uvcvideo
[ 1019.455855] Linux video capture interface: v2.00
[ 1019.460522] uvcvideo: Found UVC 1.00 device Built-in iSight (05ac:8501)
[ 1019.463115] uvcvideo: Failed to query (135) UVC control 1 (unit 0) : -32 (exp. 26).
[ 1019.465041] usbcore: registered new interface driver uvcvideo
[ 1019.465045] USB Video Class driver (SVN r189)

Test it out as usual, using:

  gst-launch-0.10 v4l2src ! video/x-raw-yuv,format=\(fourcc\)UYVY,width=640,height=480 ! ffmpegcolorspace ! ximagesink

Built-in Microphone

There is a built-in microphone over the top middle of the screen, to the left of the video camera. Recording from it works fine using audacity, once the alsa driver has been patched, see the "Audio" section above.

Optical Drive

The optical drive is a (very quiet) slot-loading 8x "SuperDrive" (DVD+R DL/DVD±RW/CD-RW). Insert the media with the printed side facing you (i.e. with the shiny readable side facing toward the back of the machine).

cdrecord -scanbus

scsibus0:
        0,0,0     0) 'MATSHITA' 'DVD-R   UJ-85J  ' 'FCQA' Removable CD-ROM
        0,1,0     1) *
        0,2,0     2) *
        0,3,0     3) *
        0,4,0     4) *
        0,5,0     5) *
        0,6,0     6) *
        0,7,0     7) *

Tested so far in Ubuntu:

  • Read CD-R (at around CD 12x speed)

Note: The message Warning: Open by 'devname' is unintentional and not supported. is output if you use /dev/scd0 as the value of the dev argument to readcd, as we're supposed to pass in the device number (e.g. 0,0,0), based on the output from cdrecord -scanbus shows for our device.

sudo apt-get install cdrecord
/usr/bin/readcd -v dev=0,0,0 f=./test.iso
scsidev: '/dev/scd0'
devname: '/dev/scd0'
scsibus: -2 target: -2 lun: -2
Linux sg driver version: 3.5.27
Read  speed:  4234 kB/s (CD  24x, DVD  3x).
Write speed:  4234 kB/s (CD  24x, DVD  3x).
Capacity: 157065 Blocks = 314130 kBytes = 306 MBytes = 321 prMB
Sectorsize: 2048 Bytes
Copy from SCSI (0,0,0) disk to file './test.iso'
end:    157065
addr:   157065 cnt: 92
Time total: 148.832sec
Read 314130.00 kB at 2110.6 kB/sec.

  • Read DVD+R (at around CD 43x, DVD 5.66x)

/usr/bin/readcd -v dev=0,0,0 f=./test.iso
scsidev: '/dev/scd0'
devname: '/dev/scd0'
scsibus: -2 target: -2 lun: -2
Linux sg driver version: 3.5.27
Read  speed: 11080 kB/s (CD  62x, DVD  8x).
Write speed: 11080 kB/s (CD  62x, DVD  8x).
Capacity: 2288192 Blocks = 4576384 kBytes = 4469 MBytes = 4686 prMB
Sectorsize: 2048 Bytes
Copy from SCSI (0,0,0) disk to file './test.iso'
end:   2288192
addr:  2288192 cnt: 32
Time total: 583.465sec
Read 4576384.00 kB at 7843.5 kB/sec.

  • Writing DVD+R using k3b

Writing a DVD+R disc using k3b worked OK, as you can see from the debug output. The disc was also later readable on a Sony DW-D22A.

Not sure if DMA is enabled for the drive. The hdparm command is for IDE drives, but this one is serial ATA using the ata_piix driver, so hdparm doesn't show much:

hdparm /dev/scd0

/dev/scd0:
 IO_support   =  0 (default 16-bit)
 readonly     =  0 (off)
 readahead    = 256 (on)
 HDIO_GETGEO failed: Inappropriate ioctl for device

In MAC OSX it can supposedly:

  • Write DVD+R DL discs at up to 2.4x speed
  • Write DVD-R and DVD+R discs at up to 8x speed
  • Write DVD-RW and DVD+RW discs at up to 4x speed
  • Read DVDs at up to 8x speed
  • Write CD-R discs at up to 24x speed
  • Write CD-RW discs at up to 16x speed
  • Read CDs at up to 24x speed

There's no eject button on the optical drive, so to eject the CD, either right-click on the CD icon on the desktop and choose Eject, or use the the following command:

  sudo umount /dev/scd0 && eject /dev/scd0

There's no support for "tray close" command (eject -t), so this causes k3b to pop up a dialogue box mentioning that it could not re-load the media after it ejects the media, if you elect to verify the data you've burned. Once you re-load the media, k3b reads it back for verification, you don't even need to click anything in the dialogue box.

We run into this bug when launching k3b and work around it using:

  sudo apt-get install libk3b2-mp3 libmad0

DVD playback

Once you have installed the libdvdcss library (needed by libdvdread), playing back DVD movies works automatically once the DVD is inserted (using totem), as well as manually using one of the following:
  vlc dvd://
  mplayer -monitoraspect 16:9 dvd://1
  xine dvd://

Packages containing this library built for the amd64 architecture are awkward to find, because it's not really a good idea to distribute them, and it's easier to build your own package from source. Following this guide, the steps for Ubuntu Feisty Fawn are as follows:

  sudo aptitude install build-essential checkinstall automake1.9 libdvdread-dev
  wget http://download.videolan.org/pub/libdvdcss/1.2.9/libdvdcss-1.2.9.tar.bz2
  tar jxvf libdvdcss-1.2.9.tar.bz2
  cd ./libdvdcss-1.2.9
  ./configure --prefix=/usr
  make
  sudo checkinstall
This installs the package, and also leaves a copy of the package in the same location where you extracted the sources, with the name: libdvdcss_1.2.9-1_amd64.deb. You can remove it from your system any time using sudo dpkg -r libdvdcss (it's only dynamically loaded by libdvdread, so removing it wouldn't break anything). You might also like to make a backup copy of the libdvdcss_1.2.9-1_amd64.deb package you built, so that you don't need to rebuild it from source again later, if you're reinstalling your root partition (for example after a disk failure). When configuring mplayer, use the following flags to turn off the mplayer-provided code, and turn on the use of libdvdread (which will dynamically load the library you built just above):
  --disable-mpdvdkit --enable-dvdread
See the Audio section above for info on configuring AC3 passthrough for digital optical output, if you have a receiver with a digital optical (TOSLink) input.

Adobe/Macromedia Flash

Update: Most google and utube videos play back just fine now using Gnash (on Ubuntu Gutsy on AMD64) within Firefox, so there's no need to worry about installing any proprietary Flash player.

See here for info on nspluginwrapper and here and here for the story on playing back the google videos of penLUG presentations on amd64.

USB Scanner

A little off-topic perhaps, but the little old Canon Canoscan FB630U USB scanner now works fine now in Ubuntu 7.04 (Feisty Fawn), thanks to the work by Nathan Rutman and many others. It's quite a small, portable and convenient USB scanner to use with the iMac. Just plug in the USB scanner, launch xsane and choose CANON FB630U flatbed scanner [canon630u:libusb:002:003]. You can choose to set the scan resolution to 75, 150, 300 and as high as 600 dpi (of course it's quite slow to scan at the 600 dpi resolution). The default scan resolution is 75 dpi, and 300 dpi resolution gives a fairly quick scan.

Exploring the Mac OS X DVD Contents

I made a backup of the DVDs provided by Apple by inserting them and using the commands:
  /usr/bin/readcd -v dev=0,0,0 f=./Mac_OS_X_Install_Disc_1_image
  eject /dev/scd0
  /usr/bin/readcd -v dev=0,0,0 f=./Mac_OS_X_Install_Disc_2_image
  eject /dev/scd0

The resulting Mac OS X Install Disc 1 image was of size 5662343168 bytes and had an md5sum of 37e7a1e9432730ed04746654c44ef944.

The resulting Mac OS X Install Disc 2 image was of size 8253407232 bytes and had an md5sum of 88be5bd6e2f230c8809e4667ee83ca3c.

To explore their contents under Linux, the images can be mounted as follows, using the hfsplus filesystem driver.

  sudo losetup /dev/loop0 ./Mac_OS_X_Install_Disc_1_image
  sudo mkdir /MacOSX1
  sudo mount -t hfsplus /dev/loop0 /MacOSX1
  sudo find /MacOSX1 -print > /tmp/Mac_OS_X_Install_Disc_1_image.list
  sudo umount /MacOSX1
  sudo losetup -d /dev/loop0
  rmdir /MacOSX1

The commands to mount the second image are similar.

  sudo losetup /dev/loop1 ./Mac_OS_X_Install_Disc_2_image
  sudo mkdir /MacOSX2
  sudo mount -t hfsplus /dev/loop1 /MacOSX2
  sudo find /MacOSX2 -print > /tmp/Mac_OS_X_Install_Disc_2_image.list
  sudo umount /MacOSX2
  sudo losetup -d /dev/loop1
  rmdir /MacOSX2

I wasn't able to locate the firmware file AppleUSBVideoSupport, mentioned earlier in the iSight section. Where does the Apple installer retrieve it from?

Internal Hard Drive

The internal ATA hard drive can be accessed using "Firewire Target Disk Mode" by holding down T when booting the iMac24, see here. Target Disk Mode only connects to the master ATA drive on the Ultra ATA bus. Essentially, your iMac24 becomes an external Firewire disk drive, and you can hotplug it into any machine which can access Firewire hard drives.

Back to LinuxHints - Everything GNU ever wanted to know about Linux

-- PeterKnaggs - 30 Jun 2007

  • xorg.conf: /etc/X11/xorg.conf for proprietary nVidia drivers on iMac 24

  • iSight.dmesg.out: dmesg output with Ivan N. Zlatev's uvcvideo driver for the iSight camera.

  • k3b.out: Debug output from k3b while burining a single-layer DVD+R

  • cpuinfo: /proc/cpuinfo for iMac24


to top

I Attachment sort Action Size Date Who Comment
xorg.conf manage 3.4 K 30 Jun 2007 - 23:01 PeterKnaggs /etc/X11/xorg.conf for proprietary nVidia drivers on iMac 24
udiff-patch_realtek.txt manage 3.6 K 05 Jul 2007 - 22:35 PeterKnaggs Patch from nicfagn to add support for pci ID 0x106b1000 for iMac 24 audio.
proc_asound_card0_codec0 manage 9.5 K 05 Jul 2007 - 23:49 PeterKnaggs /proc/asound/card0/codec#0
iSight.dmesg.out manage 31.4 K 06 Jul 2007 - 03:38 PeterKnaggs dmesg output with Ivan N. Zlatev uvcvideo driver for the iSight camera.
k3b.out manage 18.1 K 08 Jul 2007 - 02:30 PeterKnaggs Debug output from k3b while burining a single-layer DVD+R
lspci.out manage 18.7 K 09 Jul 2007 - 17:46 PeterKnaggs lspci outputs
hwinfo.out manage 264.1 K 09 Jul 2007 - 17:48 PeterKnaggs output of the hwinfo command.
bcm43xx-fwcutter.out manage 2.6 K 09 Jul 2007 - 19:08 PeterKnaggs output of installing the bcm43xx-fwcutter package
alsamixer.png manage 2.7 K 11 Jul 2007 - 17:55 PeterKnaggs Using "alsamixer -V all" to select the "Front Mi" (front microphone) input.
cpuinfo manage 1.2 K 07 Dec 2007 - 18:58 PeterKnaggs /proc/cpuinfo for iMac24
isight-firmware-tools_1.0.2-0ubuntu0ppa1_amd64.deb manage 24.9 K 24 Feb 2008 - 05:20 PeterKnaggs mirror of isight-firmware-tools for amd64
isight-firmware-tools_1.0.2-0ubuntu0ppa1_i386.deb manage 24.1 K 24 Feb 2008 - 05:22 PeterKnaggs mirror of isight-firmware-tools for i386
Mac_OS_X_Install_Disc_1_image.list.bz2 manage 59.6 K 24 Feb 2008 - 08:28 PeterKnaggs List of files in Mac_OS_X_Install_Disc_1_image
Mac_OS_X_Install_Disc_2_image.list.bz2 manage 6.6 K 24 Feb 2008 - 08:28 PeterKnaggs List of files in Mac_OS_X_Install_Disc_2_image

You are here: Main > TWikiUsers > PeterKnaggs > LinuxHints > LinuxHardwareInfo > LinuxHardwareInfoAppleiMac24

to top

Copyright © 1999-2008 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback