IntelRealSense / librealsense

Intel® RealSense™ SDK
https://www.intelrealsense.com/
Apache License 2.0
7.55k stars 4.82k forks source link

modprobe: FATAL: Module videodev is in use #12885

Closed rastinp closed 5 months ago

rastinp commented 5 months ago

Required Info
Camera Model D400
Firmware Version latest
Operating System & Version Ubuntu 22.04 LTS
Kernel Version (Linux Only) 6.5.0-28-generic
Platform Intel NUC
SDK Version newest
Language {C/C#/labview/nodejs/opencv/pcl/python/unity }
Segment Robot

Issue Description

Hi, I try to install librealsense2-dkms on the above mentioned setup for my D455. I am using a fresh installation of Ubuntu 22.04 LTS on the Intel NUC.

Installing librealsense2-dkms using sudo apt-get install librealsense2-dkms

I get the following error

modprobe: FATAL: Module videodev is in use.

The camera is not attached to the NUC, secure boot is disabled and UEFI is enabled.

Did anybody else experience this error or can support me on solving this issue?

Thanks a lot and best regards, Rastin

MartyG-RealSense commented 5 months ago

Hi @rastinp Can you confirm whether or not you attempted to apply a kernel patch script such as ./scripts/patch-realsense-ubuntu-lts-hwe.sh before you used the sudo apt-get install librealsense2-dkms command? An apt-get package install does not need a patch script to be applied because the patch is already bundled in the packages.

rastinp commented 5 months ago

Hi @MartyG-RealSense, yes, I can confirm this. Using lsmod I see that the videodev is used by

videodev v4l2_async, v4l2_fwnode, ov13858

MartyG-RealSense commented 5 months ago

Thanks very much for the information. If the kernel has been patched, would it be possible for you to change to another kernel version so that the kernel becomes unpatched and then repeat sudo apt-get install librealsense2-dkms

rastinp commented 5 months ago

I switched to another kernel (6.2.0-26-generic) but the problem still appears. It again throws the error that the videodev is in use, which is actually the case:

videodev v4l2_async, ov13858 mc v4l2_async, videodev, ov13858

I am not sure what the ov13858 (camera module or graphic card) and the mc is. There is no camera attached to the NUC but I extended the NUC with a second ETH+2xUSB.

MartyG-RealSense commented 5 months ago

ov13858 is an OmniVision image sensor but not one of the OmniVision sensors used in RealSense 400 Series cameras for its RGB and infrared sensors. My research indicates that this component is referenced in videodev listings on computers that do not have a RealSense camera attached, such as laptops with a built-in webcam (though your NUC is not a laptop). Some PC desktop computer monitor screens have a webcam built into them, so you could check whether the screen being used with your NUC has this feature.

rastinp commented 5 months ago

I am not sure why the ov13858 module is installed automatically. However, I solved now the issue, by deactivating the module ov13858 using sudo modprobe -r ov13858

Afterwards, the librealsense2-dkms installed without any issue. Thanks a lot @MartyG-RealSense for your support.

MartyG-RealSense commented 5 months ago

You are very welcome, @rastinp - it's great to hear that you achieved a solution. Thanks very much for the update!

autonomobil commented 3 months ago

In my case:

$ sudo modprobe -r videodev
modprobe: FATAL: Module videodev is in use.

and

$ lsmod | grep videodev
videodev              364544  2 rmi_core,videobuf2_v4l2
mc                     86016  3 videodev,videobuf2_v4l2,videobuf2_common

and

$ lsmod | grep rmi_core
rmi_core              118784  1 rmi_smbus
videobuf2_vmalloc      20480  1 rmi_core
videobuf2_v4l2         40960  1 rmi_core
videodev              364544  2 rmi_core,videobuf2_v4l2
videobuf2_common       86016  4 videobuf2_vmalloc,rmi_core,videobuf2_v4l2,videobuf2_memops

and

$ lsmod | grep rmi_smbus
rmi_smbus              12288  0
rmi_core              118784  1 rmi_smbus

Finally with

sudo modprobe -r rmi_smbus

I was able to do dpkg -l | grep "realsense" | cut -d " " -f 3 | xargs sudo dpkg --purge and sudo apt-get remove --purge librealsen*

MartyG-RealSense commented 3 months ago

Thanks so much @autonomobil for sharing what worked for you in your particular case!