Hi Laurent, 

On Wednesday 27 May 2009 17:11:03 Laurent Pinchart wrote:
[...]
> On Tuesday 26 May 2009 17:49:14 Jérôme Pouiller wrote:
[...]
> > 2. It looks like a hardware bug, but how to prove it?
>
> The camera stalls a GET_DEF request  on the hue control. First of all,
> does the problem occur every time  the hue control is queried, or only
> from times to times ?
100% reproducible.

> If the problem is 100% reproducible, I'd like to try other requests to
> see if the camera stalls GET_DEF(hue)  only or all GET requests on the
> hue control.
Only happens with HUE (see test-BisonCam.c and test-output).

> Could you try to read the value (VIDIOC_G_CTRL) of the hue control ?
It   return  EIO   and   uvcvideo  driver   print   same  message   (see
test-BisonCam.c and test-output).

> If  it doesn't  work, could  you  modify the  PU_HUE_CONTROL entry  in
> uvc_ctrls (uvc_ctrl.c) and retest VIDIOC_QUERYCTRL ?
>
> Set the flags field to
>
> UVC_CONTROL_GET_DEF |
> UVC_CONTROL_GET_MIN |
> UVC_CONTROL_GET_MAX |
> UVC_CONTROL_GET_RES |
> UVC_CONTROL_GET_CUR | 
> UVC_CONTROL_SET_CUR |
> UVC_CONTROL_RESTORE |
> UVC_CONTROL_AUTO_UPDATE
>
> at first  and remove the  GET_DEF, GET_MIN, GET_MAX and  GET_RES flags
> one by one, trying VIDIOC_QUERYCTRL at each step. The driver will only
> perform the listed requests in  the GET_DEF, GET_MIN, GET_MAX, GET_RES
> order. I'd like to know which of those work or fail.
VIDIOC_QUERYCTRL  success only  if  I remove  GET_DEF, GET_MIN,  GET_MAX
and  GET_RES flags.  In  all  other cases,  my  test  program give  same
output as  in test-output. (Except:  if I remove UVC_CONTROL_GET* flags,
VIDIOC_G_CTRL return EINVAL).


Best regards,

-- 
Jérôme Pouiller (jezz AT sysmic DOT org)
// Small debug program for BisonCam, NB Pro (5986:0241)
// Author: Jérôme Pouiller (jezz AT sysmic DOT org)

#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>

#include <linux/ioctl.h>
#include <linux/videodev2.h>

#include <errno.h>
#include <string.h>

int main(int argc, char **argv) {
  int fd;
  int ret;

  fd = open("/dev/video0", O_RDONLY);

  struct v4l2_queryctrl queryctrl;
  printf("Enumerate all controls:\n");
  for (int i = V4L2_CID_BASE; i < V4L2_CID_LASTP1 ; i++) {
    queryctrl.id = i;
    ret = ioctl(fd, VIDIOC_QUERYCTRL, &queryctrl);

    if (ret) {
      printf("  id:0x%X, ret:%d, flags:0x%X, err:%d (%s)\n", queryctrl.id, ret, queryctrl.flags, errno, strerror(errno));
    } else {
      printf("  id:0x%X, ret:%d, flags:0x%X, name:%s\n", queryctrl.id, ret, queryctrl.flags, queryctrl.name);
    }
  }

  struct v4l2_control ctrl;
  printf("Try to control Hue:\n");
  ctrl.id = V4L2_CID_HUE;
  ret = ioctl(fd, VIDIOC_G_CTRL, &ctrl);
  printf("  id:0x%X, ret:%d, value:%d, err:%d (%s)\n", ctrl.id, ret, ctrl.value, errno, strerror(errno));
  close(fd);
  return 0;
}

Enumerate all controls:
  id:0x980900, ret:0, flags:0x0, name:Brightness
  id:0x980901, ret:0, flags:0x0, name:Contrast
  id:0x980902, ret:0, flags:0x0, name:Saturation
  id:0x980903, ret:-1, flags:0x0, err:5 (Input/output error)
  id:0x980904, ret:-1, flags:0x0, err:22 (Invalid argument)
  id:0x980905, ret:-1, flags:0x0, err:22 (Invalid argument)
  id:0x980906, ret:-1, flags:0x0, err:22 (Invalid argument)
  id:0x980907, ret:-1, flags:0x0, err:22 (Invalid argument)
  id:0x980908, ret:-1, flags:0x0, err:22 (Invalid argument)
  id:0x980909, ret:-1, flags:0x0, err:22 (Invalid argument)
  id:0x98090A, ret:-1, flags:0x0, err:22 (Invalid argument)
  id:0x98090B, ret:-1, flags:0x0, err:22 (Invalid argument)
  id:0x98090C, ret:-1, flags:0x0, err:22 (Invalid argument)
  id:0x98090D, ret:-1, flags:0x0, err:22 (Invalid argument)
  id:0x98090E, ret:-1, flags:0x0, err:22 (Invalid argument)
  id:0x98090F, ret:-1, flags:0x0, err:22 (Invalid argument)
  id:0x980910, ret:0, flags:0x0, name:Gamma
  id:0x980911, ret:-1, flags:0x0, err:22 (Invalid argument)
  id:0x980912, ret:-1, flags:0x0, err:22 (Invalid argument)
  id:0x980913, ret:-1, flags:0x0, err:22 (Invalid argument)
  id:0x980914, ret:-1, flags:0x0, err:22 (Invalid argument)
  id:0x980915, ret:-1, flags:0x0, err:22 (Invalid argument)
  id:0x980916, ret:-1, flags:0x0, err:22 (Invalid argument)
  id:0x980917, ret:-1, flags:0x0, err:22 (Invalid argument)
Try to control Hue:
  id:0x980903, ret:-1, value:-1208459276, err:5 (Input/output error)

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

Reply via email to