January 25, 2008

Using a Logitech QuickCam Pro 3000 with ZoneMinder

Okay, so I got ZoneMinder installed. Now I want to play with it. I recently purchased an XBox 360 webcam for use with my Mac, but I thought that was a little too good for this. However I did have a Logitech QuickCam Pro 3000 lying around. I remember having to download the drivers for this camera under Windows, so it would be fair to say I had low expectations in getting this working under Linux. In fact quite the opposite--it works very well indeed. As soon as I plugged it in it showed in /var/log/messages. There's even a utility that sets the various options of the QuickCam's Philips chipset called http://www.vanheusden.com/setpwc/ written by Folkert van Heusden.

After plugging it in, the first thing I did was try and find out what settings I needed to have in ZoneMinder. After installing setpwc, it was fairly easy to find out what I needed. There is even a setpwc Debian package that can just be installed via apt-get. However for me this version was 1.1 and the latest as of January 2008 is 1.23. The obvious difference between the two is that with the latest version you can set the resolution. However just to find out the settings for ZoneMinder, 1.1 will do.

These are the settings I used initially in ZoneMinder. You can get to this area just by clicking Add New Monitor on the console page of ZoneMinder (i.e. http://yoursever/zm/) and then clicking on the Source tab:

Device Path: /dev/video0
Device Channel: 0
Device Format: AUTO
Capture Palette: YUV420P
Capture Width: 320
Capture Height: 240
Preserve Aspect Ratio: Unchecked
Orientation: Normal

I knew the device was located on /dev/video0 as that's what was reported in /log/var/messages. You'll have to check the correct device path your camera. Once I clicked Save and returned back to the ZM Console page, I clicked on what I named the source, in my case Cam1 and it worked--I saw the image! It seems that if everything went okay, the source field for the respective camera will turn orange, otherwise red.

Okay, my camera supports 640x480. I used the latest version of setpwc to set the resolution and then edited the source settings to set the correct capture height and width, but once I did that the source field for the camera on the ZM console turned red and I wasn't able to see an image. A few more Google searches and reading ZoneMinder's installation instructions correctly, it seems you have to increase the amount of shared memory. This can be done instantly by issuing the following command:

# echo 134217728 >/proc/sys/kernel/shmall && echo 134217728 >/proc/sys/kernel/shmmax

However upon reboot, this will need to be done again so it's best to edit /etc/sysctl.conf to add kernel.shmmax = 134217728. You can quickly do this by issuing:

# echo kernel.shmmax = 134217728 >> /etc/sysctl.conf

That's it. Job done, camera working.

1 comment:

kpb said...

Great article! I got my QC Pro 3000 set up in less than 30 min.
Thanks