Hi Simone,

On Tuesday 03 February 2009, Simone Freddio wrote:
> Hi Jan, hi Laurent...
>
>     i have the same problem with different webcam... i think to have
> found the problem, Laurent tell me if i am wrong, i'll go to explain:
>
>     The problem is in the bandwidth, the uvcdriver ALWAYS ask to usb
> layer a dw_MaxPayloadTransferSize that is fetched only when the device
> is opening;
>
>     In my case is always set to 3072 (3x1024). I have tried changing
> uvc_video.c in a very dirty manner (excuse me Laurent)

Don't worry :-)

> in this way: 
>
>     In function 'uvc_set_video_ctrl' where there is:
>      put_unaligned_le32(ctrl->dwMaxVideoFrameSize, &data[18]);
>      put_unaligned_le32(ctrl->dwMaxPayloadTransferSize, &data[22]);
>
>     i have commented out the second line and changed it in:
>     put_unaligned_le32(1024, &data[22]);
>
>     In this way i have always force uvc driver to ask for a payload size
> of 1024.

According to the UVC 1.1 specification, the dwMaxPayloadTransferSize is set by 
the device and read only from the host. The value set by the host shouldn't 
matter.

>     After recompiling, reinstalling, unload e load the module, i can get
> two webcam working fine and simultaneously.
>
>     Now i didn't have a big experience and i can't change source myself
> in the right way... but i think that my observation can be usefull.

It is, thanks.

>     I think that the best way to re-negotiate the bandwidth is to set
> video streaming parameters (framesize and frameinterval) and after ask
> the device wich bandwidth it requests.

That's exactly what the driver does. In uvc_probe_video, each SET_CUR request 
is followed by a GET_CUR to retrieve the bandwidth requested by the camera.

>     In a short way, at the end of uvc_set_video_ctrl function a call to
> uvc_get_video_ctrl will solve the problem... what do you think Laurent?)

This is already handled by uvc_probe_video. From your report it seems that the 
device doesn't touch the dwMaxPayloadTransferSize at all and just returns the 
value sets by the host.

Could you (or Jan) try to set dwMaxPayloadTransferSize to a weird value (let's 
say 42) and see what the device returns in the next GET_CUR call ?

Best 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