Hi Laurent, During enumeration the device is sending the proper dwMaxpayloadTransferSize to the host. In the host side also, it is refelecting. But when we start streaming, the host application is doing SET_CUR call of PROBE which is sending "0" to the device and device is sending back the same value to host. In case of ISOC also this value is being reset to "0" where as ISOC consider dwMaxFrameSize which it got from the host application and sending the same to the device. Due to this, ISOC doesn't fail.
This is what happens, Please explain is there anything I am missing. When we start the streaming on the host side this uvc_v4l2_try_format gets called under VIDIOC_S_FMT cmd. Here variable "probe" is being memset and assigned a few values. This "probe" is value is sent to the device with "SET_CUR" request. Device is copying these variable and the followed by GET_CUR request is getting back the same value of "SET_CUR". Because of this, dwMaxPayloadSize is being reset to "0". If it is a device side bug means, the SET_CUR value should not be copied inside the device thats what you are telling. But in case of ISOC alos I do copy and send back the same value during the call of GET_CUR. Please explain where am I missing. static int uvc_v4l2_try_format(struct uvc_streaming *stream, struct v4l2_format *fmt, struct uvc_streaming_control *probe, struct uvc_format **uvc_format, struct uvc_frame **uvc_frame) { . . /* Set the format index, frame index and frame interval. */ * memset(probe, 0, sizeof *probe); probe->bmHint = 1; /* dwFrameInterval */ probe->bFormatIndex = format->index; probe->bFrameIndex = frame->bFrameIndex; probe->dwFrameInterval = uvc_try_frame_interval(frame, interval);* /* Some webcams stall the probe control set request when the * dwMaxVideoFrameSize field is set to zero. The UVC specification * clearly states that the field is read-only from the host, so this * is a webcam bug. Set dwMaxVideoFrameSize to the value reported by * the webcam to work around the problem. * * The workaround could probably be enabled for all webcams, so the * quirk can be removed if needed. It's currently useful to detect * webcam bugs and fix them before they hit the market (providing * developers test their webcams with the Linux driver as well as with * the Windows driver). */ *if (stream->dev->quirks & UVC_QUIRK_PROBE_EXTRAFIELDS) probe->dwMaxVideoFrameSize = stream->ctrl.dwMaxVideoFrameSize; * * /* Probe the device. */ ret = uvc_probe_video(stream, probe); if (ret < 0) goto done;* fmt->fmt.pix.width = frame->wWidth; fmt->fmt.pix.height = frame->wHeight; fmt->fmt.pix.field = V4L2_FIELD_NONE; fmt->fmt.pix.bytesperline = format->bpp * frame->wWidth / 8; fmt->fmt.pix.sizeimage = probe->dwMaxVideoFrameSize; fmt->fmt.pix.colorspace = format->colorspace; fmt->fmt.pix.priv = 0; if (uvc_format != NULL) *uvc_format = format; if (uvc_frame != NULL) *uvc_frame = frame; } Regards, Ramesh. On Tue, Dec 1, 2009 at 6:30 PM, Laurent Pinchart < laurent.pinch...@ideasonboard.com> wrote: > Hi, > > On Wednesday 25 November 2009 13:49:30 Ramesh Rajagopal wrote: > > > > I got little luck with UVC bulk transfer after changing the uvcvideo > > driver. Now I am getting some frames on the host side. > > > > In the UVC driver, the > > dwMaxPayloadSize(stream->ctrl.dwMaxpayloadTransferSize) of streaming > > control variable is being assigned during the enumeration stage. > > When we start the luvcview on the host side, this variable is being > changed > > to "0". This is happening in the call of uvc_v4l2_do_ioctl() with > > VIDIOC_S_FMT as a "cmd" variable. > > > > The function uvc_v4l2_try_format function is copying values of > > "bFrameIndex", "formatIndex" and "dwMaxFrameVideoSize" . But it does > > re-initialize the dwMaxpayloadTransferSize to "0". > > This one causes problem in the uvc_init_video_bulk() which takes > > dwMaxpayloadSize for calculating number of URB packets which is becoming > > "0" because of the above re-initialization. > > > > When I applied the attached patch, I could get some frames on my host > side. > > Without this patch, it was failing on uvc_init_video_bulk() function. > > > > I am not well familiar with UVC video driver. I don't know whether this > is > > the correct way of fixing this problem. I may need some help on this > issue. > > Please find the attachment. Please let me know, how can I proceed from > > here. > > The dwMaxPayloadTransferSize field should be filled by the device when > queried > for the current video streaming probe or commit parameters. If the device > returns 0, that's a device bug. In that case you should fix the device to > return the correct value. > > -- > Regards, > > Laurent Pinchart >
_______________________________________________ Linux-uvc-devel mailing list Linux-uvc-devel@lists.berlios.de https://lists.berlios.de/mailman/listinfo/linux-uvc-devel