[AG-TECH] vic and Logitech QuickCam 3000 Pro on Linux

Paul L. Allen paul.l.allen at boeing.com
Tue Jul 9 13:13:48 CDT 2002


OK, I picked the first error and tracked down where that ioctl is
handled.  There's a big switch statement in drivers/usb/pwc-if.c.
The case for VIDIOCMCAPTURE shows two ways the code can return
EINVAL (invalid argument).  The argument to that ioctl is a struct
video_mmap.  You'll get EINVAL if the "frame" member is out of bounds.
You'll also get EINVAL if the requested format does not match the
current palette and the call to pwc_set_palette() fails.  (I'm 
referring to the RedHat 7.2 sources, so you may see slight 
differences.)

Since all of the ioctl's are failing, I'd start by verifying that
vic is using the same definition of struct video_mmap as the kernel.
After that I'd probably stick a couple kprintf() or Trace()
calls in the driver to figure out where it's going wrong.  A real
kernel hacker would probably have a more elegant debugging technique.
Any kernel hackers out there?

Paul Allen

Don Morton wrote:
> 
> [This was sent to AG-Tech listserv on Saturday, 06 July, with no
>  response, so I decided to subject you all to it again :)  Seriously,
>  I've added just a little more analysis and, I'm sending to the vic folks.
>  I'm including AG-Tech simply because this strikes me as an issue that others
>  will run into, wanting to use webcams in some of the more "basic" AGN
>  interfaces]
> 
> Howdy,
> 
> I'm wondering if anybody has had experience in getting the Logitech
> QuickCam 3000 Pro to work with vic on a Linux machine.  Here's
> what I'm using
> 
> RedHat 7.3 (kernel 2.4.18-3)
> vic 2.8ucl-1.1.3-AG
> 
> I followed some great instructions, available at
> 
>     http://www.isthe.com/chongo/tech/comp/pwc/rh7.3.html
> 
> for setting it all up, culminating in the use of "camstream"
> to test the drivers and camera, and all worked - I'm able
> to capture images from the web cam.
> 
> However, when I try to capture these using vic, the camera and all
> is recognized but, when I try to actually TRANSMIT via the Logitech
> camera, I get a bunch of ioctl errors indicating incorrect parameters
> being used.  Appended to this message is the output of running vic.
> 
> As you can see, vic finds both the Hauppauge and assigns to
> /dev/video0 and the Logitech and assigns to /dev/video1.
> I have no problems transmitting with the Hauppage as device but then,
> I select the Logitech USB cam as my device and then I try
> to transmit - A thumbnail appears in vic, but with no image, then
> I start getting all the ioctl invalid argument errors.  I've played
> with virtually every button on vic, and I've even played around a lot
> with arguments to the pwc module using documentation from
> 
>       http://www.smcc.demon.nl/webcam/install.html#param
> 
> However, it's been mostly trial and error with no real knowledge of
> what I'm doing.  Is anybody familiar with these issues?  It appears to
> me that vic is supplying arguments that either the kernel or, more
> likely, one of the loadable modules (pwc) can't quite deal with????
> 
> I grabbed the sources for vic-2.8ucl-1.1.3 and find that all these
> ioctl() calls are made in vic/video/grabber-video4linux.cpp  :
> 
> kluane:video% grep VIDIOCMCAPTURE *
> grabber-video4linux.cpp:    if (-1 != ioctl(fd_, VIDIOCMCAPTURE, &vid_mmap)) {
> grabber-video4linux.cpp:        if (-1 == ioctl(fd_, VIDIOCMCAPTURE, &gb_even))
> grabber-video4linux.cpp:            perror("ioctl VIDIOCMCAPTURE even");
> grabber-video4linux.cpp:        if (-1 == ioctl(fd_, VIDIOCMCAPTURE, &gb_odd))
> grabber-video4linux.cpp:            perror("ioctl VIDIOCMCAPTURE odd");
> grabber-video4linux.cpp:        if (-1 == ioctl(fd_, VIDIOCMCAPTURE,
> kluane:video% grep VIDIOCSYNC *
> grabber-video4linux.cpp:            if (-1 == ioctl(fd_, VIDIOCSYNC,
> (sync_count%2) ? &one:&zero)) {
> grabber-video4linux.cpp:                perror("ioctl VIDIOCSYNC");
> grabber-video4linux.cpp:        if (-1 == ioctl(fd_, VIDIOCSYNC, (sync_count%2)
> ? &one:&zero))
> grabber-video4linux.cpp:            perror("ioctl VIDIOCSYNC");
> 
> At this point, I don't know what direction to pursue - is the problem in the
> fact that I haven't compiled the right options into my kernel that would
> understand these ioctl() arguments?  Should linux kernel 2.4.18-3 understand
> these calls if I compiled the right modules in (right now I'm using the
> stock RH 7.3 kernel which already has pwc (Philips Web Cam) loadable modules,
> and, again, it all works until I try to use vic.
> 
> Thanks,
> 
> Don
> 
> --
>    Don Morton                   http://MRoCCS.cs.umt.edu/~morton/
>    Department of Computer Science       The University of Montana
>    Missoula, MT 59812 | Voice (406) 243-4975 | Fax (406) 243-5139
> 
> [root at kluane pwc]# vic -t 127 224.2.177.155/55524
> V4l: trying /dev/video0... ok, BT878(Hauppauge (bt878))
> V4l:   color; size: 48x32 => 640x576 (scales)
> V4l:   ports: Television Composite1 S-Video Composite3
> V4l:   depth=16, palette=yuv422P
> V4l:  ==> format { 411 422 cif } size { small large cif } port { Composite1
> Television S-Video Composite3 } type {ntsc auto pal secam}
> V4l: trying /dev/video1... ok, Logitech QuickCam 3000 Pro
> V4l:   color; size: 160x120 => 640x480
> V4l:   ports: Webcam
> V4l:   depth=24, palette=yuv420P
> V4l:  ==> format { 411 422 cif } size { small large cif } port { Webcam } type
> {ntsc auto pal secam}
> V4l: trying /dev/video2... open: No such device
> V4l: trying /dev/video3... open: No such device
> Got grid width 3
> invoke init fonts
> in init_Fonts
> in lnonwindows section
> using colormodel truecolor/24
> Got grid width 3
> enable=
> Did not find monitor list
> Using monitor list {0 0 1024 768 main 0}
> have monitor 'idx=0' '0 0 1024 768 main 0'
> v4l: mmap()'ed buffer size = 0x410000    ### This is where I selected
> Got pict, palette=13                     ### Hauppage capture card as device
> Got pict again, palette=13
> v4l: mmap()'ed buffer size = 0xe1000     ### This is where I selected
> Got pict, palette=15                     ### Logitech QuickCam 3000 Pro as
> device
> ioctl VIDIOCSPICT: Invalid argument
> Got pict again, palette=15
> ioctl VIDIOCMCAPTURE even: Invalid argument
> ioctl VIDIOCMCAPTURE odd: Invalid argument
> ioctl VIDIOCSYNC: Invalid argument
> ioctl VIDIOMCAPTURE: Invalid argument
> ioctl VIDIOCSYNC: Invalid argument
> ioctl VIDIOMCAPTURE: Invalid argument
> ioctl VIDIOCSYNC: Invalid argument
> ioctl VIDIOMCAPTURE: Invalid argument
> ioctl VIDIOCSYNC: Invalid argument
> ioctl VIDIOMCAPTURE: Invalid argument
> ioctl VIDIOCSYNC: Invalid argument
> ioctl VIDIOMCAPTURE: Invalid argument
> ioctl VIDIOCSYNC: Invalid argument
> ioctl VIDIOMCAPTURE: Invalid argument

-- 
Boeing Phantom Works                   \ Paul L. Allen, (425) 865-3297
Math & Computing Technology              \ paul.l.allen at boeing.com
POB 3707 M/S 7L-40, Seattle, WA 98124-2207 \ Prototype Systems Group



More information about the ag-tech mailing list