Hi Timo,
On Friday 21 December 2007 09:42, Timo H wrote:
> I got a Microsoft VX-7000 camera as a gift and tried to get it working. It
> works fine with luvcview, but not with any other v4l2 sw. I even managed
> to change the luvcview-code so that it feeds vloopback and I get it
> working with v4l software (thats ugly but at least makes the camera
> usable to some extent).
Nice trick. I'm pretty sure other users might be interested in this.
Could you please send me the output of lsusb -v (using usbutils 0.72 or
newer) ? Thanks.
> The biggest problem is that the kopete crashes when the uvcvideo module
> is loaded and the camera is plugged. That is really annoying because the
> camera can't be plugged on when booting. Is there anything to do or is
> there some non-standard things in the camera? (That might be possible
> because it is MS after all). I could debug this more if you could give
> some hints what to do next?
The crash is caused by a bug in the v4l1 compat layer. I raised the issue on
the video4linux mailing list.
> I added some debugging code from older threads and here is the dmesg
> output:
>
> [10750.400000] uvcvideo: Found UVC 1.00 device Microsoft� LifeCam
> VX-7000 (045e:0723)
> [10750.400000] uvcvideo: Failed to query (135) UVC control 1 (unit 0) :
> -32 (exp. 26).
This error is pretty normal. Most devices don't implement that function, and
the driver can work around this.
[snip]
> [10758.896000] divide error: 0000 [#10]
> [10758.896000] Modules linked in: uvcvideo usbvideo compat_ioctl32
[snip]
> [10758.896000] CPU: 0
> [10758.896000] EIP: 0060:[<e0d6b204>] Not tainted VLI
> [10758.896000] EFLAGS: 00010256 (2.6.20-16-386 #2)
> [10758.896000] EIP is at get_v4l_control+0xa4/0xf0 [v4l1_compat]
[snip]
Here's the offending v4l1 compat code (drivers/media/video/v4l1_compat.c).
static int
get_v4l_control(struct inode *inode,
struct file *file,
int cid,
v4l2_kioctl drv)
{
struct v4l2_queryctrl qctrl2;
struct v4l2_control ctrl2;
int err;
qctrl2.id = cid;
err = drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2);
if (err < 0)
dprintk("VIDIOC_QUERYCTRL: %d\n",err);
if (err == 0 &&
!(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED))
{
ctrl2.id = qctrl2.id;
err = drv(inode, file, VIDIOC_G_CTRL, &ctrl2);
if (err < 0) {
dprintk("VIDIOC_G_CTRL: %d\n",err);
return 0;
}
return ((ctrl2.value - qctrl2.minimum) * 65535
+ (qctrl2.maximum - qctrl2.minimum) / 2)
/ (qctrl2.maximum - qctrl2.minimum);
}
return 0;
}
When qctrl2.maximum equals qctrl2.minimum the code will divide by zero and
crash.
Best regards,
Laurent Pinchart
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel