This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM62A7: cannot capture images from a probe csi sensor

Part Number: AM62A7

Tool/software:

I connected my CSI camera to my board and the sensor has successfully probed, but I'm not able to capture images from the camera.

When I execute the following command:

media-ctl -p -d /dev/media0Code

Media controller API version 6.1.80[ 6521.709172] max 96712 get format


Media device information
------------------------
driver          j721e-csi2rx
model           TI-CSI2RX
serial          
bus info        platform:30102000.ticsi2rx
hw revision     0x1
driver version  6.1.80

Device topology
- entity 1: 30102000.ticsi2rx (7 pads, 7 links, 1 route)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
        routes:
                0/0 -> 1/0 [ACTIVE]
        pad0: Sink
                [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
                <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
        pad1: Source
                [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
                -> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE]
        pad2: Source
                -> "30102000.ticsi2rx context 1":0 [ENABLED,IMMUTABLE]
        pad3: Source
                -> "30102000.ticsi2rx context 2":0 [ENABLED,IMMUTABLE]
        pad4: Source
                -> "30102000.ticsi2rx context 3":0 [ENABLED,IMMUTABLE]
        pad5: Source
                -> "30102000.ticsi2rx context 4":0 [ENABLED,IMMUTABLE]
        pad6: Source
                -> "30102000.ticsi2rx context 5":0 [ENABLED,IMMUTABLE]

- entity 9: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 1 route)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev1
        routes:
                0/0 -> 1/0 [ACTIVE]
        pad0: Sink
                [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
                <- "max96712 2-006b":0 [ENABLED,IMMUTABLE]
        pad1: Source
                [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
                -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
        pad2: Source
        pad3: Source
        pad4: Source

- entity 15: max96712 2-006b (1 pad, 1 link, 0 route)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev2
        pad0: Source
                [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
                -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]

- entity 21: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
             type Node subtype V4L flags 0
             device node name /dev/video3
        pad0: Sink
                <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]

- entity 27: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
             type Node subtype V4L flags 0
             device node name /dev/video4
        pad0: Sink
                <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]

- entity 33: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
             type Node subtype V4L flags 0
             device node name /dev/video5
        pad0: Sink
                <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]

- entity 39: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
             type Node subtype V4L flags 0
             device node name /dev/video6
        pad0: Sink
                <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]

- entity 45: 30102000.ticsi2rx context 4 (1 pad, 1 link, 0 route)
             type Node subtype V4L flags 0
             device node name /dev/video7
        pad0: Sink
                <- "30102000.ticsi2rx":5 [ENABLED,IMMUTABLE]

- entity 51: 30102000.ticsi2rx context 5 (1 pad, 1 link, 0 route)
             type Node subtype V4L flags 0
             device node name /dev/video8
        pad0: Sink
                <- "30102000.ticsi2rx":6 [ENABLED,IMMUTABLE]

It seems that the entire v4l2 link is complete.

However,when i use v4l2-ctl to capture images,it failed.

v4l2-ctl -d /dev/video3 --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --stream-mmap=3 --stream-skip=3 --stream-to=/tmp/nv12.bin --stream-count=1 --stream-poll

I use the command:yavta -c -Fcapture -s 1920x1080 -f UYVY /dev/video3, it also not work.

More Information:

My Question is: Why i cannot capture images?

