Re: [PATCH v2] uvc: gadget: uvc: Defer uvcg_complete_buffer() until .complete()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Greg

On 09/11/2022 10:46, Greg KH wrote:
On Wed, Oct 19, 2022 at 01:45:35PM +0100, Daniel Scally wrote:
Calling uvcg_complete_buffer() from uvc_video_encode_isoc() sometimes
causes the final isoc packet for a video frame to be delayed long
enough to cause the USB controller to drop it. The first isoc packet
of the next video frame is then received by the host, which interprets
the toggled FID bit correctly such that the stream continues without
interruption, but the first frame will be missing the last isoc
packet's worth of bytes.

To fix the issue delay the call to uvcg_complete_buffer() until the
usb_request's .complete() callback, as already happens when the data
is encoded via uvc_video_encode_isoc_sg(). For consistency's sake the
same change is applied to uvc_video_encode_bulk().

Signed-off-by: Daniel Scally <dan.scally@xxxxxxxxxxxxxxxx>
---

Changes in v2:

	- Applied the same change to uvc_video_encode_bulk() for consistency

@Dan - In the end I thought this is probably worth separating from your "usb:
gadget: uvc: fix sg handling in error case" patch, since it fixes a separate
issue by itself. I _think_ they're separable but I wasn't experiencing the
problem you were so I can't test that - let me know if I'm wrong.

@Michael - I dropped your R-b since I made the change to uvc_video_encode_bulk()
too, didn't want to jump the gun :)

Does not apply to my tree anymore :(

Can you rebase against the usb-linus branch of usb.git and resend?


Sure thing


thanks,

greg k-h



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux