Page 1 of 1

Change to Modect requires restart with bt878 card

Posted: Mon Aug 21, 2006 5:21 am
by goatcatcher
Hi all,

I've been slowly configuring a ZoneMinder server and had it working well with my 2 DLink 4 channel video servers. It is a very impressive piece of software and I shall certainly be making a donation once I have everything running smoothly.

Now...I've decided to relocate a camera, and due to "logistical issues" the easiest way to do this was to get a cheap 4 channel PCI card for the server, but I'm experiencing some strange behaviour that means I have to restart ZoneMinder for MODECT to work properly.

The card is a generic bt878 clone bought from eBay and works fine in Monitor mode with card=77 in modprobe.conf. I'm using an install of Ross's Mandriva LiveCD.

There seem to be 2 sets of symptoms.

(1) On changing the camera on /dev/video0 to Modect from Monitor, no motion is detected unless zoneminder is restarted. Syslog:
Aug 20 00:33:38 zm zmdc[5623]: INF ['zmupdate.pl -c' started at 06/08/20 00:33:38]
Aug 20 00:33:38 zm zmdc[5582]: INF ['zmupdate.pl -c' starting at 06/08/20 00:33:38, pid = 5623]
Aug 20 00:33:39 zm Update agent starting at 06/08/20 00:33:39
Aug 20 00:34:04 zm zmdc[5582]: INF ['zmc -d /dev/video0' already running at 06/08/20 00:33:37, pid = 5605]
Aug 20 00:34:04 zm zmdc[5670]: INF ['zma -m 1' started at 06/08/20 00:34:04]
Aug 20 00:34:04 zm zmdc[5582]: INF ['zma -m 1' starting at 06/08/20 00:34:04, pid = 5670]
Aug 20 00:34:04 zm zma_m1[5670]: INF [Debug Level = 0, Debug Log = <none>]
Aug 20 00:34:04 zm zma_m1[5670]: INF [In mode 3/1, warming up]
Aug 20 00:34:04 zm zma_m1[5670]: INF [Got signal (Hangup), reloading]
Aug 20 00:34:06 zm zma_m1[5670]: INF [Cam_1: 14 - Processing at 3.50 fps]
Aug 20 00:34:08 zm zma_m1[5670]: INF [Cam_1: 019 - Gone into prealarm state]
Aug 20 00:34:08 zm zma_m1[5670]: INF [Cam_1: 21 - Processing at 3.50 fps]
Aug 20 00:34:10 zm zma_m1[5670]: INF [Cam_1: 28 - Processing at 3.50 fps]
Aug 20 00:34:12 zm zma_m1[5670]: INF [Cam_1: 35 - Processing at 3.50 fps]
Aug 20 00:34:14 zm zma_m1[5670]: INF [Cam_1: 42 - Processing at 3.50 fps]
Aug 20 00:34:16 zm zma_m1[5670]: INF [Cam_1: 49 - Processing at 3.50 fps]
Aug 20 00:34:18 zm zma_m1[5670]: INF [Cam_1: 56 - Processing at 3.50 fps]
Aug 20 00:34:20 zm zma_m1[5670]: INF [Cam_1: 63 - Processing at 3.50 fps]
Aug 20 00:34:22 zm zma_m1[5670]: INF [Cam_1: 70 - Processing at 3.50 fps]
Aug 20 00:34:24 zm zma_m1[5670]: INF [Cam_1: 77 - Processing at 3.50 fps]
Aug 20 00:34:26 zm zma_m1[5670]: INF [Cam_1: 84 - Processing at 3.50 fps]
Aug 20 00:34:28 zm zma_m1[5670]: INF [Cam_1: 91 - Processing at 3.50 fps]
Aug 20 00:34:30 zm zma_m1[5670]: INF [Cam_1: 98 - Processing at 3.50 fps]
Aug 20 00:34:31 zm zma_m1[5670]: INF [Cam_1: 102 - Gone into prealarm state]
Aug 20 00:34:32 zm zma_m1[5670]: INF [Cam_1: 105 - Processing at 3.50 fps]
Aug 20 00:34:34 zm zma_m1[5670]: INF [Cam_1: 112 - Processing at 3.50 fps]
Aug 20 00:34:36 zm zma_m1[5670]: INF [Cam_1: 119 - Processing at 3.50 fps]
Aug 20 00:34:37 zm zmpkg[5776]: INF [Command: restart]
Aug 20 00:34:38 zm zmdc[5582]: INF ['zmaudit.pl -c' stopping at 06/08/20 00:34:38]
Aug 20 00:34:38 zm zmdc[5582]: INF ['zmaudit.pl -c' crashed, signal 14]
Aug 20 00:34:38 zm zmdc[5582]: INF ['zma -m 1' stopping at 06/08/20 00:34:38]
Aug 20 00:34:38 zm zma_m1[5670]: INF [Got signal (Terminated), exiting]
Aug 20 00:34:38 zm zmdc[5582]: INF ['zma -m 1' exited normally]
Aug 20 00:34:38 zm zmdc[5582]: INF ['zmfilter.pl ' stopping at 06/08/20 00:34:38]
Aug 20 00:34:38 zm zmdc[5582]: INF ['zmfilter.pl ' crashed, signal 14]
Aug 20 00:34:38 zm zmdc[5582]: INF ['zmupdate.pl -c' stopping at 06/08/20 00:34:38]
Aug 20 00:34:38 zm zmdc[5582]: INF ['zmupdate.pl -c' crashed, signal 14]
Aug 20 00:34:38 zm zmdc[5582]: INF ['zmc -d /dev/video0' stopping at 06/08/20 00:34:38]
Aug 20 00:34:38 zm zmc_dvideo0[5605]: INF [Got signal (Terminated), exiting]
Aug 20 00:34:38 zm zmdc[5582]: INF ['zmc -d /dev/video0' exited normally]
Aug 20 00:34:38 zm zmdc[5582]: INF ['zmwatch.pl ' stopping at 06/08/20 00:34:38]
Aug 20 00:34:38 zm zmdc[5582]: INF ['zmwatch.pl ' crashed, signal 14]
Aug 20 00:34:48 zm zmdc[5582]: INF [Server shutdown at 06/08/20 00:34:48]
The "prealarm state" never seems to escale to a full alarm. The suspicious line here seems to be "INF [Got signal (Hangup), reloading]" which does not appear after the ZM restart.

