ZM 1.23.3 and Ubuntu 8.10

Support and queries relating to all previous versions of ZoneMinder
wisekki
Posts: 39
Joined: Tue Feb 27, 2007 11:58 am

ZM 1.23.3 and Ubuntu 8.10

Post by wisekki »

So is it really true that ZM doesn't work with Ubuntu 8.10? :cry:

I've tried everything, compiled from source, installed from repository and every goddamn time I get errors about shared memory not being valid and so on...

So is there anybody who has zm running on intrepid? I've even switched from 64bit to 32bit but that didn't help at all...

Or is this all result of v4l2 drivers? If so then nobody's running zm with default configuration of 8.10?

- AnttiK
kylejohnson
Posts: 260
Joined: Tue Aug 21, 2007 1:42 pm
Location: Baltimore, MD

Post by kylejohnson »

Hello.

ZoneMinder works fine on Ubuntu 8.10, be it 64bit or 32bit, source or package.
I am putting together a wiki entry for this exact setup, which you can find at http://www.zoneminder.com/wiki/index.php/Ubuntu_8.10.

Hope this helps.
wisekki
Posts: 39
Joined: Tue Feb 27, 2007 11:58 am

Post by wisekki »

Geez finally someone :)

Can you please tell me a little bit how you did it? I did a fresh Ubuntu 8.10 install and then I installed zoneminder from package, started it and added one monitor.

What kind of camera setup are you using? usb-cams or some hightech? And you're not getting these shared memory errors/warnings?

Can you see your "zm-memory-key" with ipcs?

Thnx already for your answers :)

- AnttiK
kylejohnson
Posts: 260
Joined: Tue Aug 21, 2007 1:42 pm
Location: Baltimore, MD

Post by kylejohnson »

wisekki wrote:Geez finally someone :)

Can you please tell me a little bit how you did it? I did a fresh Ubuntu 8.10 install and then I installed zoneminder from package, started it and added one monitor.

What kind of camera setup are you using? usb-cams or some hightech? And you're not getting these shared memory errors/warnings?

Can you see your "zm-memory-key" with ipcs?

Thnx already for your answers :)

- AnttiK
Hey there, no problem.

I am using a fresh Ubuntu 8.10 64 Bit Minimal Server install. If you are using 32bit and / or the standard server install, it shouldn't matter.

I am 8 640x480 24bit color analog cameras on my most recent build, with 2x 4 port bttv cards.

Code: Select all

root@tpp-camera:/var/log# cat /etc/modprobe.d/bttv
options i2c-algo-bit bit_test=1
options bttv card=102,102,102,102,102,102,102,102
I have also 16 IP cameras on another build.

I only get shared memory errors until I up the shared memory size:

Code: Select all

root@tpp-camera:/var/log# tail /etc/sysctl.conf
kernel.shmall = 268424446
kernel.shmmax = 268424446
vm.swappiness = 90        #ignore this
vm.dirty_background_ratio = 3        #ignore this
root@tpp-camera:/var/log#

Code: Select all

root@tpp-camera:/var/log# ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      
0x7a6d0001 557056     www-data  700        46081676   3                       
0x7a6d0002 589825     www-data  700        36865516   3                       
0x7a6d0003 622594     www-data  700        36865516   3                       
0x7a6d0004 655363     www-data  700        36865516   3                       
0x7a6d0005 688132     www-data  700        36865516   3                       
0x7a6d0006 720901     www-data  700        36865516   3                       
0x7a6d0007 753670     www-data  700        36865516   3                       
0x7a6d0008 786439     www-data  700        36865516   3
8 segments for 8 cameras. yay.

Specifically, what kind of problems are you having?
On my servers (on which I install ZM from source), all ZM related files and directories are owned by www-data (the apache2 user). This includes the binary files (/usr/bin/zm*) , the files in /var/lib/cgi-bin, the conf file and any files in /usr/share/zoneminder. (My paths are different, but they should be right for your system.) I am not sure how Ubuntu sets up permissions for a packaged install...
wisekki
Posts: 39
Joined: Tue Feb 27, 2007 11:58 am

