Projects

## NVidia 3D Vision

The NVidia 3D Vision glasses allow stereo rendering out-of the box for Windows. For that purpose the 3D Vision uses the 3D shutter glasses technique to display alternating left and right renderings for the left and right eye, respectively. This requires double the refresh rate of regular displays, so that the requirement for the 3D Vision to work properly is a monitor with 120 Hz refresh rate.

On Linux there is no out-of-the box support for the 3D Vision. The main problem is to generate the stereo renderings in a synchronized way so that the glasses shut on and off when the alternating stereo renderings are available. Producing alternating stereo renderings is not very difficult with OpenGL for the experienced software developer, so we assume that as given.

What is left to the developer is to tell the connected glasses to shut on and off. This is done by communicating with the infrared emitter of the 3D Vision so that it sends a correspondingly modulated infrared signal. The emitter is connected to the PC via USB cable. The USB protocol and firmware for the emitter is proprietary and official drivers only exist for Windows. But fortunately, some nice folks have been reverse engineering the protocol, so that it is no principle problem to use the emitter without the Windows drivers. Here is a description of the reverse engineering process:

http://users.csc.calpoly.edu/~zwood/teaching/csc572/final11/rsomers/


As a result of the reverse engineering, we are able to control the 3D Vision emitter on Linux with the aid of the libnvstusb library on SourceForge:

https://sourceforge.net/projects/libnvstusb/


The reverse engineering page and the libnvstusb project are already dating back to 2011 something, so that reproducing the described results on a recent Linux system requires some fine-tuning. The following describes what has to be done, to get the software running on Ubuntu 16.04 LTS (and OpenSuse 13.2):

First we install some required dependencies:

• proprietary NVIDIA drivers
• OpenGL development stuff, mainly freeglut3-dev and mesa-utils (freeglut3-devel on OpenSuse)
• libusb-1.0.0-dev (libusb-1_0-devel on OpenSuse)
• libdevil-dev (DevIL-devel on OpenSuse)
• automake

Now, we configure the USB bus for accessing the emitter:

In your /etc/udev/rules.d/ directory, create a new file named 98-nvstusb.rules with the following contents:
# NVIDIA 3D Vision USB IR Emitter
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", ATTR{idProduct}=="0007", MODE="0666"


Next, we setup our LCD to run with 120Hz refresh rate. This can be done with the NVIDIA control panel. To verify the settings, run “glxgears” on the terminal, to see if it reports a frame rate of roughly 120Hz.

And finally, we checkout libnvstusb from SourceForge and compile it:

svn checkout https://svn.code.sf.net/p/libnvstusb/code/ libnvstusb-code
cd libnvstusb-code
./autogen.sh
./configure
make
sudo make install


Unfortunately, the configure script of the library is old and won’t work out-of the box on a recent Ubuntu distribution like Ubuntu 16.04. This means, that the autogen.sh script will not produce a valid configure script. As a bug fix, we have to apply the following patch:

Add the line “AM_PROG_AR” to the file “configure.ac”


Now we can run autogen.sh successfully:

./autogen.sh


Next, we need to run the configure script with additional libraries to link with:

./configure LDFLAGS="-lGL -lm"


Now the library will compile and install successfully:

make
sudo make install


Update: The developer of libnvstusb was so kind to let me include the above bugfix changes in the repository. So automake will run out-of-the-box now. For more details see the commit log on SourceForge:

https://sourceforge.net/p/libnvstusb/code/34/


Have fun with the 3D Vision on Linux!