Kirill A. Korinsky wrote (2024-12-15 02:29 CET): > On Sat, 14 Dec 2024 16:47:12 +0100, > Stefan Hagen <sh+openbsd-m...@codevoid.de> 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.
The observable behavior didn't change. This is what I "see". Sometimes ffplay is able to construct a still image like this. Other times, I only see grey. https://ptrace.org/2024-12-16_07-03-19-sshot.png This is dmesg with both patches applied: https://ptrace.org/dmesg_uvideo_debug2_patch1+2.txt This one has the second patch applied and the first one reverted: https://ptrace.org/dmesg_uvideo_debug2_patch2.txt Not sure if helpful, but this command: $ video -f /dev/video0 video: ioctl VIDIOC_DQBUF: Invalid argument produces this log: Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_open: sc=0xffff800000798000 Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_find_ctrl: control not supported by device! Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_s_fmt: requested width=640, height=480 Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_find_res: frame index 0: width=640, height=480 Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_find_res: frame index 1: width=640, height=360 Dec 16 07:22:28 t14 /bsd: uvideo0: SET probe request successfully Dec 16 07:22:28 t14 /bsd: bmHint=0x01 Dec 16 07:22:28 t14 /bsd: bFormatIndex=0x02 Dec 16 07:22:28 t14 /bsd: bFrameIndex=0x01 Dec 16 07:22:28 t14 /bsd: dwFrameInterval=333333 (100ns units) Dec 16 07:22:28 t14 /bsd: wKeyFrameRate=0 Dec 16 07:22:28 t14 /bsd: wPFrameRate=0 Dec 16 07:22:28 t14 /bsd: wCompQuality=0 Dec 16 07:22:28 t14 /bsd: wCompWindowSize=0 Dec 16 07:22:28 t14 /bsd: wDelay=0 (ms) Dec 16 07:22:28 t14 /bsd: dwMaxVideoFrameSize=0 (bytes) Dec 16 07:22:28 t14 /bsd: dwMaxPayloadTransferSize=0 (bytes) Dec 16 07:22:28 t14 /bsd: uvideo0: GET probe request successfully Dec 16 07:22:28 t14 /bsd: bmHint=0x01 Dec 16 07:22:28 t14 /bsd: bFormatIndex=0x02 Dec 16 07:22:28 t14 /bsd: bFrameIndex=0x01 Dec 16 07:22:28 t14 /bsd: dwFrameInterval=333333 (100ns units) Dec 16 07:22:28 t14 /bsd: wKeyFrameRate=0 Dec 16 07:22:28 t14 /bsd: wPFrameRate=0 Dec 16 07:22:28 t14 /bsd: wCompQuality=0 Dec 16 07:22:28 t14 /bsd: wCompWindowSize=0 Dec 16 07:22:28 t14 /bsd: wDelay=1 (ms) Dec 16 07:22:28 t14 /bsd: dwMaxVideoFrameSize=614400 (bytes) Dec 16 07:22:28 t14 /bsd: dwMaxPayloadTransferSize=2940 (bytes) Dec 16 07:22:28 t14 /bsd: fixed dwMaxVideoFrameSize=614400, width=640 height=480 bpp=16 Dec 16 07:22:28 t14 /bsd: uvideo0: SET commit request successfully Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_s_fmt: offered width=640, height=480 Dec 16 07:22:28 t14 /bsd: uvideo0: SET probe request successfully Dec 16 07:22:28 t14 /bsd: bmHint=0x01 Dec 16 07:22:28 t14 /bsd: bFormatIndex=0x02 Dec 16 07:22:28 t14 /bsd: bFrameIndex=0x01 Dec 16 07:22:28 t14 /bsd: dwFrameInterval=333333 (100ns units) Dec 16 07:22:28 t14 /bsd: wKeyFrameRate=0 Dec 16 07:22:28 t14 /bsd: wPFrameRate=0 Dec 16 07:22:28 t14 /bsd: wCompQuality=0 Dec 16 07:22:28 t14 /bsd: wCompWindowSize=0 Dec 16 07:22:28 t14 /bsd: wDelay=0 (ms) Dec 16 07:22:28 t14 /bsd: dwMaxVideoFrameSize=0 (bytes) Dec 16 07:22:28 t14 /bsd: dwMaxPayloadTransferSize=0 (bytes) Dec 16 07:22:28 t14 /bsd: uvideo0: GET probe request successfully Dec 16 07:22:28 t14 /bsd: bmHint=0x01 Dec 16 07:22:28 t14 /bsd: bFormatIndex=0x02 Dec 16 07:22:28 t14 /bsd: bFrameIndex=0x01 Dec 16 07:22:28 t14 /bsd: dwFrameInterval=333333 (100ns units) Dec 16 07:22:28 t14 /bsd: wKeyFrameRate=0 Dec 16 07:22:28 t14 /bsd: wPFrameRate=0 Dec 16 07:22:28 t14 /bsd: wCompQuality=0 Dec 16 07:22:28 t14 /bsd: wCompWindowSize=0 Dec 16 07:22:28 t14 /bsd: wDelay=1 (ms) Dec 16 07:22:28 t14 /bsd: dwMaxVideoFrameSize=614400 (bytes) Dec 16 07:22:28 t14 /bsd: dwMaxPayloadTransferSize=2940 (bytes) Dec 16 07:22:28 t14 /bsd: fixed dwMaxVideoFrameSize=614400, width=640 height=480 bpp=16 Dec 16 07:22:28 t14 /bsd: uvideo0: SET commit request successfully Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_reqbufs: count=4 Dec 16 07:22:28 t14 /bsd: uvideo0: allocated 2457600 bytes mmap buffer Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_reqbufs: index=0, offset=0, length=614400 Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_reqbufs: index=1, offset=614400, length=614400 Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_reqbufs: index=2, offset=1228800, length=614400 Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_reqbufs: index=3, offset=1843200, length=614400 Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_querybuf: index=0, offset=0, length=614400 Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_querybuf: index=1, offset=614400, length=614400 Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_querybuf: index=2, offset=1228800, length=614400 Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_querybuf: index=3, offset=1843200, length=614400 Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_vs_open Dec 16 07:22:28 t14 /bsd: uvideo0: set alternate iface to bAlternateSetting=0x07 psize=2940 max_packet_size=2940 Dec 16 07:22:28 t14 /bsd: uvideo0: open pipe for bEndpointAddress=0x81 Dec 16 07:22:28 t14 /bsd: uvideo0: nframes=32 Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_vs_alloc_isoc Dec 16 07:22:28 t14 /bsd: uvideo0: allocated 94080 bytes isoc VS xfer buffer Dec 16 07:22:28 t14 last message repeated 2 times Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_vs_alloc_frame: allocated 614400 bytes frame buffer Dec 16 07:22:28 t14 /bsd: uvideo0: uvideo_vs_decode_stream_header: frame too small, skipped! Dec 16 07:22:38 t14 last message repeated 297 times Dec 16 07:22:38 t14 /bsd: uvideo0: uvideo_vs_cb: CANCELLED Dec 16 07:22:38 t14 last message repeated 2 times Dec 16 07:22:38 t14 /bsd: uvideo0: uvideo_close: sc=0xffff800000798000 Dec 16 07:22:38 t14 /bsd: uvideo0: uvideo_vs_free_isoc Dec 16 07:22:38 t14 /bsd: uvideo0: uvideo_close: sc=0xffff800000798000 Dec 16 07:22:38 t14 /bsd: uvideo0: uvideo_vs_free_isoc Best regards, Stefan