(2) With the camera on /dev/video0 set to modect (and working correctly after a ZM restart), after changing a network camera from Monitor to Modect, motion is detected but the alarm does not terminate when movement ceases: the state has to be forced back to Monitor or None. Syslog:
Aug 20 00:51:55 zm zmdc[7058]: INF ['zmc -m 2' started at 06/08/20 00:51:55]
Aug 20 00:51:55 zm zmdc[6970]: INF ['zmc -m 2' starting at 06/08/20 00:51:55, pid = 7058]
Aug 20 00:51:55 zm zmc_m2[7058]: INF [Debug Level = 0, Debug Log = <none>]
Aug 20 00:51:55 zm zmc_m2[7058]: INF [Starting Capture]
Aug 20 00:51:56 zm zmdc[7063]: INF ['zma -m 2' started at 06/08/20 00:51:56]
Aug 20 00:51:56 zm zmdc[6970]: INF ['zma -m 2' starting at 06/08/20 00:51:56, pid = 7063]
Aug 20 00:51:56 zm zma_m2[7063]: INF [Debug Level = 0, Debug Log = <none>]
Aug 20 00:51:56 zm zma_m2[7063]: INF [In mode 3/1, warming up]
Aug 20 00:51:56 zm zma_m2[7063]: INF [Got signal (Hangup), reloading]
Aug 20 00:51:57 zm zma_m2[7063]: INF [Cam_2: 7 - Processing at 7.00 fps]
Aug 20 00:51:59 zm zma_m2[7063]: INF [Cam_2: 14 - Processing at 3.50 fps]
Aug 20 00:52:00 zm zma_m1[6997]: INF [Cam_1: 106 - Gone into prealarm state]
Aug 20 00:52:01 zm zma_m1[6997]: INF [Cam_1: 107 - Gone into alarm state]
Aug 20 00:52:01 zm zma_m1[6997]: INF [Cam_1: 110 - Gone into alert state]
Aug 20 00:52:01 zm zma_m2[7063]: INF [Cam_2: 21 - Processing at 3.50 fps]
Aug 20 00:52:03 zm zma_m2[7063]: INF [Cam_2: 28 - Processing at 3.50 fps]
Aug 20 00:52:04 zm zma_m1[6997]: INF [Cam_1: 120 - Left alarm state (523) - 24(4) images]
Aug 20 00:52:06 zm zma_m2[7063]: INF [Cam_2: 35 - Processing at 2.33 fps]
Aug 20 00:52:07 zm zma_m2[7063]: INF [Cam_2: 42 - Processing at 7.00 fps]
Aug 20 00:52:09 zm zma_m2[7063]: INF [Cam_2: 49 - Processing at 3.50 fps]
Aug 20 00:52:11 zm zma_m2[7063]: INF [Cam_2: 56 - Processing at 3.50 fps]
Aug 20 00:52:13 zm zma_m2[7063]: INF [Cam_2: 63 - Processing at 3.50 fps]
Aug 20 00:52:15 zm zma_m2[7063]: INF [Cam_2: 70 - Processing at 3.50 fps]
Aug 20 00:52:18 zm zma_m2[7063]: INF [Cam_2: 77 - Processing at 2.33 fps]
Aug 20 00:52:20 zm zma_m2[7063]: INF [Cam_2: 84 - Processing at 3.50 fps]
Aug 20 00:52:22 zm zma_m2[7063]: INF [Cam_2: 91 - Processing at 3.50 fps]
Aug 20 00:52:23 zm zma_m2[7063]: INF [Cam_2: 096 - Gone into prealarm state]
Aug 20 00:52:24 zm zma_m2[7063]: INF [Cam_2: 98 - Processing at 3.50 fps]
Aug 20 00:52:26 zm zma_m2[7063]: INF [Cam_2: 105 - Processing at 3.50 fps]
Aug 20 00:52:27 zm zma_m2[7063]: INF [Cam_2: 112 - Processing at 7.00 fps]
Aug 20 00:52:28 zm zma_m2[7063]: INF [Cam_2: 113 - Gone into prealarm state]
Aug 20 00:52:30 zm zma_m2[7063]: INF [Cam_2: 119 - Processing at 2.33 fps]
Aug 20 00:52:32 zm zma_m2[7063]: INF [Cam_2: 126 - Processing at 3.50 fps]
Aug 20 00:52:34 zm zma_m2[7063]: INF [Cam_2: 133 - Processing at 3.50 fps]
Aug 20 00:52:36 zm zma_m2[7063]: INF [Cam_2: 140 - Processing at 3.50 fps]
Aug 20 00:52:36 zm zmfilter[7001]: INF [Executing '/usr/lib/zm/bin/zmeventdump 1/522']
Aug 20 00:52:36 zm zmfilter[7001]: INF [Executing '/usr/lib/zm/bin/zmeventdump 1/523']
Aug 20 00:52:38 zm zma_m2[7063]: INF [Cam_2: 147 - Processing at 3.50 fps]
Aug 20 00:52:40 zm zma_m2[7063]: INF [Cam_2: 154 - Processing at 3.50 fps]
Aug 20 00:52:42 zm zma_m2[7063]: INF [Cam_2: 161 - Processing at 3.50 fps]
Aug 20 00:52:44 zm zma_m2[7063]: INF [Cam_2: 168 - Processing at 3.50 fps]
Aug 20 00:52:45 zm zma_m2[7063]: INF [Cam_2: 174 - Gone into prealarm state]
Aug 20 00:52:46 zm zma_m2[7063]: INF [Cam_2: 175 - Processing at 3.50 fps]
Aug 20 00:52:48 zm zma_m2[7063]: INF [Cam_2: 182 - Processing at 3.50 fps]
Aug 20 00:52:50 zm zma_m2[7063]: INF [Cam_2: 189 - Processing at 3.50 fps]
Aug 20 00:52:50 zm zma_m2[7063]: INF [Cam_2: 191 - Gone into alarm state]
Aug 20 00:52:50 zm zma_m2[7063]: ERR [Got signal (Segmentation fault), crashing]
Aug 20 00:52:50 zm zma_m2[7063]: ERR [Signal address is 0x1818171b, from 0x8063e0e ]
Aug 20 00:52:50 zm zma_m2[7063]: ERR [Backtrace: /usr/lib/zm/bin/zma [0x8063e0e]]
Aug 20 00:52:50 zm zma_m2[7063]: ERR [Backtrace: /usr/lib/zm/bin/zma [0x8063e0e]]
Aug 20 00:52:50 zm zma_m2[7063]: ERR [Backtrace: /usr/lib/zm/bin/zma(__gxx_personality_v0+0x394) [0x804acb4]]
Aug 20 00:52:50 zm zma_m2[7063]: ERR [Backtrace: /lib/tls/libc.so.6(__libc_start_main+0xd0) [0xb7809e40]]
Aug 20 00:52:50 zm zma_m2[7063]: ERR [Backtrace: /usr/lib/zm/bin/zma(__gxx_personality_v0+0xa1) [0x804a9c1]]
Aug 20 00:52:50 zm zma_m2[7063]: INF [Backtrace complete]
Aug 20 00:52:50 zm zmdc[6970]: ERR ['zma -m 2' exited abnormally, exit status 11]
Aug 20 00:52:50 zm zmdc[6970]: INF [Starting pending process, zma -m 2]
Aug 20 00:52:50 zm zmdc[7180]: INF ['zma -m 2' started at 06/08/20 00:52:50]
Aug 20 00:52:50 zm zmdc[6970]: INF ['zma -m 2' starting at 06/08/20 00:52:50, pid = 7180]
Aug 20 00:52:50 zm zma_m2[7180]: INF [Debug Level = 0, Debug Log = <none>]
Aug 20 00:52:50 zm zma_m2[7180]: INF [In mode 3/1, warming up]
Aug 20 00:53:17 zm zmpkg[7277]: INF [Command: stop]
Aug 20 00:53:17 zm zmdc[6970]: INF ['zma -m 2' stopping at 06/08/20 00:53:17]
Aug 20 00:53:17 zm zma_m2[7180]: INF [Got signal (Terminated), exiting]
Aug 20 00:53:17 zm zmdc[6970]: INF ['zma -m 2' exited normally]
Aug 20 00:53:17 zm zmdc[6970]: INF ['zmc -m 2' stopping at 06/08/20 00:53:17]
Aug 20 00:53:17 zm zmc_m2[7058]: INF [Got signal (Terminated), exiting]
Aug 20 00:53:17 zm zmdc[6970]: INF ['zmc -m 2' exited normally]
Aug 20 00:53:17 zm zmdc[6970]: INF ['zmupdate.pl -c' stopping at 06/08/20 00:53:17]
Aug 20 00:53:17 zm zmdc[6970]: INF ['zmupdate.pl -c' crashed, signal 14]
Aug 20 00:53:17 zm zmdc[6970]: INF ['zmfilter.pl ' stopping at 06/08/20 00:53:17]
Aug 20 00:53:17 zm zmdc[6970]: INF ['zmfilter.pl ' crashed, signal 14]
It is interesting to note that this time the "[Got signal (Hangup), reloading]" refers to the network camera, and, although an alarm is triggered, a segmentation fault occurs. The zma -m 2 process restarts itself, and all the time the alarm is still continuing.

