Re: [PATCH v1] media: vivid: Add webcam parameter for (un)limited bandwidth

From: Max Staudt
Date: Tue Apr 11 2023 - 07:34:38 EST


On 4/11/23 16:45, Hans Verkuil wrote:
Do I understand you correctly, are you suggesting to simply update the FPS limits to a new fixed schema, and not have an option at all?

Correct.

The ideal solution is indeed proper bandwidth calculations, since this would
be a proper emulation of actual webcam hardware. If you have time and are
interested in doing the work, then that would be great, of course.

My patch suggestion is motivated by a test which expects higher FPS rates at large frame sizes than vivid currently provides.

If I have a choice, then let's keep this patch simple ;)


But if you just want to increase the fps limits to be more in line with
modern webcams, then that's much quicker and should be fine.

It might also be interesting to perhaps allow for 120 fps for the low
resolutions (below 720p).

Coincidentally, this would solve the problem we have at hand, but only until someone wants to see even higher frame rates, and then we'd revisit today's thread. Hence the idea for a parameter to simply unlock all rates, depending on whether a test needs a vivid webcam with low or high "performance".


My rationale behind the module parameter is twofold:

1. To allow for higher FPS without touching the kernel code again.
2. To stay backward compatible to previous behaviour of vivid. Changing the FPS formula would break this.


Actually I have a new idea: How about renaming my suggestion to "webcam_limit_enable" - this way, we can keep the current design with the boolean value: Not setting this value would default to "enabled" - i.e. vivid behaves as before. Disabling the limit unlocks all FPS at all sizes.

And later, should the need for a more precise simulation arise, we can add a second parameter "webcam_limit_value".

I've removed the "bandwidth" word from the new suggestions, so if a numeric limit is introduced, it can be anything, even an arbitrary number like the current "remove 2 FPS rates per size".


Please let me know what you think.

Max