DIY NVIDIA 3D Vision emitter
-
- One Eyed Hopeful
- Posts: 7
- Joined: Tue Feb 09, 2016 7:04 pm
DIY NVIDIA 3D Vision emitter
Anybody seen this topic?
After 2 years, I finally made myself to properly cleanup the code and build a more stable setup. (Software-only sync was good enough for while)...
Thanks to previous hackers from this forum, I was able to hack/make myself an emitter without even having seen one irl!
After a few code and platform iterations, here's what I can offer:
Code:
Source available on GitHub
Built using a makefile and avr-gcc. I've used Atmel Studio, but should be possible to use toolchain included with Arduino IDE.
(I can upload a binary, but a lot of stuff is hard-coded...)
Hardware:
(Arduino) Pro Micro. ~5$ for a clone from China
And an IR LED(s) + transistor + resistors combo for actual signal transmission.
In the current state, software sync is not enough and can jitter a lot, SO:
A) Use external hardware sync signal. Currently accepts VESA sync, but with a few changes it can accept raw VSync.
B) Try to tweak backlight strobe and shutter frame timings + duty cycles to minimize jitter for your own setup.
C) Contribute to the project - a timer needs to be setup and kept in sync via the extra USB packet data.
Multiple protocols are already added. G05-A universal glasses that I have seem to support a lot of protocols, including 3D-vision one!
Stay way from Sony glasses, they appear to alternate polarity instead of full-blanking! (Anybody wanna buy a set? )
Attached a picture of my "setup":
2 status leds + 1w IR led for wide range, switched via mosfet. (added the 100ohm resistor only for the sake of a safer example)
Sync signal going to pin 2 from monitor (From DVI2LVDS to be exact )
After 2 years, I finally made myself to properly cleanup the code and build a more stable setup. (Software-only sync was good enough for while)...
Thanks to previous hackers from this forum, I was able to hack/make myself an emitter without even having seen one irl!
After a few code and platform iterations, here's what I can offer:
Code:
Source available on GitHub
Built using a makefile and avr-gcc. I've used Atmel Studio, but should be possible to use toolchain included with Arduino IDE.
(I can upload a binary, but a lot of stuff is hard-coded...)
Hardware:
(Arduino) Pro Micro. ~5$ for a clone from China
And an IR LED(s) + transistor + resistors combo for actual signal transmission.
In the current state, software sync is not enough and can jitter a lot, SO:
A) Use external hardware sync signal. Currently accepts VESA sync, but with a few changes it can accept raw VSync.
B) Try to tweak backlight strobe and shutter frame timings + duty cycles to minimize jitter for your own setup.
C) Contribute to the project - a timer needs to be setup and kept in sync via the extra USB packet data.
Multiple protocols are already added. G05-A universal glasses that I have seem to support a lot of protocols, including 3D-vision one!
Stay way from Sony glasses, they appear to alternate polarity instead of full-blanking! (Anybody wanna buy a set? )
Attached a picture of my "setup":
2 status leds + 1w IR led for wide range, switched via mosfet. (added the 100ohm resistor only for the sake of a safer example)
Sync signal going to pin 2 from monitor (From DVI2LVDS to be exact )
You do not have the required permissions to view the files attached to this post.
- cybereality
- 3D Angel Eyes (Moderator)
- Posts: 11407
- Joined: Sat Apr 12, 2008 8:18 pm
- nimatoed
- One Eyed Hopeful
- Posts: 18
- Joined: Mon Oct 28, 2013 9:09 pm
Re: DIY NVIDIA 3D Vision emitter
Very cool. Wish you or someone else would sell kits for a fraction of Nvidia's exorbitant rates.
- Guig2000
- Binocular Vision CONFIRMED!
- Posts: 257
- Joined: Wed Nov 25, 2009 9:47 am
- Location: Bordeaux, France
Re: DIY NVIDIA 3D Vision emitter
Hello, did you include the "full HD 3D IR" protocol?
-
- One Eyed Hopeful
- Posts: 7
- Joined: Tue Feb 09, 2016 7:04 pm
Re: DIY NVIDIA 3D Vision emitter
Implemented protocols (but not all of them) are found in paper "Investigating the cross-compatibility of IR-controlledGuig2000 wrote:Hello, did you include the "full HD 3D IR" protocol?
active shutter glasses"
I'm not aware of the one you mentioned but could add if given the timings
- Guig2000
- Binocular Vision CONFIRMED!
- Posts: 257
- Joined: Wed Nov 25, 2009 9:47 am
- Location: Bordeaux, France
Re: DIY NVIDIA 3D Vision emitter
After more search it appears that full hd ir and rf logo comes from the full hd 3d glasses initiative, that in fact includes compatibility with many protocols from different manufacturers.
https://3dvision-blog.com/tag/full-hd-3 ... nitiative/
So my question was a nonsense.
https://3dvision-blog.com/tag/full-hd-3 ... nitiative/
So my question was a nonsense.
-
- One Eyed Hopeful
- Posts: 2
- Joined: Wed Feb 12, 2020 12:22 pm
Re: DIY NVIDIA 3D Vision emitter
Do you have a Windows compiled version (instead of Linux) compatible with Nvidia 3d vision? The code is very complicated. And also the G05-A model glasses appear to be Bluetooth as well, not just IR . Is that the only glasses it works with?
- Losti
- Golden Eyed Wiseman! (or woman!)
- Posts: 1545
- Joined: Tue Sep 17, 2019 5:30 am
Re: DIY NVIDIA 3D Vision emitter
WOOW does this means if my 3d-vision 2 pyramide dies, i can make it by my own???
-
- One Eyed Hopeful
- Posts: 1
- Joined: Sat Feb 22, 2020 10:30 am
Re: DIY NVIDIA 3D Vision emitter
hi, thanks for posting this. I think with the release of all the 4K 120hz TV's over the past year, we all want to try this! Is there any more info on this? Has anybody got this to actually work?
- Alleostro
- One Eyed Hopeful
- Posts: 4
- Joined: Tue Feb 18, 2020 4:13 am
Re: DIY NVIDIA 3D Vision emitter
Awesome project, thx for sharing this! I def wannat try it
-
- One Eyed Hopeful
- Posts: 4
- Joined: Wed Dec 09, 2020 5:16 pm
Re: DIY NVIDIA 3D Vision emitter
can someone tell me how to do the board properly with orriginal uno?
- Feisty_Fernando
- Binocular Vision CONFIRMED!
- Posts: 223
- Joined: Sun Sep 29, 2019 8:11 am
Re: DIY NVIDIA 3D Vision emitter
Wonder what ever happened with this project.
-
- One Eyed Hopeful
- Posts: 7
- Joined: Tue Feb 09, 2016 7:04 pm
Re: DIY NVIDIA 3D Vision emitter
Used it for watching 3d movies for some time, later on I moved over to VR, have my name around in VRChat scene nowadays.
Also NVIDIA dropped support for 3DVision in their drivers since April 2019.
The source code is on github so can still be used referencing or DIY projects
-
- One Eyed Hopeful
- Posts: 2
- Joined: Wed Feb 26, 2020 4:33 am
Re: DIY NVIDIA 3D Vision emitter
Does this work with a LG OLED CX?
I have already tried native 3DVision but this is out of sync then
So my plan is to build a DIY IR Emitter to setup proper timings
I have already tried native 3DVision but this is out of sync then
So my plan is to build a DIY IR Emitter to setup proper timings
-
- One Eyed Hopeful
- Posts: 40
- Joined: Fri Jan 21, 2022 12:10 am
Re: DIY NVIDIA 3D Vision emitter
Just wanted to ask if the cheap Arduino clones work without any issues? Could save me a few bucks for when I decide on a project to work on.
-
- One Eyed Hopeful
- Posts: 7
- Joined: Tue Feb 09, 2016 7:04 pm
Re: DIY NVIDIA 3D Vision emitter
"cheap Arduino clones" Isnt speciffic enough. the common atmega328p does not have usb to do the full thing, can still use IR signal part of code for hardware approach if you have frame signal(or at least vsync if frames dont flip over time)
As written in main post, the "pro micro" clone works just fine - it uses atmega32u4 mcu
As written in main post, the "pro micro" clone works just fine - it uses atmega32u4 mcu
-
- One Eyed Hopeful
- Posts: 40
- Joined: Fri Jan 21, 2022 12:10 am
Re: DIY NVIDIA 3D Vision emitter
Alright thanks, I'll look into those.
- b3nn
- One Eyed Hopeful
- Posts: 4
- Joined: Tue Apr 16, 2013 11:19 am
Re: DIY NVIDIA 3D Vision emitter
lukis101's code is AWESOME!
It impersonates Nvidia's IR emitter pyramid over USB, so it just uses the same IR Emitter USB driver already installed if you have the official Nvidia pyramid. 3D Fix Manager sees it as the normal IR Emitter and it kicks in when a game launches. This is sweeeeeeeet!
Having never used Microchip Studio before, it seemed a bit confusing. I've written up how I got lukis101's code running on an Arduino Pro Micro in Windows https://github.com/b3nn/3DVisionAVR-Har ... IRMWARE.md
For the hardware, I'm using a more expensive Pro Micro, but it's USB-C and has a built-in RESET button for flashing. If all you have is a soldering iron but want everything else from one place, I've put together my list of part from https://www.sparkfun.com/wish_lists/167547 which is about $50 (the LED pack is optional and you can get a cheaper Arduino elsewhere if you want).
Here's the high level info for creating the circuit on a breadboard. I'm just a hardware hobbyist, so there's probably ways to make this better, but seems to be working for me.
For those of you that like schematic files, here's what I have in Kicad.
It would be great to get more people testing this and eyes on both the hardware and software. Right now, I do see the sync is a off when frame rates change and it's a bit dimmer with my monitor. I'm trying to understand the USB protocol more and what is being sent to try to keep it in sync, but for now, I've posted the hardware files at https://github.com/b3nn/3DVisionAVR-Hardware and ordered a few custom PCBs to keep testing that part.
It impersonates Nvidia's IR emitter pyramid over USB, so it just uses the same IR Emitter USB driver already installed if you have the official Nvidia pyramid. 3D Fix Manager sees it as the normal IR Emitter and it kicks in when a game launches. This is sweeeeeeeet!
Having never used Microchip Studio before, it seemed a bit confusing. I've written up how I got lukis101's code running on an Arduino Pro Micro in Windows https://github.com/b3nn/3DVisionAVR-Har ... IRMWARE.md
For the hardware, I'm using a more expensive Pro Micro, but it's USB-C and has a built-in RESET button for flashing. If all you have is a soldering iron but want everything else from one place, I've put together my list of part from https://www.sparkfun.com/wish_lists/167547 which is about $50 (the LED pack is optional and you can get a cheaper Arduino elsewhere if you want).
Here's the high level info for creating the circuit on a breadboard. I'm just a hardware hobbyist, so there's probably ways to make this better, but seems to be working for me.
- Pro Micro PIN 3 is our IR Signal (goes to mosfet Gate)
- Pro Micro PIN 10 is USB Status light (goes to resistor to green led)
- Pro Micro RAW is IR LED Power (goes to positive rail)
For those of you that like schematic files, here's what I have in Kicad.
It would be great to get more people testing this and eyes on both the hardware and software. Right now, I do see the sync is a off when frame rates change and it's a bit dimmer with my monitor. I'm trying to understand the USB protocol more and what is being sent to try to keep it in sync, but for now, I've posted the hardware files at https://github.com/b3nn/3DVisionAVR-Hardware and ordered a few custom PCBs to keep testing that part.
- b3nn
- One Eyed Hopeful
- Posts: 4
- Joined: Tue Apr 16, 2013 11:19 am
Re: DIY NVIDIA 3D Vision emitter
I've submitted a pull request which fixes the sync issues I was seeing. The screen image in a game is now just as bright when I use the clone and 3D looks amazing. I still notice an eye will flicker sometimes, but I think that might be more of a hardware issue (maybe?). I've only been able to test this against my own system and monitor (PG278QR) so would love to know if these times also work for others.
The two main changes are:
I hooked my official emitter up to a logic analyzer so I could see when a USB packet with an eye sync packet was sent (0xAA, 0xFF or 0xFE) and then when one of the 10 IR leds is lit up. It is a fairly significant delay of about 3ms when running at the default 120Hz. I noticed it's slightly more delayed if I'm at 100Hz. Maybe there's a way to tell the refresh rate from the USB data, but it wasn't clear to me. Just adjust the FRAME_PAN setting in the code if you're not at 120Hz for some reason.
The other change was the IR Protocol order. Viewing the logic analyzer led data, I noticed there was never the single transition "open left eye" timing at the start of the data. It was only after what looked like a "close right eye" command. So I re-ordered the protocol struct for the 3DVision data. It will now close an eye then open the other. So an eye is open for longer (which I think is a reason the image doesn't look dim now to me). So the FRAME_DURATION constant is now the duration between closing one eye and opening the other.
The two main changes are:
- Changing the eye protocol order
- Adding a longer delay between sync trigger and start of IR token
I hooked my official emitter up to a logic analyzer so I could see when a USB packet with an eye sync packet was sent (0xAA, 0xFF or 0xFE) and then when one of the 10 IR leds is lit up. It is a fairly significant delay of about 3ms when running at the default 120Hz. I noticed it's slightly more delayed if I'm at 100Hz. Maybe there's a way to tell the refresh rate from the USB data, but it wasn't clear to me. Just adjust the FRAME_PAN setting in the code if you're not at 120Hz for some reason.
The other change was the IR Protocol order. Viewing the logic analyzer led data, I noticed there was never the single transition "open left eye" timing at the start of the data. It was only after what looked like a "close right eye" command. So I re-ordered the protocol struct for the 3DVision data. It will now close an eye then open the other. So an eye is open for longer (which I think is a reason the image doesn't look dim now to me). So the FRAME_DURATION constant is now the duration between closing one eye and opening the other.
- b3nn
- One Eyed Hopeful
- Posts: 4
- Joined: Tue Apr 16, 2013 11:19 am
Re: DIY NVIDIA 3D Vision emitter
Here's what an assembled board looks like with a USB-C Pro Mirco.
This works and games are playable, but it's not perfect. Sometimes things will get out of sync for a bit or the left eye in particular seems to stay close for an extra frame (not sure what's happening). It's mostly pretty random in the games I've tested, but I'm looking for one where I can reliably reproduce the issue to help troubleshoot it. I'm hesitant to start making kits with the board in case the issue is hardware related.
To that end, I've tested a ton of IR LEDs and there's a few options. If you need range, the OED-EL-1L2 works well. It seems to match the across the room range of the pyramid emitter. However if you sit within 5 feet of the emitter, a single MTE9440M3A works better with its 160 degree viewing angle. I'm thinking the final design should use a mix of the two types.
I'm planning to keep working on this over the weekends, but if you think you could help work out the bugs and a kit would help, send me a message.
This works and games are playable, but it's not perfect. Sometimes things will get out of sync for a bit or the left eye in particular seems to stay close for an extra frame (not sure what's happening). It's mostly pretty random in the games I've tested, but I'm looking for one where I can reliably reproduce the issue to help troubleshoot it. I'm hesitant to start making kits with the board in case the issue is hardware related.
To that end, I've tested a ton of IR LEDs and there's a few options. If you need range, the OED-EL-1L2 works well. It seems to match the across the room range of the pyramid emitter. However if you sit within 5 feet of the emitter, a single MTE9440M3A works better with its 160 degree viewing angle. I'm thinking the final design should use a mix of the two types.
I'm planning to keep working on this over the weekends, but if you think you could help work out the bugs and a kit would help, send me a message.
- Guig2000
- Binocular Vision CONFIRMED!
- Posts: 257
- Joined: Wed Nov 25, 2009 9:47 am
- Location: Bordeaux, France
Re: DIY NVIDIA 3D Vision emitter
Hello, I think that it open an eye only after the other is closed is not a bug and is required in order to reduce ghosting when using a LCD 3D screen.
- b3nn
- One Eyed Hopeful
- Posts: 4
- Joined: Tue Apr 16, 2013 11:19 am
Re: DIY NVIDIA 3D Vision emitter
Totally agree. The old code never had both eyes open at the same time, but did have a larger gap of time when both eyes were closed. That seemed to make the screen appear much dimmer. With the change I submitted, you can tweak the delay between closing an eye and opening the other via the FRAME_DURATION constant, but 500 microseconds is about what the pyramid emitter uses
-
- One Eyed Hopeful
- Posts: 1
- Joined: Fri Jun 03, 2022 7:09 am
Re: DIY NVIDIA 3D Vision emitter
Currently waiting for a microcontroller to arrive capable of running the program. I have an Arduino uno and for its usb communication it uses a 16u2 but sadly the program is a couple KB too large to flash it onto that. Thinking of reprogramming what lukis made with tinyusb to run it on a pi pico.
What I have done for so far is I hooked up my wii sensor bar with an npn transistor, a 9v battery (to power the wii sensor bar since it needs 8.5v ish) and a resistor to my Arduino. I used the timings from here viewtopic.php?t=9790 (rounded the 0.5's up) and about 7000 microseconds in-between and recorded the glasses shutters opening and closing with my phone at 960fps and it seems that the wii sensor bar is a pretty good ir emitter works up to 2.5m ish. It basically is 10 ir leds and a resistor. Can't wait to try it after the microcontroller arrives.
What I have done for so far is I hooked up my wii sensor bar with an npn transistor, a 9v battery (to power the wii sensor bar since it needs 8.5v ish) and a resistor to my Arduino. I used the timings from here viewtopic.php?t=9790 (rounded the 0.5's up) and about 7000 microseconds in-between and recorded the glasses shutters opening and closing with my phone at 960fps and it seems that the wii sensor bar is a pretty good ir emitter works up to 2.5m ish. It basically is 10 ir leds and a resistor. Can't wait to try it after the microcontroller arrives.
-
- One Eyed Hopeful
- Posts: 3
- Joined: Mon Jan 15, 2024 11:52 pm
Re: DIY NVIDIA 3D Vision emitter
I built the circuit on a breadboard. Even checked the bootloader com ports.
I am a newb to Microchip Studio and got several errors. Can you please help?
I changed the IR_SetSyncMode(SYNCMODE_COMBINED);
over to
IR_SetSyncMode(SYNCMODE_DRIVER);
When loading 3DvisionAVR into microchip studio I get an error screen:
3DVisionAVR.componentinfo.xml has the information of the pack used in the project and the file is missing, do you want to regenerate 3DVisionAVR.componentinfo.xml with the latest pack information?
Also when I run build solution it has 3 errors:
Severity Code Description Project File Line
Error error writing to -: Invalid argument 3DVisionAVR C:\Users\Forban V\3DVISION BAK\3DVisionAVR\3DVisionAVR\Emitter.c 314
Severity Code Description Project File Line
Error recipe for target 'obj/Emitter.o' failed 3DVisionAVR C:\Users\Forban V\3DVISION BAK\3DVisionAVR\lufa\LUFA\Build\DMBS\DMBS\gcc.mk 224
Severity Code Description Project File Line
Error can't create obj/Emitter.o: No such file or directory 3DVisionAVR RUNCOMPILERTASK 0
Sorry I ment to ask here on this thread. Looks like I need to get the software bugs fixed.
I lost my old emitter between 2 moves. I am not that surprised that the original nvidia pyramid is so much $$$.
I am a newb to Microchip Studio and got several errors. Can you please help?
I changed the IR_SetSyncMode(SYNCMODE_COMBINED);
over to
IR_SetSyncMode(SYNCMODE_DRIVER);
When loading 3DvisionAVR into microchip studio I get an error screen:
3DVisionAVR.componentinfo.xml has the information of the pack used in the project and the file is missing, do you want to regenerate 3DVisionAVR.componentinfo.xml with the latest pack information?
Also when I run build solution it has 3 errors:
Severity Code Description Project File Line
Error error writing to -: Invalid argument 3DVisionAVR C:\Users\Forban V\3DVISION BAK\3DVisionAVR\3DVisionAVR\Emitter.c 314
Severity Code Description Project File Line
Error recipe for target 'obj/Emitter.o' failed 3DVisionAVR C:\Users\Forban V\3DVISION BAK\3DVisionAVR\lufa\LUFA\Build\DMBS\DMBS\gcc.mk 224
Severity Code Description Project File Line
Error can't create obj/Emitter.o: No such file or directory 3DVisionAVR RUNCOMPILERTASK 0
Sorry I ment to ask here on this thread. Looks like I need to get the software bugs fixed.
I lost my old emitter between 2 moves. I am not that surprised that the original nvidia pyramid is so much $$$.
-
- One Eyed Hopeful
- Posts: 9
- Joined: Tue Mar 10, 2009 5:15 pm
Re: DIY NVIDIA 3D Vision emitter
"3DVisionAVR.componentinfo.xml has the information of the pack used in the project and the file is missing, do you want to regenerate 3DVisionAVR.componentinfo.xml with the latest pack information?"
... is not really an error message -> you can click on "yes" and ignore it.
For the other errors:
Go to the "C:\Users\Forban V\3DVISION BAK\3DVisionAVR\3DVisionAVR\" folder and create a new subdirectory called obj in there.
With the new "C:\Users\Forban V\3DVISION BAK\3DVisionAVR\3DVisionAVR\obj" folder created -> try running "BUILD SOLUTION" again.
... is not really an error message -> you can click on "yes" and ignore it.
For the other errors:
Go to the "C:\Users\Forban V\3DVISION BAK\3DVisionAVR\3DVisionAVR\" folder and create a new subdirectory called obj in there.
With the new "C:\Users\Forban V\3DVISION BAK\3DVisionAVR\3DVisionAVR\obj" folder created -> try running "BUILD SOLUTION" again.
-
- One Eyed Hopeful
- Posts: 3
- Joined: Mon Jan 15, 2024 11:52 pm
Re: DIY NVIDIA 3D Vision emitter
That worked! Thanks so much. I cant believe its simple directory location problems. Well I flashed and after a couple errors, directory path issues again...
It is recognized and 3D Fix Manager helped set it right up!
Meow to get a 3D movie... [xfingers]
It is recognized and 3D Fix Manager helped set it right up!
Meow to get a 3D movie... [xfingers]
-
- One Eyed Hopeful
- Posts: 9
- Joined: Tue Mar 10, 2009 5:15 pm
Re: DIY NVIDIA 3D Vision emitter
I did some modifications on the code for the emitter on the IREmitter.c:
... and on the IREmitter.h:
... to implement some rudimentary refresh rate detection. It's pretty crude (since i'm very bad at coding) and not very precise - but it should be good enough to be able to use different FRAME_DURATION and FRAME_PAN settings for different refresh rates and therefore make the DIY emitter more flexible.
I testet it on my setup and it worked pretty well. I did use some different protocol settings in the IRProtocols.h too:
... since those worked the best for my CRT with the emitter in external VESA-sync-mode.
Code: Select all
#include "Emitter.h"
#include "IRProtocols.h"
#define START_IR_TIMER() (TCCR1B = _BV(CS11)) // 16MHz / 8 = 0.5us ticks
#define STOP_IR_TIMER() (TCCR1B = 0)
const IR_Protocol_t* IR_CurProtocol = &IRProt_3DVision;
SyncMode_t IR_SyncMode = SYNCMODE_NONE;
static volatile bool emitterActive = false;
static bool emitterActive_last = false;
static volatile bool synced = false;
static volatile uint32_t lastFrame = 0;
static uint8_t swapEyes = 0;
static volatile uint8_t curEye = 0;
static uint8_t nextEye = 0;
static uint8_t lastPulse;
static uint8_t curPulse;
static uint8_t curToken;
static void SendToken(uint8_t token);
uint16_t FRAME_DURATION;
uint16_t FRAME_PAN;
unsigned long lastSendTokenTime = 0;
#define NUM_MEASUREMENTS 5
unsigned long periods[NUM_MEASUREMENTS];
int periodIndex = 0;
void IR_Init(void)
{
/* GPIO */
bitSet(DDR_LED_EYE, LED_EYE);
bitSet(DDR_LED_IR, LED_IR);
bitSet(DDRB, 5);
bitSet(PORTD, 5); // Force sync/output
/* TIMER1 - IR token and pulse timing*/
TCCR1B = 0; // Timer stopped, normal mode
TCCR1A = 0;
TIMSK1 = 0; // All interrupts disabled
TIFR1 = 0xFF; // Clear pending interrupt flags if any
IR_SetSyncMode(SYNCMODE_EXTERNAL);
}
void detectRefreshRate(void)
{
if (lastSendTokenTime == 0) {
lastSendTokenTime = millis();
return;
}
uint32_t currentSendTokenTime = millis();
uint32_t period = currentSendTokenTime - lastSendTokenTime;
lastSendTokenTime = currentSendTokenTime;
periods[periodIndex] = period;
periodIndex = (periodIndex + 1) % NUM_MEASUREMENTS;
//Continue after enough measurements
if (periodIndex != 0) return;
// Calculate average value
unsigned long totalPeriod = 0;
for (int i = 0; i < NUM_MEASUREMENTS; i++) {
totalPeriod += periods[i];
}
unsigned long avgPeriod = totalPeriod / NUM_MEASUREMENTS;
// Calculate refresh rate
uint32_t refreshRate = 1000 / avgPeriod;
// Set FRAME_DURATION and FRAME_PAN according to refresh rate
if (refreshRate >= 80 && refreshRate <= 90) {
FRAME_DURATION = FRAME_DURATION_85HZ;
FRAME_PAN = FRAME_PAN_85HZ;
} else if (refreshRate >= 95 && refreshRate <= 111) {
FRAME_DURATION = FRAME_DURATION_100HZ;
FRAME_PAN = FRAME_PAN_100HZ;
} else if (refreshRate >= 115 && refreshRate <= 130) {
FRAME_DURATION = FRAME_DURATION_120HZ;
FRAME_PAN = FRAME_PAN_120HZ;
} else {
// Default values for non recognized refresh rates
FRAME_DURATION = FRAME_DURATION_100HZ;
FRAME_PAN = FRAME_PAN_100HZ;
}
}
void IR_Update(uint32_t curTime)
{
if (IR_SyncMode == SYNCMODE_FREERUN)
{
// Send without any sync source - good for testing glasses
uint16_t delta = curTime-lastFrame;
if (delta >= 9) // 111.(1)Hz
{
IR_SetEye(!curEye);
IR_StartFrame();
}
}
/* Update activity led */
if (emitterActive)
{
if (!emitterActive_last) // just started
{
bitSet(PORT_LED_ACTIVE, LED_ACTIVE);
emitterActive_last = true;
}
else
{
if ((curTime-lastFrame) >= 200)
{
// Sync timeout
bitClear(PORT_LED_ACTIVE, LED_ACTIVE);
bitSet(PORT_LED_EYE, LED_EYE); // Active low
emitterActive = false;
emitterActive_last = false;
}
}
}
}
void IR_SetSyncMode(SyncMode_t mode)
{
if (mode & SYNCMODE_EXTERNAL)
{
EICRA |= (0 << ISC21) | (1 << ISC20); // any edge
bitSet(EIMSK, INT2); // enable external interrupt
}
else
{
EICRA &= ~((0 << ISC21) | (1 << ISC20)); // any edge
bitClear(EIMSK, INT2);
}
synced = false;
emitterActive = false;
IR_SyncMode = mode;
}
void IR_SwapEyes(uint8_t swap)
{
swapEyes = swap != 0;
}
void IR_SetEye(uint8_t eye)
{
nextEye = eye ^ swapEyes;
synced = true;
}
void IR_StartFrame(void)
{
emitterActive = true;
curEye = nextEye;
lastFrame = millis();
synced = false;
SendToken(curEye * 2);
detectRefreshRate(); // Call refresh rate detection
}
//void IR_EndFrame(void) {}
static void SendToken(uint8_t token)
{
if (IR_CurProtocol->sizes[token] == 0) // Check if token exists
return;
curToken = token;
curPulse = IR_CurProtocol->indices[token]; // Get timing array start index
lastPulse = curPulse + IR_CurProtocol->sizes[token];
bitClear(PORT_LED_IR, LED_IR);
TCNT1 = 0;
OCR1A = FRAME_PAN; // Token pan/delay
//OCR1B = 0x00FF;
bitSet(TIMSK1, OCIE1A); // Enable rising edge interrupt
//TIFR1 = 0xFF; // Clear pending interrupts if any
START_IR_TIMER();
// Light up only between frames - invisible(ideally) with glasses
bitSet(PORT_LED_EYE, LED_EYE); // Active low
}
ISR(TIMER1_COMPA_vect) // IR pulse rising edge
{
bitSet(PORT_LED_IR, LED_IR);
OCR1B = OCR1A + (IR_CurProtocol->timings[curPulse++] * 2); // Pulse duration
bitSet(TIMSK1, OCIE1B); // Enable falling edge interrupt
bitClear(TIMSK1, OCIE1A); // Disable this interrupt
}
ISR(TIMER1_COMPB_vect) // IR pulse falling edge
{
bitClear(PORT_LED_IR, LED_IR);
if (curPulse == lastPulse) // Token finished
{
uint8_t nextsize;
bool hasnext = (curToken & 1) == 0; // end of shutter opening token
if (hasnext)
{
nextsize = IR_CurProtocol->sizes[curToken+1];
hasnext = nextsize > 0; // closing token exists
}
if (hasnext)
{
OCR1A = OCR1B + FRAME_DURATION;
bitSet(TIMSK1, OCIE1A); // Enable rising edge interrupt
curToken++;
curPulse = IR_CurProtocol->indices[curToken]; // Get timing array start index
lastPulse = curPulse + nextsize;
//bitSet(PORTB, 5); // Frame start debug
}
else
{
//bitClear(PORTB, 5); // Frame end debug
STOP_IR_TIMER();
bitClear(PORT_LED_EYE, LED_EYE); // Active low
}
}
else
{
OCR1A = OCR1B + (IR_CurProtocol->timings[curPulse++] * 2); // Time until next pulse
bitSet(TIMSK1, OCIE1A); // Enable rising edge interrupt
}
bitClear(TIMSK1, OCIE1B); // Disable this interrupt
}
// Frame sync edge
ISR (INT2_vect)
{
if (IR_SyncMode & SYNCMODE_EXTERNAL)
{
if ((IR_SyncMode == SYNCMODE_EXTERNAL) || ((PIND & _BV(4)) == 0))
{
// VESA 3D sync: high = left eye, low = right eye
IR_SetEye((PIN_SYNCIN & _BV(SYNCIN)) != 0);
}
if (synced) // When using USB sync
IR_StartFrame();
}
}
Code: Select all
#ifndef _IREMITTER_H_
#define _IREMITTER_H_
// Duration between close to open eye frames - in half-microseconds (@16MHz)
#define FRAME_DURATION_85HZ (2*400)
#define FRAME_PAN_85HZ (2*10500)
#define FRAME_DURATION_100HZ (2*400)
#define FRAME_PAN_100HZ (2*9100)
#define FRAME_DURATION_120HZ (2*400)
#define FRAME_PAN_120HZ (2*7500)
// Default values
extern uint16_t FRAME_DURATION;
extern uint16_t FRAME_PAN;
//#define FRAME_DURATION (2*400)
// Time between sync trigger and start of IR token (same units)
//#define FRAME_PAN (2*9100) // 2*3000 for 120Hz display (use 2*3400 for 100Hz)
// INT2, pin 2 on "Arduino Pro Micro"
#define SYNCIN 2
#define PIN_SYNCIN PIND
#define LED_IR 0
#define DDR_LED_IR DDRD
#define PORT_LED_IR PORTD
#define LED_EYE 0
#define DDR_LED_EYE DDRB
#define PORT_LED_EYE PORTB
#define EYE_RIGHT 0
#define EYE_LEFT 1
typedef enum {
SYNCMODE_NONE = 0,
SYNCMODE_DRIVER = 1, // }
SYNCMODE_EXTERNAL = 2, // } Can be used as masks
SYNCMODE_COMBINED = 3,
SYNCMODE_FREERUN = 4
} SyncMode_t;
SyncMode_t IR_SyncMode;
void IR_Init(void);
void IR_Update(uint32_t curTime);
void IR_SetSyncMode(SyncMode_t mode);
void IR_SwapEyes(uint8_t swap);
void IR_SetEye(uint8_t eye);
void IR_StartFrame(void);
//void IR_EndFrame(void);
#endif /* _IREMITTER_H_ */
I testet it on my setup and it worked pretty well. I did use some different protocol settings in the IRProtocols.h too:
Code: Select all
const IR_Protocol_t IRProt_3DVision = {
.sizes = { 3,3, 1,3 },
.indices = { 0,3, 6,7 },
.timings = { 23,46,31, 23,21,23,
43, 23,78,40 }
-
- One Eyed Hopeful
- Posts: 2
- Joined: Fri May 31, 2024 12:06 pm
Re: DIY NVIDIA 3D Vision emitter
Hello everybody
As a newbie in this subject I wish to ask couple of questions, I hope that I`m not gonna piss anybody for not knowing basic stuff regarding this project.
- Is this project is useful without sync signal from DVI2LVDS? I must admit that it cost bit much By word useful I understand that this is DIY and I get that it might be troublesome.
- Am I able to make it work with ELSA Revelator IR glasses? I have some lying around. I bet that their protocol is somewhat exotic and need to be implemented but wish to hear from you, maybe I`m wrong. I also have Samsung wireless shutter glasses but wireless is out of the question as far as I understand this DIY project.
I`m a big fan of 3D technology, played a lot with anaglyph via IZ3D driver and took some anaglyph photos back in the time as a kid. Great stuff. Nowadays when high refresh rate monitors are getting more and more affordable it looks like active 3D might be great idea.
Thank you in advance!
As a newbie in this subject I wish to ask couple of questions, I hope that I`m not gonna piss anybody for not knowing basic stuff regarding this project.
- Is this project is useful without sync signal from DVI2LVDS? I must admit that it cost bit much By word useful I understand that this is DIY and I get that it might be troublesome.
- Am I able to make it work with ELSA Revelator IR glasses? I have some lying around. I bet that their protocol is somewhat exotic and need to be implemented but wish to hear from you, maybe I`m wrong. I also have Samsung wireless shutter glasses but wireless is out of the question as far as I understand this DIY project.
I`m a big fan of 3D technology, played a lot with anaglyph via IZ3D driver and took some anaglyph photos back in the time as a kid. Great stuff. Nowadays when high refresh rate monitors are getting more and more affordable it looks like active 3D might be great idea.
Thank you in advance!
-
- One Eyed Hopeful
- Posts: 2
- Joined: Fri May 31, 2024 12:06 pm
Re: DIY NVIDIA 3D Vision emitter
Idk how to remove this duplicate post! Sorry guys
-
- One Eyed Hopeful
- Posts: 9
- Joined: Tue Mar 10, 2009 5:15 pm
Re: DIY NVIDIA 3D Vision emitter
It is. You can use it the same way you use an original 3D-Vision-Emitter: by syncing it via USB. It is recognized as a "NVIDIA stereoscopic 3D USB controller" and uses its drivers. So with a NVIDIA graphics card you should be able to use NVIDIAs stereo drivers.Wroblos787 wrote: ↑Fri May 31, 2024 1:27 pm - Is this project is useful without sync signal from DVI2LVDS?
Without a NVIDIA gpu you have to rely on third party software for driving the emitter. For example... the:
3DVisionActivator - shuttering without Nvidia
... should work with the DIY emitter too.
It should be possible. The software for the DIY emitter comes with some known and common IR protocols for a couple of IR shutter glasses (you can find them in the IRProtocols.h). Even though the protocol for the H3D/ELSA shutter glasses is missing in it, it is well documented on the web... for example in here:Wroblos787 wrote: ↑Fri May 31, 2024 1:27 pm- Am I able to make it work with ELSA Revelator IR glasses?
https://cmst.curtin.edu.au/wp-content/u ... ync-IR.pdf
... on page 9. According to the White Paper this added lines to the IRProtocols.h:
Code: Select all
const IR_Protocol_t IRProt_ELSA = {
.sizes = { 11,0, 11,0 },
.indices = { 0,0, 11,0 },
.timings = { 11,16,15,16,15,16,15,16,15,47,15,
11,16,15,16,15,47,15,16,15,16,15 }
};
By adding another tactile switch to the hardware layout (connected to one of the input pins of the Arduino) and modifying the software a bit, it should be possible to switch between protocols on the fly (which isn't possible yet... so for every protocol change you have to modify the software and re-flash it onto the Arduino).
I designed a small PCB for an Arduino Clone with Mini-USB:
https://oshpark.com/shared_projects/Jz0WtGLn
... which fits into those aluminum cases:
https://www.amazon.com/gp/product/B08HZB5PMV
Feel free to use and/or modify it.
Then you might want to look at the Open3DOLED project too:Wroblos787 wrote: ↑Fri May 31, 2024 1:27 pmNowadays when high refresh rate monitors are getting more and more affordable it looks like active 3D might be great idea.
System for watching 3d movies on 120hz LCD/OLED OLED displays/TVs (BFI improves quality) Open3DOLED
... which tries to drive some common shutter glasses (like 3D Vision glasses) with modern high refresh rate OLED/LCD monitors.
You do not have the required permissions to view the files attached to this post.