I've tried all sorts of things to get rid of this behaviour:

- thinking it might be the AMD64 architecture I re-installed on a P4
- thinking it might be an IRQ conflict I moved the card to various PCI slots in both machines
- thinking it might be the distro I rebuilt the server using Ubuntu 6.06
- I've tried a number of different card=XX: 77, 89, 103, 105, with and without tuner=-1.
The result was the same each time.

The output from dmesg all looks normal, as does scanpci. The network cameras work fine on their own or when the local camera is set to none. It plainly isn't the install or the hardware so could the card be a dud?

Apologies for the long post but I've run out of ideas. Can anyone else shed any light on this?

Thanks, Goatcatcher

EDIT: added info

Posted: Mon Aug 21, 2006 9:29 am
by zoneminder
It is odd to see the scripts all apparently 'crashing' on an alarm signal. Can you check in zmaudit.log and the others for anything odd?

Also, can you do a

Code: Select all

addr2line /usr/lib/zm/bin/zma 0x8063e0e 0x8063e0e
and post what you get?

Posted: Mon Aug 21, 2006 12:28 pm
by goatcatcher
No errors in zmaudit.log: just "Found database monitor" for each monitor plus "Found filesystem monitor" for the two cameras I'm experimenting with in modect.

Can't find anything in the other logs that does not appear in syslog.

