I've got ZoneMinder installed, I can access the control panel through Apache, and I can set up a monitor. But, whenever I view the monitor, the image isn't there, except for one attempt.
I've got a LorexPro CVC2051P/R camera plugged into a Prolink PV-BT878P+FM card, and it works fine under xawtv, using /dev/video0, channel 1.
/tmp/zmdc.log reports that zmc keeps crashing; there are multiple instances of:
Starting pending process, zmc -d 0
'zmc -d 0' starting at 03/10/24 23:27:08, pid = 4479
'zmc -d 0' started at 03/10/24 23:27:08
'zmc -d 0' crashed at 03/10/24 23:27:08, exit status 255
zmc says this:
# ZM_DBG_PRINT=1 zmc -d 0
10/25/03 11:28:15.100488 zmc-d0[7183].INF-zm_debug.c/189 [Debug Level = 0, Debug Log = ]
10/25/03 11:28:15.103513 zmc-d0[7183].INF-zm_monitor.cpp/635 [Got 1 monitors]
10/25/03 11:28:15.121080 zmc-d0[7183].INF-zm_local_camera.cpp/68 [X:0]
10/25/03 11:28:15.121592 zmc-d0[7183].INF-zm_local_camera.cpp/69 [Y:0]
10/25/03 11:28:15.121692 zmc-d0[7183].INF-zm_local_camera.cpp/70 [W:384]
10/25/03 11:28:15.121756 zmc-d0[7183].INF-zm_local_camera.cpp/71 [H:288]
10/25/03 11:28:15.122009 zmc-d0[7183].ERR-zm_local_camera.cpp/85 [Failed to set window attributes: Invalid argument]
Using xawtv, I get a nice color image. While playing around with ZoneMinder, one attempt made immediately after rebooting got me greyscale video in the monitor display. I'm pretty sure it was in passive mode. I thought 'great, it works now' and tried to set it to rgb24 mode, and from that point on I couldn't get a picture again. I thought maybe the reason it worked after reboot was that /tmp got cleared out, and perhaps the socket you keep there wasn't closed properly. Deleting it manually (as root) didn't fix the problem, though, even after making sure all the zm* processes were killed.
Does zmc depend on having X running? I'm trying to run ZoneMinder on a server which is usually headless, but my xawtv tests were done with the monitor hooked up and X running. I'm also able to run xawtv by exporting DISPLAY to my workstation, so I know the camera, card, driver, and xawtv don't rely on X running locally.
Some interesting parts of v4l-info:
# v4l-info
### video4linux device info [/dev/video0] ###
general info
VIDIOCGCAP
name : "BT878(Prolink Pixelview PV-BT)"
type : 0xeb [CAPTURE,TUNER,OVERLAY,CLIPPING,FRAMERAM,SCALES]
channels : 4
audios : 1
maxwidth : 768
maxheight : 480
minwidth : 48
minheight : 32
channels
...
VIDIOCGCHAN(1)
channel : 1
name : "Composite1"
tuners : 0
flags : 0x2 [AUDIO]
type : CAMERA
norm : 1
...
picture
VIDIOCGPICT
brightness : 32768
hue : 32768
colour : 32512
contrast : 27648
whiteness : 0
depth : 8
palette : GREY
buffer
VIDIOCGFBUF
base : (nil)
height : 768
width : 1024
depth : 16
bytesperline : 2048
window
VIDIOCGWIN
x : 0
y : 0
width : 384
height : 288
chromakey : 0
flags : 1
Failed to set window attributes
Re: Failed to set window attributes
Update: if I stop ZoneMinder, then remove bttv with 'modprobe -r bttv', then restart ZoneMinder, I can get the video again. However, as soon as I change any settings, it disappears on me and I have to remove and reload bttv.
Re: Failed to set window attributes
No go... after a few restarts this way, ZoneMinder is permanently shut down, with zma crashing, and xawtv gives me Seg faults.
- tech_fixer
- Posts: 132
- Joined: Tue Jul 29, 2003 3:07 pm
Re: Failed to set window attributes
Douglass:
Issue the following command to stop all ZM daemons: zmpkg.pl stop
Then log into ZM and click on Options. Go to the Video tab and turn off the option that says ZM_STRICT_VIDEO_CONFIG.
After that issue the following command to start the ZM daemons: zmpkg.pl start
Hope this helps.
Regards,
Jose Rodriguez
Issue the following command to stop all ZM daemons: zmpkg.pl stop
Then log into ZM and click on Options. Go to the Video tab and turn off the option that says ZM_STRICT_VIDEO_CONFIG.
After that issue the following command to start the ZM daemons: zmpkg.pl start
Hope this helps.
Regards,
Jose Rodriguez
Re: Failed to set window attributes
I solved my problem by commenting out lines 82-86 in zm_local_camera.cpp:
/*
if( ioctl( m_videohandle, VIDIOCSWIN, &vid_win ) )
{
Error(( "Failed to set window attributes: %s", strerror(errno) ));
if ( (bool)config.Item( ZM_STRICT_VIDEO_CONFIG ) ) exit(-1);
}
*/
Turning off ZM_STRICT_VIDEO_CONFIG would prevent the exit(-1) too, but with this line commented out everything else can still be strict. I'm curious to know what this block is supposed to do, and why it fails, though.
Regarding my greyscale/color problem, I was able to get color but only by reducing the image size drastically. I assume this is due to a problem getting enough shared memory. It seems to me that if ZoneMinder can figure out how much shared memory it is able to allocate, then it could present a dialog that lets the user choose a combination of format, image size, and buffer length that would work.
At the very least, you could provide a meaningful error message in the interface when the shared memory allocation fails, perhaps with a calculation of the memory needed, and a suggestion to modify those three paramters.
Doug.
/*
if( ioctl( m_videohandle, VIDIOCSWIN, &vid_win ) )
{
Error(( "Failed to set window attributes: %s", strerror(errno) ));
if ( (bool)config.Item( ZM_STRICT_VIDEO_CONFIG ) ) exit(-1);
}
*/
Turning off ZM_STRICT_VIDEO_CONFIG would prevent the exit(-1) too, but with this line commented out everything else can still be strict. I'm curious to know what this block is supposed to do, and why it fails, though.
Regarding my greyscale/color problem, I was able to get color but only by reducing the image size drastically. I assume this is due to a problem getting enough shared memory. It seems to me that if ZoneMinder can figure out how much shared memory it is able to allocate, then it could present a dialog that lets the user choose a combination of format, image size, and buffer length that would work.
At the very least, you could provide a meaningful error message in the interface when the shared memory allocation fails, perhaps with a calculation of the memory needed, and a suggestion to modify those three paramters.
Doug.