svn_2766, zmc, and bttv channels

Forum for questions and support relating to the 1.24.x releases only.
Locked
User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

svn_2766, zmc, and bttv channels

Post by rdmelin »

Some progress here on the problem with using more than one channel on single chip bttv cards. Reported in this and other threads:
http://www.zoneminder.com/forums/viewtopic.php?p=49611

With svn_2766 using v4l2 and two channels the feed from the two gets mixed together, rapidly and randomly switching back and forth. In one test both settled in and captured on channel 1 despite being set to 0 & 1.
No errors or warnings in logs even with _zmc debug turned up (except when trying palettes that were incompatible.)

Using v41 version 1 I can capture from both channel 0 & 1 without errors or problems. However cpu usage by zmc jumps from negligible to ~40% when enabling the second channel. This is with both set to a very modest 2 fps and 320x240.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I have spent a lot of time today chasing this and I have just updated the SVN which now has something in there for this. It just seems to be that if you double (or multi) buffer that the driver can't sync fast enough to get a stable picture, plus you get a high load (which also seems to be in the driver).

I think this worked before (if at all) mostly by accident. I would suggest you set captures_per_frame to 2 and try that or (but not both) switch off the new v4l_multi_buffer option. I get a stable picture in both cases but at the expense of frame rates. This is the same for v1 or v2 by the
Phil
User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

Post by rdmelin »

OK Phil, with svn_2775 this is working well. No good with v4l2, but with v4l version 1 and v4l_multi_buffer disabled I get stable capture on two channels and zmc uses .5% cpu.
Thanks and congrats on the new version. :)
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

What is the issue with the V4L2 version as that is working exactly the same as the 1 version here?
Phil
User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

Post by rdmelin »

Sorry Phil, I wasn't careful enough of details in testing.
v4l2 does work properly using YUV422P and BGR24 at least.
RGB24 does not work with v4l2, which is what I tried first since it works with v4l version 1.
Maybe this is not a bug, but expected behavior with v4l2.
GREY does not work with either v4l 1 or 2, but I see in another thread that you are already on that one.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

What do you get with RGB24? If it is odd colours then I think that is to be expected as I think that actually everything is reallt BGR24 and there was a hack in V4L1 to work around it. I think :lol:
Phil
User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

Post by rdmelin »

What do you get with RGB24?
In /var/log/messages
Feb 19 07:05:40 archbox zmc_dvideo0[26247]: INF [New Debug Level = 3, New Debug Log = /var/log/zm/zm_debug.log]
Feb 19 07:05:40 archbox zmc_dvideo0[26247]: INF [Starting Capture]
Feb 19 07:05:40 archbox zmc_dvideo0[26247]: INF [Got signal 6 (Aborted), exiting and forcing backtrace]
Feb 19 07:05:40 archbox zmc_dvideo0[26247]: INF [Backtrace complete, please execute the following command for more information]
Feb 19 07:05:40 archbox zmc_dvideo0[26247]: INF [addr2line -e /usr/lib/zm/bin/zmc 0xb7fe1424 0xb7fe1424 0xb7128790 0xb712a0c8 0x8055257 0x80
66d97 0x8067694 0x804ccc8 0xb71146c5 0x804c8a1]
Feb 19 07:05:40 archbox zma_m1[26214]: WAR [Waiting for capture daemon]
Feb 19 07:05:41 archbox zma_m1[26214]: WAR [Waiting for capture daemon]
Feb 19 07:05:42 archbox zma_m1[26214]: WAR [Waiting for capture daemon]
In /var/log/zm/zm_debug.log
02/19/09 07:05:40.128884 zmc_dvideo0[26247].DB1-zm_monitor.cpp/1810 [Loaded monitor 1(Front), 1 zones]
02/19/09 07:05:40.128907 zmc_dvideo0[26247].INF-zmc.cpp/186 [Starting Capture]
02/19/09 07:05:40.129274 zmc_dvideo0[26247].DB3-zm_local_camera.cpp/350 [Opening video device /dev/video0]
02/19/09 07:05:40.129365 zmc_dvideo0[26247].DB2-zm_local_camera.cpp/356 [V4L2 support enabled, using V4L2 api]
02/19/09 07:05:40.129382 zmc_dvideo0[26247].DB3-zm_local_camera.cpp/361 [Checking video device capabilities]
02/19/09 07:05:40.129408 zmc_dvideo0[26247].DB3-zm_local_camera.cpp/371 [Setting up video format]
02/19/09 07:05:40.129454 zmc_dvideo0[26247].FAT-zm_local_camera.cpp/387 [Failed to set video format: Invalid argument]
02/19/09 07:05:40.129718 zmc_dvideo0[26247].INF-zm_signal.cpp/64 [Got signal 6 (Aborted), exiting and forcing backtrace]
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I think that just means your driver doesn't support that format. I don't think mine does either. I take that to mean that in V4L2 BGR is really BGR unlike in V4L1 RGB was really BGR and that BGR is the common format and maybe no-one bothers with RGB.

I've not seen that actually written down anywhere though, googling turns up all sorts of vague references to byte order flipping.
Phil
estro
Posts: 1
Joined: Thu Apr 09, 2009 8:47 am

Multiple channels not working in 1.24.1

Post by estro »

Hi!

I think this is the closest thread to the issue I am having, but I don't understand what svn_27gg and v4I2 such that I can figure out what I need to do to use the given solution.

For reference:
I had Zoneminder 1.23 running with minimal problems on a fresh install of Ubuntu. Same box, fresh install of both Ubuntu and Zoneminder 1.24.1, most of the same settings, except now the monitors show either blue or the same image if more than one channel is enabled on a given device path. I have changed the frame rates to no avail.

Thanks!

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

Post by cordel »

svn is a development repository, and it allows you to to get unreleased code from it while it is being actively developed. ZM svn can be viewed at svn.zoneminder.com and directions to be able to download are on that page.

v4l1 and v4l2 are part of the kernel drivers specifically for video devices.

If you just want something that works, I would suggest rolling back to 1.23.3 for the time being as it would seem issues are still creeping up.
Locked