Index | Thread | Search

From:
Kirill A. Korinsky <kirill@korins.ky>
Subject:
Re: sys/uvideo: don't skip frame immediately when buffer unavailable (regression from v1.256)
To:
Marcus Glocker <marcus@nazgul.ch>
Cc:
tech@openbsd.org, Ian Darwin <ian@darwinsys.com>
Date:
Sun, 06 Apr 2025 15:54:03 +0200

Download raw body.

Thread
On Sun, 06 Apr 2025 11:22:15 +0200,
Marcus Glocker <marcus@nazgul.ch> wrote:
>
> On Sun, Apr 06, 2025 at 10:44:36AM GMT, Kirill A. Korinsky wrote:
>
> > > As already discussed a bit on ICB:
> > >
> > > I don't exactly understand ian@ issue, and I also didn't see a bug
> > > report on bugs@ for it which would explain it well.  I can half way
> > > imagine the issue based on your explanation.
> > >
> > > I also don't understand how your diff would fix what I did understand
> > > from your issue explanation.
> > >
> > > In any case, since I'm also using motion;  I don't see glitches with
> > > my setup using motion with uvideo.c,1.256.  And if I apply your diff,
> > > *then* I'm seeing glitches, almost every 5-8 seconds.
> > >
> > > So based on the current information, it's pretty hard to discuss
> > > about a possible solution.  Maybe ian@ could provide a detailed bug
> > > report on bugs@, showing a dmesg, 'ubsdevs -v' output, and his
> > > motion.conf.  Based on that, by any chance we could try to reproduce
> > > the issue locally, and then discuss about a possible solution.
> > >
> >
> > Well, I do not understand your issue but I can reproduce ian@ one on one of
> > my webcam, and only one. So, I will prepare two debug outputs later today.
> >
> > But we're short in the time, this changes needed only to support new devices
> > with high FPS... So, I suggest to revert it for release.
> >
> > Ok?
>
> Fine for me to revert the bcopy() performance diff for the release.
>
> ok mglocker@
>

Thanks, it is reverted.

Meanwhile I had played with different screen size and frame rate and had
found that some settings which triggers on my affected device some glitches
with any tested version of uvideo when I had enabled UVIDEO_DEBUG and
increases uvideo_debug to 2. As a base line to proof that it doesn't recent
changes I've used 1.221.

If I touches framerate or screen size, it behaves differently. Threshold is
10 FPS, and if I consume more than 10 FPS I haven't got major glitches. With
15 FPS or more I haven't got any kind of glitches on tested version.

So, I have:

 - uvideo.c,v 1.221 and 1.257 some micro glitches time to time when I had
   enabled debug, and major glitches when I also increased uvideo_debug.

 - uvideo.c,v 1.256 major gliteches, screenshot:
   https://kirill.korins.ky/pub/uvideo-motion-regression/screenshot-2025-04-06_13-19-56.png

 - uvideo.c,v 1.256 + diff from a thread better, but still see some glitches
   with enabled debug.

BTW I had keep samples of debug log and differences with motion.conf here:
https://kirill.korins.ky/pub/uvideo-motion-regression/

Anyway, base on all that I said, I don't think that bcopy diff is a root
cause of the issue. I think that that we already have the issue, but bcopy
diff uncovers it on some device and settings as side effect, which allows us
to notice it.

--
wbr, Kirill