Utterly confused by shared memory

Support and queries relating to all previous versions of ZoneMinder
Locked
MikeH
Posts: 23
Joined: Tue Jul 22, 2008 5:16 pm
Location: UK

Utterly confused by shared memory

Post by MikeH »

I have successfully got my Logitech Quickcam Pro 9000 working with Zoneminder 1.22.3 at 320x240.

I'm currently trying to get it working a 640x480 and seem to have encountered shared memory problems:-

Code: Select all

Aug 23 19:28:12 HomePC zmu[26014]: ERR [Can't shmget, probably not enough shared memory space free: Invalid argument]
I've read the wiki and various posts on the subject, but I'm left unsure as to whether my default shared memory configuration is a problem or not.

I'm using a ring buffer setting of 40 and the webcam delivers 24-bit colour, so I'm assuming that my shared memory needs to be 40 x 640 x 480 x 3, or 36854000 bytes.

My existing shared memory is as follows....

Code: Select all

mike@HomePC:~$ cat /proc/sys/kernel/shmall
134217728
mike@HomePC:~$ cat /proc/sys/kernel/shmmax
134217728
....so it's already considerably bigger than the apparent requirement for 36854000 bytes.

The result of ipcs -l is:-

Code: Select all

------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 131072
max total shared memory (kbytes) = 536870912
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 = 16
max size of message (bytes) = 8192
default max size of queue (bytes) = 16384
I've read here that there is some confusion over the units in which one of the shared memory settings is specified, but I'm left unsure as to whether this is an issue with a particular distribution or whether it affects all distributions (and therefore warrants an update to the documentation).

The problem of shared memory settings seems to arise again and again. Is there a definitive statement anywhere which will tell me how to set it without just adding to my confusion with more rumour and caveats?

I know how to set it in /etc/sysctl.conf, but I just have no idea what values to use! :?

Can anyone enlighten me... please?

If my shared memory is, in fact, OK for my single webcam, what's the likely cause of the shared memory entries in the log files?

The camera woks fine at 640x480 with VLC.

Thanks,

Mike
MikeH
Posts: 23
Joined: Tue Jul 22, 2008 5:16 pm
Location: UK

Post by MikeH »

No worries - it's burst into life without me making any changes. :D

I think it wasn't working at 640x480 because I was constantly changing resolutions to check what would work and what wouldn't. Unfortunately, I wasn't re-booting after changing the settings, so probably had shared memory segments lying around that weren't being closed.

It's only just now that I remembered reading something about needing to re-boot or use ipcrm to clear-up.

What's that expression... RTFM...? ;)
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Good show mate. Glad you got it sorted.
Locked