Open RokerHRO opened 3 years ago
patches welcome
I'd do that if I were sure whether this limit exists in the v4l core itself or only in the v4l2loopback driver or somewhere else and whether it can be raised by simply changing a magic constant somewhere (in the source or can it be changed at runtime?) and what the disadvantages of such a change would be.
But at least tell the users about this limit would be easy for everyone with write access to this project. :-)
so far, it's documented in the source-code (only):
however, the new dynamic device management kind of obsoletes this, as you can (dynamically) create as many devices as you want to.
e.g. i just created 128 additional loopback devices using:
for i in $(seq 128); do
v4l2loopback-ctl add
done
to answer your question more specifically:
I'd do that if I were sure whether this limit exists in the v4l core itself or only in the v4l2loopback driver or somewhere else and whether it can be raised by simply changing a magic constant somewhere (in the source or can it be changed at runtime?)
there's a hard limitation in the kernel, where the minor device number is an unsigned 8bit value. given that v4l
uses a fixed major device numer (81
) this forces the maximum number of /dev/video
devices to be 256.
and what the disadvantages of such a change would be.
(iirc) the main reason for the hardcoded limit to 8 devices is to prevent the innocent user to shoot themselves in their knees.
it probably could be set to the absolute maximum (256
) if this is really important.
i think that so far most people who need "a lot" of devices also need a way to dynamically allocate (and deallocate) them.
@umlaeute : Thank you for your detailed answers! :-)
So now when we have all the necessary information together, where can it be added to the documentation, so other users don't have to dig into the kernel sources (and misinterpreting e.g. the comment above the MAX_DEVICES
constant as a hard compile-time constant that cannot be changed without recompilation etc.)?
so other users don't have to dig into the kernel sources
well they don't really have to read the kernel source, just the module source. but of course, even that might be too much.
and misinterpreting e.g. the comment above the
MAX_DEVICES
constant as a hard compile-time constant
not sure i understand that. where do you think there is a misinterpretation?
the MAX_DEVICES
is the hard coded maximum of devices that can be created when loading the module.
if you want to change that, you indeed need to recompile the module.
using dynamic device managment simply bypasses this restriction.
Step 2: Describe your environment
v4l2loopback
version: Version: 0.12.1-1kernel version: 4.19.0-10-amd64 #1 SMP Debian 4.19.132-1 (2020-07-24) x86_64 GNU/Linux
Distribution (+version): Debian 10.5
Step 3: Describe the problem:
I tried to load the v4l2loopback kernel module with more than 8 video devices. Only 8 devices are created.
No error message is emitted.dmesg
tells:This limit is not mentioned on the v4l2loopback documentation and also whether it is possible to increase that limit and if yes, how to increase it and if there are any disadvantages when set this limit to a far too high number etc.