Re: [PATCH] media: uvcvideo: Handle payloads starting in the middle of a bulk URB
From: Muhammad Waleed Badar
Date: Sun Oct 25 2026 - 13:09:32 EST
(Resending as plain text, the previous copy was rejected by the lists.)
Hi Ricardo, Hans,
On 12-Oct-26 15:04, Hans de Goede wrote:
> If I understand things correctly from the email thread + previous patch
> there is only 1 USB vid:pid combo which needs this.
>
> So although I'm normally in favor of heuristics over per device quirks
> I think in this case a device-quirk might make more sense ?
Thank you both for the review. Ricardo, you're right that v1 would
decode trailer data as a payload header and break those cameras.
In v2 I combined both suggestions:
- The URB is only split for devices with a new
UVC_QUIRK_BULK_UNALIGNED_PAYLOAD quirk, set for 0bda:579f only.
Everything else goes through the existing path unchanged.
- Even with the quirk, the remainder is only decoded as a new payload
if it looks like a UVC header (EOH set, bHeaderLength fits the data
and covers the PTS/SCR fields it announces). Otherwise the URB is
handled as before.
- A one-time "UVC non compliance" message is printed when the
workaround is used.
v2 is here, with test results on the affected camera:
https://lore.kernel.org/linux-media/20261025170220.42789-1-walid.badar@xxxxxxxxx/
Ricardo, Mauro: sorry, I left you off the v2 Cc by mistake.
Thanks,
Waleed