Compiling SGI O2 video formats

SGI's vfc (video format compiler) lets you compile .vfs video-format source files into .vfo files, with a variety of screen sizes and scan rates, for at least a couple of kinds of graphics hardware: Infinite Reality and the O2's CRM graphics. You can then install these .vfo files in the appropriate place,
and use   xscreen   or   /usr/gfx/setmon  to activate them.

See also the companion page on compiling stereoscopic video formats for the O2. In this one, I'll just describe some general information, and how to create high-res monoscopic formats. Also check out Simon Lok's analog 1600SW .vfs for driving an SGI flat panel in analog mode, with a multilink adapter instead of a digital flat panel adapter.

You can pick up this documentation, assorted examples, etc. in one tarball: see o2-stereo.tar.gz.

To play this game, you need:

How To

  1. Use vfc (/usr/sbin/vfc) to compile the .vfs file; see the Makefile in this package, or try (supposing the file was XYZ.vfs):
    vfc -i "cc -E" -a -c chip=/usr/gfx/ucode/vfc/rules/O2_Chip.def,board=/usr/gfx/ucode/vfc/rules/O2_Board.def  -o XYZ.vfo  XYZ.vfs
    to yield XYZ.vfo and

  2. The name of the file isn't actually crucial (on the O2 at least), though by convention it has the form (see "man setmon"):
    where the optional s indicates a stereo format, and (for the O2), p indicates a format for the flat-panel display.

  3. Copy XYZ.vfo into the directory /usr/gfx/ucode/CRM/vof/.

  4. If you don't already know it, check the size of the current X server's managed area, with e.g.
    xdpyinfo | grep dimensions
  5. If the new video format's size doesn't exceed the X managed area size in either dimension, you can try loading it immediately (no need to be root) with:
    /usr/gfx/setmon -n formatname
    where the formatname is as described above, e.g.
    /usr/gfx/setmon -n 1280x1024_72
    Note that setmon requires invoking formats by their conventional name, even if the installed .vfo file has a different name. Setmon actually parses the given name, extracting the size and other parameters, and asks the X server for a video format with those attributes.

  6. To make this the default format for future sessions too, you must be root; then, use
    /usr/gfx/setmon -w formatname

  7. If the new video format's size exceeds the X server's managed area, you'll need to make it the X server's default format, then restart X. Prepare for the possibility that the format may be unusable (see below). When ready, become root and use
    /usr/gfx/setmon -w formatname
    to make the new format be the default one, which the X server uses when it's (re-)started, e.g. at boot time.

  8. You can then (after setmon -w) force the X server to restart; there are several ways to do this, but the simplest is the Vulcan Death Grip key sequence: press the following four keys and hold them all down:
    • Ctrl
    • Shift
    • the / key on the keypad (not under the ? key)
    • the F12 key
    The X server will exit, destroying your session (so save any apps you'll want saved before doing this!). If the new format works, you should get another login screen.

  9. In case the new format screws up, you'll need another way to log into the machine (and become root) without using the graphical console. A terminal plugged into the tty1 port will do; so will an ethernet connection, if you can telnet/etc. in and su to root. You can recover a usable display mode with e.g.
    /usr/gfx/setmon -w 72 (or 75, or 60)
    which is shorthand for 1280x1024_72 and etc., as described in man setmon.

    Then, force the X server to stop (if it started at all) and restart; if the Vulcan Death Grip doesn't do it (it won't if the X server never started), try (as root)


Making your own formats

Try creating your own formats too, based on these examples.

The ACTIVE_LINES, ACTIVE_PIXELS and FPS values should be obvious, but EXTRA_HBP needs explanation.

For high-res formats, it often seems that the default allotted horizontal retrace time isn't quite enough for the monitor; the symptom is that the extreme left edge of the raster will be very bright, and a bit compressed. Extending the horizontal back porch (HBP) time seems to help. Use the smallest number you can that makes the artifact disappear.


The O2 hardware imposes some limits to frame rate, etc. The ones I know about are:

The monitor will impose limitations too. Be ready to /usr/gfx/setmon -n 72 if the monitor goes blank, begins to screech, etc. Might be wise to alias something simple to that command in case you can't see to type -- or better, bind an Alt-Fxx key to f.exec that command in ~/.4Dwmrc.

The 1600x1200_56.* format acts a bit odd: a strip (~190 wide x 38 high) of the upper left portion of the screen is duplicated at the lower right, hiding anything that ought to appear in that extreme lower right strip. The cursor, and contents of the overlay planes, are not duplicated. If you don't like this, try reducing the resolution a bit.


Although SGI doesn't even claim that vfc works on Octanes, it looks as though the relevant files are supplied. Furthermore, the Octane .vfo files all claim to have been compiled with vfc. Unfortunately, I haven't found any combination of tweaks to get any .vfs file, even for non-stereo formats, to compile on the Octane yet. If anyone succeeds, I'd love to hear about it.

Stuart Levy,