Hi,

On Monday 05 April 2010 18:41:21 loody wrote:
> >> Dear all:
> >> I try to fix the uvc driver on my mips platform.
> >> But I got the messages as I append at the end of letter, the messages
> >> are triggered by capture.c the sample c code at the official website.
> >> I have some questions:
> >> 1. why the uvc resend the urb in uvc_video_complete?
> > 
> > Because the USB core doesn't resubmit URBs automatically. If the driver
> > didn't do it there, it would only receive a few URBs (currently
> > hardcoded to 5 in the driver) and then stop.
> 
> I find the place where you mention and it seems we use a recursive
> method to send urbs in UVC, right?

It's not recursive. The uvc_video_complete function is called in response to a 
USB controller interrupt. It will resubmit the URB, and then return without 
waiting for the URB to be completed. The function will then be called again 
when the next URB completes.

> >> 2. from the log, it seems uvc keep catching when the VIDIOC_STREAMON
> >> passed from v4l2 to uvc.
> > 
> > I'm not sure to get what you mean.
> > 
> >> 3. if the answer of 1 is yes; what will uvc does when he get
> >> VIDIOC_QBUF and VIDIOC_DQBUF ?
> >>     ( in my opinion, uvc should starting catpureing when he receives
> >> VIDIOC_QBUF and stop when the buffer is full. Then it pass the buffer
> >> above when he got VIDIOC_DQBUF. But from the log below, it start
> >> captureing when he got VIDIOC_STREAMON. Am i right?)
> > 
> > THe driver instructs the device to start sending data when it receives
> > VIDIOC_STREAMON. If there's no buffer queued the data will just be
> > discarded.
> > 
> >> 4. if my assumption above is correct, uvc start capture at
> >> VIDIOC_DQBUF and stop when buffer full. it should stop capture when
> >> frame complete in the log appears.
> > 
> > It could, but just discarding the data is enough.
> > 
> >> VIDIOC_STREAMON
> >> uvcvideo: Failed to resubmit video URB (-38).
> >> uvcvideo: Failed to resubmit video URB (-38).
> > 
> > -38 is -ENOSYS, and that error is returned by very few USB host
> > controller drivers. Which controller are you using on your platform ?
> > Chances are you might need to fix it.
> 
> EHCI controller and I am wondering whether the error comes from my slowly
> cpu. My cpu is running at 400Mhz

Now that's weird. The ENOSYS error isn't documented in the USB error codes, 
and I can't find any reference to it in the EHCI driver. Are you using some 
sort of exotic platform, with a vendor-specific kernel ?

> >> uvcvideo: Frame complete (overflow).
> >> uvcvideo: Dropping payload (out of sync).
> >> uvcvideo: Dropping payload (out of sync).
> >> uvcvideo: Dropping payload (out of sync).
> >> uvcvideo: Dropping payload (out of sync).
> >> uvcvideo: Dropping payload (out of sync).
> 
> BTW, if I look at the correct place in the driver, why uvc doesn't
> support r/w io and userptr?

Because nobody bothered to implement that :-)

read/write support is slow, and I'm not sure it will be implemented. I got a 
patch for userptr support, I need to clean and submit it.

-- 
Regards,

Laurent Pinchart
_______________________________________________
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to