I've been using libdc1394 in our software for a couple years and there was an error logged the other day that I hadn't seen in quite a while now. The error messages follows:
libdc1394 error: Camera Initialize called
libdc1394 error: failed to create iso context
libdc1394 error: IOCTL failure: in setup (Camera.cpp, line 160): Could not setup camera-make sure that the video mode and framerate are supported by your camera
After this error occurred, the user tried to restart the software a few times (it looks like 4 times over roughly 4 or 5 minutes according to my logs) and the same error appeared each time. The 5th time they restarted, the problem went away and stayed away for the remainder of the sessions. The software is written in such a way that its used in an experiment as the first step and then the user exits the application. If they run multiple experiments it will be launched and closed repeatedly. It had been launched and closed half a dozen times or so prior to this that day with no issues.
I checked the logs before the error first appeared and there were no abnormal terminations and the camera shutdown occurred properly.
This problem has not occurred in the recent past and the software has been used thousands of times without any issues like this. I'm trying to understand and document the root cause of this issue and find an appropriate action to take in software when it happens. The fact that it eventually appears to resolve itself suggests that there might be a corrective action I can take or some way to avoid it! I believe it failed to create the DMA buffers, but I typically don't have this issue- and haven't since the error occurred. The code responsible for the failed initialization looks like this:
err=dc1394_capture_setup(m_pcamera, 30, DC1394_CAPTURE_FLAGS_DEFAULT);
DC1394_ERR_RTN(err,"Could not setup camera-\nmake sure that the video mode and framerate are\nsupported by your camera");
The camera is the same Point Grey Grasshopper we run on all of our systems....
Vendor : Point Grey Research
Model : Grasshopper GRAS-20S4M
Unit : 0
Specifications ID : 0xa02d
Software revision : 0x102
IIDC version code : 548
Unit directory offset : 0x428
Unit dependent directory offset : 0x440
Commands registers base : 0xf00000
Unique ID : 0x00b09d01009a0955
Vendor ID : 0xb09d
Model ID : 0x1
Advanced features found at offset : 0xf01000
1394b mode capable (>=800Mbit/s) : Yes
Platform backend : juju
And the operating system is Kubuntu 12.04.1 LTS running 64 bit linux kernel version 3.2.0-29-generic. The card being used for firewire is the recommended point grey card and not a cheap alternative. The camera itself is running the firmware it shipped with, and has not been upgraded. Given that this occurred once now, I don't suspect the camera firmware to be the issue.
libdc1394 is version 2.2.0-2, with libraw1394-11.
Does anyone have any ideas what causes this sort of rare issue? It resolved itself in time, which suggests that its related to a resource managed by the system. The system has plenty of free memory and its dedicated to this purpose so there should be no background activity that would impact this. It had been up for only 6 days at the time of the problem. The kernel log doesn't show any messages regarding the /dev/fw interfaces going offline. In the distant past when I saw this sort of issue during the development, I believe it was because of a loose card or a bad cable. I could always connect the failure to some kernel message showing that the cable had become disconnected.
I'm at a bit of a loss to explain what happened. My intuitive explanation of a cabling issue doesn't hold water since I didn't see any errors reported from the kernel on a loss of connection from a loose cable. I don't believe the card had come loose, but I've seen a loose card or thermal expansion cause strange issues before.
If anyone has any ideas on what to look at, or how to get more diagnostics when/if it occurs, I'd appreciate the advice. I could add code to log some diagnostics if I get a similar problem again, but I'm not sure what to look at. Like I said, I've not seen this error for 2 years and there has been no major change to the camera handling code.
thanks,
Byron
Byron Guernsey
CTO/VP
IKOTECH, LLC
byr...@ik...
(502) 410-1827
http://www.ikotech.com/
|