-
Notifications
You must be signed in to change notification settings - Fork 535
Frequently Asked Questions for the v4l2loopback kernel module
A: Please read the documentation carefully: while it is not very long, it does contain some information that might help fixing your problem.
This FAQ and the wiki should provide some information as well :-)
A: If you have general questions or problems, please use the v4l2loopback
tag on Stack Overflow:
https://unix.stackexchange.com/questions/tagged/v4l2loopback
The issue tracker is ill-suited for general help. Please do not use it.
A: use the 'devices' module parameter. e.g.
# modprobe v4l2loopback devices=3
will create 3 loopback devices. Make sure producers and consumers stream to/from the appropriate devices. Please refer to the Multiple Devices example to see how to do that.
A: Please refer to the MPlayer examples to see how to do that.
A: Please refer to the MPlayer examples to see how to do that.
A: Please refer to the Skype examples to see how to do that.
A: v4l2loopback
is a kernel-module and thus runs in kernel-space. while you can do many a-thing in kernel-space that you cannot do in user-space, there are also some things that you only do in user-space (like using a dynamic library). what's more there are things that you shouldn't do in the privileged kernel-space (mostly all the things that you can easily do in user-space). scaling images and converting between colorspaces, is something that should be done in user-space, and thus cannot be done in the v4l2loopback module. See also Colorspace Issues.
A: Latest package v4l2loopback-dkms can be downloaded for example here:
https://launchpad.net/ubuntu/+source/v4l2loopback
Or you can use this PPA:
https://launchpad.net/~rayanayar/+archive/v4l2loopback
When running make
, I get errors like the following:
make -C /lib/modules/uname -r/build M=/home/me/src/v4l2loopback modules_install
make[1]: Entering directory '/usr/src/linux-headers-5.0.0-0'
INSTALL /home/me/src/v4l2loopback/v4l2loopback.ko
At main.c:160:
SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:72
SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:79
sign-file: certs/signing_key.pem: No such file or directory
DEPMOD 5.0.0-0
Warning: modules_install: missing 'System.map' file. Skipping depmod.
make[1]: Leaving directory '/usr/src/linux-headers-5.0.0-0'
A: Most often, You can safely ignore these "errors" (they only say, that the kernel-module could not be cryptographically signed).
To check whether the build actually succeeded, check the exit code of the build process. It should be 0
:
$ make
[...]
$ echo $?
0
$
A: Sometimes these errors indicate a real problem, as some kernels will refuse to load modules that are not cryptographically signed.
The easiest way to make the kernel recognize the module, is by building the module via the dkms
framework.
See the DKMS section in the README for instructions.
modprobe: ERROR: could not insert 'v4l2loopback': Operation not permitted
Lockdown: modprobe: unsigned module loading is restricted; see man kernel_lockdown.7
A: If you are running secure boot, that's most likely the reason you will see this error. Go through the following steps to see if it corrects the problem.
(note the name OBS.priv, OBS.der, and /CN=OBS/ are the names I just gave it, you can call it whatever you want)
The first six steps you only have to do once:
- openssl req -new -x509 -newkey rsa:2048 -keyout OBS.priv -outform DER -out OBS.der -nodes -days 36500 -subj "/CN=OBS/"
- sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./OBS.priv ./OBS.der $(modinfo -n v4l2loopback)
- tail $(modinfo -n v4l2loopback) | grep "Module signature appended"
- sudo mokutil --import OBS.der - you'll have to make a password at this step REMEMBER IT!
- Reboot; You will go through a MOK enrollment process in the BIOS; This is where you need the password from step 4.
- mokutil --test-key OBS.der (this just confirms it's enrolled)
- sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./OBS.priv ./OBS.der $(modinfo -n v4l2loopback)
(Not sure if step 7 is needed the first time (since you do it in step 2), but I had it in my notes for another module with the same issue so I'm including it here.)
Now every time there's a kernel update, or the v4l2loopback module is updated, you'll have to go through step 7 again and reboot.