ubuntu 9.04 desktop with zoneminder 1.23.3

Support and queries relating to all previous versions of ZoneMinder
Locked
dmb2002man
Posts: 28
Joined: Thu Nov 04, 2010 2:39 pm

ubuntu 9.04 desktop with zoneminder 1.23.3

Post by dmb2002man »

I am getting memory error in my logs and i added the kernel.shmmax and kernel.shmall with 33554432 as im running 512 megs of memory.

Here are my logs.

root@camera-pc:~# tail /var/log/messages
Nov 19 01:36:20 camera-pc zmdc[2427]: INF ['zmc -d /dev/video0' starting at 10/11/19 01:36:20, pid = 3581]
Nov 19 01:36:20 camera-pc zmwatch[2468]: INF ['zmc -d /dev/video0' starting at 10/11/19 01:36:20, pid = 3581]
Nov 19 01:36:20 camera-pc zmc_dvideo0[3581]: INF [Debug Level = 0, Debug Log = <none>]
Nov 19 01:36:20 camera-pc zmc_dvideo0[3581]: INF [New Debug Level = 0, New Debug Log = /tmp/zm_debug.log.03581]
Nov 19 01:36:30 camera-pc zmwatch[2468]: INF [Restarting capture daemon for FrontDoor, shared memory not valid]
Nov 19 01:36:30 camera-pc zmdc[3684]: INF ['zmc -d /dev/video0' started at 10/11/19 01:36:30]
Nov 19 01:36:30 camera-pc zmdc[2427]: INF ['zmc -d /dev/video0' starting at 10/11/19 01:36:30, pid = 3684]
Nov 19 01:36:30 camera-pc zmwatch[2468]: INF ['zmc -d /dev/video0' starting at 10/11/19 01:36:30, pid = 3684]
Nov 19 01:36:30 camera-pc zmc_dvideo0[3684]: INF [Debug Level = 0, Debug Log = <none>]
Nov 19 01:36:30 camera-pc zmc_dvideo0[3684]: INF [New Debug Level = 0, New Debug Log = /tmp/zm_debug.log.03684]


root@camera-pc:~# tail /tmp/zm_debug.log.03684
11/19/10 01:36:30.804853 zmc_dvideo0[3684].INF-zm_debug.c/305 [New Debug Level = 0, New Debug Log = /tmp/zm_debug.log.03684]
11/19/10 01:36:30.813352 zmc_dvideo0[3684].ERR-zm_local_camera.cpp/162 [Failed to setup memory: Invalid argument]
root@camera-pc:~#


root@camera-pc:~# zmu -q -d /dev/video0 -v
Video Capabilities
Name: Hauppauge WinTV PVR-150
Type: 7
Can capture
Can tune
Does teletext
Video Channels: 5
Audio Channels: 0
Maximum Width: 720
Maximum Height: 480
Minimum Width: 48
Minimum Height: 32
Window Attributes
X Offset: 0
Y Offset: 0
Width: 320
Height: 240
Picture Attributes
Palette: 0 - Unknown
Colour Depth: 0
Brightness: 32896
Hue: 32896
Colour :33026
Contrast: 33026
Whiteness: 0
Channel 0 Attributes
Name: Tuner 1
Channel: 0
Flags: 1
Channel has a tuner
Type: 1 - TV
Format: 1 - NTSC
Channel 1 Attributes
Name: S-Video 1
Channel: 1
Flags: 0
Type: 2 - Camera
Format: 1 - NTSC
Channel 2 Attributes
Name: Composite 1
Channel: 2
Flags: 0
Type: 2 - Camera
Format: 1 - NTSC
Channel 3 Attributes
Name: S-Video 2
Channel: 3
Flags: 0
Type: 2 - Camera
Format: 1 - NTSC
Channel 4 Attributes
Name: Composite 2
Channel: 4
Flags: 0
Type: 2 - Camera
Format: 1 - NTSC
root@camera-pc:~#

