new installaion shared memory problem

Support and queries relating to all previous versions of ZoneMinder
Locked
pdc124
Posts: 15
Joined: Fri Feb 02, 2007 9:53 am

new installaion shared memory problem

Post by pdc124 »

Ive put together an old machine which will sit by the back door, after the local pondlife invited themselves in

Code: Select all

hickcam zoneminder # uname -a
Linux 2.6.17-gentoo-r8 #2 SMP PREEMPT Thu Oct 12 11:32:00 Local time zone must be set-- i686 VIA Samuel 2 GNU/Linux
chickcam / # df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda3              2829624   2067396    618488  77% /
udev                     59296       172     59124   1% /dev
none                     59296         0     59296   0% /dev/shm
/dev/hda1                35104      6312     26980  19% /boot
chickcam / #           zon  
zoneminder 1.22.3 installed via portage
when i start it

Code: Select all

chickcam syslog-ng # tail -f /var/log/messages
Feb  2 10:48:53 chickcam sudo:     root : TTY=pts/0 ; PWD=/ ; USER=apache ; COMMAND=/usr/bin/zmdc.pl start zmupdate.pl -c
Feb  2 10:48:54 chickcam zmdc[12213]: INF ['zmupdate.pl -c' starting at 07/02/02 10:48:54, pid = 12264]
Feb  2 10:48:54 chickcam zmdc[12264]: INF ['zmupdate.pl -c' started at 07/02/02 10:48:54]
Feb  2 10:48:58 chickcam zmdc[12213]: INF [Starting pending process, zmc -d /dev/video]
Feb  2 10:48:58 chickcam zmdc[12213]: INF ['zmc -d /dev/video' starting at 07/02/02 10:48:58, pid = 12297]
Feb  2 10:48:58 chickcam zmdc[12297]: INF ['zmc -d /dev/video' started at 07/02/02 10:48:58]
Feb  2 10:48:58 chickcam zmc_dvideo[12297]: INF [Debug Level = 0, Debug Log = <none>]
Feb  2 10:48:58 chickcam zmc_dvideo[12297]: ERR [Failed to open video device /dev/video: Permission denied]
Feb  2 10:48:58 chickcam zmdc[12213]: ERR ['zmc -d /dev/video' exited abnormally, exit status 255]
Feb  2 10:49:02 chickcam zmu[12299]: ERR [Shared memory not initialised by capture daemon]
Feb  2 10:49:14 chickcam zmu[12306]: ERR [Shared memory not initialised by capture daemon]
Feb  2 10:49:18 chickcam zmdc[12213]: INF [Starting pending process, zmc -d /dev/video]
Feb  2 10:49:18 chickcam zmdc[12213]: INF ['zmc -d /dev/video' starting at 07/02/02 10:49:18, pid = 12312]
Feb  2 10:49:18 chickcam zmdc[12312]: INF ['zmc -d /dev/video' started at 07/02/02 10:49:18]
Feb  2 10:49:18 chickcam zmc_dvideo[12312]: INF [Debug Level = 0, Debug Log = <none>]
Feb  2 10:49:18 chickcam zmc_dvideo[12312]: ERR [Failed to open video device /dev/video: Permission denied]
Feb  2 10:49:18 chickcam zmdc[12213]: ERR ['zmc -d /dev/video' exited abnormally, exit status 255]
Feb  2 10:49:23 chickcam zmwatch[12260]: INF [Restarting capture daemon for webcam, shared memory not valid]
Feb  2 10:49:24 chickcam zmdc[12213]: INF ['zmc -d /dev/video' starting at 07/02/02 10:49:24, pid = 12325]
Feb  2 10:49:24 chickcam zmdc[12325]: INF ['zmc -d /dev/video' started at 07/02/02 10:49:24]
ive manually added another symlink

Code: Select all

chickcam / # ls -la  /dev/vid*
lrwxrwxrwx 1 root root 11 Feb  2 10:24 /dev/video -> /dev/video0
lrwxrwxrwx 1 root root 10 Feb  1 20:44 /dev/video0 -> v4l/video0
chickcam / #               
(dont know what this bit means )

Code: Select all

chickcam syslog-ng # ipcs

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x7a6d2001 163840     apache    700        12166308   0

------ Semaphore Arrays --------
key        semid      owner      perms      nsems
0x00000000 131072     apache    600        1
0x00000000 163841     apache    600        1

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages

it finds the camera

Code: Select all

