VSync-driven shutter glasses

All my previous stereoscopic attempts are fun and cool, but what I really wanted was to manage to connect my cheap-o shutter glasses to my computer, and use them for stereoscopic rendering. The main barrier is that consumer nvidia cards do not include a stereo port (unlike expensive quadros), and their drivers don’t support stereoscopic OpenGL visuals.

I had already side-stepped the second problem by writing stereowrap, an LD_PRELOAD-based tool that fakes OpenGL stereo contexts for GLX apps and presents the stereo pair in a number of ways, such as various anaglyphs, side-by-side, etc.

So at some point I decided to attack the first problem. Turns out there’s a simple way to drive shutter glasses. It’s a brilliant idea, and I didn’t come up with it, but it boils down to making a simple circuit that toggles the shutter glasses when it detects a pulse on the montior vsync wire!

Original vsync shutter glasses driver schematic.
vsync stereo driver prefboard prototype
I immediately designed a circuit based on this design, but modified to work with the signals expected by my ASUS VR-100 shutter glasses. Then I wired it up on a perfboard, and it worked like a charm! Finally I added a sequential stereo presentation method to stereowrap, synchronized with vsync, and suddenly I can view all my stereoscopic programs in awesome full-color stereo glory.

The downside to this simple contraption is that it doesn’t really know whether the left or the right image is presented at any given time, it only knows when to switch between them. That’s why the switch is included in the circuit: if the image appears wrong, and you can really tell by your brain attempting to blow up while looking at it, the switch can be used to flip the glasses around instantly. If however the application can’t catch up with the refresh rate of the monitor and misses a vsync interval the images will flip again.

I plan to build a more intelligent, microcontroller-based, driver circuit at some point. But for now, the simple vsync driver works well enough.

25 Responses to “VSync-driven shutter glasses”

  1. PCB Etching « Code Laboratorium Says:

    […] I didn’t want to start with a huge complex circuit, so I decided to make a PCB version of my vsync shutter glasses driver. […]

  2. V-Synch detector lets you use 3D shutter glasses on Linux systems - Hack a Day Says:

    […] circuit is how [John Tsiombikas] makes his cheap 3D shutter glasses work with a Linux machine. It’s not that they were incompatible with Linux. The issue is that only certain video cards […]

  3. Conundrum Says:

    Nice circuit!
    Now can someone PLEASE do an ‘ible on how to make the expensive 3D glasses in the first place? its just a relatively cheap single polariser LCD so it should be easy to make your own using say a DSi touchscreen, salvaged LCD fluid etc.
    Cheapest shutter glasses I could find are nearly £60..

    Alternate idea, use old B/W phone screen such as 3310 ? these can sometimes be hacked by turning the power on and off while the screen is powered.

    • Nuclear Says:

      I bought my ASUS VR100 shutter glasses from ebay for 5-10 euros. In fact recently I found another pair on ebay at a similar price and got it just to have a spare, and to allow two people to watch at the same time.

  4. Joost Says:

    Great work. Could you post the schematics for the Asus shutter glasses? Does this method only work for vga?

    • Nuclear Says:

      The schematics are in this post, first image. The far right where it says “stereo jack” is where the VR-100 shutter glasses connect. The other DIN3 connector at the bottom is for standard VESA shutter glasses.

      You can also check out my next post (pcb etching) where I re-created this hand-drawn schematic in a proper schematic capture program and designed a PCB for it.

  5. Joost Says:

    Thank you. I missed the schematics with the 12V level shift.

  6. Kian Says:

    I was wondering what kind of monitor you’re using? (CRT vs. LCD)

    • Nuclear Says:

      I’m using a CRT 19″ Samsung monitor. TFT monitors generally don’t go higher than 60Hz, which is pretty much unusable for shutter glasses. Ideally you need 120Hz refresh rate, but anything higher than say 85Hz is tolerable.

  7. richardulrich Says:

    Any chance on getting my 10 year old shutter glasses to work with a non VGA monitor? E.g. my netbook.
    I imagine with your stereowrap, it would be possible to trigger the shutter glasses with a simple FTDI or similar on a USB port. Not sure about the latency though…

    • Nuclear Says:

      Do you mean using shutter glasses with the LCD monitor of the netbook? The internal monitor will not work very well due to the very low refresh rate (60hz) it probably supports, even if you get a synchronization signal to the shutter glasses somehow.

      As for stereowrap, yes it would be trivial to add USB/serial support. In fact I’m planning to do just that, and build a serial shutter glasses driving circuit based on an AVR microcontroller. It shouldn’t be hard to do, and it will eliminate the stereo flipping problem when the application misses a vsync interval.

      • richardulrich Says:

        Yes, exactly, I thought about using it with the netbook’s monitor, but also DVI monitors would be good. So, I’m looking forward to the AVR solution. I have some Attiny’s laying around waiting for a project like this ;-)

      • richardulrich Says:

        It might even work without an AVR by abusing the RTS line.

      • richardulrich Says:

        I have a semi working prototype with an Arduino:

        • Nuclear Says:

          Awesome! As soon as you iron out the details and you get a stereoscopic effect with it, let me know and we’ll merge the code into stereowrap.

      • richardulrich Says:

        Thanks for the hint on fsnav.
        Within there I could look up what an application has to do to generate stereoscopic output.
        But with fsnav, one site of the shutter glasses is dimmed about 80% of the time while the other is only 20%. With glxgears it’s about 50/50. The hardware is nowhere near it’s limit. Do you have an idea what could be the reason, and how to fix it? Can I install callbacks to be called exactly when the screen is being redrawn?

        Also, I was thinking if I could add a potentiometer to adjust the disparity. I was hoping that this could be done in stereowrap, but looking through the code, it looks like it’s in fsnav/src/stereo.c.

        • Nuclear Says:

          First of all, maybe we should continue this discussion through email. I find the web very tiresome for this sort of technical discussion. If you want to reply send it as an email to nuclear@member.fsf.org

          For the imbalance you’re experiencing in the shuttering, I can’t really tell with the data at hand, but it’s obviously a bug somewhere so sidestepping the issue with a potentiometer and a delay feels wrong :)

          Is it possible that you’re running synchronized to the vertical retraced for only the last swapbuffers of the pair for instance? I haven’t looked at your modifications to stereowrap yet so I’m just shooting blind. Otherwise, maybe something is wrong hardware side? Do you have an oscilloscope handy?

  8. Sabuj Pattanayek Says:

    does this work with 120Hz LCD monitors?

  9. mungewell Says:

    Hi, was there a trick to get StereoWrap to work with ‘-m sequential’… just segfault on then machines I’ve tried (Nouveau and VMware drivers), other modes such as ‘-m redcyan’ work though.

    • Nuclear Says:

      No, no tricks involved, it’s just a bug of some sort. If you can send me an email with a backtrace or a core dump I’ll try to find it.

  10. ferdna Says:

    it would be cool if it can be done with dvi port. also can you draw a better schematic?

  11. Reviving my vintage 3d shutter glasses | Richi's Blog Says:

    […] with current equipment. There have been pages on that topic for a long time, but only now I found a page that has all the details to get me interested enough. It features a preload library with which you can hook into the process […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: