On Sat, 14 Dec 2024 16:47:12 +0100,
Stefan Hagen <[email protected]> wrote:
>
> Kirill A. Korinsky wrote (2024-12-14 12:39 CET):
> > Here a blind shot. Future debug requires uvideo_debug = 2 which very noise.
>
> Cool, thank you! Unfortunately it doesn't change much.
>
> Below is a dmesg with uvideo_debug = 2 while I was running:
>
> Once:
> $ video -f /dev/video0
>
> And then twice:
> $ ffplay -f v4l2 -input_format mjpeg -i /dev/video0
>
> The first time it showed a window with was mostly grey, with some light
> green resemblance of the actual image.
>
> The second time, it only showed grey.
>
> No change in error messages.
>
> dmesg (12MB): https://ptrace.org/dmesg_uvideo_debug2.txt
>
Thanks for dmesg with detailed output. I see a lot of empty frames from the
camera, and that it may produce some of them after EOF.
I had notices that we have a bit larger limit of packets 40 instead of 32 in
Linux. [1] Here I wonder can it overload the cam?
Anyway, here a trivial diff which synchronizes it with Linux.
Index: sys/dev/usb/uvideo.h
===================================================================
RCS file: /home/cvs/src/sys/dev/usb/uvideo.h,v
diff -u -p -r1.60 uvideo.h
--- sys/dev/usb/uvideo.h 8 Dec 2019 13:21:21 -0000 1.60
+++ sys/dev/usb/uvideo.h 15 Dec 2024 01:11:38 -0000
@@ -416,7 +416,7 @@ struct uvideo_format_desc {
} u;
} __packed;
-#define UVIDEO_NFRAMES_MAX 40
+#define UVIDEO_NFRAMES_MAX 32
struct uvideo_isoc_xfer {
struct uvideo_softc *sc;
struct usbd_xfer *xfer;
Footnotes:
[1]
https://github.com/torvalds/linux/blob/v6.12/drivers/media/usb/uvc/uvcvideo.h#L50-L53b
--
wbr, Kirill