zma repeatedly being restarted...

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
User avatar
lazyleopard
Posts: 403
Joined: Tue Mar 02, 2004 6:12 pm
Location: Gloucestershire, UK

zma repeatedly being restarted...

Post by lazyleopard »

Not sure what's going on. I recently put my cameras (which I'd been testing on a nice short network cable) up outside where they're actually useful. I then set about creating some useful zones. At some point they started acting a bit erratically. I can't tell whether this is because they're sending frames slightly slower, or because they do now each have more than one zone...
The main symptom is captured in this log sequence:

Code: Select all

Jun  1 07:10:35 zm zmwatch[9996]: INF [Restarting analysis daemon for 2 Garden]
Jun  1 07:10:37 zm zmdc[9762]: WAR [Can't find process with command of 'zma -m 2']
Jun  1 07:10:38 zm zmdc[9762]: INF ['zma -m 2' starting at 19/06/01 07:10:38, pid = 1040]
Jun  1 07:10:38 zm zmdc[1040]: INF ['zma -m 2' started at 19/06/01 07:10:38]
Jun  1 07:10:41 zm zma_m2[1040]: INF [zma_m2] [In mode 3/1, warming up]
Jun  1 07:10:42 zm zma_m2[1040]: INF [zma_m2] [Analysis fps (2.00) is lower than capturing fps (2.04), disabling adaptive skip feature]
Jun  1 07:10:48 zm zma_m2[1040]: INF [zma_m2] [Garden: 011 - Gone into prealarm state]
Jun  1 07:10:49 zm zma_m2[1040]: INF [zma_m2] [Garden: 012 - Gone into alarm state PreAlarmCount: 1 > AlarmFrameCount:1]
Jun  1 07:10:50 zm zmc_m2[9842]: INF [zmc_m2] [Garden: images:48300 - Capturing at 2.00 fps, capturing bandwidth 774021bytes/sec]
Jun  1 07:10:53 zm zma_m2[1040]: INF [zma_m2] [Garden: 012 - Opening new event 2183, alarm start]
Jun  1 07:11:00 zm zmwatch[9996]: INF [Analysis daemon for 2 Garden needs restarting, time since last analysis 13 seconds (1559373060-1559373047)]
Jun  1 07:11:02 zm zmwatch[9996]: INF [Restarting analysis daemon for 2 Garden]
Jun  1 07:11:09 zm zmdc[9762]: INF ['zma -m 2' sending stop to pid 1040 at 19/06/01 07:11:09]
Jun  1 07:11:11 zm zma_m2[1040]: ERR [zma_m2] [Can't insert log entry: sql(06/01/19 07:11:11.234059 zma_m2[1040].INF-zm_signal.cpp/40 [Got signal 15 (Terminated), exiting) error(db is locked)]
Jun  1 07:11:11 zm zma_m2[1040]: WAR [zma_m2] [Calling zmDbConnect when already connected]
Jun  1 07:11:11 zm zma_m2[1040]: INF [zma_m2] [Got signal 15 (Terminated), exiting]
Jun  1 07:11:13 zm zmc_m2[9842]: WAR [zmc_m2] [Buffer overrun at index 10, image 48346, slow down capture, speed up analysis or increase ring buffer size]
Jun  1 07:11:14 zm zma_m2[1040]: INF [zma_m2] [Garden: image_count:14 - Closing event 2183, shutting down]
Jun  1 07:11:16 zm zmdc[9762]: INF ['zma -m 2' exited normally]
Jun  1 07:11:19 zm zmdc[9762]: INF [Starting pending process, zma -m 2]
Jun  1 07:11:19 zm zmdc[9762]: INF ['zma -m 2' starting at 19/06/01 07:11:19, pid = 1045]
Jun  1 07:11:19 zm zmdc[1045]: INF ['zma -m 2' started at 19/06/01 07:11:19]
Jun  1 07:11:21 zm zmwatch[9996]: ERR [Last analyse time for 2 Garden was zero.]
Jun  1 07:11:22 zm zma_m2[1045]: INF [zma_m2] [In mode 3/1, warming up]
Jun  1 07:11:22 zm zmwatch[9996]: INF [Restarting analysis daemon for 2 Garden]
Jun  1 07:11:24 zm zma_m2[1045]: INF [zma_m2] [Analysis fps (2.00) is lower than capturing fps (2.05), disabling adaptive skip feature]
The zma process goes into alarm mode, then zmwatch decides it needs re-starting. The zma is terminated and re-started, and the zmwatch complains thah the analyse time was zero. There's a zmDbConnect re-connection problem somewhere in there, too.

I have two HikVision network cameras, and they're both doing this. The one with more zones is only very rarely compling

Any ideas?
Rick Hewett
User avatar
kitkat
Posts: 193
Joined: Sun Jan 27, 2019 5:17 pm

Re: zma repeatedly being restarted...

Post by kitkat »

Try leaving 'Analysis FPS' empty - I'm under the impression that most of those FPS settings are best left alone.

You may also see erratic frame rates if your camera supports different exposure modes - My cheap Chinese things have 'Framerate' and 'Exposure,' with the former enforcing a strict frame rate, even at the expense of under-exposed images, and the latter varying the frame rate to achieve sensible exposure. I use 'Exposure' mode and during the day I get the 10 FPS that I've set in the camera, but it drops nearer to 5 at night.
User avatar
lazyleopard
Posts: 403
Joined: Tue Mar 02, 2004 6:12 pm
Location: Gloucestershire, UK

Re: zma repeatedly being restarted...

Post by lazyleopard »

I had the cameras with the default "All" zone working reasonably smoothly at 4fps 1920x1080 when they were beside me on the windowsil, but I dropped the rate to 2fps when I put them up outside. If there's a data bottleneck it's more likely the machine running ZM, which is a few years old now. It used to run four local V4L video cameras at 640x480 quite happily, but two 1920x1080 cameras take more work than four 640x480 ones even without the network side...
Rick Hewett
User avatar
iconnor
Posts: 2882
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: zma repeatedly being restarted...

Post by iconnor »

You will want to increase the values for WATCH_CHECK_INTERVAL and WATCH_MAX_DELAY
User avatar
lazyleopard
Posts: 403
Joined: Tue Mar 02, 2004 6:12 pm
Location: Gloucestershire, UK

Re: zma repeatedly being restarted...

Post by lazyleopard »

Thanks. They were set to 10 and 5. I've changed then to 90 and 10 to see what happens.

Clearing the MaxFPS value had an unexpected side-effect on a trigger script that relied on there being a value in that field; it ended up dividing by nothing, which did at least make it clear where one of the unexpected problems was... ;)
Rick Hewett
Post Reply