summaryrefslogtreecommitdiff
path: root/drivers/media/usb/uvc/uvc_driver.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2023-10-20 01:02:46 +0300
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-12-09 09:36:47 +0300
commit323666d1b32315930f6f14175fc59f0853647881 (patch)
tree32c62fa5be5ac48fbd75c22e44c1229bfee621f5 /drivers/media/usb/uvc/uvc_driver.c
parentdba3e701917a4cce92920f8ccb9fa4d4ee5ac07e (diff)
downloadlinux-323666d1b32315930f6f14175fc59f0853647881.tar.xz
media: uvcvideo: Pick first best alternate setting insteed of last
When selecting an alternate setting, the driver loops over all available alternate settings to find the one with the lowest bandwidth high enough for the selected format and resolution. While all alternate settings should have different packet sizes, some buggy devices report multiple alternate settings with the same size. The driver happens to pick the last one in this case. In theory this should work fine, but in real life we have device bugs. The Ali Corp. Newmine Camera (0402:8841) exposes four alternate settings with the same packet size. The first three seem to work fine, while selecting the last one results in lots of transmission errors. Switch to using the first best alternate setting when multiple are present. This should be safe (last famous words), as sniffing USB traffic with the faulty device shows that Windows 10 picks the first alternate setting, and devices are typically tested on Windows. Closes: https://lore.kernel.org/linux-media/Nh6D0WI--3-9@tutanota.com/ Reported-by: Karel Janda <karel1@tutanota.com> Suggested-by: Karel Janda <karel1@tutanota.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/usb/uvc/uvc_driver.c')
0 files changed, 0 insertions, 0 deletions