Xfit hardware stereo

I have just installed the NuVision 60GX hardware stereo setup to run Xfit on Linux. To do this you have to go through the following steps:

  1. Install the hardware
  2. Edit the XF86Config-4 file
  3. Adjust Xfit parameters
  4. Monitor tips

Install the hardware

This part is trivial. Just follow the steps in the "Quick installation for non stereo-ready workstations & PC's" leaflet. Basically, you switch off the computer & monitor. Unplug the monitor cable from your computer. Attach the sync-doubler connector instead, and the monitor connector can then be attached to the other end of the sync-doubler. The emitter plugs into the sync-doubler control box. Switch the computer and monitor back on. If the green led on the control box lights up you are done. If not then you have to provide external power to the control box using the included transformer.

Edit the XF86Config-4 file

This used to be the tricky part. The sync-doubler will double the rate at which data is send to your monitor. Therefore you have to select a screen resolution and refresh rate that, after doubling of the refresh rate, will still be acceptable to your monitor. For this you first have to dig up your monitor manual and look up the vertical refresh frequency range (in Hz), the horizontal synch range (in kHz), and the pixel clock frequency range (in MHz). You may also find some of this information in the /etc/X11/XF86Config-4 file. Next you go to the following website http://koala.ilog.fr/cgi-bin/nph-colas-modelines. Here you enter half the maximal pixel clock frequency in the "Max Bandwidth" field, 68 in the "Max Vertical Frequency" field, and half the maximal horizontal synch frequency in the "Max Horizontal Frequency" field (note: the program seems to need integer values). In the "Min Refresh rate desired" field you enter the minimal vertical refresh frequency for your monitor (not half of it). You can leave the "Min Bandwidth" and "Min Horizontal Frequency" fields empty. Finally if you want to run at a particular screen resolution you can fill that in if you so desire. Hit "List Modelines" and you will get a list of modelines that fit your criteria. Find the screen resolution/vertical refresh rate combination that you like best. It is highly recommended to select a screen resolution that will also be useful for your normal work when not using stereo. That may mean you have to accept a rather low refresh rate. This is not too bad in stereo as the sync-doubler doubles the refresh rate. It also doesn't hurt your normal monitor use because you can simply switch to a different refresh rate when not using stereo.

Now log in as root and go to the /etc/X11 directory. Make a copy of the XF86Config-4 file, just to be on the safe side (if you use the older XFree release 3 then the file will be called XF86Config). Go to the Monitor Section and after the monitor specs, paste in the modeline from the webserver but change the name. I used "1280x1024-56" to indicate both resolution and vert. refresh rate. Next you go to the Screen Section which is normally near the end of the file. Change the Modes line to include two entries of the same resolution. In my case they are "1280x1024" and "1280x1024-56" in that order. When X-windows starts it will come up in 1280x1024 resolution mode with the optimal VESA standard refresh rate setting for your monitor (85Hz in my case). When you press [Ctrl][Alt][-] (press control, alt, and minus on numeric key pad all together) X will switch to the second setting with the lower vert. refresh rate, ready to be used for hardware stereo. Press [Ctrl][Alt][+] to return to the original setting.


I have a Dell UltraScan P1110 monitor with the following specs:

Vert. refresh	48-160 Hz
Hor. freq.	30-121 kHz
Bandwidth	278    MHz
I want to run at a screen resolution of 1280x1024. Following the procedure described above I get a modeline of:
ModeLine "1280x1024" 102.96 1280 1336 1616 1728 1024 1026 1038 1064 #56Hz
This gives the desired 1280x1024 resolution and a 56Hz refresh. Upon doubling, the signal will still be within monitor specs.

To start using the new values press [Ctrl][Alt][Backspace] to kill X and have it automatically restart. You will have to log in again. Try the [Ctrl][Alt][-] and [Ctrl][Alt][+] key combinations to see if the switching works. If you are pushing the limits too much, the monitor may not like it and you have to change your modeline to a more conservative setting, e.g. lower refresh rate. If both settings work, but the screen size or position is not ideal, then use your monitor buttons to get your default (first) setting ok. Next switch to the second setting and run the xvidtune command to tweak the modeline settings a bit (look at the man page for help if you need it, and ignore the alarmist message you get when the program starts). Stick the improved modeline values in your XF86Config-4 file and restart X. You should now have proper display in both settings, being that the latter will probably show noticable flicker. Don't worry.

Adjust Xfit parameters

Start up Xfit with a pdb file to look at. Go to the "View" menu and select "Hardware Stereo". The screen will split with one molecule displayed in the top half, the other in the bottom half. Press [Ctrl][Alt][+] to jump to the low refresh setting and then switch on the sync-doubler control box. The two images should have merged. If not, make sure you have selected the "Over/Under" mode and not the "Field sequential" mode on the sync-doubler control box. Blow up your molecule until it is easy to recognize the two stereo images. They are probably not displayed at exactly the same hight. Use the 0 and 9 keys to bring both images in vertical register. Note: if you change the vertical dimension of the Xfit canvas window you will have to use 0 and 9 again to adjust. Next find a phenylalanine or tyrosine and center on it. Orient the molecule so that the ring is in the plane of the screen and the CB-CG bond runs horizontal. Blow up the molecule so that the ring just fits the canvas window. Now measure the CG-CZ distance and the CD-CE diagonals. If they are not the same length, then use the ( and ) keys to adjust. You should now have a nice stereo image!

Switch off the sync-doubler control box and exit Xfit with the "Quit" button in the main menu. The program will write the adjustment settings to the screen and a file named xfit_stereo_parameters.dat as XFIT_BLANKINTERVAL and XFIT_ASPECTRATIO environment variables. You can add these variables to your default XtalView startup script to have them set automatically in the future. Time to fetch some innocent bystanders and impress them with your stereo display!

Monitor tips

You will get the best result with monitors that have a very high horizonal synch frequency. My monitor at 121kHz is doing very well. Randy Read reported earlier that on 19" monitors the highest horizontal synch available was 115kHz, at least at that point in time. 21" monitors also differ significantly so make sure you check the specs before purchasing. When I bought my monitor, Eizo had the best system but at a very significant price hike. Ijyama had a very nice model but that brand is not sold in Canada :(
A quick check at http://www.iiyama.com/US.html shows that they now have a Vision Master Pro 512 22" model that can go up to 140kHz!!! They also have a 19" Vision Master Pro 454 going up to 130kHz. Clearly technology is still improving. I think that LCD monitors are not suitable because the light emitted by the pixels doesn't go off quick enough to have died out completely before the next stereo image is displayed. But please check this for yourself. The NuVision people were very helpful when I called them in the past.

For questions or suggestions please send e-mail to: Bart.Hazes@Ualberta.ca