<[email protected]>
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
>
> On Tuesday 15 September 2009 10:01:03 Bo Liu wrote:
>> Hi=2C
>>
>> I found a problem when using my webcam. First=2C it's ok=2C but after I =
unplug
>> it. Systerm call poll() will not return.
>>
>> I looked at the src code=2C and found that uvc_queue_poll() always retur=
n 0=2C
>> it didn't know the webcam have unpluged at that time.
>>
>> And I saw in funtion uvc_video_complete()=2C if urb->status is
>> -ESHUTDOWN=2Cuvc_queue_cancel(queue=2C urb->status =3D=3D -ESHUTDOWN)=3B=
will be
>> called.
>
> That's right=2C and then uvc_queue_poll() should return POLLERR=2C making=
poll()
> return.
>
>> But=2C if just when in uvc_video_complete()> usb_submit_urb() =2C the we=
bcam is
>> unpluged=2C the usb_submit_urb() will failed=2C but just with a printk. =
Won't
>> call uvc_queue_cancel(). So=2C uvc_queue_poll() will always return 0. An=
d=2C I
>> add uvc_queue_cancel() after usb_submit_urb() failed=2Cerverything is ok=
.
>>
>> Is this a bug ?
>
> This is weird. The uvcvideo driver submits several URBs=2C so even if the=
device
> is disconnected during the completion handler=2C the next URBs should get=
a -
> ESHUTDOWN status (at least with EHCI USB controllers).
>
> Are you using the latest driver ? What status do you get when the complet=
ion
> handler is called for the next URB after usb_submit_urb() returns -ESHUTD=
OWN ?
> What USB controller are you using ?
=20
The driver version is about last month.
The status sometimes is -ESHUTDOWN then uvc_queue_poll() can return POLLERR=
.
But most of the time urb->status is 0 and I got several "Failed to resubmit=
=20
video URB (-19)" error.
So I must add uvc_queue_cancel() to make poll() alwasy can return.
> 716 if ((ret =3D usb_submit_urb(urb=2CGFP_ATOMIC)) < 0) {
> //added
> uvc_queue_cancel()
> 717 uvc_printk(KERN_ERR=2C "Failed to resubmit video URB (%d).\n"
> 718 ret)=3B
> 719 }
usb controller is intel's ECHI.
>
>> Funtions uvc_video_complete():
>>
>> 716 if ((ret =3D usb_submit_urb(urb=2C GFP_ATOMIC)) < 0) {
>> 717 uvc_printk(KERN_ERR=2C "Failed to resubmit video URB (%d).\n"=2C
>> 718 ret)=3B
>> 719 }
>
> --
> Regards=2C
>
> Laurent Pinchart =0A=
_________________________________________________________________=0A=
Drag n=92 drop=97Get easy photo sharing with Windows Live=99 Photos.
=0A=
http://www.microsoft.com/windows/windowslive/products/photos.aspx=
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel