I've modified the Genlock application (based on SoftGenLock) to make it work with recent kernels, 2.6.32 in my case. One of the goals of this application is to provide a kernel module to do page flipping active stereo with consumer NVIDIA cards on Linux (ie. not Quadro only). I don't know with which cards it's compatible, but I've tested it successfully on my GeForce 7600 GT (AGP) and the authors used it with a GeForce 4, so I guess it'll work on most NVIDIA graphic cards.
You'll find the tarball in the attachement provided below : genlock-20100615.tar.gz.
*** How to compile it ***
First, you need to untar the archive. From the command line :
Code: Select all
tar xvfz genlock-20100615.tar.gz
Code: Select all
cd genlock-20100615 ; make
Code: Select all
Building modules, stage 2.
MODPOST 1 modules
CC /home/frederic/tarred/stereo/genlock-20100615/genlock.mod.o
LD [M] /home/frederic/tarred/stereo/genlock-20100615/genlock.ko
make[1]: quittant le répertoire « /usr/src/linux-headers-2.6.32-5-686 »
Code: Select all
make install
If all went well during the compilation and installation of the genlock module, you need to load it. First, you'll need to unload parallel port modules because they interfer with it and will cause a kernel oops :
Code: Select all
rmmod parport_pc
rmmod parport
rmmod lp
Code: Select all
modprobe genlock
Code: Select all
cat /proc/driver/genlock/state
Code: Select all
slave: disabled [mono]
To use this module, you need to configure a virtual screen twice the width of your current resolution by either modifying /etc/X11/xorg.conf or by using nvidia-settings. When activated, the module will display the left and the right part of the virtual screen alternatively in synchronisation with the vertical retrace.
For the nvidia-settings method, go to X Server Display Configuration, click on the Advanced... button, type 2048x768 (where 2048 is twice your current width and 768 your current height) in the Panning edit box then click on Apply.
For the xorg.conf method, add the line marked with an arrow (without typing the arrow of course) in the "Display" subsection of your "Screen" section :
Code: Select all
Section "Screen"
...
SubSection "Display"
Depth 24
Modes "1024x768"
-> Virtual 2048 768
EndSubSection
...
EndSection
To activate the page flipping mode, just type this line in a terminal :
Code: Select all
echo stereo > /proc/driver/genlock/state
Code: Select all
echo mono > /proc/driver/genlock/state
There are some options you should be able to modify by accessing the files in /proc/driver/genlock or passing parameters when you load the genlock module. I didn't try yet, but feel free to have a look at these files or refer to the documentation of either Genlock or SoftGenLock.
*** Caveats***
There is one major caveat with this module on my machine, it does work correctly only when I'm in a 60 Hz DoubleScan mode. When I choose an higher vertical frequency, the screen swaps are no longer synchronized to the vertical retrace and I've got this message in syslog :
Code: Select all
[ 2416.429192] genlock: PROBABLY OUT OF SYNC - time between expected and real irq: 6165 us, frametime 16716 us, 2 skipped, lastdiff -10298 us
To make a better use of this application, you should try to display two different images in each part of the virtual screen, for example by writing an OpenGL application with a two cameras that render their views respectively in a (0, 0, 1024, 768) and a (1024, 0, 2048, 768) rectangle.
If you try this application, don't hesitate to report back in this thread how it does work for you.
Thank you.