yet another Failed to setup memory: Invalid argument

Support and queries relating to all previous versions of ZoneMinder
Locked
lfs
Posts: 13
Joined: Fri Aug 08, 2008 8:47 pm

yet another Failed to setup memory: Invalid argument

Post by lfs »

When I run zmc -d /dev/video it returns immediately with error code 255 and I get this in the logs:

08/08/08 20:43:13.080096 zmc_dvideo[3088].ERR-zm_local_camera.cpp/162 [Failed to setup memory: Invalid argument]

I have a sony dcr-pc9 mini-DV camera plugged into a hauppauge 150 capture card on a plain LFS linux system with kernel 2.6.24.7 and ZoneMinder 1.23.3.

I have used v4l2-ctl -i 2 to set the camera to input 2, which is composite. I have tested everything end to end by creating an avi and putting it on the webserver. cat /dev/video0 > /srv/www/htdocs/duh.avi. I can view this avi on another machine just fine.

I have also set the shared memory sizes to something that I hope is plenty big:
cat /proc/sys/kernel/shmmax
268435456
cat /proc/sys/kernel/shmall
268435456

Here is the output of ipcs:

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status

------ 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


I believe this is the code from src/zm_local_camera.cpp that is failing:

if ( ioctl(m_videohandle, VIDIOCGMBUF, &m_vmb) < 0 )
{
Error(( "Failed to setup memory: %s", strerror(errno) ));
exit(-1);
}


Here is the output of zmu -d /dev/video0 -q -v
Video Capabilities
Name: Hauppauge WinTV PVR-150
Type: 7
Can capture
Can tune
Does teletext
Video Channels: 5
Audio Channels: 0
Maximum Width: 720
Maximum Height: 480
Minimum Width: 48
Minimum Height: 32
Window Attributes
X Offset: 0
Y Offset: 0
Width: 320
Height: 240
Picture Attributes
Palette: 0 - Unknown
Colour Depth: 0
Brightness: 32896
Hue: 32896
Colour :33026
Contrast: 33026
Whiteness: 0
Channel 0 Attributes
Name: Tuner 1
Channel: 0
Flags: 1
Channel has a tuner
Type: 1 - TV
Format: 1 - NTSC
Channel 1 Attributes
Name: S-Video 1
Channel: 1
Flags: 0
Type: 2 - Camera
Format: 1 - NTSC
Channel 2 Attributes
Name: Composite 1
Channel: 2
Flags: 0
Type: 2 - Camera
Format: 1 - NTSC
Channel 3 Attributes
Name: S-Video 2
Channel: 3
Flags: 0
Type: 2 - Camera
Format: 1 - NTSC
Channel 4 Attributes
Name: Composite 2
Channel: 4
Flags: 0
Type: 2 - Camera
Format: 1 - NTSC

Any ideas?
Thanks in advance.
-K
lfs
Posts: 13
Joined: Fri Aug 08, 2008 8:47 pm

Post by lfs »

I just noticed this other logfile:

08/08/2008 21:18:19.674561 zmwatch[3964].INF ['zmc -d /dev/video' starting at 08/08/08 21:18:19, pid = 4045]
08/08/2008 21:18:29.677108 zmwatch[3964].ERR [Can't get shared memory id '7a6d0001', 1: No such file or directory]
08/08/2008 21:18:29.677294 zmwatch[3964].INF [Restarting capture daemon for pc9, shared memory not valid]
08/08/2008 21:18:29.770045 zmwatch[3964].INF ['zmc -d /dev/video' starting at 08/08/08 21:18:29, pid = 4049]
08/08/2008 21:18:39.772398 zmwatch[3964].ERR [Can't get shared memory id '7a6d0001', 1: No such file or directory]
08/08/2008 21:18:39.772588 zmwatch[3964].INF [Restarting capture daemon for pc9, shared memory not valid]
08/08/2008 21:18:39.865849 zmwatch[3964].INF ['zmc -d /dev/video' starting at 08/08/08 21:18:39, pid = 4056]
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

have you tested the cam on v4l with tvtime or similar?
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
lfs
Posts: 13
Joined: Fri Aug 08, 2008 8:47 pm

Post by lfs »

couldn't get tvtime to build.

xawtv -nodga (had to use that option to even run) says:

v4l-conf had some trouble, trying to continue anyway

and the window is just black. So I guess v4l doesn't work. I enabled it in the kernel, not sure what else to do. Here are some kernel configs:

CONFIG_VIDEO_DEV=y
CONFIG_VIDEO_V4L1=y
CONFIG_VIDEO_V4L1_COMPAT=y
CONFIG_VIDEO_V4L2=y
CONFIG_VIDEO_CAPTURE_DRIVERS=y
# CONFIG_VIDEO_ADV_DEBUG is not set
CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
CONFIG_VIDEO_TVAUDIO=m
CONFIG_VIDEO_TDA9840=m
CONFIG_VIDEO_TEA6415C=m
(all the rest of these were added as modules...)
lfs
Posts: 13
Joined: Fri Aug 08, 2008 8:47 pm

Post by lfs »

ok, looks like pvr-150 can actually have different chipsets. maybe mine is not supported or something:
Internext Compression Inc iTVC16 (CX23416) MPEG-2 Encoder

From another thread it looks like the ivtv driver should work. dunno.

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

Post by cordel »

ZM is only able to use the drivers provided by the V4L1 driver currently. If you PVR-150 is the type that requires IVTV then it will not work with ZM to the best of my knowledge without some major work. know someone had started working on something a few years back, his post is in the contribs section of the forum and obviously pretty dated and really was just a proof of concept that unfortunately didn't go anywhere.

You would obviously be correct in that just because you have a pvr-150, Hauppauge is famous for changing the hardware, with out changing the model, and likely you have one of the more recent cards.

This would be the third case I know of, two of which were just this month including yours.
Locked