v4l2loopback module failing on Ubuntu 20.04

I am trying a new web camera on a workstation that hitherto had no video capture devices attached. It should be plug-and-play but none of the programmes is able to find the camera once connected.

First I checked whether the kernel itself was identifying the camera:

$ lsusb
[...]
Bus 001 Device 007: ID 046d:082d Logitech, Inc. HD Pro Webcam C920
[...]

So there is a camera, it must be a software thing. Checking connected devices with video for Linux gives one more clue:

$ v4l2-ctl --list-devices
Cannot open device /dev/video0, exiting.

Looked like the kernel module was disabled, so I tried to start it up:

$ sudo modprobe v4l2loopback
modprobe: FATAL: Module v4l2loopback not found in directory /lib/modules/5.4.0-81-generic

Odd, the module was not even installed. I then pulled it from the packages and gave it another try:

$ sudo aptitude install v4l2loopback-dkms
[...]

$ sudo modprobe v4l2loopback
modprobe: ERROR: could not insert 'v4l2loopback': Unknown symbol in module, or unknown parameter (see dmesg)

And this is what I found among the messages:

$ dmesg
[...]
[1271004.074955] v4l2loopback: Unknown symbol video_ioctl2 (err -2)
[1271004.075027] v4l2loopback: Unknown symbol v4l2_ctrl_handler_init_class (err -2)
[1271004.075105] v4l2loopback: Unknown symbol video_devdata (err -2)
[1271004.075167] v4l2loopback: Unknown symbol v4l2_ctrl_new_custom (err -2)
[1271004.075221] v4l2loopback: Unknown symbol video_unregister_device (err -2)
[1271004.075276] v4l2loopback: Unknown symbol video_device_alloc (err -2)
[1271004.075336] v4l2loopback: Unknown symbol v4l2_device_register (err -2)
[1271004.075410] v4l2loopback: Unknown symbol __video_register_device (err -2)
[1271004.075463] v4l2loopback: Unknown symbol v4l2_ctrl_handler_free (err -2)
[1271004.075513] v4l2loopback: Unknown symbol v4l2_device_unregister (err -2)
[1271004.075562] v4l2loopback: Unknown symbol video_device_release (err -2)

I believe this means some software dependencies are missing. But which? There is a discussion at GitHub in a cloud context, but the solution is too general (install all extra package modules available).


After some more searching I noticed something odd, none of the extra kernel modules was actually installed on this system:

$ aptitude search linux-modules-extra*
[...]
p   linux-modules-extra-5.4.0-70-generic                                                              - Linux kernel extra modules for version 5.4.0 on 64 bit x86 SMP
p   linux-modules-extra-5.4.0-71-generic                                                              - Linux kernel extra modules for version 5.4.0 on 64 bit x86 SMP
p   linux-modules-extra-5.4.0-72-generic                                                              - Linux kernel extra modules for version 5.4.0 on 64 bit x86 SMP
p   linux-modules-extra-5.4.0-73-generic                                                              - Linux kernel extra modules for version 5.4.0 on 64 bit x86 SMP
p   linux-modules-extra-5.4.0-74-generic                                                              - Linux kernel extra modules for version 5.4.0 on 64 bit x86 SMP
p   linux-modules-extra-5.4.0-77-generic                                                              - Linux kernel extra modules for version 5.4.0 on 64 bit x86 SMP
p   linux-modules-extra-5.4.0-80-generic                                                              - Linux kernel extra modules for version 5.4.0 on 64 bit x86 SMP
c   linux-modules-extra-5.4.0-81-generic                                                              - Linux kernel extra modules for version 5.4.0 on 64 bit x86 SMP 

That being an obvious culprit, I installed the package and gave it another try:

$ sudo aptitude install linux-modules-extra-5.4.0-81-generic
[...]

$ sudo modprobe v4l2loopback

$ v4l2-ctl --list-devices
Dummy video device (0x0000) (platform:v4l2loopback-000):
    /dev/video0

Albeit that brought the module back to life, the web camara remains invisible to the software. But that is another question.