0

I have been trying to set up v4l2loopback on an EC2 instance and get the error - modprobe: FATAL: Module v4l2loopback not found in directory /lib/modules/5.4.0-1041-aws on sudo modprobe v4l2loopback.

Trying to load videodev using sudo modprobe videodev also returns the same module not found error.

I tried installing Linux headers for this but to no success. Any leads?

Akshay Kumar
  • 277
  • 2
  • 11

1 Answers1

0

kernels for cloud VMs are most often stripped of anything unnecessary in a cloud environment for space (and implicitly speed) reasons (and put in a share of security reasons as well).

now most virtualized hardware that is running in some unknown datacenter has absolutely no requirement for hardware drivers (apart from the small set of drivers to run the "virtual hardware"). Also audio and multimedia applications are exceedingly rare under these circumstances - thus the image vendors strip away audio drivers and the v4l2 framework.

in order to use the v4l2loopback module, you need a kernel that comes with the v4l2-framework. since the vendored images lack it, you need to configure and compile such a kernel yourself (and make sure it persists). just installing the kernel-headers is not enough.

here's an excerpt of the relevant info of the kernel-configuration that should give you a v4l2loopback-compatible kernel:

CONFIG_MEDIA_SUPPORT=y
# CONFIG_MEDIA_SUPPORT_FILTER is not set
# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set

#
# Media device types
#
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
CONFIG_MEDIA_RADIO_SUPPORT=y
CONFIG_MEDIA_SDR_SUPPORT=y
CONFIG_MEDIA_PLATFORM_SUPPORT=y
CONFIG_MEDIA_TEST_SUPPORT=y
# end of Media device types

#
# Media core support
#
CONFIG_VIDEO_DEV=y
CONFIG_MEDIA_CONTROLLER=y
CONFIG_DVB_CORE=y
# end of Media core support

#
# Video4Linux options
#
CONFIG_VIDEO_V4L2=y
CONFIG_VIDEO_V4L2_I2C=y
# CONFIG_VIDEO_V4L2_SUBDEV_API is not set
# CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
# end of Video4Linux options
umläute
  • 28,885
  • 9
  • 68
  • 122