root@camera-pc:~# tail /tmp/zmwatch.log
11/19/2010 01:46:39.273503 zmwatch[4389].INF [Restarting capture daemon for FrontDoor, shared memory not valid]
11/19/2010 01:46:39.747202 zmwatch[4389].INF ['zmc -d /dev/video0' starting at 10/11/19 01:46:39, pid = 4649]
11/19/2010 01:46:49.749450 zmwatch[4389].INF [Restarting capture daemon for FrontDoor, shared memory not valid]
11/19/2010 01:46:50.231208 zmwatch[4389].INF ['zmc -d /dev/video0' starting at 10/11/19 01:46:50, pid = 4651]
11/19/2010 01:47:00.233471 zmwatch[4389].INF [Restarting capture daemon for FrontDoor, shared memory not valid]
11/19/2010 01:47:00.711218 zmwatch[4389].INF ['zmc -d /dev/video0' starting at 10/11/19 01:47:00, pid = 4653]
11/19/2010 01:47:10.713459 zmwatch[4389].INF [Restarting capture daemon for FrontDoor, shared memory not valid]
11/19/2010 01:47:11.179215 zmwatch[4389].INF ['zmc -d /dev/video0' starting at 10/11/19 01:47:11, pid = 4655]
11/19/2010 01:47:21.181515 zmwatch[4389].INF [Restarting capture daemon for FrontDoor, shared memory not valid]
11/19/2010 01:47:21.651355 zmwatch[4389].INF ['zmc -d /dev/video0' starting at 10/11/19 01:47:21, pid = 4657]
root@camera-pc:~#


root@camera-pc:~# tail /var/log/syslog
Nov 19 01:56:47 camera-pc zmc_dvideo0[5044]: ERR [Failed to setup memory: Invalid argument]
Nov 19 01:56:47 camera-pc zmdc[4360]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
Nov 19 01:56:57 camera-pc zmwatch[4389]: INF [Restarting capture daemon for FrontDoor, shared memory not valid]
Nov 19 01:56:57 camera-pc zmdc[5046]: INF ['zmc -d /dev/video0' started at 10/11/19 01:56:57]
Nov 19 01:56:57 camera-pc zmdc[4360]: INF ['zmc -d /dev/video0' starting at 10/11/19 01:56:57, pid = 5046]
Nov 19 01:56:57 camera-pc zmwatch[4389]: INF ['zmc -d /dev/video0' starting at 10/11/19 01:56:57, pid = 5046]
Nov 19 01:56:57 camera-pc zmc_dvideo0[5046]: INF [Debug Level = 0, Debug Log = <none>]
Nov 19 01:56:57 camera-pc zmc_dvideo0[5046]: INF [New Debug Level = 0, New Debug Log = /tmp/zm_debug.log.05046]
Nov 19 01:56:57 camera-pc zmc_dvideo0[5046]: ERR [Failed to setup memory: Invalid argument]
Nov 19 01:56:57 camera-pc zmdc[4360]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
root@camera-pc:~#


Not sure how else to fix it. Im thinking i may not have enough memory in this pc for zoneminder to run with my cameras. Any help would be appreciated.

thanks
bb99
Posts: 943
Joined: Wed Apr 02, 2008 12:04 am

Post by bb99 »

I believe you're thinking right. 512MB is enough to run Linux and ZM, have a look: http://www.zoneminder.com/forums/viewto ... red+memory. I've run two camera's at 640*480 on 512 MB without any issues but your card might be an issue depending on the kernel: http://www.zoneminder.com/wiki/index.ph ... VR_150/160
dmb2002man
Posts: 28
Joined: Thu Nov 04, 2010 2:39 pm

Post by dmb2002man »

So what kernal version should I be using? kernel 2.6.16? Its weird that ivtv commands v4lt-ctl commands all work fine and I can save the video fromthe command using ivtv and it shows the video. I added the correct values for my 512 mgs of ram but still gets the shared memory invalid. So it doesn't like the memory.
bb99
Posts: 943
Joined: Wed Apr 02, 2008 12:04 am

