zmc sync failure when using more than 1 input

Support and queries relating to all previous versions of ZoneMinder
Locked
User avatar
davide
Posts: 78
Joined: Mon Mar 22, 2004 1:04 am
Location: Italy

zmc sync failure when using more than 1 input

Post by davide »

I don't know if the cause is related to zm, bttv or my capture card.. but here is the problem:

if I use 1 input it works well, if I use 2 inputs /var/log/messages starts getting filled with such logs:

Code: Select all

[root@vid tmp]# grep "13:37" /var/log/messages
Jun  5 13:37:00 vid zmc-d0[3319]: INF [Got TERM signal, exiting]
Jun  5 13:37:00 vid zmc-d0[3383]: INF [Debug Level = 0, Debug Log = ]
Jun  5 13:37:00 vid zmc-d0[3383]: INF [Starting Capture]
Jun  5 13:37:00 vid zmc-d0[3383]: ERR [Capture failure for frame 0: Invalid argument]
Jun  5 13:37:00 vid zmc-d0[3383]: ERR [Capture failure for frame 0: Invalid argument]
Jun  5 13:37:00 vid zmc-d0[3383]: ERR [Sync failure for frame 1 buffer 0(3): Invalid argument]
Jun  5 13:37:00 vid zmc-d0[3383]: ERR [Capture failure for frame 0: Invalid argument]
Jun  5 13:37:00 vid zmc-d0[3383]: ERR [Sync failure for frame 1 buffer 0(3): Invalid argument]
Jun  5 13:37:01 vid zmc-d0[3383]: ERR [Capture failure for frame 0: Invalid argument]
... from here start repeating:
Jun  5 13:37:01 vid zmc-d0[3403]: ERR [Capture failure for frame 0: Invalid argument]
Jun  5 13:37:01 vid zmc-d0[3403]: ERR [Sync failure for frame 1 buffer 0(3): Invalid argument]
Jun  5 13:37:01 vid zmc-d0[3403]: ERR [Capture failure for frame 0: Invalid argument]
Jun  5 13:37:01 vid zmc-d0[3403]: ERR [Sync failure for frame 1 buffer 0(3): Invalid argument]
Jun  5 13:37:01 vid zmc-d0[3403]: ERR [Capture failure for frame 0: Invalid argument]
...etc...
and captures nothing

here is /tmp/zmwatch.log:

Code: Select all

...
Watchdog starting at 04/06/05 13:35:51
Watchdog pausing for 30 seconds
Restarting capture daemon ('/usr/local/bin/zmdc.pl restart zmc -d 0'), time since last capture 11 seconds (1086435431-1086435420
)
'zmc -d 0' starting at 04/06/05 13:37:12, pid = 3403
'zmc -d 0' started at 04/06/05 13:37:12
Can't get shared memory id '2053971974': No such file or directory
Restarting capture daemon ('/usr/local/bin/zmdc.pl restart zmc -d 0'), time since last capture 10 seconds (1086435442-1086435432
)
'zmc -d 0' started at 04/06/05 13:37:22
'zmc -d 0' starting at 04/06/05 13:37:22, pid = 3408
Can't get shared memory id '2053971974': No such file or directory
Restarting capture daemon ('/usr/local/bin/zmdc.pl restart zmc -d 0'), time since last capture 9 seconds (1086435452-1086435443)
'zmc -d 0' started at 04/06/05 13:37:32
'zmc -d 0' starting at 04/06/05 13:37:32, pid = 3413
Can't get shared memory id '2053971974': No such file or directory
Restarting capture daemon ('/usr/local/bin/zmdc.pl restart zmc -d 0'), time since last capture 9 seconds (1086435462-1086435453)
'zmc -d 0' starting at 04/06/05 13:37:43, pid = 3417
'zmc -d 0' started at 04/06/05 13:37:43
Can't get shared memory id '2053971974': No such file or directory
Restarting capture daemon ('/usr/local/bin/zmdc.pl restart zmc -d 0'), time since last capture 10 seconds (1086435473-1086435463
)

