SK-TDA4VM: How to change camera resolution

Part Number: SK-TDA4VM

Tool/software:

Hi, camera expert:

  I have brought up a 1920x1080 camera.

  Next , I try a 3840x2160 camera. The only difference between the two camera is the resolution. I can get frame from 3840x2160 camera. But the picture is abnormal.I have checked everywhere including "media-ctl -p",  al the settings had been changed to 3840x2160. 

  What should I check next?  The picture is as the following:

From the picture, the first line and the fifth line is similar, as if the resolution is still remain in 1920x1080

  • Hi, 

    Could you please let me know the command used to stream the camera? 

    Can you also share the logs for media-ctl -p?

    Regards,

    Nikhil

  • Could you please let me know the command used to stream the camera? 

    ffmpeg -f video4linux2 -pix_fmt uyvy422 -i /dev/video3 -vframes 1 image.jpg

    Can you also share the logs for media-ctl -p?

    root@tda4vm-sk:/opt/edgeai-gst-apps# media-ctl -p
    Media controller API version 6.1.80
    
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial
    bus info        platform:4500000.ticsi2rx
    hw revision     0x1
    driver version  6.1.80
    
    Device topology
    - entity 1: 4500000.ticsi2rx (17 pads, 17 links, 1 route)
                type V4L2 subdev subtype Unknown flags 0
                device node name /dev/v4l-subdev0
            routes:
                    0/0 -> 2/0 [ACTIVE]
            pad0: Sink
                    [stream:0 fmt:UYVY8_2X8/3840x2160 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    <- "cdns_csi2rx.4504000.csi-bridge":1 [ENABLED,IMMUTABLE]
            pad1: Source
                    -> "4500000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE]
            pad2: Source
                    [stream:0 fmt:UYVY8_2X8/3840x2160 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    -> "4500000.ticsi2rx context 1":0 [ENABLED,IMMUTABLE]
            pad3: Source
                    -> "4500000.ticsi2rx context 2":0 [ENABLED,IMMUTABLE]
            pad4: Source
                    -> "4500000.ticsi2rx context 3":0 [ENABLED,IMMUTABLE]
            pad5: Source
                    -> "4500000.ticsi2rx context 4":0 [ENABLED,IMMUTABLE]
            pad6: Source
                    -> "4500000.ticsi2rx context 5":0 [ENABLED,IMMUTABLE]
            pad7: Source
                    -> "4500000.ticsi2rx context 6":0 [ENABLED,IMMUTABLE]
            pad8: Source
                    -> "4500000.ticsi2rx context 7":0 [ENABLED,IMMUTABLE]
            pad9: Source
                    -> "4500000.ticsi2rx context 8":0 [ENABLED,IMMUTABLE]
            pad10: Source
                    -> "4500000.ticsi2rx context 9":0 [ENABLED,IMMUTABLE]
            pad11: Source
                    -> "4500000.ticsi2rx context 10":0 [ENABLED,IMMUTABLE]
            pad12: Source
                    -> "4500000.ticsi2rx context 11":0 [ENABLED,IMMUTABLE]
            pad13: Source
                    -> "4500000.ticsi2rx context 12":0 [ENABLED,IMMUTABLE]
            pad14: Source
                    -> "4500000.ticsi2rx context 13":0 [ENABLED,IMMUTABLE]
            pad15: Source
                    -> "4500000.ticsi2rx context 14":0 [ENABLED,IMMUTABLE]
            pad16: Source
                    -> "4500000.ticsi2rx context 15":0 [ENABLED,IMMUTABLE]
    
    - entity 19: cdns_csi2rx.4504000.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_2X8/3840x2160 field:none]
                    <- "ds90ub960 6-0029":4 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_2X8/3840x2160 field:none]
                    -> "4500000.ticsi2rx":0 [ENABLED,IMMUTABLE]
            pad2: Source
            pad3: Source
            pad4: Source
    
    - entity 25: ds90ub960 6-0029 (6 pads, 2 links, 1 route)
                 type V4L2 subdev subtype Unknown flags 0
                 device node name /dev/v4l-subdev2
            routes:
                    0/0 -> 4/0 [ACTIVE]
            pad0: Sink
                    [stream:0 fmt:UYVY8_2X8/3840x2160 field:none]
                    <- "ds90ub953 6-0040":1 [ENABLED,IMMUTABLE]
            pad1: Sink
            pad2: Sink
            pad3: Sink
            pad4: Source
                    [stream:0 fmt:UYVY8_2X8/3840x2160 field:none]
                    -> "cdns_csi2rx.4504000.csi-bridge":0 [ENABLED,IMMUTABLE]
            pad5: Source
    
    - entity 34: ds90ub953 6-0040 (2 pads, 2 links, 1 route)
                 type V4L2 subdev subtype Unknown flags 0
                 device node name /dev/v4l-subdev3
            routes:
                    0/0 -> 1/0 [ACTIVE]
            pad0: Sink
                    [stream:0 fmt:UYVY8_2X8/3840x2160 field:none]
                    <- "imx390 10-001a":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_2X8/3840x2160 field:none]
                    -> "ds90ub960 6-0029":0 [ENABLED,IMMUTABLE]
    
    - entity 39: imx390 10-001a (1 pad, 1 link, 2 routes)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev4
            routes:
                    0/0 -> 0/0 [ACTIVE]
                    0/0 -> 0/1 [INACTIVE]
            pad0: Source
                    [stream:0 fmt:UYVY8_2X8/3840x2160@1/30 field:none colorspace:smpte170m]
                    -> "ds90ub953 6-0040":0 [ENABLED,IMMUTABLE]
    
    - entity 45: 4500000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video2
            pad0: Sink
                    <- "4500000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 51: 4500000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video3
            pad0: Sink
                    <- "4500000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 57: 4500000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video4
            pad0: Sink
                    <- "4500000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 63: 4500000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video5
            pad0: Sink
                    <- "4500000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    - entity 69: 4500000.ticsi2rx context 4 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video6
            pad0: Sink
                    <- "4500000.ticsi2rx":5 [ENABLED,IMMUTABLE]
    
    - entity 75: 4500000.ticsi2rx context 5 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video7
            pad0: Sink
                    <- "4500000.ticsi2rx":6 [ENABLED,IMMUTABLE]
    
    - entity 81: 4500000.ticsi2rx context 6 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video8
            pad0: Sink
                    <- "4500000.ticsi2rx":7 
    
    - entity 87: 4500000.ticsi2rx context 7 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video9
            pad0: Sink
                    <- "4500000.ticsi2rx":8 [ENABLED,IMMUTABLE]
    
    - entity 93: 4500000.ticsi2rx context 8 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video10
            pad0: Sink
                    <- "4500000.ticsi2rx":9 [ENABLED,IMMUTABLE]
    
    - entity 99: 4500000.ticsi2rx context 9 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video11
            pad0: Sink
                    <- "4500000.ticsi2rx":10 [ENABLED,IMMUTABLE]
    
    - entity 105: 4500000.ticsi2rx context 10 (1 pad, 1 link, 0 route)
                  type Node subtype V4L flags 0
                  device node name /dev/video12
            pad0: Sink
                    <- "4500000.ticsi2rx":11 [ENABLED,IMMUTABLE]
    
    - entity 111: 4500000.ticsi2rx context 11 (1 pad, 1 link, 0 route)
                  type Node subtype V4L flags 0
                  device node name /dev/video13
            pad0: Sink
                    <- "4500000.ticsi2rx":12 [ENABLED,IMMUTABLE]
    
    - entity 117: 4500000.ticsi2rx context 12 (1 pad, 1 link, 0 route)
                  type Node subtype V4L flags 0
                  device node name /dev/video14
            pad0: Sink
                    <- "4500000.ticsi2rx":13 [ENABLED,IMMUTABLE]
    
    - entity 123: 4500000.ticsi2rx context 13 (1 pad, 1 link, 0 route)
                  type Node subtype V4L flags 0
                  device node name /dev/video15
            pad0: Sink
                    <- "4500000.ticsi2rx":14 [ENABLED,IMMUTABLE]
    
    - entity 129: 4500000.ticsi2rx context 14 (1 pad, 1 link, 0 route)
                  type Node subtype V4L flags 0
                  device node name /dev/video16
            pad0: Sink
                    <- "4500000.ticsi2rx":15 [ENABLED,IMMUTABLE]
    
    - entity 135: 4500000.ticsi2rx context 15 (1 pad, 1 link, 0 route)
                  type Node subtype V4L flags 0
                  device node name /dev/video17
            pad0: Sink
                    <- "4500000.ticsi2rx":16 [ENABLED,IMMUTABLE]
    
    



     

  • The image size that I captured is 3840x2160. But the image is distorted. The first line of the image should be closed to the fifth line.

    Is there any other files that related to image resolution?

  • Hi, 

    In the driver, I see that UYVY8_2X8 is not supported in the SDK. Did you add this format in the csirx driver?

    If yes, can you let me know which MIPI CSI2 data type did you correspond to this?

    Regards,

    Nikhil

  • Hi, Nikhil:

    I add this in the file j721e-csi2rx.c

  • The following is camera output. Output format is UYVY

  • Hi, Nikhil:

    What should I do next? The format setting can bring up 1920x1080 camera normally. But when I changed to 3840x2160 based on 1920x1080, I got a distorted picture.

  • Hi,

    Could you try running the same using the below command? 

    v4l2-ctl -d /dev/video2 --set-fmt-video=width=1936,height=1100,pixelformat=RG12 --stream-mmap (please change the size and format) 

    Can you check if you are seeing the same issue with the above command as well. You can save the image using "--stream-to=/tmp/capture.raw --stream-count=60" 

    Regards,

    nikhil

  • Could you try running the same using the below command? 

  • Hi,

    This seems to stream continuously at 30FPS.

    Does the saved image here same as the one you shared before?

    Regards,

    nikhil 

  • Does the saved image here same as the one you shared before?

    Yes,the captured image is the same as the one  shared before.

  • Hi, Nikhil

    The 1920x1080 camera display normally. When I change from 1920x1080 to 3840x2160 camera, 3840x2160 camera image is distorted.

    Data transfered is changed from 1920*1080*16*30  to 3840*2160*16*30.  Is this related to link frequency?

    I have tried 400000000 and 800000000, but it does not work. 

    Please help to analyze the reason further.

    Thanks a lot.

  • Hi Nikhil!

    Sorry for interrupting this thread, but I have got a similar issue. I am trying to use the the edgeai_tiovx_apps with my own imx568 Linux camera driver. When I launch the application I get an image like this:

    As you can see it shows me something from the reality but its quite distorted. It looks like the byte order or something like that is messed up in the buffers.

    In my case if I use v4l2-ctrl the image is perfectly captured. So it seems like the tiovx pipeline messes up something:

    $ v4l2-ctl -d /dev/video-imx568-cam0 --set-fmt-video=width=1236,height=1032,pixelformat=RG12 --stream-mmap --stream-skip=10 --stream-count=1 --stream-to=testStream1236.raw


    My format in this case is:
    IMX568_CAM_FMT="${IMX568_CAM_FMT:-[fmt:SRGGB12_1X12/1236x1032]}"

    To make things more interesting: My camera can also operate on 2472x2064 resolution:
    IMX568_CAM_FMT="${IMX568_CAM_FMT:-[fmt:SRGGB12_1X12/2472x2064]}"

    In this resolution the TIOVX application is working perfectly, just like the v4l2-ctrl. So this problem only occurs with 1236x1032, and only with edgai-apps-stack. The stream is continuous and AEWB seemingly working (stream adapts to the brightness of the room), so I think the problem is not with the DCC files.

    Thank you for your help!

    Zsombor Szalay

  • Hi Zsombar, 

    Please raise a new thread for this. In this thread, the output for 3840x2160 is not coming correctly even with V4l2 command. So I believe your issue is with edgeAI-tiovx-apps. This does not align with this thread.

    Hence please raise a new thread for the same, so that the relevent expertise could be assigned to that thread.

    Thank you for your understanding.

    Regards,

    Nikhil

  • Hi,

    Regarding the original issue in the thread,

    The laneband speed was changed in the dts, but did you also change in the sensor driver? I believe you are reusing imx390 driver right?

    May I know which is the sensor that is streaming 3840x2160? Is it IMX390 itself?

    Regards,

    Nikhil

  • Hi, Nikhil:

    Yes, I have changed camera driver, and the camera I used is OX08B40, not imx390. I changed laneband speed in my driver, and the problem  is resolved.

    Thank you very much.

  • Hi, Nikhil:

        One more question, I have two cameras connected to the deserializer. And the two camera can preview image independently. How can I preview the two cameras concurrently? I add k3-fpdlink-imx390-rcm-0-0.dtbo and k3-fpdlink-imx390-rcm-0-1.dtbo to uEnv.txt, as the followings,  but it does not work:

    name_overlays=k3-j721e-edgeai-apps.dtbo k3-j721e-sk-fusion.dtbo k3-fpdlink-imx390-rcm-0-0.dtbo k3-fpdlink-imx390-rcm-0-1.dtbo

  • Our camera framework is  (OX08B40+ISP) -> maxim9295 -> max96712 -> TDA4

    Our camera  (OX08B40+ISP) has a built-in ISP and do not need to config. We only config maxim9295 and  max96712. For the built-in ISP camera, I modified the imx390.c according to the patch you provided in another thread one year ago.

    May this changed imx390.c lead to two camera error? 

  • Hi,

    Could you elaborate what you mean by preview concurrently? Is it that you want to stream them in parallel? 

    If yes, you can run the v4l2 command with "&" appended at the end of the first script, so that both would run in parallel.

    Or are you using display to view them?

    Regards,

    Nikhil

  • Hi,

    Yes, I want to stream the two in parallel.

    But when I add the following in uEnv.txt:

    name_overlays=k3-j721e-edgeai-apps.dtbo k3-j721e-sk-fusion.dtbo k3-fpdlink-imx390-rcm-0-0.dtbo k3-fpdlink-imx390-rcm-0-1.dtbo

    There areno video device nodes  appear in /dev directory.    And media-ctl -p  result is:

    root@tda4vm-sk:~#
    root@tda4vm-sk:~# media-ctl -p
    Media controller API version 6.1.80
    
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial
    bus info        platform:4500000.ticsi2rx
    hw revision     0x1
    driver version  6.1.80
    
    Device topology
    - entity 1: 4500000.ticsi2rx (17 pads, 0 link, 0 route)
                type V4L2 subdev subtype Unknown flags 0
            pad0: Sink
            pad1: Source
            pad2: Source
            pad3: Source
            pad4: Source
            pad5: Source
            pad6: Source
            pad7: Source
            pad8: Source
            pad9: Source
            pad10: Source
            pad11: Source
            pad12: Source
            pad13: Source
            pad14: Source
            pad15: Source
            pad16: Source
    
    - entity 19: cdns_csi2rx.4504000.csi-bridge (5 pads, 1 link, 0 route)
                 type V4L2 subdev subtype Unknown flags 0
            pad0: Sink
                    <- "ds90ub960 6-0029":4 [ENABLED,IMMUTABLE]
            pad1: Source
            pad2: Source
            pad3: Source
            pad4: Source
    
    - entity 25: ds90ub960 6-0029 (6 pads, 2 links, 0 route)
                 type V4L2 subdev subtype Unknown flags 0
            pad0: Sink
                    <- "ds90ub953 6-0040":1 [ENABLED,IMMUTABLE]
            pad1: Sink
            pad2: Sink
            pad3: Sink
            pad4: Source
                    -> "cdns_csi2rx.4504000.csi-bridge":0 [ENABLED,IMMUTABLE]
            pad5: Source
    
    - entity 34: ds90ub953 6-0040 (2 pads, 2 links, 0 route)
                 type V4L2 subdev subtype Unknown flags 0
            pad0: Sink
                    <- "imx390 10-001a":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    -> "ds90ub960 6-0029":0 [ENABLED,IMMUTABLE]
    
    - entity 39: imx390 10-001a (1 pad, 1 link, 0 route)
                 type V4L2 subdev subtype Sensor flags 0
            pad0: Source
                    -> "ds90ub953 6-0040":0 [ENABLED,IMMUTABLE]
    
    root@tda4vm-sk:~#
    root@tda4vm-sk:~#
    

    root@tda4vm-sk:~#
    root@tda4vm-sk:~# v4l2-ctl --list-devices
    TI-CSI2RX (platform:4500000.ticsi2rx):
            /dev/media0
    
    TI-CSI2RX (platform:4510000.ticsi2rx):
            /dev/media1
    
    vxd-dec (platform:vxd-dec):
            /dev/video0
    
    vxe-enc (platform:vxe-enc):
            /dev/video1
    
    root@tda4vm-sk:~#
    

    What is the reason?

  • Hi,

    What SDK version are you using? Please keep in mind that we currently do not support IMX390 with built-in ISP. Modifications to the driver and dts files would be required. The IMX390 RCM sensor does not have built-in ISP. For more information on what will be required to enable IMX390 with built-in ISP, see the following thread: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1233573/sk-am62a-lp-debug-about-csi2rx

    Thank you,

    Fabiana

  • Hi, 

      I have brought up the built-in ISP camera. When I use two same camera, and k3-fpdlink-imx390-rcm-0-0.dtbo and k3-fpdlink-imx390-rcm-0-1.dtbo to uEnv.txt,  the serializer probe (ub953_probe) is called only once.  I think ub953_probe should be called twice since there are two in device tree.

      Can you help analyze what may cause ub953_probe  is called only once?

  • Hi, 

    I have found the problem.  It is caused by the code I changed. 

    Thanks

  • Glad to hear the issue has been resolved!

    Thanks,

    Fabiana