My SDK is : ti-processor-sdk-linux-edgeai-am62axx-evm-09_02_00_05

  • By the way, i use the same method to revise max96712.ko and k3-am62a3-sk.dts for the ti-processor-sdk-linux-edgeai-am62axx-evm-09_00_01_03 SDK. it works well.

    Here is the modification point of DTS.

    ...

  • Hello,

    Here is the modification point of DTS.

    Were you trying to share some code? I don't see any.

    It seems that the entire v4l2 link is complete.

    Yes, the media pipe looks good. Just in case, can you compare the log of "media-ctl -p" between 9.0 and 9.2 and see if there is any difference?

    Regards,

    Jianzhong

  • Hello,

    The modification points for k3-am62a7-sk  are as follows:

    &main_i2c2 {
    	status = "okay";
    	pinctrl-names = "default";
    	pinctrl-0 = <&main_i2c2_pins_default>;
    	clock-frequency = <400000>;
    
    	imx96712: camera@6b {
    		compatible = "maxim,max96712";
    		reg = <0x6b>;
    		//enable-gpios = <&pca9654_a 0 GPIO_ACTIVE_HIGH>;
    
    		max96712_ports: ports {
    				#address-cells = <1>;
    				#size-cells = <0>;
    
    				port@4 {
    					reg = <4>;
    					max96712_out0: endpoint {
    							data-lanes = <1 2 3 4>;
    							clock-lanes = <0>;
    							bus-type = <4>; /* CSI2 DPHY. */
    							link-frequencies = /bits/ 64 <800000000>;
    							remote-endpoint = <&csi2rx0_in_sensor>;
    					};
    				};
    		};
    	};
    };
    
    &cdns_csi2rx0 {
    	ports {
    		port@0 {
    			status = "okay";
    
    			csi2rx0_in_sensor: endpoint {
    				remote-endpoint = <&max96712_out0>;
    				clock-lanes = <0>;
    				data-lanes = <1 2 3 4>;
    				link-frequencies = /bits/ 64 <800000000>;
    			};
    		};
    	};	
    };

    Today,I compare the log of "media-ctl -p" between 9.0 and 9.2 and find that they are consistent.

    here is 9.0 log

    root@am62axx-evm:/opt/edgeai-gst-apps# media-ctl -p
    Media controller API version 6.1.46[   49.399966] max 96712 get format
    
    
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial          
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  6.1.46
    
    Device topology
    - entity 1: 30102000.ticsi2rx (7 pads, 7 links, 1 route)
                type V4L2 subdev subtype Unknown flags 0
                device node name /dev/v4l-subdev0
            routes:
                    0/0 -> 1/0 [ACTIVE]
            pad0: Sink
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
                    <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
                    -> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE]
            pad2: Source
                    -> "30102000.ticsi2rx context 1":0 [ENABLED,IMMUTABLE]
            pad3: Source
                    -> "30102000.ticsi2rx context 2":0 [ENABLED,IMMUTABLE]
            pad4: Source
                    -> "30102000.ticsi2rx context 3":0 [ENABLED,IMMUTABLE]
            pad5: Source
                    -> "30102000.ticsi2rx context 4":0 [ENABLED,IMMUTABLE]
            pad6: Source
                    -> "30102000.ticsi2rx context 5":0 [ENABLED,IMMUTABLE]
    
    - entity 9: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 1 route)
                type V4L2 subdev subtype Unknown flags 0
                device node name /dev/v4l-subdev1
            routes:
                    0/0 -> 1/0 [ACTIVE]
            pad0: Sink
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
                    <- "max96712 2-006b":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
                    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
            pad2: Source
            pad3: Source
            pad4: Source
    
    - entity 15: max96712 2-006b (1 pad, 1 link, 0 route)
                 type V4L2 subdev subtype Unknown flags 0
                 device node name /dev/v4l-subdev2
            pad0: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
                    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    
    - entity 21: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video3
            pad0: Sink
                    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 27: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video4
            pad0: Sink
                    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 33: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video5
            pad0: Sink
                    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 39: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video6
            pad0: Sink
                    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    - entity 45: 30102000.ticsi2rx context 4 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video7
            pad0: Sink
                    <- "30102000.ticsi2rx":5 [ENABLED,IMMUTABLE]
    
    - entity 51: 30102000.ticsi2rx context 5 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video8
            pad0: Sink
                    <- "30102000.ticsi2rx":6 [ENABLED,IMMUTABLE]				

    here is 9.2 log

    Media controller API version 6.1.80
    
    [   95.267614] max 96712 get format
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial          
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  6.1.80
    
    Device topology
    - entity 1: 30102000.ticsi2rx (7 pads, 7 links, 1 route)
                type V4L2 subdev subtype Unknown flags 0
                device node name /dev/v4l-subdev0
            routes:
                    0/0 -> 1/0 [ACTIVE]
            pad0: Sink
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
                    <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
                    -> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE]
            pad2: Source
                    -> "30102000.ticsi2rx context 1":0 [ENABLED,IMMUTABLE]
            pad3: Source
                    -> "30102000.ticsi2rx context 2":0 [ENABLED,IMMUTABLE]
            pad4: Source
                    -> "30102000.ticsi2rx context 3":0 [ENABLED,IMMUTABLE]
            pad5: Source
                    -> "30102000.ticsi2rx context 4":0 [ENABLED,IMMUTABLE]
            pad6: Source
                    -> "30102000.ticsi2rx context 5":0 [ENABLED,IMMUTABLE]
    
    - entity 9: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 1 route)
                type V4L2 subdev subtype Unknown flags 0
                device node name /dev/v4l-subdev1
            routes:
                    0/0 -> 1/0 [ACTIVE]
            pad0: Sink
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
                    <- "max96712 2-006b":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
                    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
            pad2: Source
            pad3: Source
            pad4: Source
    
    - entity 15: max96712 2-006b (1 pad, 1 link, 0 route)
                 type V4L2 subdev subtype Unknown flags 0
                 device node name /dev/v4l-subdev2
            pad0: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
                    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    
    - entity 21: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video3
            pad0: Sink
                    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 27: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video4
            pad0: Sink
                    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 33: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video5
            pad0: Sink
                    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 39: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video6
            pad0: Sink
                    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    - entity 45: 30102000.ticsi2rx context 4 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video7
            pad0: Sink
                    <- "30102000.ticsi2rx":5 [ENABLED,IMMUTABLE]
    
    - entity 51: 30102000.ticsi2rx context 5 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video8
            pad0: Sink
                    <- "30102000.ticsi2rx":6 [ENABLED,IMMUTABLE]

    actually, i write a demo based v4l2 framework to capture images, the program is blocked at xioctl(fd, VIDIOC_DQBUF, &buf);

    it means there are no valid video stream data arriving to /dev/video3?

    Here is demo:

    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <fcntl.h>
    #include <unistd.h>
    #include <sys/ioctl.h>
    #include <sys/mman.h>
    #include <linux/videodev2.h>
    #include <errno.h>
    #include <linux/v4l2-subdev.h>
    
    #define VIDEO_DEVICE "/dev/video3"
    #define VIDEO_WIDTH 1920
    #define VIDEO_HEIGHT 1080
    #define BUFFER_COUNT 4
    
    #define SUBDEV_J271			"/dev/v4l-subdev0"
    #define SUBDEV_BRIDGE		"/dev/v4l-subdev1"
    #define SUBDEV_max96712		"/dev/v4l-subdev2"
    
    struct buffer {
        void *start;
        size_t length;
    };
    
    static void errno_exit(const char *s) {
        fprintf(stderr, "%s error %d, %s\n", s, errno, strerror(errno));
        exit(EXIT_FAILURE);
    }
    
    static int xioctl(int fd, int request, void *arg) {
        int r = -10;
        do {
            r = ioctl(fd, request, arg);
        } while (r == -1 && errno == EINTR);
    	printf("r: %d, errno: %d \n", r, errno);
        return r;
    }
    
    int get_subdev_fmt(const char* name)
    {
    	int fd = open(name, O_RDWR | O_NONBLOCK);
    	if(fd < 0)
    	{
    		printf("open[%s] errno[%d]\n", name, errno);
    		return -1;
    	}
    	printf("fd[%d]\n", fd);
    
    	struct v4l2_subdev_format format;
    	memset(&format, 0, sizeof(format));
    	format.pad = 0;
    	format.which = V4L2_SUBDEV_FORMAT_ACTIVE;
    	if (xioctl(fd, VIDIOC_SUBDEV_G_FMT, &format) == -1) {
            perror("Failed to get_subdev_fmt");
    		close(fd);
            return EXIT_FAILURE;
        }
    
    	printf("name[%s] code[%d] width[%d] height[%d]\n", name, format.format.code, format.format.width, format.format.height);
    	close(fd);
    	return 0;
    }
    
    int set_subdev_fmt(const char* name, struct v4l2_subdev_format* format)
    {
    	int fd = open(name, O_RDWR | O_NONBLOCK);
    	if(fd < 0)
    	{
    		printf("open[%s] errno[%d]\n", name, errno);
    		return -1;
    	}
    	printf("fd[%d]\n", fd);
    
    	if (xioctl(fd, VIDIOC_SUBDEV_S_FMT, format) == -1) {
            perror("Failed to set_subdev_fmt");
    		close(fd);
            return EXIT_FAILURE;
        }
    	
    	close(fd);
    	return 0;
    }
    
    //#define FMT	MEDIA_BUS_FMT_RGB888_1X24
    #define FMT	MEDIA_BUS_FMT_UYVY8_1X16
    
    int main() {
        struct v4l2_capability cap;
        struct v4l2_format fmt;
        struct v4l2_requestbuffers req;
        struct v4l2_buffer buf;
        struct buffer *buffers;
        unsigned int i;
        int fd;
    	int ret;
    
        fd = open(VIDEO_DEVICE, O_RDWR | O_NONBLOCK, 0);
        if (fd == -1) {
            perror("Failed to open video device");
            return EXIT_FAILURE;
        }
    	printf("twl %s fd[%d ] \n", VIDEO_DEVICE, fd);
    
        if (xioctl(fd, VIDIOC_QUERYCAP, &cap) == -1) {
            perror("Failed to query device capabilities");
            return EXIT_FAILURE;
        }
    	printf("twl driver_name[%s ] \n", cap.driver);
    
    
        if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) {
            fprintf(stderr, "Device does not support video capture\n");
            return EXIT_FAILURE;
        }
    	
    	struct v4l2_subdev_format format;
    
    	//cdns_csi2rx
    	memset(&format, 0, sizeof(format));
    	format.which = V4L2_SUBDEV_FORMAT_ACTIVE;
    	format.format.code = FMT;
    	format.format.field  = V4L2_FIELD_NONE;
    	format.format.width = 1920;
    	format.format.height = 1080;
    	format.pad = 0;
    	set_subdev_fmt(SUBDEV_BRIDGE, &format);
    	printf("set cdns fmt end\n");
    
    
    
    	//ticsi2rx
    	memset(&format, 0, sizeof(format));
    	format.which = V4L2_SUBDEV_FORMAT_ACTIVE;
    	format.format.code = FMT;
    	format.format.field  = V4L2_FIELD_NONE;
    	format.format.width = 1920;
    	format.format.height = 1080;
    	format.pad = 0;
    	set_subdev_fmt(SUBDEV_J271, &format);
    	printf("J271 end\n");
    
    
    
    	//video set format
        memset(&fmt, 0, sizeof(fmt));
        fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        fmt.fmt.pix.width = VIDEO_WIDTH;
        fmt.fmt.pix.height = VIDEO_HEIGHT;
        fmt.fmt.pix.pixelformat = FMT;
        fmt.fmt.pix.field = V4L2_FIELD_NONE;
        if (xioctl(fd, VIDIOC_S_FMT, &fmt) == -1) {
            perror("Failed to set pixel format");
            return EXIT_FAILURE;
        }
    
    	//buf
        memset(&req, 0, sizeof(req));
        req.count = BUFFER_COUNT;
        req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        req.memory = V4L2_MEMORY_MMAP;
        if (xioctl(fd, VIDIOC_REQBUFS, &req) == -1) {
            perror("Failed to request buffers");
            return EXIT_FAILURE;
        }
    
        buffers = (struct buffer *)calloc(req.count, sizeof(*buffers));
        if (!buffers) {
            fprintf(stderr, "Out of memory\n");
            return EXIT_FAILURE;
        }
    
        for (i = 0; i < req.count; i++) {
            memset(&buf, 0, sizeof(buf));
            buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
            buf.memory = V4L2_MEMORY_MMAP;
            buf.index = i;
            if (xioctl(fd, VIDIOC_QUERYBUF, &buf) == -1) {
                perror("Failed to query buffer");
                return EXIT_FAILURE;
            }
    
            buffers[i].length = buf.length;
            buffers[i].start = mmap(NULL, buf.length, PROT_READ | PROT_WRITE, MAP_SHARED, fd, buf.m.offset);
            if (buffers[i].start == MAP_FAILED) {
                perror("Failed to mmap buffer");
                return EXIT_FAILURE;
            }
        }
    
        for (i = 0; i < req.count; i++) {
            memset(&buf, 0, sizeof(buf));
            buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
            buf.memory = V4L2_MEMORY_MMAP;
            buf.index = i;
            if (xioctl(fd, VIDIOC_QBUF, &buf) == -1) {
                perror("Failed to queue buffer");
                return EXIT_FAILURE;
            }
        }
    
    	sleep(1);
        enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    
        if (xioctl(fd, VIDIOC_STREAMON, &type) == -1) {
            perror("Failed to start streaming");
            return EXIT_FAILURE;
        }
    	//printf("start tick[%d]\n", );
    
    	while(1)
    	{
    	    if (xioctl(fd, VIDIOC_DQBUF, &buf) == -1) {
    	        printf("Failed to dequeue buffer\n");
    			usleep(50*1000);
    	        continue;
    	    }
    		break;
    	}
    
    	FILE *fp = fopen("/tmp/frame.raw", "wb");
        if (!fp) {
            perror("Failed to open output file");
            return EXIT_FAILURE;
        }
        fwrite(buffers[buf.index].start, buf.bytesused, 1, fp);
        fclose(fp);
    
        if (xioctl(fd, VIDIOC_STREAMOFF, &type) == -1) {
            perror("Failed to stop streaming");
            return EXIT_FAILURE;
        }
    
        for (i = 0; i < req.count; i++) {
            if (munmap(buffers[i].start, buffers[i].length) == -1) {
                perror("Failed to munmap buffer");
                return EXIT_FAILURE;
            }
        }
    	
        free(buffers);
        close(fd);
        return EXIT_SUCCESS;
    }
    
    

    Can you provide some ideas to trace the video stream?I want to  know the reason why it block at VIDIOC_DQBUF.

    Regards,

    twl

  • Hi twl,

    Thanks for the detailed information. Please give me a few days to look into this issue.

    Regards,

    Jianzhong

  • Hi twl,

    I noticed that you set the link frequency to 800MHz:

    link-frequencies = /bits/ 64 <800000000>;

    According to MIPI D-PHY specs, skew calibration is needed for speeds greater than 1.5Gbps (750MHz).

    Can you try a lower link frequency?

    Can you provide some ideas to trace the video stream?I want to  know the reason why it block at VIDIOC_DQBUF.

    Can you try your demo code with a sensor that is supported by the SDK (e.g. IMX219) and debug your code?

    Regards,

    Jianzhong

  • ,Hi,

    i reduce the frequency to 750M Hz, or even 500MHz, it still cannot work.

    Firstly, the driver for max96712 will be automatically loaded when the development board starts, , but since max96712 does not to be connected yet, I need to restart the module through i2cset. When the module starts working, I uninstall the driver(max96712.so) first and then load it back. Will this method of operation have an impact?

  • Will this method of operation have an impact?

    Can you try to uninstall and reinstall max96712 as well as j721e_csi2rx, cdns_csi2rx?

    modprobe -r  j721e_csi2rx, cdns_csi2rx max96712 

    modprobe -a  j721e_csi2rx, cdns_csi2rx max96712 

  • Hi,

    I uninstalled the drivers in the following order:

    rmmod max96712
    rmmod cdns_dphy_rx
    rmmod cdns_csi2rx

    and then i  reinstalled the drivers in the following order:

    insmod /lib/modules/6.1.80-dirty/kernel/drivers/media/platform/cadence/cdns-csi2rx.ko
    insmod /lib/modules/6.1.80-dirty/kernel/drivers/phy/cadence/cdns-dphy-rx.ko
    insmod /lib/modules/6.1.80-dirty/kernel/drivers/staging/media/max96712/max96712.ko

    However, it still cannot work.

    The log:

    root@am62axx-evm:/opt/edgeai-gst-apps# rmmod max96712
    root@am62axx-evm:/opt/edgeai-gst-apps# rmmod cdns_dphy_rx
    root@am62axx-evm:/opt/edgeai-gst-apps# rmmod cdns_csi2rx
    root@am62axx-evm:/opt/edgeai-gst-apps# insmod /lib/modules/6.1.80-dirty/kernel/drivers/media/platform/cadence/cdns-csi2rx.ko
    root@am62axx-evm:/opt/edgeai-gst-apps# insmod /lib/modules/6.1.80-dirty/kernel/drivers/phy/cadence/cdns-dphy-rx.ko
    root@am62axx-evm:/opt/edgeai-gst-apps# [   71.999074] ------------[ cut here ]------------
    [   72.003702] WARNING: CPU: 2 PID: 65 at drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c:524 csi_async_notifier_bound+0x28/0x40 [j721e_csi2rx]
    [   72.016840] Modules linked in: cdns_dphy_rx cdns_csi2rx overlay rpmsg_ctrl xhci_plat_hcd rpmsg_char snd_soc_hdmi_codec dwc3 cfg80211 bluetooth ecdh_generic ecc rfkill snd_soc_simple_card snd_soc_simple_card_utils crct10dif_ce display_connector k3_j72xx_bandgap e5010_jpeg_enc dwc3_am62 rtc_ti_k3 wave5 j721e_csi2rx ti_k3_r5_remoteproc tidss videobuf2_dma_contig v4l2_mem2mem videobuf2_memops drm_dma_helper videobuf2_v4l2 snd_soc_davinci_mcasp ti_k3_dsp_remoteproc v4l2_fwnode virtio_rpmsg_bus videobuf2_common rpmsg_ns snd_soc_ti_udma ti_k3_common v4l2_async sa2ul sii902x videodev snd_soc_ti_edma snd_soc_ti_sdma drm_kms_helper tps6598x syscopyarea typec mc snd_soc_tlv320aic3x_i2c snd_soc_tlv320aic3x optee_rng sysfillrect sysimgblt fb_sys_fops rng_core fuse drm drm_panel_orientation_quirks ipv6 [last unloaded: cdns_csi2rx]
    [   72.089227] CPU: 2 PID: 65 Comm: kworker/u8:2 Tainted: G         C         6.1.80-dirty #2
    [   72.097481] Hardware name: Texas Instruments AM62A7 SK (DT)
    [   72.103043] Workqueue: events_unbound deferred_probe_work_func
    [   72.108884] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    [   72.115836] pc : csi_async_notifier_bound+0x28/0x40 [j721e_csi2rx]
    [   72.122021] lr : v4l2_async_match_notify+0x54/0x1a4 [v4l2_async]
    [   72.128034] sp : ffff80000981ba80
    [   72.131339] x29: ffff80000981ba80 x28: 0000000000000000 x27: 0000000000000000
    [   72.138472] x26: ffff000802144078 x25: ffff0008021441c8 x24: ffff800000dd9000
    [   72.145604] x23: ffff000802144180 x22: ffff000807fc6000 x21: ffff0008081800b8
    [   72.152735] x20: 0000000000000000 x19: ffff000802144078 x18: ffffffffffffffff
    [   72.159867] x17: 7968702e30303030 x16: 313130332d796870 x15: 0000000000000000
    [   72.166998] x14: 0000000000000001 x13: 0000000000000000 x12: 0000000000000000
    [   72.174129] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000000000
    [   72.181259] x8 : 0000000000000000 x7 : 0000000000000000 x6 : 0000000000000001
    [   72.188389] x5 : 0000000008000005 x4 : 0000000000000000 x3 : ffff800000ddd400
    [   72.195520] x2 : ffff000808180080 x1 : ffff000802144078 x0 : ffff000800d06c78
    [   72.202652] Call trace:
    [   72.205092]  csi_async_notifier_bound+0x28/0x40 [j721e_csi2rx]
    [   72.210931]  v4l2_async_register_subdev+0x8c/0x1bc [v4l2_async]
    [   72.216855]  csi2rx_probe+0x3b8/0x590 [cdns_csi2rx]
    [   72.221737]  platform_probe+0x68/0xe0
    [   72.225400]  really_probe+0xbc/0x2dc
    [   72.228973]  __driver_probe_device+0x78/0x114
    [   72.233327]  driver_probe_device+0xd8/0x15c
    [   72.237506]  __device_attach_driver+0xb8/0x134
    [   72.241945]  bus_for_each_drv+0x7c/0xdc
    [   72.245777]  __device_attach+0xac/0x1d0
    [   72.249609]  device_initial_probe+0x14/0x20
    [   72.253789]  bus_probe_device+0x9c/0xa4
    [   72.257622]  deferred_probe_work_func+0x88/0xc0
    [   72.262147]  process_one_work+0x1d0/0x320
    [   72.266158]  worker_thread+0x14c/0x444
    [   72.269904]  kthread+0x10c/0x110
    [   72.273130]  ret_from_fork+0x10/0x20
    [   72.276703] ---[ end trace 0000000000000000 ]---
    [   72.281435] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    
    root@am62axx-evm:/opt/edgeai-gst-apps# insmod /lib/modules/6.1.80-dirty/kernel/drivers/staging/media/max96712/max96712.ko
    [   78.026642] max96712: module is from the staging directory, the quality is unknown, you have been warned.
    [   78.037419] twl aaa probe
    [   78.040100] start probe
    [   78.042643] check id
    [   78.045309] id success
    [   78.207924] max96712 2-006b: Consider updating driver max96712 to match on endpoints
    root@am62axx-evm:/opt/edgeai-gst-apps# 

    When I execute the command:

    modprobe -r  j721e_csi2rx, cdns_csi2rx max96712 

    It says:

    root@am62axx-evm:/opt/edgeai-gst-apps# modprobe -r  j721e_csi2rx, cdns_csi2rx max96712 
    modprobe: FATAL: Module j721e_csi2rx, not found.

    It seems that I don't have this driver j721e_csi2rx.

    But why i can see j721e_csi2rx through “media-ctl -p” As mentioned above?

    Regards,

    twl

  • But why i can see j721e_csi2rx through “media-ctl -p” As mentioned above?

    I'm not sure. What does "lsmod | grep j721e_csi2rx" show right after boot?

  • After boot, j721e_csi2rx driver will be automatically loaded.But When i want to remove this driver.It says:"modprobe: FATAL: Module j721e_csi2rx, not found."

    root@am62axx-evm:/opt/edgeai-gst-apps# modprobe -r  j721e_csi2rx, cdns_csi2rx
    modprobe: FATAL: Module j721e_csi2rx, not found.
    root@am62axx-evm:/opt/edgeai-gst-apps# 
    root@am62axx-evm:/opt/edgeai-gst-apps# lsmod | grep j721e_csi2rx
    j721e_csi2rx           24576  0
    videobuf2_dma_contig    20480  3 j721e_csi2rx,e5010_jpeg_enc,wave5
    videobuf2_v4l2         32768  4 j721e_csi2rx,v4l2_mem2mem,e5010_jpeg_enc,wave5
    videobuf2_common       57344  7 j721e_csi2rx,videobuf2_dma_contig,videobuf2_v4l2,v4l2_mem2mem,e5010_jpeg_enc,wave5,videobuf2_memops
    v4l2_async             24576  3 v4l2_fwnode,j721e_csi2rx,cdns_csi2rx
    videodev              245760  8 v4l2_async,j721e_csi2rx,videobuf2_v4l2,cdns_csi2rx,videobuf2_common,v4l2_mem2mem,e5010_jpeg_enc,wave5
    mc                     57344  7 v4l2_async,videodev,j721e_csi2rx,videobuf2_v4l2,cdns_csi2rx,videobuf2_common,v4l2_mem2mem

  • I'm not sure why it failed to remove j721e_csi2rx. Did you make any changes to the SDK?

    Firstly, the driver for max96712 will be automatically loaded when the development board starts, , but since max96712 does not to be connected yet, I need to restart the module through i2cset. When the module starts working, I uninstall the driver(max96712.so) first and then load it back. Will this method of operation have an impact?

    The max96712 is a deserializer, right? Do you have cameras connected to it? I guess you can not connect max96712 before booting the AM62A board. Is that right? I have tried similar operation before, and it worked fine.

  • I can remove j721e_csi2rx by "rmmod j721e_csi2rx".

    Can you elaborate on the sequence of operations?

  • I used DS90UB960 deserializer in my case. The following works fine for me:

    1. power up the AM62A board and boot to Linux

    2. power up the deserializer board

    3. remove and reload modules:

    modprobe -r j721e_csi2rx ds90ub960 cdns_csi2rx

    modprobe -a j721e_csi2rx ds90ub960 cdns_csi2rx

    On the other hand, if the deserializer board is powered up before AM62A, then #3 above is not needed.