Hello,
I’m trying to connect Sony IMX412 camera to the board using MIPI interface and following driver with slight adjustments for it to work with older linux kernel version (4.14.69).
dts
i2c@075ba000{
/* On Low speed expansion */
label = "LS-I2C3";
status = "okay";
camera@1a {
compatible = "sony,imx412";
reg = <0x1a>;
clocks = <&mmcc CAMSS_MCLK0_CLK>;
assigned-clocks = <&mmcc CAMSS_MCLK0_CLK>;
assigned-clocks-parent = <&mmcc>;
assigned-clocks-rate = <24000000>;
enable-gpios = <&msmgpio 26 GPIO_ACTIVE_HIGH>;
reset-gpios = <&msmgpio 25 GPIO_ACTIVE_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&camera_rear_default>;
vdddo-supply = <&camera_vdddo_1v8>;
vdda-supply = <&camera_vdda_2v8>;
vddd-supply = <&camera_vddd_1v5>;
status = "okay";
port {
imx412_ep: endpoint {
remote-endpoint = <&csiphy0_ep>;
data-lanes = <1 2 3 4>;
link-frequencies = /bits/ 64 <600000000>;
};
};
};
};
cci@a0c000 {
status = "ok";
camss@a00000 {
status = "ok";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
csiphy0_ep: endpoint {
data-lanes = <1 2 3 4>;
remote-endpoint = <&imx412_ep>;
status = "okay";
};
};
};
};
};
Things that work:
-
i2cdetect
sees camera on the bus (howeveri2cdump
shows all zeros) - media device appears and I can build a pipeline
- driver can succesfully probe camera (albeit it reads different device id than specified by default)
What I want to achieve: capture data from camera using either gstreamer of v4l2-ctl
Currently v4l2-compliance -s
fails blocking wait and MMAP tests.
v4l2-compliance -s
v4l2-compliance SHA: not available, 64 bits
Compliance test for device /dev/video0:
Driver Info:
Driver name : qcom-camss
Card type : Qualcomm Camera Subsystem
Bus info : platform:a34000.camss
Driver version : 4.14.69
Capabilities : 0x85201000
Video Capture Multiplanar
Read/Write
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x05201000
Video Capture Multiplanar
Read/Write
Streaming
Extended Pix Format
Media Driver Info:
Driver name : qcom-camss
Model : Qualcomm Camera Subsystem
Serial :
Bus info :
Media version : 4.14.69
Hardware revision: 0x00000000 (0)
Driver version : 4.14.69
Interface Info:
ID : 0x03000027
Type : V4L Video
Entity Info:
ID : 0x00000025 (37)
Name : msm_vfe0_video0
Function : V4L2 I/O
Pad 0x01000026 : Sink
Link 0x02000029: from remote pad 0x1000024 of entity 'msm_vfe0_rdi0': Data, Enabled, Immutable
Required ioctls:
test MC information (see 'Media Driver Info' above): OK
test VIDIOC_QUERYCAP: OK
Allow for multiple opens:
test second /dev/video0 open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK
Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
test VIDIOC_LOG_STATUS: OK (Not Supported)
Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 1 Audio Inputs: 0 Tuners: 0
Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_ENUMAUDOUT: OK (Not Supported)
test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0
Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
test VIDIOC_G/S_EDID: OK (Not Supported)
Control ioctls (Input 0):
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported)
test VIDIOC_QUERYCTRL: OK (Not Supported)
test VIDIOC_G/S_CTRL: OK (Not Supported)
test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported)
test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
Standard Controls: 0 Private Controls: 0
Format ioctls (Input 0):
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
test VIDIOC_G/S_PARM: OK (Not Supported)
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK
test VIDIOC_TRY_FMT: OK
test VIDIOC_S_FMT: OK
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OK
Codec ioctls (Input 0):
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
test VIDIOC_G_ENC_INDEX: OK (Not Supported)
test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
Buffer ioctls (Input 0):
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
test VIDIOC_EXPBUF: OK
Test input 0:
Streaming ioctls:
test read/write: OK
fail: v4l2-test-buffers.cpp(1245): pid != pid_streamoff
fail: v4l2-test-buffers.cpp(1278): testBlockingDQBuf(node, q)
test blocking wait: FAIL
fail: v4l2-test-buffers.cpp(885): can_stream
test MMAP: FAIL
test USERPTR: OK (Not Supported)
test DMABUF: Cannot test, specify --expbuf-device
Total: 48, Succeeded: 46, Failed: 2, Warnings: 0
I’ve also noticed that driver’s s_stream
operation is never called, which means (from my understanding) that for some reason it never starts streaming. Trying to use something like v4l2-ctl -d 0 --stream-mmap --set-fmt-video=width=4056,height=3040,pixelformat=pBAA --stream-to=frame.raw --stream-count=1
just produces file with zero length (and streaming function still not called).
dmesg log
[ 19.460072] imx412 3-001a: imx412_probe
[ 19.463750] imx412 3-001a: imx412_parse_hw_config
[ 19.463826] imx412 3-001a: imx412_power_on
[ 19.465061] imx412 3-001a: imx412_detect
[ 19.465065] imx412 3-001a: imx412_read_reg
[ 19.466313] imx412 3-001a: imx412_init_controls
[ 19.470104] imx412 3-001a: imx412_power_off
[ 19.541224] imx412 3-001a: imx412_init_pad_cfg
[ 19.541230] imx412 3-001a: imx412_fill_pad_format
[ 19.541232] imx412 3-001a: imx412_set_pad_format
[ 19.541234] imx412 3-001a: imx412_fill_pad_format
I’m not sure where to start, is my device tree flawed or does the driver fail to implement some functionality? I’ve also tried to put the same structure (contained in i2c@075ba000
) inside cci@a0c000
block but it made no difference. Is it even theoretically possible to make this camera work?