Post by wisekki »

Thnx for the quick reply. I'm using 4 usb-cams, all of them logitechs, using gspca_zc3xx and gspca_main modules. These cams work perfectly with mplayer...

When I add the first camera I simply get this:

Code: Select all

zmwatch[11094].ERR [Can't get shared memory id '7a6d0001', 1: No such file or directory]
zmwatch[11094].INF [Restarting capture daemon for Koti1, shared memory not valid]
And it keeps repeating that all day long :( ZM says that ZM_SHM_KEY is 0x7a6d0000.. so it should be right... I've no key print for zm in shared memory segments...

I've set shmall and shmmax to:

Code: Select all

kernel.shmall = 134217728
kernel.shmmax = 134217728
I'm kinda lost here.. with ubuntu 8.04 zm worked like a wet dream :P
kylejohnson
Posts: 260
Joined: Tue Aug 21, 2007 1:42 pm
Location: Baltimore, MD

Post by kylejohnson »

I think I got that error when zoneminder was running as the root user. After changing the owner of the binaries to www-data and restarting the service, things started working.

What user is ZM running as?

Code: Select all

ps axu | grep zm
wisekki
Posts: 39
Joined: Tue Feb 27, 2007 11:58 am

Post by wisekki »

It's running as www-data...

Code: Select all

www-data 11642  0.0  0.1  11892  6096 pts/4    S    22:04   0:00 /usr/bin/perl -wT /usr/bin/zmdc.pl startup
www-data 11667  0.4  0.3  14776 10440 pts/4    S    22:04   0:00 /usr/bin/perl -wT /usr/bin/zmfilter.pl
www-data 11670  0.3  0.2  12396  7980 pts/4    S    22:04   0:00 /usr/bin/perl -wT /usr/bin/zmaudit.pl -c
www-data 11672  0.2  0.2  11628  7308 pts/4    S    22:04   0:00 /usr/bin/perl -wT /usr/bin/zmwatch.pl
www-data 11675  0.3  0.2  12804  8484 pts/4    S    22:04   0:00 /usr/bin/perl -w /usr/bin/zmupdate.pl -c
kylejohnson
Posts: 260
Joined: Tue Aug 21, 2007 1:42 pm
Location: Baltimore, MD

Post by kylejohnson »

Reading over a few other posts:
1: Did you ever start ZM as root? Do you have any .sock files in /tmp that are owned by root?
2: Did you start ZM from /etc/init.d, or from the web interface? Try killing all the zoneminder processes, and then starting from the web interface.
3: Are there any errors in zmdc.log?
tail -f /tmp/zm*
Also check you messages log as you might find something more discriptive there. /var/log/messages
4: Where is nph-zms and zms installed at? Either /usr/lib/cgi-bin or /usr/share/zoneminder?[/list]
wisekki
Posts: 39
Joined: Tue Feb 27, 2007 11:58 am

Post by wisekki »

Again thnx for trying to help me.. I really appriciate it :!:

I've tried with root and www-data and i've deleted everything from /tmp.. killed everything so ps axu doesn't show anything and i've started zm from /etc/init.d and from the web interface.. Every time the same error:

Code: Select all

01/27/09 22:31:19.238487 zmwatch[12504].INF ['zmc -d /dev/video0' starting at 09/01/27 22:31:19, pid = 12623]
01/27/09 22:31:19.238704 zmwatch[12504].ERR [Can't get shared memory id '7a6d0002', 2: No such file or directory]
01/27/09 22:31:19.238762 zmwatch[12504].INF [Restarting capture daemon for Koti2, shared memory not valid]
nph-zms and zms are at /usr/lib/cgi-bin/

Okay I have some extra errors at syslog now after fiddling with the system:

Code: Select all

Jan 27 22:36:46 router zmc_dvideo0[13305]: ERR [Sync failure for frame 1 buffer 2(1): Invalid argument]
Jan 27 22:36:46 router zmc_dvideo0[13305]: ERR [Failed to post-capture monitor 0]
Jan 27 22:36:46 router zmc_dvideo2[13317]: INF [Debug Level = 0, Debug Log = <none>]
Jan 27 22:36:46 router zmc_dvideo2[13317]: INF [Starting Capture]
Jan 27 22:36:46 router zmdc[13209]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 255] 
Jan 27 22:36:47 router kernel: [192286.059743] zc3xx: probe 2wr ov vga 0x0000
And before that it said permission denied /dev/video0 so I just chmodded them to 777 :)
kylejohnson
Posts: 260
Joined: Tue Aug 21, 2007 1:42 pm
Location: Baltimore, MD

Post by kylejohnson »

I added www-data to the video group to get around the permission denied errors.

Can you query your cameras doing zmu -q -v --device /dev/video0? I think the syntax is right!

Also, not sure if it matters, but by which user are your zm binaries owned?
wisekki
Posts: 39
Joined: Tue Feb 27, 2007 11:58 am

Post by wisekki »

hehe okay how do I add www-data to the video group? (this is just a sideq. :)

Code: Select all

zmu -q -v --device /dev/video0
Video Capabilities
  Name: USB Camera (046d:08d9)
  Type: 1
    Can capture
  Video Channels: 1
  Audio Channels: 0
  Maximum Width: 640
  Maximum Height: 480
  Minimum Width: 48
  Minimum Height: 32
Window Attributes
  X Offset: 0
  Y Offset: 0
  Width: 640
  Height: 480
Picture Attributes
  Palette: 0 - Unknown
  Colour Depth: 8
  Brightness: 32896
  Hue: 0
  Colour :0
  Contrast: 32768
  Whiteness: 39321
Channel 0 Attributes
  Name: zc3xx
  Channel: 0
  Flags: 0
  Type: 2 - Camera
  Format: 0 - PAL
And my cams work with mplayer or xawtv... using v4l2..

ZM binaries are owned by root.
kylejohnson
Posts: 260
Joined: Tue Aug 21, 2007 1:42 pm
Location: Baltimore, MD

Post by kylejohnson »

sudo usermod -a -G video www-data] might do you.

