Hi,

On Friday 21 December 2007, Plooij wrote:
> I have some news on this issue: after an update from Ubuntu last Wednesday,
> both cameras work fine simultaneously. They even continue to work fine
> after rebooting, so the problem seems to be solved permanently (there's
> nothing worse than problems that occur only sometimes). The Ubuntu update
> contained an updated kernel.
>
> Sorry, I forgot rule nr. 1 in bug reporting: use the latest version of the
> program. I downloaded a recent version of your driver from SVN. Should I
> use that one instead of the one from Ubuntu that seems to work now?

Given that the Ubuntu package will probably follow the driver's development, I 
would at least try the SVN version to discover bugs before it's too late :-)

> After the update, I still can't set the frame rate parameter. I've added my
> code below (irrelevant code is replaced by text between [] brackets). This
> is the output of the code section:
>
> Parameter getting not supported.
> Parameter setting not supported.

See comment below.

> Do you think it is possible to make a driver that skips frames in case of
> insufficient bandwidth, instead of giving corrupted frames to applications?

For YUV video streams that would be possible, as images have a fixed size. For 
MJPEG video streams there is no way to detect packet loss.

> void CGrabber_Implementation::init_device()
> {
>       struct v4l2_capability cap;
>       struct v4l2_cropcap cropcap;
>       struct v4l2_crop crop;
>       struct v4l2_streamparm streamparm;
>       struct v4l2_format fmt;
>       unsigned int min;
>
>       [Capability checks]
>
>       [Cropping settings]
>
>       //Parameters
>       CLEAR(streamparm);

Set streamparm.type to V4L2_BUF_TYPE_VIDEO_CAPTURE. That should solve your 
problem.

>       if (-1 == xioctl (fd, VIDIOC_G_PARM, &streamparm))
>       {
>               switch (errno)
>               {
>               case EINVAL:
>                       printf("Parameter getting not supported.\n");
>                       break;
>               default:
>                       errno_exit ("VIDIOC_G_PARM");
>                       break;
>               }
>       }
>
>       streamparm.parm.capture.timeperframe.numerator   = 1;
>       streamparm.parm.capture.timeperframe.denominator = 15;
>
>       if (-1 == xioctl (fd, VIDIOC_S_PARM, &streamparm))
>       {
>               switch (errno)
>               {
>               case EINVAL:
>                       printf("Parameter setting not supported.\n");
>                       break;
>               default:
>                       errno_exit ("VIDIOC_S_PARM");
>                       break;
>               }
>       }
>
>       //Format
>       CLEAR (fmt);
>
>       fmt.type                = V4L2_BUF_TYPE_VIDEO_CAPTURE;
>       fmt.fmt.pix.width       = 640;
>       fmt.fmt.pix.height      = 480;
>       fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
>       fmt.fmt.pix.field       = V4L2_FIELD_NONE;
>
>       if (-1 == xioctl (fd, VIDIOC_S_FMT, &fmt))
>               errno_exit ("VIDIOC_S_FMT");
>
>       [Format checks]
>
>       [More initialization]
>
>       [Camera control settings]
> }

Best regards,

Laurent Pinchart
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to