Re: [libdc] Corrupted frames under OS X - libdc1394 2.0.1
Capture and control API for IIDC compliant cameras
Brought to you by:
ddouxchamps,
gordp
From: Mark <mar...@go...> - 2008-02-28 08:01:06
|
On 28.02.2008, at 03:00, David Moore wrote: > On Wed, 2008-02-27 at 15:39 -0500, David Moore wrote: >> It is >> not possible for the image data to be corrupted on the bus, since >> there >> are checksums to verify the integrity of each packet. >> > > Ah, I am wrong there! > > I went back and looked at the OHCI specs, and in fact the CRC is > checked, but the packet data is passed to us even if it has been > detected to be corrupt. We are responsible for looking at the error > codes for _each_ packet and making sure they are valid. > > For obscure reasons, this only applies to Mac OS. The technique Linux > uses for capturing packets _does_ automatically discard them if they > are > corrupt. That's why I hadn't seen this before. > > So in fact, these corruptions you are seeing are probably a result of > bus traffic, just like the skipped packets. I can weed these out by > checking the error codes for each packet, which I am currently > ignoring. > > I will whip up some code for this and check it into SVN hopefully > later > tonight. This change will only apply to Mac OS. Are bad packets automatically re-transmitted or does that mean that from now on a frame with bad packets will be just dropped? If the later is the case, it would be great to know that somehow - maybe capture_dequeue could just deliver the bad frame with a return code of DC1394_BAD_FRAME instead of DC1394_SUCCESS. Mark |