Hi @all,
I'm sorry for digging out this old thread, but I'm facing similar issues as @chrispeterson did and hopefully somebody of you can help me.
Currently I'm trying to connect a Sony IMX327 image sensor via MIPI-CSI2 to the imx8mp. Since the sensor has no ISP capabilities I want to use the internal ISP of the imx8mp. It seems like there is a problem with the data exchange between the MIPI-CSI2 core and the ISP.
What I did so far:
- Implemented a vvcam kernel driver for the IMX327 based on the nxp example for OV2775. In principle the same that @chrispeterson did.
- Changed the device-tree as follows:
imx327_0: imx327@1a {
compatible = "sony,imx327";
reg = <0x1A>;
csi_id = <0x00>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_powergood &pinctrl_imager_io>;
pg-3v3-gpio = <&gpio3 19 GPIO_ACTIVE_HIGH>;
pg-1v2-gpio = <&gpio3 21 GPIO_ACTIVE_HIGH>;
pg-1v8-gpio = <&gpio3 23 GPIO_ACTIVE_HIGH>;
pg-2v8-gpio = <&gpio3 25 GPIO_ACTIVE_HIGH>;
en-1v2-gpio = <&gpio3 20 GPIO_ACTIVE_HIGH>;
en-1v8-gpio = <&gpio3 22 GPIO_ACTIVE_HIGH>;
en-2v8-gpio = <&gpio3 24 GPIO_ACTIVE_HIGH>;
sen-clk-en-gpio = <&gpio4 22 GPIO_ACTIVE_HIGH>;
sen-rst-n-gpio = <&gpio4 25 GPIO_ACTIVE_HIGH>;
port {
imx327_ep_0: endpoint {
data-lanes = <1 2 3 4>;
clock-lanes = <0>;
max-pixel-frequency = /bits/ 64 <266000000>;
remote-endpoint = <&mipi_csi0_ep>;
};
};
};
&mipi_csi_0 {
status = "okay";
port@0 {
reg = <0>;
mipi_csi0_ep: endpoint {
remote-endpoint = <&imx327_ep_0>;
data-lanes = <4>;
csis-hs-settle = <2>; // 4
csis-clk-settle = <0>;
csis-wclk;
};
};
};
&cameradev {
status = "okay";
};
&isi_0 {
status = "disabled";
};
&isp_0 {
status = "okay";
};
&dewarp {
status = "okay";
};
- Added imx327.drv based on OV2775 and imx327.xml based on DAA3840_30MC_4K.xml and changed resolution to 1920x1080. (Also the same as in the examples above)
- Changed run.sh script to support my drivers
After all these changes I can start the isp_media_server with start_isp.sh I see that my driver is loaded and the v4l-devices are generated properly. But I'm confused why there is no linking between the mipi and the isp. Can anybody confirm that this is correct?
RUN_SCRIPT=/opt/imx8-isp/bin/run.sh
RUN_SCRIPT_PATH=/opt/imx8-isp/bin
Trying configuration "imx327_1080p30"...
Removing vvcam-isp...
Removing vvcam-dwe...
Removing vvcam-video...
[ 806.113804] enter viv_video_exit_module
Removing imx8-media-dev...
[ 806.300133] : Unregistered all entities
Removing ov2775...
Removing os08a20...
Removing basler-camera-driver-vvcam...
Loading module imx327 ...
imx327
imx327 20480 0
imx327 already loaded.
Loading module imx8-media-dev ...
imx8_media_dev
[ 806.722106] imx8_media_dev: module is from the staging directory, the quality is unknown, you have been warned.
[ 806.738391] mxc_md_probe
[ 806.741860] mx8-img-md: Registered sensor subdevice: imx327 1-001a (1)
[ 806.748716] mx8-img-md: created link [imx327 1-001a] => [mxc-mipi-csi2.0]
[ 806.755721] mxc-md 32c00000.bus:camera: mxc_md_create_links
Loaded /lib/modules/5.10.52+g0fe40616142b/kernel/drivers/staging/media/imx/imx8-media-dev.ko
Loading module vvcam-video ...
[ 806.799057] enter imx327_priv_ioctl (cmd = -2140645888)
[ 806.805286] enter imx327_query_capability
vvcam_video
[ 806.987356] enter viv_video_init_module
Loaded /lib/modules/5.10.52+g0fe40616142b/extra/video/vvcam-video.ko
Loading module vvcam-dwe ...
[ 807.085842] enter isp_mi_stop
vvcam_dwe
vvcam_dwe 28672 1
vvcam-dwe already loaded.
Loading module vvcam-isp ...
vvcam_isp
vvcam_isp 65536 1
vvcam-isp already loaded.
Starting isp_media_server with configuration file CAMERA0
Then I tried to start the video with gstreamer and the provided program video_test, but I can't get any video data. (See the log below)
./video_test -w 1920 -h 1080 -f RAW12 -t 2 -m0 -d0
loading [imx327.drv]...
Info - IMX327_IsiHalQuerySensorIss (enter)
Info - IMX327_IsiHalQuerySensorIss (exit)
WARN : [DEWARP_HW] dwe type /dev/v4l-subdev0 0
WARN : [DEWARP_HW] dwe type /dev/v4l-subdev1 1
WARN : [DEWARP_HW] dwe type /dev/v4l-subdev2 2
loading [imx327.drv]...
Info - IMX327_IsiHalQuerySensorIss (enter)
Info - IMX327_IsiHalQuerySensorIss (exit)
Video Test:caps supports:{
count = 1
{
index = 0
width = 1920
height = 1080
fps = 30
hdr_mode = 0
}
}
loading [imx327.drv]...
Info - IMX327_IsiHalQuerySensorIss (enter)
Info - IMX327_IsiHalQuerySensorIss (exit)
loading [imx327.drv]...
Info - IMX327_IsiHalQuerySensorIss (enter)
Info - IMX327_IsiHalQuerySensorIss (exit)
Info - IMX327_IsiGetSensorIss (enter)
Info - IMX327_IsiGetSensorIss (exit)
Info - IMX327_IsiHalQuerySensorIss (enter)
Info - IMX327_IsiHalQuerySensorIss (exit)
Info - IMX327_IsiCreateSensorIss (enter)
Info - IMX327_IsiSensorSetPowerIss: (enter)
Info - IMX327_IsiSensorSetPowerIss: set power 1
Info - IMX327_IsiSensorSetPowerIss: (exit)
Info - IMX327_IsiSensorGetClkIss: (enter)
Info - IMX327_IsiSensorGetClkIss: status:276111060 sensor_mclk:37125000 csi_max_pixel_clk:266000000
Info - IMX327_IsiSensorGetClkIss: (exit)
Info - IMX327_IsiSensorSetClkIss: (enter)
Info - IMX327_IsiSensorSetClkIss: status:1 sensor_mclk:37125000 csi_max_pixel_clk:266000000
Info - IMX327_IsiSensorSetClkIss: (exit)
Info - IMX327_IsiResetSensorIss: (enter)
Info - IMX327_IsiResetSensorIss: (exit)
Info - IMX327_IsiSetSensorModeIss (enter)
Info - IMX327_IsiSetSensorModeIss (exit)
Info - IMX327_IsiCreateSensorIss (exit)
Info - IMX327_IsiGetSensorModeIss (enter)
Info - IMX327_IsiGetSensorModeIss (exit)
Info - IMX327_IsiGetCapsIss (enter)
Info - IMX327_IsiQuerySensorIss (enter)
Info - IMX327_IsiHalQuerySensorIss (enter)
Info - IMX327_IsiHalQuerySensorIss (exit)
Info - IMX327_IsiQuerySensorIss (exit)
Info - IMX327_IsiGetCapsIss (exit)
isp input: 1920x1080 RAW12
isp output: 1920x1080 YUV422I
dewarp input: 1920x1080 YUV422I
dewarp output: 1920x1080 YUV422I
Info - IMX327_IsiSetupSensorIss (enter)
Info - IMX327_IsiSetupSensorIss (exit)
Info - IMX327_IsiSetTestPatternIss (enter)
Info - IMX327_IsiSetTestPatternIss: test pattern enable[0] mode[0]
Info - IMX327_IsiSetTestPatternIss: (exit)
Info - IMX327_IsiSetSensorFpsIss: (enter)
Info - IMX327_IsiSetSensorFpsIss: (exit)
Info - IMX327_IsiGetSensorModeIss (enter)
Info - IMX327_IsiGetSensorModeIss (exit)
Info - IMX327_IsiGetSensorModeIss (enter)
Info - IMX327_IsiGetSensorModeIss (exit)
Info - IMX327_IsiGetAeInfoIss (enter)
Info - IMX327_IsiGetAeInfoIss (exit)
Info - IMX327_IsiGetSensorFpsIss: (enter)
Info - IMX327_IsiGetSensorFpsIss: (exit)
Info - IMX327_IsiGetAeStartExposureIs (enter)
Info - IMX327_IsiGetAeStartExposureIs:get start exposure 36403200
Info - IMX327_IsiGetAeStartExposureIs: (exit)
Info - IMX327_IsiGetSensorModeIss (enter)
Info - IMX327_IsiGetSensorModeIss (exit)
Info - IMX327_IsiGetAeInfoIss (enter)
Info - IMX327_IsiGetAeInfoIss (exit)
Info - IMX327_IsiSetIntegrationTimeIss (enter)
Info - IMX327_IsiSetIntegrationTimeIss set linear exp 400
Info - IMX327_IsiSetIntegrationTimeIss (exit)
Info - IMX327_IsiSetGainIss (enter)
Info - IMX327_IsiSetGainIss set linear gain 3072
Info - IMX327_IsiSetGainIss (exit)
Info - IMX327_IsiGetIntegrationTimeIss (enter)
Info - IMX327_IsiGetIntegrationTimeIss (exit)
Info - IMX327_IsiGetGainIss (enter)
Info - IMX327_IsiGetGainIss (exit)
#### CsiSetFormat 1920 1080 842090322
Info - IMX327_IsiGetSensorIspStatusIss: (enter)
Info - IMX327_IsiGetSensorIspStatusIss: (exit)
Info - IMX327_IsiGetSensorIspStatusIss: (enter)
Info - IMX327_IsiGetSensorIspStatusIss: (exit)
Info - IMX327_IsiGetSensorIspStatusIss: (enter)
Info - IMX327_IsiGetSensorIspStatusIss: (exit)
Info - IMX327_IsiGetSensorModeIss (enter)
Info - IMX327_IsiGetSensorModeIss (exit)
Info - IMX327_IsiGetSensorModeIss (enter)
Info - IMX327_IsiGetSensorModeIss (exit)
Info - IMX327_IsiGetSensorIspStatusIss: (enter)
Info - IMX327_IsiGetSensorIspStatusIss: (exit)
CamEngineEnableCproc: set val 1 1 1 1.10 -15 1.00 0.00
Info - IMX327_IsiSensorSetStreamingIss (enter)
Info - IMX327_IsiSensorSetStreamingIss: set streaming 1
Info - IMX327_IsiSensorSetStreamingIss (exit)
I checked that the sensor is configured properly by measuring the traffic on all MIPI data/clock lanes. I read out the interrupt source register of the MIPI core and can see that the data is coming in until a FIFO overflow occures.
For testing purposes I then activated the ISI. With this configuration there are no FIFO overflows and I can see the MIPI Frame Counter running up.
Due to that I assume that there must be a problem with the MIPI-CSI <-> ISP data exchange.
Has anybody an idea what's going wrong here? Maybe somebody can post the logs of a successful try.
Any help is appreciated.
Thanks in advance!
Best regards,
Daniel