Compiling SGI O2 stereo video formats

(See also highres.html for notes on high-resolution, monoscopic O2 video formats, and 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.)

SGI's vfc (video format compiler) lets you compile .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.

Although the O2 doesn't include a stereo-glasses port by default, it can be purchased cheaply enough ($200-$300, marketing code STEREO-XEYE). SGI supplies a 1024x768_96s stereo-in-a-window format, that's not especially high resolution, so I tried to use vfc to build a higher-res one.

Unfortunately, if you do the obvious thing, it

  1. doesn't compile. This is easily fixed, but upon installing the result it
  2. doesn't work; setmon reports No match for requested format.

But with some small patches to the SGI-supplied StereoTemplate.def, it can be made to work.

I posted a note to about this around 4/29/1999.


Files included here: There are also some O2 monoscopic, but higher-resolution, samples included, described in the companion highres.html page:


Here's how to make O2 stereo-in-a-window formats after you've installed SGI's video format compiler, e.g.
   I  vfc                  02/09/99  Video Format Compiler, 1.0
The SGI-supplied /usr/gfx/ucode/vfc/vfs/StereoTemplate.def file seems to work fine for building formats for IR graphics, but not for O2s. A patch to the standard version appears below, and a complete updated file is in this www directory.

To build and use one:

My O2's monitor has survived several weeks' operation on the enclosed 1240x980_84s.vfo without apparent harm. Your mileage may vary.

Known problems

I've encountered two problems when using stereo video formats larger than 1024x768. Both are annoying, but probably tolerable.
  1. Anything using the overlay/popup planes -- like menus, dragging-window frames, the "snapshot" program -- turns into unreadable snow when in higher-resolution stereo modes. I'm not sure why. If you need them to work, just switch temporarily (setmon -n ...) into a non-stereo mode, or into the SGI-supplied 1024x768_96s mode.

  2. xscreen dumps core (!) if one of these supercharged .vfo files is in the /usr/gfx/ucode/CRM/vfo/ directory. Can't guess why this is, either. Workarounds: just use /usr/gfx/setmon rather than xscreen to load video formats; to check properties of video formats, try e.g. the enclosed listformats (or meddle with its source to show other properties). Or, temporarily remove the new .vfo file(s) from /usr/gfx/ucode/CRM/vof . Sorry.


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,

From slevy Thu Apr 29 15:12:28 CDT 1999
Subject: Re: Video Format Compiler Source [Here's how to build O2 stereo formats]
References: <> <7g638e$am4$> <7g7fu7$> <7g8mk4$gee$>
Organization: NCSA, University of Illinois Urbana-Champaign

In article <7g8mk4$gee$>,
Stuart Levy  wrote:
>In article <7g7fu7$>,
>Paul Spencer  wrote:
>  [I'd written...]
>>> Clearly there's *some* way to compile a format-file that Xsgi interprets
>>> correctly, since the SGI-distributed .vfo works great.
>>Note that formats distributed by SGI may not be straight compiled ones;
>>we can tweak them, or just generate them by hand.
>>In any case; try adding the line
>>#define	STEREO_FMT	2
>>to your .vfs file, and changing ActiveLinesPerFrame to 1536 (768 * 2).

After building a little vfo decompiler (to extract the named values
>from  the .vfo fields), and comparing the recompiled .vfo with the
SGI-supplied one, I figured out what was wrong with the SGI-supplied .def
files.  I'll report it here in case anyone else wants to try compiling
stereo formats for O2s.  Mine is now running (fairly) happily with a
1200x900_76s format, and I'll try others when it's working well.

You'll need to patch /usr/gfx/ucode/vfc/vfs/StereoTemplate.def,
setting ActiveLinesPerFrame to the full (doubled) number of lines
in two stereo fields, and also to change the "repeat" clauses in each field
to compensate.  You can't do this by just doubling VACT in the .vfs file.

Thanks to Paul Spencer and others for help with this!

  Stuart Levy,

--- /usr/gfx/ucode/vfc/vfs/StereoTemplate.def	Thu Apr 29 13:56:18 1999
+++ O2StereoTemplate.def	Thu Apr 29 13:58:22 1999
@@ -83,13 +83,13 @@
     ActivePixelsPerLine = HACT;
-    ActiveLinesPerFrame = VACT;
+    ActiveLinesPerFrame = 2*VACT;	/* Doubled for O2 */
     FramesPerSecond = FPS / 2;
     FieldsPerFrame = 2;
     TotalLinesPerFrame = 2 * (VSYNC + VBP + VACT + VFP);
     TotalPixelsPerLine = (HSYNC + HBP + HACT + HFP);
     FormatName = FORMAT_NAME;
-    SerratedCSyncOnHSync = true;
+    /* SerratedCSyncOnHSync = true;   Do this only for IR, not O2 */
 #define CVT_PIXEL_CLOCK(p) ((p * VideoClockRatioNumerator) / VideoClockRatioDenominator)
@@ -171,7 +171,7 @@
     Active =
-	repeat ActiveLinesPerFrame
+	repeat ActiveLinesPerFrame/2
 	    Length = 1.0H;
 	    Low = 0 usec;
@@ -245,7 +245,7 @@
     Active =
-	repeat ActiveLinesPerFrame
+	repeat ActiveLinesPerFrame/2
 	    Length = 1.0H;
 	    Low = 0 usec;