Post by bb99 »

Kernel 2.6.16 or newer. Shared memory values for ZM are not determined by how much memory you have available but by ring buffer size x image width x image height x 3 (for 24 bit images) + a bit of overhead (covered in the wiki). A base value of 134217728 for shmall and shmmax is what I see mostly posted, this is good for 320*240 resolutions but won't work for 640*480. The programs you list as working probably map their memory use (I'm guessing) and aren't using the shared. It's not unusual for browsers, VLC, MPlayer, and others to display a picture/stream with nothing showing up in ZM. It usually boils down to source settings or shared memory.
PacoLM
Posts: 971
Joined: Wed Dec 02, 2009 9:55 pm
Location: Spain

Post by PacoLM »

Hi,

Debian 5 (Linux sheevaplug-debian 2.6.32-00007-g56678ec #1 PREEMPT Mon Feb 8 03:49:55 PST 2010 armv5tel GNU/Linux), running a in Guruplug with 512Mbytes of RAM, with 2 ipcams working in a 320x240, my settings for shared memory:

kernel.shmmax = 536870912
kernel.shmall = 805306368

Regards,

PacoLM
dmb2002man
Posts: 28
Joined: Thu Nov 04, 2010 2:39 pm

Post by dmb2002man »

bb99 wrote:Kernel 2.6.16 or newer. Shared memory values for ZM are not determined by how much memory you have available but by ring buffer size x image width x image height x 3 (for 24 bit images) + a bit of overhead (covered in the wiki). A base value of 134217728 for shmall and shmmax is what I see mostly posted, this is good for 320*240 resolutions but won't work for 640*480. The programs you list as working probably map their memory use (I'm guessing) and aren't using the shared. It's not unusual for browsers, VLC, MPlayer, and others to display a picture/stream with nothing showing up in ZM. It usually boils down to source settings or shared memory.
Here is my output from uname -r. So i am running a new version of the kernel that 2.6.16

root@camera-pc:/tmp# uname -r
2.6.28-11-generic
dmb2002man
Posts: 28
Joined: Thu Nov 04, 2010 2:39 pm

Post by dmb2002man »

PacoLM wrote:Hi,