chickcam / # zmu -d /dev/video0 -q -v
Video Capabilities
  Name: Logitech QuickCam Express II
  Type: 1
    Can capture
  Video Channels: 1
  Audio Channels: 0
  Maximum Width: 352
  Maximum Height: 288
  Minimum Width: 160
  Minimum Height: 120
Window Attributes
  X Offset: 0
  Y Offset: 0
  Width: 320
  Height: 240
Picture Attributes
  Palette: 4 - 24bit RGB
  Colour Depth: 24
  Brightness: 27136
  Hue: 0
  Colour :0
  Contrast: 11264
  Whiteness: 320
Channel 0 Attributes
  Name: SPCA561
  Channel: 0
  Flags: 0
  Type: 2 - Camera
  Format: 0 - PAL
chickcam / #                       
Is my machine not big enough to run this ? ( ie I dont understand the shared memory bit )
Last edited by pdc124 on Fri Feb 02, 2007 4:44 pm, edited 2 times in total.
emo82
Posts: 21
Joined: Wed Oct 18, 2006 6:21 pm
Contact:

Post by emo82 »

modify /etc/sysctl.conf
kernel.shmall = 134217728
kernel.shmmax = 134217728
pdc124
Posts: 15
Joined: Fri Feb 02, 2007 9:53 am

Post by pdc124 »

Code: Select all

