Basler MIPI CSI not detecting

Hello,

I am trying to get a Basler Dart daA3840 CSI Camera connected and working with the MIPI CSI port on the iMX8 M Plus SOM. I have built the imx-image-full in yocto using Gatesgarth successfully. At runtime I am receiving some errors coming after loading the basler_camera_driver_vvcam kernel module

[    7.406198] i2c_transfer() failed: -6
[    7.409890] basler_read_register_chunk() failed: -6
[    7.414791] basler_read_register() failed: -6

When I try to run one of the simple examples with pypylon The code is unable to detect any camera instances. Here is a snippet of what I am running. Nothing is printed in the output.

from pypylon import pylon


tl_factory = pylon.TlFactory.GetInstance()
devices = tl_factory.EnumerateDevices()
for device in devices:
    print(device.GetFriendlyName())

I have also attempted to access the camera through OpenCV and I am receiving the following dimes prints

[  881.648266] cma: cma_alloc: alloc failed, req-size: 4050 pages, ret: -12
[  881.658522] cma: cma_alloc: alloc failed, req-size: 4050 pages, ret: -12
[  882.854179] enter viv_isp_exit_module
[  882.857897] enter isp_hw_remove
[  882.890438] enter viv_dwe_exit_module
[  882.894151] enter dwe_hw_remove
[  882.897522] vvcam dewarp driver removed
[  882.939871] : Unregistered all entities
[  883.047189] i2c_transfer() failed: -6
[  883.050881] basler_read_register_chunk() failed: -6
[  883.055869] basler_read_register() failed: -6
[  883.096649] imx8_media_dev: module is from the staging directory, the quality is unknown, you have been warned.
[  883.156339] enter viv_dwe_init_module
[  883.160318] enter dwe_hw_probe
[  883.163846] vvcam dewarp driver probed
[  883.206355] enter viv_isp_init_module
[  883.210412] enter isp_hw_probe
[  883.219844] cma: cma_alloc: alloc failed, req-size: 4050 pages, ret: -12
[  883.230151] cma: cma_alloc: alloc failed, req-size: 4050 pages, ret: -12
[  883.240740] vvcam isp driver registered
[  886.776558] cma: cma_alloc: alloc failed, req-size: 4050 pages, ret: -12
[  886.792166] cma: cma_alloc: alloc failed, req-size: 4050 pages, ret: -12
[  886.807685] cma: cma_alloc: alloc failed, req-size: 4050 pages, ret: -12
[  886.823155] cma: cma_alloc: alloc failed, req-size: 4050 pages, ret: -12
[  886.838825] unsupported dwe command 259
[  886.838833] unsupported dwe command 260

That BSP contained a bug in the Basler device connected to the MIPI CSI port used on the SOM. I believe that is fixed in the most recent BSP. I will post a link to a test image. Sorry about the confusion.

1 Like

Sounds great. If you could also provide a link to the fix I can patch it in. Thanks!

Checking in to see if you have discovered a pending fix in the BSP. I saw some commits regarding the MIPI clock speed in the 5.4.x 2.3.0 BSP but no references to the 5.10 branch.

Hello,

I still have an issue with Basler Dart daA3840 CSI Camera with the latest image.
Where I can find a fixed image?

This has been fixed in our latest Yocto BSP that will be released this week. The initial kernel code has been posted here, GitHub - SolidRun/linux-stable at lf-5.10.72-2.2.0-sr. I am still working on fine tuning the memory allocations for the 1GB SOM variants.

Thank you

Can you share tunning memory results for 1GB memory?
I guess you are talking about VVCAM, ISP_REG_BASE and ISP_REG_BASE in version.h?

Those settings are all specific to the device and won’t change. I am mostly working to tweak the Linux kernel settings for CMA memory allocation that are used for allocating large contiguous buffers that are used primarily by the multimedia subsystems.