I'm getting nowhere with addr2line: 'a.out': No such file.

I have noticed that an alarm that does not turn itself off can be cancelled by later motion that causes an alarm.

Thanks for your help

Posted: Mon Aug 21, 2006 1:30 pm
by zoneminder
I missed out a '-e' in the addr2line command, try

Code: Select all

addr2line -e /usr/lib/zm/bin/zma 0x8063e0e 0x8063e0e
and see what that gives.

Posted: Tue Aug 22, 2006 12:44 pm
by goatcatcher
Phil,
addr2line with that address gives nothing:
??:0
??:0
This is on the 64 bit machine running Ubuntu. The behaviour seems less predictable on this than the Intel machine with the liveCD install, but I borrowed that from work for the weekend so is not available now. Less predictable insofaras I can't tell which error will result!

Anyway, this is the latest, if it's of any help, with notes:
Aug 22 22:05:16 zm zmdc[5868]: INF [Server starting at 06/08/22 22:05:16]
... nothing extraordinary ...
Aug 22 22:05:27 zm zma_m11[5903]: INF [New: 026 - Gone into alarm state]
...local camera goes into alarm state and stays that way.
...network camera switched from Monitor to Modect (this is the next log entry after the alarm on m11):
Aug 22 22:07:36 zm zmdc[5868]: INF ['zmc -m 1' already running at 06/08/22 22:05:19, pid = 5891]
Aug 22 22:07:37 zm zmdc[6353]: INF ['zmf -m 1' started at 06/08/22 22:07:37]
Aug 22 22:07:37 zm zmdc[5868]: INF ['zmf -m 1' starting at 06/08/22 22:07:37, pid = 6353]
Aug 22 22:07:37 zm zmdc[6358]: INF ['zma -m 1' started at 06/08/22 22:07:37]
Aug 22 22:07:37 zm zmdc[5868]: INF ['zma -m 1' starting at 06/08/22 22:07:37, pid = 6358]
...why so many starts?
Aug 22 22:07:37 zm zma_m1[6358]: INF [In mode 3/1, warming up]
Aug 22 22:07:37 zm zmf_m1[6353]: INF [Frame server socket open, awaiting images]
Aug 22 22:07:37 zm zma_m1[6358]: INF [Got signal (Hangup), reloading]
... there it is again
Aug 22 22:07:37 zm zma_m1[6358]: INF [Inside: 14 - Processing at inf fps]
Aug 22 22:07:40 zm zma_m1[6358]: INF [Inside: 21 - Processing at 3.50 fps]
Aug 22 22:07:41 zm zma_m1[6358]: INF [Inside: 28 - Processing at 3.50 fps]
... there are a few of these ...
Aug 22 22:07:58 zm zma_m1[6358]: INF [Inside: 084 - Gone into prealarm state]
Aug 22 22:07:59 zm zma_m1[6358]: INF [Inside: 088 - Gone into prealarm state]
Aug 22 22:08:00 zm zma_m1[6358]: INF [Inside: 91 - Processing at 3.50 fps]
Aug 22 22:08:02 zm zma_m1[6358]: INF [Inside: 98 - Processing at 3.50 fps]
Aug 22 22:08:04 zm zma_m1[6358]: INF [Inside: 105 - Processing at 3.50 fps]
Aug 22 22:08:04 zm zma_m1[6358]: INF [Inside: 105 - Gone into alarm state]
... seg fault
Aug 22 22:08:04 zm zma_m1[6358]: ERR [Got signal (Segmentation fault), crashing]
Aug 22 22:08:04 zm zma_m1[6358]: ERR [Signal address is 0x10293, no eip ]
Aug 22 22:08:04 zm zma_m1[6358]: ERR [Backtrace: /lib/libc.so.6 [0x2aaaac0e51b0]]
Aug 22 22:08:04 zm zma_m1[6358]: ERR [Backtrace: /usr/local/bin/zma [0x41e2e3]]
Aug 22 22:08:04 zm zma_m1[6358]: ERR [Backtrace: /usr/local/bin/zma(__gxx_personality_v0+0x380) [0x405c38]]
Aug 22 22:08:04 zm zma_m1[6358]: ERR [Backtrace: /lib/libc.so.6(__libc_start_main+0xdb) [0x2aaaac0d249b]]
Aug 22 22:08:04 zm zma_m1[6358]: ERR [Backtrace: /usr/local/bin/zma(__gxx_personality_v0+0xb2) [0x40596a]]
Aug 22 22:08:04 zm zma_m1[6358]: INF [Backtrace complete]
Aug 22 22:08:04 zm zmf_m1[6353]: WAR [Socket closed at remote end]
Aug 22 22:08:04 zm zmdc[5868]: ERR ['zma -m 1' exited abnormally, exit status 11]
Aug 22 22:08:04 zm zmdc[5868]: INF [Starting pending process, zma -m 1]
...pending?
Aug 22 22:08:04 zm zmdc[6428]: INF ['zma -m 1' started at 06/08/22 22:08:04]
Aug 22 22:08:04 zm zmdc[5868]: INF ['zma -m 1' starting at 06/08/22 22:08:04, pid = 6428]
Aug 22 22:08:04 zm zma_m1[6428]: INF [Debug Level = 0, Debug Log = <none>]
Aug 22 22:08:04 zm zma_m1[6428]: INF [In mode 3/1, warming up]
Aug 22 22:08:04 zm zmf_m1[6353]: INF [Frame server socket open, awaiting images]
...local camera still seemingly in alarm state
Aug 22 22:09:10 zm zmc_dvideo0[5895]: INF [New: 1000 - Capturing at 4.33 fps]
Aug 22 22:09:10 zm zma_m11[5903]: INF [New: 1000 - Processing at 4.33 fps]
Aug 22 22:09:44 zm zmc_m1[5891]: INF [Inside: 1000 - Capturing at 3.77 fps]
Aug 22 22:10:57 zm zmdc[5868]: INF ['zmc -m 1' already running at 06/08/22 22:05:19, pid = 5891]
... both cameras now in persistent alarm state. No subsequent motion cancels it.
I tried addr2line with the address of the seg fault above, but it produced the same result.

Posted: Tue Aug 22, 2006 1:36 pm
by zoneminder
Hmm, it does seem that something a bit odd is going on.

You asked about all the starts, basically when in monitor mode only the capture daemon needs to run. When you want to motion detect then other daemons that do this need to be started. However one, zma, then gets reloaded. This appears to be causing a problem on your system.

You could try this. Edit zm_actions.php and look for the line

Code: Select all

zmaControl( $monitor, "reload" );
and change "reload" to "restart".

See if that makes any difference?

Posted: Sun Sep 03, 2006 11:40 am
by goatcatcher
All that moving hard drives between machines killed my install and it's taken upto now to get everything back how it was. But thanks Phil, that seems to have done the trick!