Feb  2 13:35:42 chickcam zmpkg[7115]: INF [Command: start]
Feb  2 13:35:42 chickcam sudo:     root : TTY=pts/0 ; PWD=/ ; USER=apache ; COMMAND=/bin/true
Feb  2 13:35:42 chickcam sudo:     root : TTY=pts/0 ; PWD=/ ; USER=apache ; COMMAND=/usr/bin/zmdc.pl check
Feb  2 13:35:44 chickcam sudo:     root : TTY=pts/0 ; PWD=/ ; USER=apache ; COMMAND=/usr/bin/zmfix
Feb  2 13:35:44 chickcam zmfix[7126]: ERR [Can't chmod /dev/video0 to 20666: Operation not permitted]
Feb  2 13:35:44 chickcam sudo:     root : TTY=pts/0 ; PWD=/ ; USER=apache ; COMMAND=/usr/bin/zmdc.pl startup
Feb  2 13:35:45 chickcam zmdc[7130]: INF [Server starting at 07/02/02 13:35:45]
Feb  2 13:35:48 chickcam sudo:     root : TTY=pts/0 ; PWD=/ ; USER=apache ; COMMAND=/usr/bin/zmdc.pl start zmc -d /dev/video0
Feb  2 13:35:49 chickcam zmdc[7130]: INF ['zmc -d /dev/video0' starting at 07/02/02 13:35:49, pid = 7153]
Feb  2 13:35:49 chickcam zmdc[7153]: INF ['zmc -d /dev/video0' started at 07/02/02 13:35:49]
Feb  2 13:35:49 chickcam zmc_dvideo0[7153]: INF [Debug Level = 0, Debug Log = <none>]
Feb  2 13:35:49 chickcam zmc_dvideo0[7153]: ERR [Failed to open video device /dev/video0: Permission denied]
Feb  2 13:35:49 chickcam zmdc[7130]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
Feb  2 13:35:49 chickcam zmdc[7130]: INF [Starting pending process, zmc -d /dev/video0]
Feb  2 13:35:49 chickcam zmdc[7130]: INF ['zmc -d /dev/video0' starting at 07/02/02 13:35:49, pid = 7156]
Feb  2 13:35:49 chickcam zmdc[7156]: INF ['zmc -d /dev/video0' started at 07/02/02 13:35:49]
Feb  2 13:35:49 chickcam zmc_dvideo0[7156]: INF [Debug Level = 0, Debug Log = <none>]
Feb  2 13:35:49 chickcam zmc_dvideo0[7156]: ERR [Failed to open video device /dev/video0: Permission denied]
Feb  2 13:35:49 chickcam zmdc[7130]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
Feb  2 13:35:49 chickcam sudo:     root : TTY=pts/0 ; PWD=/ ; USER=apache ; COMMAND=/usr/bin/zmdc.pl start zmfilter.pl
Feb  2 13:35:50 chickcam zmdc[7130]: INF ['zmfilter.pl' starting at 07/02/02 13:35:50, pid = 7159]
Feb  2 13:35:50 chickcam zmdc[7159]: INF ['zmfilter.pl' started at 07/02/02 13:35:50]
Feb  2 13:35:51 chickcam sudo:     root : TTY=pts/0 ; PWD=/ ; USER=apache ; COMMAND=/usr/bin/zmdc.pl start zmaudit.pl -c
Feb  2 13:35:53 chickcam zmfilter[7159]: INF [Scanning for events]
Feb  2 13:35:53 chickcam zmu[7162]: ERR [Shared memory not initialised by capture daemon]
Feb  2 13:35:54 chickcam zmdc[7130]: INF [Starting pending process, zmc -d /dev/video0]
Feb  2 13:35:54 chickcam zmdc[7130]: INF ['zmc -d /dev/video0' starting at 07/02/02 13:35:54, pid = 7167]
Feb  2 13:35:54 chickcam zmdc[7167]: INF ['zmc -d /dev/video0' started at 07/02/02 13:35:54]
Feb  2 13:35:54 chickcam zmc_dvideo0[7167]: INF [Debug Level = 0, Debug Log = <none>]
Feb  2 13:35:54 chickcam zmc_dvideo0[7167]: ERR [Failed to open video device /dev/video0: Permission denied]
Feb  2 13:35:54 chickcam zmdc[7130]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
Feb  2 13:35:55 chickcam zmdc[7130]: INF ['zmaudit.pl -c' starting at 07/02/02 13:35:55, pid = 7171]
Feb  2 13:35:55 chickcam zmdc[7171]: INF ['zmaudit.pl -c' started at 07/02/02 13:35:55]
Feb  2 13:35:56 chickcam sudo:     root : TTY=pts/0 ; PWD=/ ; USER=apache ; COMMAND=/usr/bin/zmdc.pl start zmwatch.pl
Feb  2 13:35:58 chickcam zmdc[7130]: INF ['zmwatch.pl' starting at 07/02/02 13:35:58, pid = 7177]
Feb  2 13:35:58 chickcam zmdc[7177]: INF ['zmwatch.pl' started at 07/02/02 13:35:58]
Feb  2 13:35:59 chickcam zmwatch[7177]: INF [Watchdog starting]
Feb  2 13:35:59 chickcam zmwatch[7177]: INF [Watchdog pausing for 30 seconds]
Feb  2 13:35:59 chickcam sudo:     root : TTY=pts/0 ; PWD=/ ; USER=apache ; COMMAND=/usr/bin/zmdc.pl start zmupdate.pl -c
Feb  2 13:36:01 chickcam zmdc[7130]: INF ['zmupdate.pl -c' starting at 07/02/02 13:36:01, pid = 7181]
Feb  2 13:36:01 chickcam zmdc[7181]: INF ['zmupdate.pl -c' started at 07/02/02 13:36:01]
Feb  2 13:36:04 chickcam zmdc[7130]: INF [Starting pending process, zmc -d /dev/video0]
Feb  2 13:36:04 chickcam zmdc[7130]: INF ['zmc -d /dev/video0' starting at 07/02/02 13:36:04, pid = 7187]
Feb  2 13:36:04 chickcam zmdc[7187]: INF ['zmc -d /dev/video0' started at 07/02/02 13:36:04]
Feb  2 13:36:04 chickcam zmc_dvideo0[7187]: INF [Debug Level = 0, Debug Log = <none>]
Feb  2 13:36:04 chickcam zmc_dvideo0[7187]: ERR [Failed to open video device /dev/video0: Permission denied]
Feb  2 13:36:04 chickcam zmdc[7130]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
Feb  2 13:36:10 chickcam zmu[7189]: ERR [Shared memory not initialised by capture daemon]
                                                                                                                                                  
and the config stuff is

Code: Select all

chickcam ~ # cat /usr/src/linux/.config |grep SYS
CONFIG_SYSVIPC=y
CONFIG_SYSCTL=y
CONFIG_ACPI_SYSTEM=y
# CONFIG_SCSI_ADVANSYS is not set
CONFIG_SYSFS=y
# CONFIG_SYSV_FS is not set
CONFIG_MAGIC_SYSRQ=y
chickcam ~ # grep ^[A-Za-z]  /etc/sysctl.conf
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
kernel.shmall = 134217728
kernel.shmmax = 134217728
chickcam ~ # ipcs

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x7a6d2001 131072     apache    700        12166308   0

------ Semaphore Arrays --------
key        semid      owner      perms      nsems
0x00000000 32768      apache    600        1
0x00000000 65537      apache    600        1

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages

chickcam ~ #                                                                        
chickcam ~ #                                                        
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

This is not failing because of shared memory but because it cannot open your video device. It should be able to adjust the permissions to suit but for some reason that is not working. Can you temporarily, as root,

Code: Select all

chmod 777 /dev/video0
and then restart ZM and see if that makes any difference.
Phil
pdc124
Posts: 15
Joined: Fri Feb 02, 2007 9:53 am

Post by pdc124 »

Code: Select all

Feb  2 14:50:25 chickcam sudo:     root : TTY=pts/1 ; PWD=/ ; USER=apache ; COMMAND=/bin/true
Feb  2 14:50:25 chickcam sudo:     root : TTY=pts/1 ; PWD=/ ; USER=apache ; COMMAND=/usr/bin/zmdc.pl check
Feb  2 14:50:26 chickcam sudo:     root : TTY=pts/1 ; PWD=/ ; USER=apache ; COMMAND=/usr/bin/zmfix
Feb  2 14:50:26 chickcam sudo:     root : TTY=pts/1 ; PWD=/ ; USER=apache ; COMMAND=/usr/bin/zmdc.pl startup
Feb  2 14:50:27 chickcam zmdc[9612]: INF [Server starting at 07/02/02 14:50:27]
Feb  2 14:50:30 chickcam sudo:     root : TTY=pts/1 ; PWD=/ ; USER=apache ; COMMAND=/usr/bin/zmdc.pl start zmc -d /dev/video0
Feb  2 14:50:31 chickcam zmdc[9612]: INF ['zmc -d /dev/video0' starting at 07/02/02 14:50:31, pid = 9635]
Feb  2 14:50:31 chickcam zmdc[9635]: INF ['zmc -d /dev/video0' started at 07/02/02 14:50:31]
Feb  2 14:50:31 chickcam zmc_dvideo0[9635]: INF [Debug Level = 0, Debug Log = <none>]
Feb  2 14:50:32 chickcam sudo:     root : TTY=pts/1 ; PWD=/ ; USER=apache ; COMMAND=/usr/bin/zmdc.pl start zmfilter.pl
Feb  2 14:50:32 chickcam /var/tmp/portage/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca561.h: [spca561_init:473] Find spca561 USB Product ID 928
Feb  2 14:50:32 chickcam zmc_dvideo0[9635]: INF [Starting Capture]
Feb  2 14:50:33 chickcam zmdc[9612]: INF ['zmfilter.pl' starting at 07/02/02 14:50:33, pid = 9639]
Feb  2 14:50:33 chickcam zmdc[9639]: INF ['zmfilter.pl' started at 07/02/02 14:50:33]
Feb  2 14:50:35 chickcam sudo:     root : TTY=pts/1 ; PWD=/ ; USER=apache ; COMMAND=/usr/bin/zmdc.pl start zmaudit.pl -c
Feb  2 14:50:37 chickcam zmfilter[9639]: INF [Scanning for events]
Feb  2 14:50:38 chickcam zmdc[9612]: INF ['zmaudit.pl -c' starting at 07/02/02 14:50:38, pid = 9644]
Feb  2 14:50:38 chickcam zmdc[9644]: INF ['zmaudit.pl -c' started at 07/02/02 14:50:38]
Feb  2 14:50:40 chickcam sudo:     root : TTY=pts/1 ; PWD=/ ; USER=apache ; COMMAND=/usr/bin/zmdc.pl start zmwatch.pl
Feb  2 14:50:41 chickcam zmdc[9612]: INF ['zmwatch.pl' starting at 07/02/02 14:50:41, pid = 9649]
Feb  2 14:50:41 chickcam zmdc[9649]: INF ['zmwatch.pl' started at 07/02/02 14:50:41]
Feb  2 14:50:43 chickcam sudo:     root : TTY=pts/1 ; PWD=/ ; USER=apache ; COMMAND=/usr/bin/zmdc.pl start zmupdate.pl -c
Feb  2 14:50:43 chickcam zmwatch[9649]: INF [Watchdog starting]
Feb  2 14:50:43 chickcam zmwatch[9649]: INF [Watchdog pausing for 30 seconds]
Feb  2 14:50:45 chickcam zmdc[9612]: INF ['zmupdate.pl -c' starting at 07/02/02 14:50:45, pid = 9653]
Feb  2 14:50:45 chickcam zmdc[9653]: INF ['zmupdate.pl -c' started at 07/02/02 14:50:45]
Feb  2 14:52:30 chickcam zmc_dvideo0[9635]: INF [webcam: 1000 - Capturing at 8.47 fps]
                                                                                                                             
ive now got a black box !

camsource still gives an image though.

and when I go console->webcam->settings->brightness changing it to anything results in '0' being rewritten into the box and the image doesnt change
Locked