fixing monitor problem on zoneminder

After installing Zoneminder, some people (including me) reported that they had a problem with monitor. A black screen, or even no picture / video at all. From logs, it’s usually said: “Can’t get shared memory id…” or “Shared memory invalid…”, something like that. Especially when we’re using a webcam.
After googling, i found some solutions for this. First, increase the shared memory, and second, edit file.

1. Increase shared memory maximum

Open the file “/etc/sysctl.conf”, and paste this 2 line at the bottom of the file.

# Increase the maximum shared memory
kernel.shmmax = 167772160

save, and restart your machine.
If still no luck, continue to the next step:

2. Edit

We need to edit zoneminder source to point the video driver.
Open file ” /usr/bin/” (the location on some machine, might be different)
and add this code, right before the “my @daemons =….” (about line 64).

$ENV{LD_PRELOAD} = ‘/usr/lib/libv4l/’;


*UPDATE!* added by ldp

Also work:
$ENV{LD_PRELOAD} = ‘/usr/lib/libv4l/’;

check your /usr/lib/libv4l or /usr/lib64/libv4l directory for other files to preload

save, and restart your zoneminder.

it works like charm…

Published by Miaz Akemapa

Book minded!!!

Reader Comments

  1. WORKS!
    Running Ubuntu 10.04 server.
    ZoneMinder v1.24.2
    0ac8:301b Z-Star Microelectronics Corp. ZC0301 Webcam
    driver zc3xx
    may work on other gspca webcams

    Cut and Paste to failed :

    Unrecognized character \xE2 in column 20 at /usr/bin/ line 65.

    Changed : $ENV{LD_PRELOAD} = ‘/usr/lib/libv4l/‘;
    To : $ENV{LD_PRELOAD} = ‘/usr/lib/libv4l/’;

    Could be difference in fonts? but the ‘ is not the same as ‘

    Also $ENV{LD_PRELOAD} = ‘/usr/lib/libv4l/’;

    check your /usr/lib/libv4l or /usr/lib64/libv4l directory for other files to preload

    1. yes, that should be a single quote ‘,
      but my text editor changed to: ’

      you have to fix the single quote before paste to


  2. Hello: i’, trining to fix this problem, your fix didn’d work for me.
    should be like this?

    my @daemons = (
    $ENV{LD_PRELOAD} = ‘/usr/lib/libv4l/’;

  3. adding:

    $ENV{LD_PRELOAD} = ‘/usr/lib64/libv4l/’;

    just before

    my @daemons = (

    works lika charm on my fc15 64bit box which, otherwise, would scream the logs full of :

    05/06/2012 12:15:16.611943 zmdc[11139].ERR [‘zmc -d /dev/video0’ exited abnormally, exit status 11]

    thanks a lot !!!

  4. AWWWWWW you rock! This made my whole week.

    I am on ubuntu 12.0.4 32-bit and had to add this to the path of the libs i386-linux-gnu/

    So they look like:

    $ENV{LD_PRELOAD} = ‘/usr/lib/i386-linux-gnu/libv4l/’;
    $ENV{LD_PRELOAD} = ‘/usr/lib/i386-linux-gnu/libv4l/’;

    1. update:

      I had to put them together as well.

      $ENV{LD_PRELOAD} = ‘/usr/lib/i386-linux-gnu/libv4l/’;

  5. Doesn’t work for me: the Zoneminder Console stopped
    I had this problem before and solved it by adding the command Sleep 15 in the file /etc/init.d/zoneminder
    After that it worked but no obviously the mysql server starts too soon.

    How can i fix this problem?

  6. This does not work for me

    im using 12.04 LTS 64BIt

    Your instructions are bland…. . $ENV{LD_PRELOAD} = ‘/usr/lib/libv4l/’;

    right before or right above, does it have a space between the two??? Im confused and cant figure this out.

    any help appreciated…


Leave a Reply

Your email address will not be published. Required fields are marked *