I _vaguely_ recall that when changing the owner of my binaries from root to www-data, and then restarting the processes, shared memory started working.
wisekki
Posts: 39
Joined: Tue Feb 27, 2007 11:58 am

Post by wisekki »

Yea I think shared memory is no longer the prob here. Now it's something like:

Code: Select all

Jan 28 07:08:15 router kernel: [222973.700432] zc3xx: probe 2wr ov vga 0x0000
Jan 28 07:08:16 router zmc_dvideo0[22418]: ERR [Sync failure for frame 1 buffer 2(1): Invalid argument]
Jan 28 07:08:16 router zmc_dvideo0[22418]: ERR [Failed to post-capture monitor 0]
Jan 28 07:08:16 router zmdc[22341]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
Jan 28 07:08:22 router zms[22438]: WAR [Shared memory not initialised by capture daemon, some query functions may not be available or produce invalid results]
Jan 28 07:08:22 router zms[22438]: ERR [Got signal (Floating point exception), crashing]
Again I have no idea what so ever :( Hopefully you or someone knows what to do :)
kylejohnson
Posts: 260
Joined: Tue Aug 21, 2007 1:42 pm
Location: Baltimore, MD

Post by kylejohnson »

Well those errors don't look good, and a google search returns nothing... Hopefully another member has seen these and can help you, because I can't!
wisekki
Posts: 39
Joined: Tue Feb 27, 2007 11:58 am

Post by wisekki »

I know man i know :( And I've fiddled with zm and ubuntu 8.10 since ubuntu's release.. it just refuses to work :(
Locked