Memory map question

Forum for questions and support relating to the 1.24.x releases only.
Locked
johngc
Posts: 51
Joined: Sun May 25, 2008 4:38 pm

Memory map question

Post by johngc »

I have been trying to install 1.24 for a while and while the guides here help me get it up and running I am still having problems getting an image from either of my cameras.

I think that ultimately the problem is with my memory settings and after reading several of the posts here I still cannot get it to work at an acceptable resolution (I could get 150x150 but only in black and white - any bigger and it was either a black screen with a cm of image or nothing)

I have now seen the mention of memory map and being very new to Linux (Ubuntu) I do not fully understand how it works / what it does.

I did try to install using it by including the --enable-mmap=yes argument when I ran ./configure but I get an error saying :
configure: error: zm requires Sys::Mmap for mapped memory
At this stage I am stuck.

Can someone please point me in the right direction or explain what memory map does and how I can enable it.

Thanks
User avatar
henriquejf
Posts: 77
Joined: Tue Feb 10, 2009 12:01 pm
Location: Brazil

Post by henriquejf »

Hi there; well, i am using ubuntu 8.10 and zm 1.24.1, and i was experimenting related problems, but after i have upgraded my ubuntu these problems seemed to stop;

i think you should try

aptitude update
aptitude full-upgrade

if it does not solve your problem, you may check

http://www.zoneminder.com/forums/viewto ... 0772#50772

or

http://www.zoneminder.com/wiki/index.ph ... esolutions.

Actually, if possible try to follow the tutorial below that has shown very usefull for many people as far as i know, including myself

http://www.zoneminder.com/wiki/index.ph ... ozola-0.7)


hope it may help, see you !
-----------------------
Henrique Barbosa
Consultant
Juiz de Fora, MG - Brazil
allanE
Posts: 44
Joined: Mon Feb 09, 2009 1:19 pm
Location: Sharps Chapel,TN

Post by allanE »

what worked for me was to google "sys-mmap" get the file and install it . 32 bit ubuntu did not require that but 64 bit did.
Allan
johngc
Posts: 51
Joined: Sun May 25, 2008 4:38 pm

Post by johngc »

Thanks for the suggestions but I did actually follow the full guide mentioned and the install runs very well but the images do not display.

The two links refer to shmall and shmmax which I have already read and experimented with but with no luck and is the reason why I am now looking at Memorymap. - It is my understanding that the memorymap feature removes the need to mess around with the shmall and shmmax settings as ZM handles it in another way:

Taken from the changelog 1.24.0
FEATURE : Optional use of mapped memory instead of shared memory. This is a different, though related, method of sharing memory between processes. From the help for ZM_PATH_MEM ZoneMinder has historically used IPC shared memory for shared data between processes. This has its advantages and limitations. This version of ZoneMinder can use an alternate method, mapped memory, instead which can be enabled with the --enable--mmap directive to configure. This requires less system configuration and is generally more flexible. However it requires each shared data segment to map onto a filesystem file. This option indicates where those mapped files go. You should ensure that this location has sufficient space for these files and for the best performance it should be a tmpfs file system or ramdisk otherwise disk access may render this method slower than the regular shared memory one.
I also managed to install Sys::Mmap from CPAN after a while so now the install has worked with no errors but I still can't get it working!

Are there some settings that I need to change for memory map?


The most frustrating thing is that a while ago, on a previous install it was all working fine and there is a post on here with my memory settings. After a fresh install I just cant get it to work. I am reluctant to doa clean install just yet as my server also runs my email and backups :? [/b]
johngc
Posts: 51
Joined: Sun May 25, 2008 4:38 pm

Post by johngc »

Ok, I seem to have figured out the mmap thing.

I ran :
sudo mount -t tmpfs -o rw,noexec,nosuid,nodev,mode=1777 vartmp /var/tmp
and then pointed ZM at /var/tmp for the mapping config. I then tried to run it but still no image.

I checked some of the error logs and saw a complaint that mmap was expecting a bigger space so I re ran:
sudo mount -t tmpfs -o rw,noexec,nosuid,nodev,size=4801192,mode=1777 vartmp /var/tmp
which it seemed to accept and restarted ZM, but still no image.

The only reccurent message in my syslog is:
'zmc -d /dev/video0' crashed, signal 6
but i have not got to he bottom of what that means!
User avatar
henriquejf
Posts: 77
Joined: Tue Feb 10, 2009 12:01 pm
Location: Brazil

Post by henriquejf »

johngc wrote:
The only reccurent message in my syslog is:
'zmc -d /dev/video0' crashed, signal 6
but i have not got to he bottom of what that means!
From the zoneminder documentation on

http://www.zoneminder.com/wiki/index.php/Documentation

"Components

ZoneMinder is not a single monolithic application but is formed from several components. These components primarily include executable compiled binaries which do the main video processing work, perl scripts which usually perform helper and/or external interface tasks and php web scripts which are used for the web interface.

A brief description of each of the principle components follows.

zmc
This is the ZoneMinder Capture daemon. This binary's job is to sit on a video device and suck frames off it as fast as possible, this should run at more or less constant speed. "

As you see, zmc is a heart component, so if I understand you right from your first post, when you mention you could only get very poor resolution, i suggest that you use that poor resolution temporarily and then come back to the greater problem that you have that is zmc failing; believe me, you have to fix that first in order to mess around with other things;

You could go to options > debug, enable extra debugs and set them at least to level 4, and the observe if you get something useful to fix the zmc problem;

can you also tell how much memory you got on your system and tell me how much you have left on your hd for the swap partition ?

please also attach your syslog so that i can see if there is any permission problem on dev/video0;

good luck !
-----------------------
Henrique Barbosa
Consultant
Juiz de Fora, MG - Brazil
johngc
Posts: 51
Joined: Sun May 25, 2008 4:38 pm

Post by johngc »

Thank you for your suggestions / help but I ended up going back to the original settings for memory and after a clean install it worked ! - I guess I just managed to mess something up inadvertently....
User avatar
henriquejf
Posts: 77
Joined: Tue Feb 10, 2009 12:01 pm
Location: Brazil

Post by henriquejf »

Good for you !
-----------------------
Henrique Barbosa
Consultant
Juiz de Fora, MG - Brazil
User avatar
henriquejf
Posts: 77
Joined: Tue Feb 10, 2009 12:01 pm
Location: Brazil

fixed installing via perl

Post by henriquejf »

i have it fixed like that:

enter perl shell by:

perl -MCPAN -e shell
install Sys::Mmap


when configuring zm before compile, i used


./configure --with-webdir=/var/www/zm --with-cgidir=/usr/lib/cgi-bin ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zmuser \
ZM_DB_PASS=zmpass --enable-debug=yes --with-webgroup=www-data --with-webuser=www-data --enable-mmap=yes


and the makefile for zoneminder got prepared; it is documment on my article http://www.zoneminder.com/wiki/index.ph ... rl_Modules , hope it helps !
-----------------------
Henrique Barbosa
Consultant
Juiz de Fora, MG - Brazil
Locked