03-15-2017 01:39 AM
03-18-2017 09:18 AM
-Try deleting the camera files(.iid and .icd) and Drivers and do fresh installation of drivers.
Where is the location of those files to delete them ?
you mean by fresh installation, uninstalling the camera drivers from device manager, then unplug the camera usb, and then plug the usb and let the computer automatically detects the device and install the drivers again, right ?
03-18-2017 06:28 PM
The Original Poster discovered (perhaps by searching the LabVIEW Forums) that I have used a Logitech C920 WebCam with IMAQdx, and asked me a series of questions in a Private Message. I posted an answer, but realized that I did not directly address the questions I was asked. So, for the benefit of the Original Poster and others who may have a similar problem, I'm going to post the Q&A here. Here are the questions, with my answers and comments below.
I am going to purchase a new Logitech C920 camera, and while I am searching in the forum, I find that you own one.
I am afraid of having the same issue with the Logitech camera. That's why I am texting you.
- Did you face such an issue in your camera ?
- Are the drivers supported in windows 10 ?
- Is there any problem working with grabbing 1280x720p @30fps ?
- Did you try to work with USB 3.0 interface ? If yes, is there any improvements in the performance ?
- What modes are you having in MAX ? YUY2 or MJPEG ?
Did I face "such an issue"? I explained that I was unclear what the "issue" was, as no code was posted, so I wasn't even clear if the problem was viewing images in MAX at the stated resolution (I pointed out that this is a transfer of >100MB/sec), viewing the images in LabVIEW, or saving the Images to a Video file.
I'm currently on my home Desktop, running Windows 10 with LabVIEW 2016. The drivers "auto-installed" without a hitch. I also have a Microsoft LifeCam Cinema (don't know the model, but the camera is pretty old, maybe 8 years) that shows up, as well.
Problem grabbing at 1280x720, 30 fps, MJPG? Works just fine in MAX -- I left it running for >15 minutes, looked pretty smooth.
USB 3.0 or 2.0? I'm pretty sure this is plugged into a USB 3.0 socket, but haven't yet crawled around to the back of my PC to verify -- just a second ...
Good thing I checked -- the camera is plugged into a USB 2.0 hub (along with my wireless keyboard/mouse, a Logitech controller, a Label Printer, something else I'm not sure about), which is plugged into a USB 2.0 port on my PC. I have another one of these Cameras at work, where it is easier to plug into USB 2 or 3 without a lot of crawling (somehow I managed to lock up my PC just now, requiring me to power down and restart -- fortunately the Forum saved my unfinished partial reply). So at the present time, I can't say what "improvement" plugging into USB 3.0 would be, as, in MAX, it looked fine in USB 2.0.
What mode? I was using MJPG.
OK, so "just for fun", I whipped up a few IMAQdx VIs to try to do the same thing in LabVIEW (the code's gone "bye-bye" in my reboot, but it's dirt simple to set up). I used about 4 or 5 IMAQdx functions (plus an IMAQ Create to create my Image, U32 RGB). The camera (in MAX) was configured as 1280x720, 30fps, MJPG, and when I looked at the image being displayed on the LabVIEW Front Panel, it was very "jerky", I'd say about 3-5 fps. Of course, the reason was obvious when looking at the information shown on the Image Display -- the camera was running at max resolution, 2304x1536 RGB24, 2fps. Simple fix to change the Video Mode to 1280x720, 30fps MJPG, and once again, images smooth as silk (I only wanted for a few minutes).
Some comments on earlier posts.
Don't give up -- it is definitely "do-able", though if you want to write Video files, you may have to think about compression techniques (which IMAQ will probably handle for you).
Bob Schor
03-18-2017 08:12 PM
Did I face "such an issue"? I explained that I was unclear what the "issue" was, as no code was posted, so I wasn't even clear if the problem was viewing images in MAX at the stated resolution (I pointed out that this is a transfer of >100MB/sec), viewing the images in LabVIEW, or saving the Images to a Video file.
The issue is stated in the first post in the thread. Problem is camera timeout which leads to glitch images and freezing. This situation is applied to both software MAX (no code here) and LabVIEW (with code). I am making sure first that the camera is working fine in MAX then try it after that with my LabVIEW and the post-acquisition steps which is image processing. I am getting the error in both cases. Several resolutions are tested with different fps but problem is still there. Other softwares are tested, different computers and still no luck. I doubt that there is something wrong with the code because I tested it with my laptop built in webcam and I didn't face any timeout problems. I looked up in microsoft forums and searched about this issue,
[Dropped frames, timeout, image freezing, USB device not recognized suddenly]
and here are some suggestions:
- Scale down (mute) the microphone of the camera from the driver [Tested, didn't fix it]
- Disable the option of power management in USB Root Hub (Allow the computer to turn off this device to save power mode [Tested, didn't fix it]
- Some people report problem with the camera driver and windows 10, specifically after the anniversary update 1607
- Some people converted to Logitech products [That's why I asked the user with Logitech C920]
Logitech claims that their C920 is a USB 3.0 ready device. As far as I know, USB 2.0 only have enough speed for 720p @30fps, or a less fps at higher resolution. The USB 2.0 bandwidth is limited to delivering a maximum of 60 Mbytes/sec. Higher resolutions encoded frames @30fps will be compressed and sent over this limited bus through UVC 1.1 compliant of the camera.
If your getting higher bandwidth >60 Mbytes/sec with your Logitech C920, maybe you're getting a benefit of USB 3.0 claimed product.
My Lifecam Studio doesn't show MJPG format in MAX. It only shows YUY2, I don't know if there is way to configure that.
Code is attached, as I stated at the beginning, I tested it with my built in laptop camera and no timeout problem appeared
03-19-2017 04:03 PM
At last! Code! Something I can run and inspect.
A good idea when getting started with Video is to do what I did (yesterday?) -- spend 10-15 minutes and create a loop that does nothing except take images and display them on a single (1!) Image output. Do include the Stop control. When you do this, look at the Image Indicator and note whether or not the Image is what you expect (i.e. 1280 x 720 32-bit RGB). If not, post your simple code and we can try to fix it.
Bob Schor
03-19-2017 06:12 PM
Sir, I know the code is working well and there is another vi I have where the acquisition and the processing are in separated loops. Again, I can't run my Lifecam Studio in BOTH (MAX) and (LabVIEW) as it gives me timeout error ALSO IN BOTH. The acquisition process doesn't stand for a couple of seconds > maximum 2-3 minutes and frames are dropped resulting glitch images/freezing then USB device not recognized. The problem is not in the coding. As I tested the camera with other several softwares not related to NI, ex: Skype .. and still freezes then disconnects automatically after a few seconds.
03-20-2017 12:24 AM - edited 03-20-2017 12:25 AM
-The iid and Icd files are located in below path: C:\Users\Public\Documents\National Instruments\NI-IMAQdx\Data
-Often I see parameters of the camera are changed Knowingly/Unknowingly and it messes the settings for the camera, hence i suggested deleting those files and trying with new setting files which MAX generates with default parameters.
-Yes I meant by reinstalling the drivers as you mentioned.
--I think you have tried with Different USB Port/Different Software/Different PC also then i believe it is not the problem with NI/Software and it could be with Camera itself.
-Contact Camera Vendor and ask for suggestions and replacement if it is faulty.
03-20-2017 09:46 AM
Another suggestion would be to try switching the camera drivers used by the OS. There are typically several layers of drivers involved for USB web cameras, including the generic UVC video driver from Microsoft as well as vendor-provided filter drivers that sit on top and modify the behavior. This last one typically is the one that has several variations: often there is an inbox-provided one (distributed by Microsoft automatically) in addition to vendor-provided ones (on installation media with the camera or vendor's website). You may want to try switching between these by alternately installing vendor drivers and/or uninstalling them.
Realistically I'd suggest if you continue having issues to simply switch cameras.
03-20-2017 10:37 AM - edited 03-20-2017 10:39 AM
I've just done additional tests with a Logitech C920 Camera on my work PC, an I7 with 32GB memory running Windows 7 x64 and LabVIEW 2015 and 2016, both 32-bit. Let me summarize my findings:
Bob Schor
P.S. -- I meant to mention that I plugged this Camera into my Win 7 PC as a "new Camera". It had no problem loading the Drivers, and came right up in MAX as "cam25", which I renamed to C920.
03-20-2017 11:48 PM
OK, my routine has been running for over an hour (technically for 3850.84 seconds), has acquired 115522 frames, for a calculated frame rate of 29.9992 FPS. No frames were dropped.
Conclusion -- the Logitech C920 can easily acquire 1280x720 32-bit RGB images at 30fps using Windows 7 x64, LabVIEW 2015 32-bit for significant periods of time without dropping any images. The image acquisition/display takes <10% of the CPU on a USB 2.0 or 3.0 port (did not notice a significant difference). I didn't run this same extended test on my home Windows 10 system, but I'll try to do that this evening.
Bob Schor
P.S. -- sorry, I actually thought I posted this 12 hours ago, but something went haywire in my work PC, and I didn't notice it in time. Fortunately, the unposted copy was saved, so I could finish it now ...