Page 1 of 1

Streaked (sometimes garbled) Images with Kodicom 4400!

Posted: Wed Apr 05, 2006 6:00 pm
by maclellan
Hello ZM friends,

I have this issue with distorted (streaked) images when I 'MOCORD' on 2 cameras pointed to the same object. The streaks last for a single frame at a time and only occur arround the moving object. The lines appear to shaddow the moving object but can be much wider. The artifacts also seem to be only a single field - ie every other line in the frame. Also both images are affected but streaks appear at different times in video sequence.

On rare occasion I get similar garbled images as described in this posting as well sometimes in addition to above:

http://www.zoneminder.com/forums/viewto ... ple+camera


This is my setup:

Hardware and OS:
-----------------------------

-Gentoo 2005.1-r1
-zm 1.22.0
-pentiun4, intel chipset
-KODICOM 4400r board
-512 M ram (shmmax set to 301,989,888)


Software (ZM):
--------------------------

- 4 monitors defined - one monitor per bt878 chip - ie channel 1,5 from each cable harness.
- 2 cameras pointed to same object in MOCORD mode with a single zone.
- other 2 cameras are in 'MONITOR' mode not actively streaming.
- All monitors set to limit 10 FPS.
- All monitors set to 640 X 480 RGB24.
- Analyse mode switched off.
- Buffers are 20,5,5,10,1


Still looking for error messages. Will post later.

Here are some examples one from each camera:





Image
Image

Posted: Tue Apr 18, 2006 2:58 am
by maclellan
Here's an update!

To solve this problem I tried many many things - especially reading numerous forum articles, but little avail. However ...

I solved this problem and in turn discovered something new about ZM behaviour!

The problem appears to be when I have multiple devices on a single card and two or more monitors recording in "modect" or "record' mode the data transfers interfere with each other.

I reverted back to 1.21.3 and saw the same problem. Keeping to this version I set the max fps for the two monitors recording to different values - one to 7 and the other to 8. NO more interference lines! If I tried any other numbers that are the same - I get the lines!

So Phil (if you are listening) , I think there may be something in the timing / cycling of capturing monitors and sending to disk that can be improved upon here. It appears that initiating a disk save for two or more monitors at the time results in data corruption. Just a guess.

-scott

Posted: Tue Apr 18, 2006 3:18 pm
by zoneminder
Thanks for reporting back. I suspect this is not related to disk writing (as that takes place in another binary) but in the timing of the switching between inputs. Possibly the Kodicom requires a little 'settle' time between captures and the maximum values you have selected allow that whereas others cause some of the captures to come too close together.

That's what I would guess anyway but I have nothing solid to base that on without further evidence really.

Posted: Tue Apr 18, 2006 6:30 pm
by maclellan
Thanks Phil,

You might be right. At this point I dont really know. I would like to help you solve this issue.

Here are some clues / observations (based on 1.21.3) :

- Max FPS setting still produces 'collisions' even at a low setting but both channels set to same value. For example both monitors set to 3 or even 10 show collisions. One set to 7 and the other 8 do not.

- HD performance has little to do with it. Initially my hdparm showed 4.5 mB/sec! Now it's 48 mB/Sec and little difference.

- 'Collisions' not seen on streaming even at high max fps only recording! (I need to do more tests to absolutely confirm this.)

- Coincidental with the /var/log/messages report : ERR[ Incomplete write of image data ... and ERR [ incomplete read .... . (These errors are seen by others - possibly they have the same image artifacts but havent set up a test to observe them. )

- Using frame server actually make the problem worse. I tried varying buffer setting as well and wmem_max with no change.

- Changing monitor buffer settings has little effect. Any other options have absolutely no effect on problem.

- Collisions are likely to start at the very beginning of recorded event and recur every 2 seconds or so. They do not occur at all when a single monitor is recording video.

- I observed this problem with the 2 monitors in 'Record' mode to eliminate the possibility of additional motion detection processing, but no change.

- The artifacts are mostly seen when a subject moves in front of both cameras. But that does not mean they are not there for still images.

- Artifacts are always every other line implying that only a single field is corrupt.

My thoughts are originally this has to do more with data writes since I have not seen artifacts in the simultaneous live viewing of 4 channels even at high fps. (I'll get back with more on this)

Either way it possibly has to do with sychronizing the data from 2 or more bt878a coming from 4 instances of the device driver to a single occurance of the ZM daemons. When the max FPS setting is the same data handling might be occuring at the same time on asynchronous sources leading to errors.

-scott