How to get X.Org working on an Apple eMac (ATI Radeon 7500)

20 February 2009

About 8 or so months ago, I bought an Apple eMac, which came with a DVD drive, 1GHz PowerPC processor, 1GB of RAM, and an ATI Radeon 7500 video card.

One of the first things I did was attempt to install Linux on it. Ubuntu 8.04 was my first try, and I was annoyed to find that I couldn’t get a picture with Xorg on it — just a blank screen. I also tried Debian Etch, Debian Sid, and Fedora 8, which also had the exact same symptoms.

The only Linux distro that worked was openSUSE 11, but I couldn’t stand openSUSE because it was slow, YaST was painful to use, I hated RPM, and they customised GNOME way too much.

Initially, I thought it was a refresh rate problem. I have gathered that the optimum screen mode for the eMac is 1024×768 @ 89Hz. Because Ubuntu was trying to set the mode to 1280×800 @ 60Hz by default, I added a modeline for the proper mode. However, that didn’t fix my blank screen, and I almost gave up in despair.

I also ran xrandr under a tty, and it was interesting to see that it thought my Mac had DVI hardware — DVI-0 and DVI-1. The eMac most definitely does not support DVI, so this told me the issue was a little more advanced than refresh rates.

On Saturday, while talking to the friendly folks on #gentoo-powerpc, one of them pointed me to this page (Update: the link is an equivalent page, as the original link is now gone), which contained some ConnectorTable hacks. As it turned out, the hacks worked! Both internal and external VGA worked (internal VGA was called VGA-1, and external VGA was called VGA-0), which makes me really happy.

So, to get X.Org working on your eMac, make the following changes to xorg.conf.

First you need to define the Modeline for the video mode:

Section "Monitor"
  Identifier   "Configured Monitor"
  # 1024x768 @ 89.00 Hz (GTF) hsync: 72.00 kHz; pclk: 99.07 MHz
  Modeline "1024x768"  99.07  1024 1088 1200 1376  768 769 772 809  +HSync +Vsync
EndSection

Then, tell it to use the video mode:

Section "Screen"
  Monitor    "Configured Monitor"
  # Fill in self-explanatory data here.
  SubSection "Display"
     Viewport   0 0
     Depth     24
     Modes   "1024x768"
  EndSubSection
EndSection

Fix the broken ConnectorTable:

Section "Device"
  # Fill in device information here.
  Option      "ConnectorTable" "100,1,0,1,108,2,0,1"
EndSection

After you do that, you should have a working X display. If you still get a blank screen, switch to a tty, run export DISPLAY=:0, run xrandr, and check to see that the eMac is using the correct resolution. Make sure DVI is not mentioned.

The photo by Oswald using -HSync +Vsync depicts the eMac with the picture off-centre. This is because -HSync +Vsync (the default) is wrong! Use +HSync +Vsync, and your picture will be in the centre of the screen.

Instead of the ConnectorTable hack above, one user from the Ubuntu forums points out that it is possible to get a picture by adding the following code to the Device section:

Section "Device"
  # Device information goes here.
  Option "monitor-DVI-0" "iMac"
EndSection

This is not as good a solution as setting ConnectorTable, as the external VGA monitor does not work with this set.

If you used this information to try and fix X on your eMac, please let me know in the comments so I know whether it was helpful or not! Thanks!

Happy 1234567890

14 February 2009

Unix-like boxen (including Linux and Mac OS X) around the world just had their internal dates pass 1234567890!

This means 1234567890 seconds have passed since 12:00AM, January 1, 1970, which is the date that, as far as Unix is concerned, the universe began.

Bushfire updates

8 February 2009

Google Australia has mashed together a live map of the bushfire situation in Victoria.

Also, Lindsay Holmwood has created a NSW Bushfire Twitter updater for those of us in NSW.

Simple Second Life elevator script

5 February 2009

Yesterday, Dad and I worked on a simple elevator script for Second Life.

Well, actually, it wasn’t technically on Second Life — rather, it was on my OpenSim node attached to OSGrid, but this script should work on Second Life as well. Note that I haven’t actually tested it on Second Life, and OpenSim translates LSL to C# and compiles it with Mono, so behaviour may not be smooth on Second Life.

But anyways, here’s the script:

vector LIFT_TOP    = <112.,112.,81.5>;
vector LIFT_BOTTOM = <112.,112.,27.>;

Travelator(vector start, vector finish)
{
    float  distance = 0;
    float  progress = 0;
    float increment = 1;

    vector direction = finish - start;
    vector dir_normal = llVecNorm(direction);
    distance = llVecDist(finish, start);

    vector next_pos = start;

    llSetPos(next_pos);

    do
    {
        progress += increment;
        if (progress >= distance)
        {
            llSetPos(finish);
            return;
        }
        next_pos += increment * dir_normal;
        llSetPos(next_pos);
    } while (progress <= distance);

}

default
{
    state_entry()
    {
        llWhisper(0, "Going down...");
        Travelator(LIFT_TOP, LIFT_BOTTOM);
    }

    touch_start(integer num_detected)
    {
        state top;
    }
}

state top
{
    state_entry()
    {
        llWhisper(0, "Going up...");
        Travelator(LIFT_BOTTOM, LIFT_TOP);
    }

    touch_start(integer num_detected)
    {
        state default;
    }
}

The constants LIFT_TOP and LIFT_BOTTOM are the coordinates of the top and bottom points of the elevator. This script does not support multiple storeys or call buttons -- rather, it's something you should build upon, rather than use out of the box.

Have fun.