Capturing dies once an event starts

Support and queries relating to all previous versions of ZoneMinder
Locked
toml
Posts: 3
Joined: Fri Apr 22, 2005 2:58 am

Capturing dies once an event starts

Post by toml »

Hi all,

I'm currently running ZoneMinder 1.20.1 on a P4 3ghz HT, 1024MB DDR Ram, 2x 72gb Western Digital 10000rpm SATA drives in RAID 1 machine.
It's monitoring 2x Axis 201 cameras via IP.

It's been running fine (however its always keeping the load above 1.1 on a fairly high spec'd machine just for two cameras!)... but now its developed some wierd problem.

It seems that whenever an event is triggered (motion, forced, anything), the ZoneMinder seems to stop receiving images.

I have the Pre Image Event Buffer set to 15 frames... and whenever an event is triggered, that 15 frame buffer gets written to the event directory, but nothing else does.

The following shows up in the system logfile when an event occurs:

Code: Select all

Apr 22 18:38:16 [zma_m1] INF [nscam1: 7000 - Processing at 12.05 fps]
Apr 22 18:38:24 [zma_m1] INF [nscam1: 7105 - Gone into alarm state]
Apr 22 18:38:24 [zmf_m1] ERR [Incomplete read of frame image data, 16112 bytes only]
Apr 22 18:38:24 [zma_m1] ERR [Incomplete frame write: 16128 of 43740 bytes written]
Apr 22 18:38:24 [zmf_m1] INF [Frame server socket open, awaiting images]
Apr 22 18:38:25 [zmf_m1] ERR [Incomplete read of frame image data, 16112 bytes only]
Apr 22 18:38:25 [zma_m1] ERR [Incomplete frame write: 16128 of 43701 bytes written]
Apr 22 18:38:25 [zmf_m1] INF [Frame server socket open, awaiting images] 
Apr 22 18:38:25 [zmf_m1] ERR [Incomplete read of frame image data, 16112 bytes only]
Apr 22 18:38:25 [zma_m1] ERR [Incomplete frame write: 16128 of 43750 bytes written]
Apr 22 18:38:25 [zmf_m1] INF [Frame server socket open, awaiting images]
Apr 22 18:38:25 [zmf_m1] ERR [Incomplete read of frame image data, 16112 bytes only]
Apr 22 18:38:25 [zma_m1] ERR [Incomplete frame write: 16128 of 44251 bytes written]
Apr 22 18:38:25 [zmf_m1] INF [Frame server socket open, awaiting images]
Apr 22 18:38:25 [zmf_m1] ERR [Incomplete read of frame image data, 16112 bytes only]
Apr 22 18:38:25 [zma_m1] ERR [Incomplete frame write: 16128 of 44588 bytes written]
Apr 22 18:38:25 [zma_m1] ERR [Can't insert frames: Duplicate entry '262646' for key 1]
Apr 22 18:38:27 [zmc_m1] WAR [Buffer overrun at index 9_]
                - Last output repeated twice -
Apr 22 18:38:30 [zmc_m1] INF [nscam1: 25000 - Capturing at 12.05 fps]
Apr 22 18:38:32 [zmc_m1] WAR [Buffer overrun at index 9_]
                - Last output repeated 32 times -
Apr 22 18:39:55 [zmc_m1] INF [nscam1: 26000 - Capturing at 11.76 fps]
Apr 22 18:39:57 [zmc_m1] WAR [Buffer overrun at index 9_]
                - Last output repeated twice -
Apr 22 18:39:59 [zmc_m2] INF [nscam2: 224000 - Capturing at 1.09 fps]
Apr 22 18:40:01 [/usr/sbin/cron] (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )
Apr 22 18:40:02 [zmc_m1] WAR [Buffer overrun at index 9_]
                - Last output repeated 24 times -
Apr 22 18:41:05 [zma_m1] INF [Debug Level = 0, Debug Log = <none>]
Apr 22 18:41:05 [zma_m1] INF [Warming up]
Apr 22 18:41:05 [zmf_m1] INF [Frame server socket open, awaiting images]
Apr 22 18:41:20 [zmc_m1] INF [nscam1: 27000 - Capturing at 11.76 fps]
Apr 22 18:42:29 [zma_m1] INF [nscam1: 1000 - Processing at 11.90 fps]
Apr 22 18:42:45 [zmc_m1] INF [nscam1: 28000 - Capturing at 11.76 fps]
Apr 22 18:43:54 [zma_m1] INF [nscam1: 2000 - Processing at 11.76 fps]

Any ideas?

Much appreciated,

Tom
toml
Posts: 3
Joined: Fri Apr 22, 2005 2:58 am

Post by toml »

Okay... so I fixed the previous problem by upgrading to 1.21.0.
All events are now being captured and recorded properly.. although there is a lot of these showing up in my logs:

Code: Select all

Apr 23 03:05:00 [zmf_m1] ERR [Incomplete read of frame image data, 16112 bytes only]
Apr 23 03:05:00 [zma_m1] ERR [Incomplete frame write: 16128 of 43092 bytes written]
Apr 23 03:05:00 [zmf_m1] INF [Frame server socket open, awaiting images]
The main problem I'm now having is this:

Code: Select all

Apr 23 03:09:10 [zms] ERR [Unable to authenticate user]
Why would this be happening? I can't stream any streams, but still pictures display fine. I know the user authenticates properly, otherwise I wouldn't be able to log into ZoneMinder...

Thanks,

Tom
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

The frame write errors you don't need to worry about to much though you should try and remove them. Basically it means that frames are being written to disk by the zma process itself rather than being dished out to the zmf daemon. To correct this you need to modify Options->System->ZM_FRAME_SOCKET_SIZE taking careful note of the help associated with it, namely
For large captured images it is possible for the writes from the analysis daemon to the frame server to fail as the amount to be written exceeds the default buffer size. While the images are then written by the analysis daemon so no data is lost, it defeats the object of the frame server daemon in the first place. You can use this option to indicate that a larger buffer size should be used. Note that you may have to change the existing maximum socket buffer size on your system via sysctl (or in /proc/sys/net/core/wmem_max) to allow this new size to be set. Alternatively you can change the default buffer size on your system in the same way in which case that will be used with no change necessary in this option
Your other issue with authentication we will need to dig a little further into, do you have any other information which might help? If not then we may need to increase the debug on zms to find out what is happening.

Phil
toml
Posts: 3
Joined: Fri Apr 22, 2005 2:58 am

Post by toml »

Hi Phil,

Thanks for your reply.

I have increased the ZM_FRAME_SOCKET_SIZE option as you suggested, firstly to 512 KB, then to 1024 KB (increasing the kernel's wmem_max at the same time, to a value higher than ZM_FRAME_SOCKET_SIZE).

I've also tried increasing the kernel's shared memory maximum to 256MB from its previous 128MB limit.

Neither of these had any effect, so I've now increased ZM_FRAME_SOCKET_SIZE and wmem_max to 6MB and 10MB respectively... but I'm still getting the same "Incomplete read of frame image data" from the zmf process and "Incomplete frame write" from the zma process.

Any other suggestions in regards to this?

As for the zms cgi application, what is the best way to increase debug output so I can find any errors?


Thanks,

Tom
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

The socket buffer sizes should need to be no more than the size of an image. A 100Kb or is often enough. Are you changing the sysconfig files or using the /proc interface to change the values? One will update them directly, the other will have no effect until after a boot.

Debugging zms works best by setting the ZM debug variables in a terminal shell, then setting the QUERY_STRING env var to the parameters passed to zms from the web page (monitor=1&bitrate=... etc). Then just run zms on the command line, but capture the output to a file as if it works it will be binary and probably mess up your screen!

Phil
Locked