Problem with bt787 card after disabling V4L_MULTI_BUFFER

Post here to ask any questions about hardware suitability, configuration in ZoneMinder, or experiences. If you just want to know if something works with ZoneMinder or not, please check the Hardware Compatibility sections in the forum, and the Wiki first. Also search this topic as well.
Post Reply
paranoid_android
Posts: 2
Joined: Thu Dec 03, 2009 5:20 pm

Problem with bt787 card after disabling V4L_MULTI_BUFFER

Post by paranoid_android »

Hi,

I have just started out setting up a machine for zoneminder. I have a generic bt878 card (4 input channels, one chip) and 2 composite cameras. I have the hardware configured correctly, I believe. When I open tvtime and set the input standard to PAL, I am able to view the camera images fine. I have 2 cameras and I am able to switch between them and see watch the feed from both by switching the channel. All seems good!


First, I configured ZoneMinder for a single camera. I set up a ZM monitor to monitor only, to get things configured ok. I set it up using the following:
Device: /dev/video0
Capture method: V4L version 2
Channel: 0
Format: PAL
Palette: YUYV
Width: 600
height: 480

Things seem to run fine with these settings, so I tried setting up the second camera. I set op the second camera using the same options as the first one, but using channel 3 instead. When i tried to view the ZM monitor, the images from the 2 camera were over-lapping. It would come and go, but the 2 cameras were obviously interfering. I did some reading on this on the ZM website, and I discovered that it is due to the single chip in the card handling the input from all 4 channels. I found the this article (http://www.zoneminder.com/wiki/index.php/Pico2000), and tried the 3 recommended fixes:

The reported solution for these problems has varied. You may want to try each of the following options one at a time. Remember to restart ZoneMinder after each change.

* Disable V4L_MULTI_BUFFER (found in options >> config)
* Change CAPTURES_PER_FRAME to a value such as 2 or 4 (found in options >> config)
* Use Video For Linux version 1 for each input (found in source >> source >> capture method)

I tried all 3 options, one at a time, and I found that the first was the most effective, however there is a side effect: the white balance seems to change rapidly, the light levels fluctuate, even when the camera is used in a indoor settings.


This was not a problem when viewing a single channel in tvtime since the chip was only accessing the one channel, but in ZM, there is a process for each channel, polling an image from that channel. I believe that each time the channel is polled, a different white balance value is determined. The overall problem is that the fluctuating light levels cause ZM to detect false positives for motion dection.

For now, I have removed the 2nd camera, using just the one. (At least I can keep an eye on my back yard!) I was wondering if anyone might know any tricks to try.

One solution, I believe, would be to buy a card that has a dedicated chip for each input. That way, I would use /dev/video0, /dev/video1, /dev/video2, etc, instead of multiple channels on the single video device. However, I would like to see if there are any other work-arounds, before I buy new hardware.

Sorry for for the long winded post, but I thought someone might know a neat trick to deal with this problem.

Thanks,
Adam
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Your assumptions pretty much are correct.
The single chip can operate only one input at a time. On each input change, the bt878 driver tries to determine the best white balance, contrast, etc. Obviously it a bit different each time.

Moving to a card the has several chips obviously does help. Dedicating is the best, but you can share if you take care.

Since you only have two cams this obviously don't apply to you but might later. What helps is to try to match cameras and place in areas that have the same lighting so that when the inputs switch, the values between the two will be relatively close which will minimize the effect and they can share the same chip.

Hope that makes since and helps.
Post Reply