iMX8MP ISI and load of camera kernel module

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX8MP ISI and load of camera kernel module

4,317 Views
ulrich_sorensen
Contributor II

Hi,

I am working with the ov5640 camera on the iMX8M plus and Linux BSP 5.10.52.

If I change the ov5640 driver from built-in to loadable module, then the ISI capture device /dev/video3 is not created during boot which is as expected.

However, when I manually load the ov5640 driver after boot, I would expect the ISI driver to be notified of the camera and to re-create the capture device /dev/video3 but this does not happen.

Any way to fix this problem in the ISI driver?

BR,

Ulrich

9 Replies

4,286 Views
joanxie
NXP TechSupport
NXP TechSupport

do you mean you change the driver from build-in, after you loading the driver manually, you couldn't use ov5640 anymore? do you mind sharing the logfile?

0 Kudos
Reply

4,282 Views
ulrich_sorensen
Contributor II

Hi,

Yes, that is correct. I have changed kernelconfig to module instead of built-in for ov5640. Please see attached kernelconfig and dmesg for complete logs.

I have added ov5640 to blacklist so it does not get autoloaded.

Below is the section of the log that shows the video3 device being registered and then immediately being unregistered.

[ 4.675727] mx8-img-md: Registered mxc_isi.0.capture as /dev/video3
[ 4.676698] unregister ISI channel: mxc_isi.0

BR

Ulrich

0 Kudos
Reply

4,267 Views
joanxie
NXP TechSupport
NXP TechSupport

which dtb do you use? and tell me how you changed the deconfig file? I used imx8mp-evk-balser-ov5640.dtb, ov5640 should use isi.1, I don't know what dtb file you use? if you don't change the deconfig file, could you capture video from ov5640 successfully?

0 Kudos
Reply

4,252 Views
ulrich_sorensen
Contributor II

Hi,

I use imx8mp-evk.dts. Camera board is MINISASTOCSI

I do not use Yocto but ptxdist to build. The config that is changed is:

CONFIG_VIDEO_OV5640=m

Furthermore, I blacklist the module to stop autoloading during boot so I can manually modprobe after boot.

Before changing kernel config I was able to capture video.

BR,

Ulrich

 

 

0 Kudos
Reply

4,229 Views
joanxie
NXP TechSupport
NXP TechSupport

after insmod the ov5640 drvier, don't forget install the  imx8-media-dev.ko, I built and test this successfully, after you install the imx8-media-dev.ko module, you can get videox under /dev for ov5640

0 Kudos
Reply

4,212 Views
ulrich_sorensen
Contributor II

Hi,

I understand what you say, but I think you miss my point. The point is that ov5640 and imx8-media-dev drivers use v4l2_async_notifiers to make the load sequence of the modules independent.

I you load imx8-media-dev first and the ov5640 afterwards, you will not get any videox under /dev for ov5640.

BR,

Ulrich

4,205 Views
joanxie
NXP TechSupport
NXP TechSupport

yes, you must load ov5640 driver first, what's your point? you don't want this sequence? if you don't load ov5640 first, how the isi register the camera driver to the device? that's the reason kernel build-in the ov5640 driver

 

4,198 Views
ulrich_sorensen
Contributor II

Hi,

If you have a setup with a removable camera, you need to be able to register/un-register the camera with the video subsystem (ISI) asynchronously.

My point is that I think there is a bug/missing functionality in the imx8-media-dev.c

When I look at the code, imx8-media-dev.c seems to include everything for handling of async. registration of the sensor driver but it only works (creating /dev/videoXXX) if the camera is registered before probing of imx8-media-dev. This should also work if the camera is registered after the imx8-media-dev.

BR,

Ulrich

4,187 Views
joanxie
NXP TechSupport
NXP TechSupport

I have confirmed that this sequence is correct, if you don't install camera driver before install the imx8-media-dev.ko firstly, the device will detect the camera failed, then you install the camera driver, the device wouldn't detect the camera again, so you must install the camera driver at first