This project is read-only.

VGA2USB in GoblinXNA4.1 compare to GoblinXNA3.5

Aug 2, 2012 at 8:36 PM

In stead of using camera for Totorial16, I am using VGA2USB capture card (http://www.epiphan.com/products/frame-grabbers/vga2usb-lr/) so that I can feed VGA.

But when I tried with Tutorial16, it doesn't work very stable. 6 our of 10 times, it is ok to open VGA2USB successfully and display VGA signal from other machine just fine. The is a little delay to start up.

The other 4 times I got black screen?

I then tried this card in GoblinXNA 3.5. 10 out of 10, I can just open VGA2USB fine and no delay at all.

Trying to compare the code of camera initialize between the two version, can't figure out why?

Coordinator
Aug 2, 2012 at 11:27 PM

There is no change between 3.5 and 4.1 for DirectShowCapture class, so I don't know really why.

Aug 2, 2012 at 11:30 PM

From the code comment, I do see this

// Create our video capture device that uses DirectShow library. Note that

// the combination of resolution and frame rate that are allowed depend on

// the particular video capture device. Thus, setting incorrect resolution

// and frame rate values might cause exception or simply be ignored, depending

// on the device driver. The values set here will work for a Microsoft VX 6000,

// any many other webcams.

And from the specs page of VGA2USB here http://www.epiphan.com/products/frame-grabbers/vga2usb-lr/specifications/

I see that the combination of Resolution: 800x600 and Frame Rate 22.6-60 FPS. I set it to 30, Should be ok but I don't know why it is very unstable.

But in 3.5, it is extremely stable.

Aug 3, 2012 at 4:10 PM
Edited Aug 3, 2012 at 4:53 PM

Further investigate this morning showing that Goblin XNA is also unstable with VGA2USB capture card. Sometime it can capture the camera and sometime it not.

The exception is the same as 4.1.

"Video capture device ID: 1, Name: VGA2USB LR V3U46942 is used by other application, and can not be accessed"

This is an exeption throw from DirectShowCapture at line 391. Please see the image

http://www.flickr.com/photos/74025721@N05/7704678598/in/photostream

Although I close all application and there is no other is using the capture card.

I do see that the first time it start it is always fine but the second time and the following does have issue.

Does it because we don't release the camera whent he application exit? Don't see where in the code doing that?

I think the scene.Dispose() under Dispose(bool disposing) should take care of resouce releasing including the capture card?

Thanks

Truyen

Coordinator
Aug 4, 2012 at 10:22 PM

The dispose of each individual devices are taken care of by the device class's dispose method. In this case, it's the DirectShowCapture class's dispose class. Since it works fine for regular webcam, I believe it disposes for VGA2USB as well.

One possibility is that it takes a while to start from the 2nd time. The mechanism I use to detect whether the capture device is used by another application or not is to try to connect to the capture device for a constant number of times (I believe it's set to 1000 at the moment, and you can see this number in DirectShowCapture). If it fails to access within this number of times, it'll assume it's used right now since there is no other way to tell. For certain camera devices, it takes time to dispose and restart, which won't usually happen with a regular webcam. If this is the case for you, you can increase the number used to large number instead of 1000. Try to see if this solves your problem.

By the way, I won't have much time from now on since I need to finish my Ph.D thesis.

Ohan

Aug 4, 2012 at 11:31 PM

Thank Ohann for the help.

That's what I did, I already increase that to 5000. It have more change to open the VGA2USB capture but still fail. Said 4 our of 10.

All the best for your thesis Ohan. I will do further testing and see if I can improve this. I'll post back for sure to share just in case other facing the same issue.

Truyen

Coordinator
Aug 5, 2012 at 4:05 AM

Please try a regular webcam as well just to make sure it only happens with VGA2USB interface. If it happens to webcam as well, then it might be something to do with the system since it doesn't happen to us.

Ohan

Aug 5, 2012 at 10:08 PM

Yeah, I tried with normal webcam. It's only having issue with VGA2USB and not happen to normal webcam at all.

Wishing that somebody already tried this capture card and can report back if the issue exist.

Thank Ohan.

Coordinator
Aug 5, 2012 at 10:47 PM

By the way, you're always welcome to implement your own IVideoCapture interface if that makes more sense. There might be specific library that works better with VGS2USB than DirectShow library.

Ohan

Aug 6, 2012 at 4:05 PM

Thank Ohan, I'll see what I can do to improve this.