My 1GB Module perfectly works with the camera. It seems the configuration was done correctly. Can you point me to the source tree with these settings?
Thank you

This is done in the device-tree file for the board. You can see the memory node that is dedicated to cma.

Hi,

I’m trying to bring-up the Basler Dart daA3840 CSI camera with iMx8 MP solidrun board. (https://wiki.analog.com/_media/resources/eval/user-guides/eval-adtf3175-nxz/som_carrier-datasheet.pdf)

The camera has been probed successfully but I’m not able to capture the frames. Also v4l2-ctl command line tool gives error and not able to detect the frame format.

Here is the dump of dmesg when camera driver is probed:

[Feb 9 11:14] : Unregistered all entities
[ +0.061861] basler_camera_driver_vvcam: loading out-of-tree module taints kernel.
[ +0.059659] ABRM FamilyName not supported
[ +0.033668] ABRM: Manufacturer: Basler, Model: daA3840-30mc, Device: 108220-05, Serial: basler:40097239
[ +0.026257] imx8_media_dev: module is from the staging directory, the quality is unknown, you have been warned.
[ +0.001677] mx8-img-md: Registered mxc_isi.0.capture as /dev/video0
[ +0.000129] mx8-img-md: Registered sensor subdevice: basler-camera-vvcam 3-0036 (1)
[ +0.000006] mx8-img-md: Registered sensor subdevice: adsd3500 1-0038 (2)
[ +0.000007] mx8-img-md: created link [mxc_isi.0] => [mxc_isi.0.capture]
[ +0.000005] mx8-img-md: created link [mxc-mipi-csi2.0] => [mxc_isi.0]
[ +0.000007] mx8-img-md: created link [adsd3500 1-0038] => [mxc-mipi-csi2.0]
[ +0.000004] mx8-img-md: created link [basler-camera-vvcam 3-0036] => [mxc-mipi-csi2.1]
[ +0.000005] mxc-md 32c00000.bus:camera: mxc_md_create_links
[ +0.050899] enter viv_video_init_module
[ +0.046688] enter viv_dwe_init_module
[ +0.000435] enter dwe_hw_probe
[ +0.000546] vvcam dewarp driver probed
[ +0.083172] enter viv_isp_init_module
[ +0.000476] enter isp_hw_probe
[ +0.000795] vvcam isp driver registered
[ +0.000530] enter isp_hw_probe
[ +0.000401] vvcam isp driver registered
[ +0.015007] enter isp_mi_stop
[ +0.008057] enter isp_mi_stop

Here is the dump of v4l2-ctl output:

analog@aditof:~$ v4l2-ctl --all -d /dev/video1
Driver Info:
Driver name : viv_v4l2_device
Card type : VIV
Bus info : platform:viv0
Driver version : 5.10.72
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : vvcam-video
Model : viv_media
Serial :
Bus info :
Media version : 5.10.72
Hardware revision: 0x00000000 (0)
Driver version : 5.10.72
Interface Info:
ID : 0x03000003
Type : V4L Video
Entity Info:
ID : 0x00000001 (1)
Name : viv_v4l20
Function : V4L2 I/O
Pad 0x01000002 : 0: Sink, Must Connect
Link 0x02000011: from remote pad 0x1000010 of entity ‘vvcam-isp.0’: Data, Enabled
Priority: 2
Video input : 0 (camera: ok)
Format Video Capture:
Width/Height : 0/0
Pixel Format : ‘’
Field : None
Bytes per Line : 0
Size Image : 0
Colorspace : Rec. 709
Transfer Function : Default (maps to Rec. 709)
YCbCr/HSV Encoding: Default (maps to Rec. 709)
Quantization : Default (maps to Full Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 0, Height 0
Default : Left 0, Top 0, Width 0, Height 0
Pixel Aspect: 1/1
Selection Video Capture: crop, Left 0, Top 0, Width 0, Height 0, Flags:
Selection Video Capture: crop_default, Left 0, Top 0, Width 0, Height 0, Flags:
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 0, Height 0, Flags:
Selection Video Capture: compose, Left 0, Top 0, Width 0, Height 0, Flags:
Selection Video Capture: compose_default, Left 0, Top 0, Width 3840, Height 2160, Flags:
Selection Video Capture: compose_bounds, Left 0, Top 0, Width 3840, Height 2160, Flags:
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: invalid (0/1)
Read buffers : 0

User Controls

               viv_ext_ctrl 0x0098f901 (str)    : min=0 max=65535 step=1 value='' flags=has-payload

error 22 getting ctrl sensor.resw
error 22 getting ctrl sensor.resh

Am I missing something here?
Any leads would be appriciated.

Which mipi CSI connector do you have the camera connected to? Also please include the output for media-ctl -p

The camera is connected on csi1 interface.

analog@aditof:~/isp-vvcam$ v4l2-ctl --list-devices
():
/dev/v4l-subdev0
/dev/v4l-subdev4
/dev/v4l-subdev5

():
/dev/v4l-subdev1
/dev/v4l-subdev6
/dev/v4l-subdev7

(csi1):
** /dev/v4l-subdev2**

mxc-isi-cap (platform:32e00000.isi:cap_devic):
/dev/video0

FSL Capture Media Device (platform:mxc-md):
/dev/media0

VIV (platform:viv0):
/dev/video1

VIV (platform:viv1):
/dev/video2

viv_media (platform:vvcam-video):
** /dev/media1**

Here’s the required dump of media-ctl -p


analog@aditof:~/$ media-ctl -p
Media controller API version 5.10.72

Media device information
------------------------
driver          mxc-md
model           FSL Capture Media Device
serial          
bus info        
hw revision     0x0
driver version  5.10.72

Device topology
- entity 1: mxc_isi.0 (16 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
	pad0: Sink
		<- "mxc-mipi-csi2.0":4 [ENABLED]
	pad1: Sink
	pad2: Sink
	pad3: Sink
	pad4: Sink
	pad5: Sink
	pad6: Sink
	pad7: Sink
	pad8: Sink
	pad9: Sink
	pad10: Sink
	pad11: Sink
	pad12: Source
		-> "mxc_isi.0.capture":0 [ENABLED]
	pad13: Source
	pad14: Source
	pad15: Sink

- entity 18: mxc_isi.0.capture (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video0
	pad0: Sink
		<- "mxc_isi.0":12 [ENABLED]

- entity 22: mxc-mipi-csi2.0 (8 pads, 2 links)
             type Node subtype V4L flags 0
             device node name /dev/v4l-subdev0
	pad0: Sink
		<- "adsd3500 1-0038":0 [ENABLED,IMMUTABLE]
	pad1: Sink
	pad2: Sink
	pad3: Sink
	pad4: Source
		-> "mxc_isi.0":0 [ENABLED]
	pad5: Source
	pad6: Source
	pad7: Source

- entity 31: mxc-mipi-csi2.1 (8 pads, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/v4l-subdev1
	pad0: Sink
		<- "basler-camera-vvcam 3-0036":0 [ENABLED,IMMUTABLE]
	pad1: Sink
	pad2: Sink
	pad3: Sink
	pad4: Source
	pad5: Source
	pad6: Source
	pad7: Source

- entity 40: basler-camera-vvcam 3-0036 (1 pad, 1 link)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev2
	pad0: Source
		-> "mxc-mipi-csi2.1":0 [ENABLED,IMMUTABLE]

- entity 42: adsd3500 1-0038 (1 pad, 1 link)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev3
	pad0: Source
		[fmt:SBGGR8_1X8/512x512@1/10 field:none colorspace:raw
		 crop:(0,0)/512x512]
		-> "mxc-mipi-csi2.0":0 [ENABLED,IMMUTABLE]

Let me know if you need any additional information.