Debian 5 (Linux sheevaplug-debian 2.6.32-00007-g56678ec #1 PREEMPT Mon Feb 8 03:49:55 PST 2010 armv5tel GNU/Linux), running a in Guruplug with 512Mbytes of RAM, with 2 ipcams working in a 320x240, my settings for shared memory:

kernel.shmmax = 536870912
kernel.shmall = 805306368

Regards,

PacoLM
also i changed my values to what you have and still getting a failed to setup memory: invalid argument in the zm_debug.log.32761
dmb2002man
Posts: 28
Joined: Thu Nov 04, 2010 2:39 pm

Post by dmb2002man »

i also have an update for zoneminder to the latest version. Should i go with the update or will that not made a difference at all. Also here is some more output.


root@camera-pc:~# sudo zmu -q -d /dev/video0
N:Hauppauge WinTV PVR-150,T:7,nC:5,nA:0,mxW:720,mxH:480,mnW:48,mnH:32,X:0,Y:0,W:320,H:240,P:0,D:0,B:32896,h:32896,Cl:33026,Cn:33026,w:0,n0:Tuner 1,C0:0,Fl0:1,T0:1F0:1,,n1:S-Video 1,C1:1,Fl1:0,T1:2F1:1,,n2:Composite 1,C2:2,Fl2:0,T2:2F2:1,,n3:S-Video 2,C3:3,Fl3:0,T3:2F3:1,,n4:Composite 2,C4:4,Fl4:0,T4:2F4:1

oot@camera-proot@camera-pc:~# lsmod | grep video
video 25360 0
output 11008 1 video
videodev 41600 3 msp3400,tuner,ivtv
v4l1_compat 21764 1 videodev


root@camera-pc:~# ps axo user,command | grep zm
www-data /usr/bin/perl -wT /usr/bin/zmdc.pl startup
www-data /usr/bin/perl -wT /usr/bin/zmfilter.pl
www-data /usr/bin/perl -wT /usr/bin/zmaudit.pl -c
www-data /usr/bin/perl -wT /usr/bin/zmwatch.pl
www-data /usr/bin/perl -w /usr/bin/zmupdate.pl -c
root grep zm
root@camera-pc:~#


root@camera-pc:/tmp# tail /tmp/zm_debug.log.13618
11/21/10 20:08:26.525687 zmc_dvideo0[13618].DB1-zm_local_camera.cpp/92 [Old D:0]
11/21/10 20:08:26.525705 zmc_dvideo0[13618].DB1-zm_local_camera.cpp/93 [Old B:32896]
11/21/10 20:08:26.525722 zmc_dvideo0[13618].DB1-zm_local_camera.cpp/94 [Old h:32896]
11/21/10 20:08:26.525740 zmc_dvideo0[13618].DB1-zm_local_camera.cpp/95 [Old Cl:33026]
11/21/10 20:08:26.525757 zmc_dvideo0[13618].DB1-zm_local_camera.cpp/96 [Old Cn:33026]
11/21/10 20:08:26.529592 zmc_dvideo0[13618].DB1-zm_local_camera.cpp/140 [Old X:0]
11/21/10 20:08:26.529611 zmc_dvideo0[13618].DB1-zm_local_camera.cpp/141 [Old Y:0]
11/21/10 20:08:26.529629 zmc_dvideo0[13618].DB1-zm_local_camera.cpp/142 [Old W:320]
11/21/10 20:08:26.529646 zmc_dvideo0[13618].DB1-zm_local_camera.cpp/143 [Old H:240]
11/21/10 20:08:26.529702 zmc_dvideo0[13618].ERR-zm_local_camera.cpp/162 [Failed to setup memory: Invalid argument]
root@camera-pc:/tmp#

root@camera-pc:~# sysctl -p
kernel.shmall = 805306368
kernel.shmmax = 536870912
root@camera-pc:~# ipcs -l

------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 524288
max total shared memory (kbytes) = 3221225472
min seg size (bytes) = 1

------ Semaphore Limits --------
max number of arrays = 128
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 32
semaphore max value = 32767

------ Messages: Limits --------
max queues system wide = 989
max size of message (bytes) = 8192
default max size of queue (bytes) = 16384
bb99
Posts: 943
Joined: Wed Apr 02, 2008 12:04 am

Post by bb99 »

If you update now you might solve the problem or more likely have to start completely over. A better suggestion would be to get a copy of ZoneMinder LiveCD 1.23.3 or better yet ZoneMinder 1.24.2 on Arch Linux live CD from Linuxtracker, boot it (don't install), and configure a monitor (camera). If you get it working the problem is in the Ubuntu install. Be sure to use 320*240 resolution, greyscale, and device path of /dev/video0, with a channel of 0. Toggle the Vfl choice between 1 and 2; and try both ntsc and pal. Ross' live CD's are very valuable for this type of troubleshooting.
dmb2002man
Posts: 28
Joined: Thu Nov 04, 2010 2:39 pm

Post by dmb2002man »

bb99 wrote:If you update now you might solve the problem or more likely have to start completely over. A better suggestion would be to get a copy of ZoneMinder LiveCD 1.23.3 or better yet ZoneMinder 1.24.2 on Arch Linux live CD from Linuxtracker, boot it (don't install), and configure a monitor (camera). If you get it working the problem is in the Ubuntu install. Be sure to use 320*240 resolution, greyscale, and device path of /dev/video0, with a channel of 0. Toggle the Vfl choice between 1 and 2; and try both ntsc and pal. Ross' live CD's are very valuable for this type of troubleshooting.
ok i cant download torrent at work but will give this a try after i download it at home. I also was browsing the capture file size for pvr 150 and pvr 250 cards. Heres the info i got. So should i be putting this information in zoneminder.

Pvr-150 (MPEG1)
-320X 240 (NTSC)
-352X288 (PAL/SECAM)

Pvr-250 (MPEG1)
-352-480 (NTSC)
-352-576 (PAL/SECAM)
dmb2002man
Posts: 28
Joined: Thu Nov 04, 2010 2:39 pm

Post by dmb2002man »

After playing with the /etc/modprobe.d/ivtv file i am seeing these errors in dmesg. Here is exactly what is in the modprobe.d/ivtv file.

#wintv pvr 150
alias char-major-81-0 ivtv

#winTV PVR 250
alias char-major-81-1 ivtv

root@camera-pc:~# dmesg | grep Initialized
[ 14.451112] ivtv0: Initialized card #0: Hauppauge WinTV PVR-150
[ 14.829903] ivtv1: Initialized card #1: Hauppauge WinTV PVR-250
[ 48.150413] [drm] Initialized drm 1.1.0 20060810
[ 48.185144] [drm] Initialized i810 1.4.0 20030605 on minor 0


my dmesg log:

[ 48.150413] [drm] Initialized drm 1.1.0 20060810
[ 48.183693] pci 0000:00:02.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[ 48.183705] pci 0000:00:02.0: setting latency timer to 64
[ 48.185144] [drm] Initialized i810 1.4.0 20030605 on minor 0
[ 48.282510] mtrr: base(0xec000000) is not aligned on a size(0x12c000) boundary
[ 48.294354] [drm] Using v1.4 init.
[ 51.504017] [drm:drm_release] *ERROR* reclaim_buffers_locked() deadlock.
Please rework this
[ 51.504025] driver to use reclaim_buffers_idlelocked() instead.
[ 51.504029] I will go on reclaiming the buffers anyway.
[ 58.072035] eth0: no IPv6 routers present

Now when i run these commands:

root@camera-pc:~# cat /dev/video1 > /home/joe/test_capture1.mpg (doesnt work)

root@camera-pc:~# cat /dev/video0 > /home/joe/test_capture.mpg (works)

The dmsg | grep Intialized shows Video1 is there. I really dont get this.
bb99
Posts: 943
Joined: Wed Apr 02, 2008 12:04 am

Post by bb99 »

I was under the impression you were working on one card at a time, if I'm wrong pull the 250 out for now; it's much harder to get two working initially. Do this with the 1.24.2 live CD also, remember: the idea for now is to just get it working then make changes.

The settings mentioned earlier belong on the monitor -> source tab when setting up the monitor. If the values I've posted (widely supported by capture cards) don't work you can substitute the resolution values you've listed.

Just brought up a seed for both LiveCD's mentioned earlier, should be able to bump up your download by at least 250 - 300 kB/sec.
bb99
Posts: 943
Joined: Wed Apr 02, 2008 12:04 am

Post by bb99 »

Just to be sure, did you get a look at this: http://www.zoneminder.com/forums/viewto ... deo+output
dmb2002man
Posts: 28
Joined: Thu Nov 04, 2010 2:39 pm

Post by dmb2002man »

bb99 wrote:Just to be sure, did you get a look at this: http://www.zoneminder.com/forums/viewto ... deo+output
yeah i seen this post yesterday and thinking the pvr-150 is not supported so looking for more open-source security camera software for linux but not having much luck. I also have a q-see 4 channel dvr pci card but on on the q-see site it only shows supported in windows and tried to search google linux for it but no luck. I was thinking of just putting the card in and seeing if linux would recognize it.
dmb2002man
Posts: 28
Joined: Thu Nov 04, 2010 2:39 pm

Post by dmb2002man »

hello,

since i cannot get these cards to work, i need to find newer cards that will work. Either single pci cards or dvr pci cards. Im using 2 single cameras with bnc connectors. I also have the bnc to composite adapter. Any help would be appreciated.

thanks
Locked