From: "Michał Pecio" <michal.pecio@gmail.com>
To: linux-media@vger.kernel.org
Subject: uvcvideo bogus SuperSpeed bandwidth calculations
Date: Sat, 30 Dec 2023 23:48:23 +0100 [thread overview]
Message-ID: <20231230234823.238115f4@foxbook> (raw)
Hi,
I encountered two problems getting one no-name SuperSpeed UVC camera to
work with Linux 6.6.8 (some earlier kernels were similar or worse).
1. The required bandwidth (as reported by "Device requested %u B/frame
bandwidth" with trace=0x400) appears to equal wMaxPacketSize*burst*mult
of the fastest altsetting, sometimes the second fastest one, regardless
of selected video mode. (And my xHCI refuses to enable the fastest alt
for supposed lack of bandwidth, so the camera is unusable).
This is nonsense, and I suspect a bug either in uvcvideo or in camera
firmware. Any thoughts or hints what to look at?
2. I tried to work around this by enabling the banwdidth fixup quirk,
but the quirk has never been updated to work with USB3.x. Code below
needs to have USB_SPEED_SUPER (and others?) added to it.
bandwidth = frame->wWidth * frame->wHeight / 8 * format->bpp;
bandwidth *= 10000000 / interval + 1;
bandwidth /= 1000;
if (stream->dev->udev->speed == USB_SPEED_HIGH)
bandwidth /= 8;
After fixing and enabling the quirk, my camera works. Although with
trace=0xffff I'm still getting regular messages about dropped frames,
not sure if this is normal? Observed framerate is close to nominal.
Regards,
Michal
reply other threads:[~2023-12-30 22:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231230234823.238115f4@foxbook \
--to=michal.pecio@gmail.com \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox