media: uvcvideo: Implement dual stream quirk to fix loss of usb packets
authorIsaac Scott <isaac.scott@ideasonboard.com>
Thu, 28 Nov 2024 14:51:43 +0000 (14:51 +0000)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 2 Jan 2025 08:58:30 +0000 (09:58 +0100)
commitc2eda35e675b6ea4a0a21a4b1167b121571a9036
tree5e908d99e46234511436a1633de826153df68e25
parent40ed9e9b2808beeb835bd0ed971fb364c285d39c
media: uvcvideo: Implement dual stream quirk to fix loss of usb packets

Some cameras, such as the Sonix Technology Co. 292A, exhibit issues when
running two parallel streams, causing USB packets to be dropped when an
H.264 stream posts a keyframe while an MJPEG stream is running
simultaneously. This occasionally causes the driver to erroneously
output two consecutive JPEG images as a single frame.

To fix this, we inspect the buffer, and trigger a new frame when we
find an SOI.

Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
Link: https://lore.kernel.org/r/20241128145144.61475-2-isaac.scott@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/usb/uvc/uvc_video.c
drivers/media/usb/uvc/uvcvideo.h