my current config is:
zm 1.19.4
livecd1.19 (mandrake 10, kernel 2.6)
capture card: grandtec grand x-guard 16P (just 1 chip for all 16 inputs)
512 RAM
motherboard: gigabyte 7vm400m
cpu: Duron

I could use my capture card with up to 4 inputs but at that time I was using livecd1.17, so mandrake9.2 (kernel 2.4), same hardwre.

any clue?
User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post by victor_diago »

simple answer : INCREASE YOUR SHARED MEMORY.

guy, read readme and FAQ before do anything. you have to calculate your shared memory size from your ring buffer size, capture height and width, color scheme... thats ALL in README and FAQ.

just increase shared memory and/or decrease ring buffer size.

(BUT READ FAQ AND README AS WELL)

my best regards

victor diago
User avatar
davide
Posts: 78
Joined: Mon Mar 22, 2004 1:04 am
Location: Italy

Post by davide »

it would be strange, I set a very low buffer ring size and resolution...

current config (not working):
2 sources each:
384x288 grey
buffer ring size: 22

prec config (working):
1 source
768x576 24 bit
buffer ring size 22

current settings should need less shared memory then the working one

I will try to increase shared memory and tell you if it solves.
User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post by victor_diago »

the rate that you capture is important too.

22 at ring buffer, for me, for example is a VERY HIGH VALUE.

i use 10, and capture at 1 fps.
just increase your shared memory.


victor diago
User avatar
davide
Posts: 78
Joined: Mon Mar 22, 2004 1:04 am
Location: Italy

Post by davide »

shared memory was 128MB
now is 256 MB but still not working..
from /etc/sysctl.conf:

Code: Select all

kernel.shmall = 268435356
kernel.shmmax = 268435356
current settings:
2 monitors 384x288 grey
ring buffer size: 10
1 FPS max

ideally I should be able to use MANY MANY monitors with this setting (each monitor needs +/- 1 MB)

1 source works well
2 sources don't.

when I installed zm for the first time I didn't set proper ring buffer sizes and I remember I could not start the capturing.. the problem now looks different: it starts but gives the above errors and I get 0.00 FPS

here is my ipcs:

Code: Select all

[root@vid tmp]# ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x7a6d2001 14254080   apache    700        1106008    1
0x7a6d2007 14286849   apache    700        1106008    1
as you see I have 2 segments allocated with zm's key.. (my monitors)

I would say that the problem is not the quantity of shared memory.. but something does not work how it should: in my zmwatch.log I keep finding

Code: Select all

Can't get shared memory id '2053971975': No such file or directory
why does zm keep looking for segment with id=2053971975 ?
User avatar
lazyleopard
Posts: 403
Joined: Tue Mar 02, 2004 6:12 pm
Location: Gloucestershire, UK

Post by lazyleopard »

Might be permission problems? Have you checked the ID your zm* processes are using?
Rick Hewett
User avatar
davide
Posts: 78
Joined: Mon Mar 22, 2004 1:04 am
Location: Italy

Post by davide »

Here I report the 2 cases with some log...

working config:
1 source 384x288 grey
everything ok
none of the zm logs report errors,

Code: Select all

[root@vid root]# ipcs -p

------ Shared Memory Creator/Last-op --------
shmid      owner      cpid       lpid
0          apache     2498       2523

[root@vid root]# ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x7a6d2001 0          apache    700        5529848    2

[root@vid root]# ps -A
  PID TTY          TIME CMD
... 
2470 ?        00:00:00 zmdc.pl
...
 2504 ?        00:00:26 zma
 2509 ?        00:00:01 zmfilter.pl
 2514 ?        00:00:00 zmaudit.pl
 2523 ?        00:00:01 zmwatch.pl
...
 2746 ?        00:00:00 zmc
...


and now the not working config
2 sources each 384x288 grey

Code: Select all

[root@vid root]# ipcs -p

------ Shared Memory Creator/Last-op --------
shmid      owner      cpid       lpid
0          apache     2498       2523
163841     apache     3881       2523

[root@vid root]# ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x7a6d2001 0          apache    700        5529848    2
0x7a6d2007 163841     apache    700        5529848    2

[root@vid root]# ps -A
  PID TTY          TIME CMD
...
 2470 ?        00:00:00 zmdc.pl
...
 2504 ?        00:00:26 zma
 2509 ?        00:00:01 zmfilter.pl
 2514 ?        00:00:00 zmaudit.pl
 2523 ?        00:00:01 zmwatch.pl
...
 3889 ?        00:00:00 zma
 3933 ?        00:00:00 zmc
...

[root@vid root]# tail /var/log/messages
Jun  6 20:18:22 vid zmc-d0[3928]: ERR [Capture failure for frame 0: Invalid argument]
Jun  6 20:18:22 vid zmc-d0[3928]: ERR [Sync failure for frame 1 buffer 0(3): Invalid argument]
Jun  6 20:18:22 vid zmc-d0[3928]: ERR [Capture failure for frame 0: Invalid argument]
Jun  6 20:18:22 vid zmc-d0[3928]: ERR [Sync failure for frame 1 buffer 0(3): Invalid argument]
Jun  6 20:18:22 vid zma-m7[3889]: WAR [Waiting for capture daemon]
Jun  6 20:18:23 vid zmc-d0[3928]: ERR [Capture failure for frame 0: Invalid argument]
Jun  6 20:18:23 vid zmc-d0[3928]: ERR [Sync failure for frame 1 buffer 0(3): Invalid argument]
Jun  6 20:18:23 vid zmc-d0[3928]: ERR [Capture failure for frame 0: Invalid argument]
Jun  6 20:18:23 vid zmc-d0[3928]: ERR [Sync failure for frame 1 buffer 0(3): Invalid argument]
Jun  6 20:18:23 vid zma-m7[3889]: WAR [Waiting for capture daemon]

[root@vid root]# tail /tmp/zmwatch.log
...
Restarting capture daemon ('/usr/local/bin/zmdc.pl restart zmc -d 0'), time since last capture 19 seconds (1086546013-1086545994)
'zmc -d 0' started at 04/06/06 20:20:13
'zmc -d 0' starting at 04/06/06 20:20:13, pid = 3958
Restarting capture daemon ('/usr/local/bin/zmdc.pl restart zmc -d 0'), time since last capture 19 seconds (1086546033-1086546014)
'zmc -d 0' started at 04/06/06 20:20:34
'zmc -d 0' starting at 04/06/06 20:20:34, pid = 3964
Restarting capture daemon ('/usr/local/bin/zmdc.pl restart zmc -d 0'), time since last capture 20 seconds (1086546054-1086546034)
etc...

[root@vid root]# tail /tmp/zmdc.log
'zmc -d 0' started at 04/06/06 20:20:54
'zmc -d 0' starting at 04/06/06 20:20:54, pid = 3969
'zmc -d 0' stopping at 04/06/06 20:21:14
'zmc -d 0' died at 04/06/06 20:21:14
'zmc -d 0' started at 04/06/06 20:21:14
'zmc -d 0' starting at 04/06/06 20:21:14, pid = 3974
'zmc -d 0' stopping at 04/06/06 20:21:35
'zmc -d 0' died at 04/06/06 20:21:35
'zmc -d 0' started at 04/06/06 20:21:35
'zmc -d 0' starting at 04/06/06 20:21:35, pid = 3978

how do I see if there are permission problems?
User avatar
lazyleopard
Posts: 403
Joined: Tue Mar 02, 2004 6:12 pm
Location: Gloucestershire, UK

Post by lazyleopard »

I'd check that "ps aux" showed that user apache owned all the zm* processes, and that user apache could wite to the events directories etc. If those were all Ok then I'd take a look at the setting for ZM_STRICT_VIDEO_CONFIG in Options tab Config, and try checking it. Then, having saved the config, I'd shut zm down and re-start it from scratch with the two-monitor setup.
Rick Hewett
User avatar
davide
Posts: 78
Joined: Mon Mar 22, 2004 1:04 am
Location: Italy

Post by davide »

ps aux showed all ok, apache owned all zm processes
permissions ok
but problem persists.

I reinstalled the liveCD on a new partition and everything works ok.

I will keep the installation with the problem and try to dig more and find why I got this problem...

thank you anyway...
Locked