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.

SK-TDA4VM: /dev/video2 is not created

Part Number: SK-TDA4VM

Tool/software:

I am debugging ds90ub960&ds90ub953 serdes camera:

I add k3-j721e-sk-fusion.dtbo and  k3-fpdlink-imx390-rcm-0-0.dtbo to name_overlays in  uEnv.txt.

But after power-on, there is no newly created video2 node in /dev directory ( /dev/video2 not exist).

Can you help why  /dev/video2 is not created?

Thanks.

  • Hi Chenglei Yang,

    If you run `dmesg | grep imx390` or `lsmod | grep imx390`, does anything appear?

    i.e. Was the imx390 device probed?

    Best,
    Jared

  • Hi,

    I can get /dev/video2  now.

    In media-ctl -p command,  I found:

    - 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:SRGGB12_1X12/1936x1100 field:none]
    <- "ds90ub960 6-0030":4 [ENABLED,IMMUTABLE]
    pad1: Source
    [stream:0 fmt:SRGGB12_1X12/1936x1100 field:none]
    -> "4500000.ticsi2rx":0 [ENABLED,IMMUTABLE]
    pad2: Source
    pad3: Source
    pad4: Source

    - entity 25: ds90ub960 6-0030 (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:SRGGB12_1X12/1936x1100 field:none]
    <- "ds90ub953 6-0044":1 [ENABLED,IMMUTABLE]
    pad1: Sink
    pad2: Sink
    pad3: Sink
    pad4: Source
    [stream:0 fmt:SRGGB12_1X12/1936x1100 field:none]
    -> "cdns_csi2rx.4504000.csi-bridge":0 [ENABLED,IMMUTABLE]
    pad5: Source

    - entity 34: ds90ub953 6-0044 (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:SRGGB12_1X12/1936x1100 field:none]
    <- "imx390 10-001a":0 [ENABLED,IMMUTABLE]
    pad1: Source
    [stream:0 fmt:SRGGB12_1X12/1936x1100 field:none]
    -> "ds90ub960 6-0030":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_1X16/1920x1080@1/30 field:none colorspace:smpte170m]
    -> "ds90ub953 6-0044":0 [ENABLED,IMMUTABLE]

    *********************************************************************************************************

    our camera fmt is UYVY8_1X16.

    How to change ds90ub953&ds90ub960 fmt from SRGGB12_1X12 to UYVY8_1X16  ?????

    I changed the following in ds90ub953.c, but it did not take effect:

    static const struct v4l2_mbus_framefmt format = {
    .width = 1920,
    .height = 1080,
    .code = MEDIA_BUS_FMT_UYVY8_1X16,
    .field = V4L2_FIELD_NONE,
    .colorspace = V4L2_COLORSPACE_SRGB,
    .ycbcr_enc = V4L2_YCBCR_ENC_601,
    .quantization = V4L2_QUANTIZATION_LIM_RANGE,
    .xfer_func = V4L2_XFER_FUNC_SRGB,
    };

  • Hi Chenglei Yang,

    Can execute the following so I can see it as a graph?

    media-ctl --print-topology
    media-ctl --print-dot > graph.dot
    dot -Tpng graph.dot > graph.png

    Additionally, I've received a fusion board and will be running some tests to see if I can replicate your issue.

    Best,
    Jared

  • I set the following:

    media-ctl -V '"4500000.ticsi2rx":0 [fmt:UYVY8_2X8/1920x1080 field: none]'
    media-ctl -V '"cdns_csi2rx.4504000.csi-bridge":0 [fmt:UYVY8_2X8/1920x1080 field: none]'

    media-ctl -V '"ds90ub953 6-0044":0 [fmt:UYVY8_2X8/1920x1080 field: none]'
    media-ctl -V '"ds90ub960 6-0030":0 [fmt:UYVY8_2X8/1920x1080 field: none]'

    But only ds90ub953 can be changed to UYVY8_2X8,   others automatically changed to YUYV8_1X16.

  • Hi Chenglei Yang,

    But only ds90ub953 can be changed to UYVY8_2X8,   others automatically changed to YUYV8_1X16.

    Do you not want them to be set to UYVY8_1X16? I was able to set them to UYVY8_1X16.

    media-ctl -V '"ds90ub953 6-0044":0 [fmt:UYVY8_1X16/1920x1080 field: none]'
    media-ctl -V '"ds90ub960 6-0030":0 [fmt:UYVY8_1X16/1920x1080 field: none]'

    I unfortunately cannot test the complete setup, because my IMX390 driver/sensor outputs SRGGB12_1X12. Additionally, are you using your own custom driver? I assume so, since, the IMX390 driver within the ti-linux-kernel (branch ti-linux-6.1.y) only supports SRGGB12_1X12.

    Best,
    Jared

  • Hi, :

      Our application is:  

    I had refered to the related thread:

     https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1162037/tda4vm-some-errors-when-using-imx390-from-otobrite-on-linux

    So far,  I can change format to "UYVY8_2X8/1920x1080"  by command "media-ctl -V". The reason is that the newest version dos not include the "UYVY8_2X8" option.

    Now, the format is OK, graph relation is OK,too.  But I can not get a frame by command  "yavta -c -Fcapture -s 1920x1080 -f UYVY /dev/video3".

    I still need your help eagerly.

    Do you know how to execute the function "ub960_log_status" in the file ds90ub960.c ? I want to check the status of ds90ub960.

    Since you have a ds90ub960 fusion board already,  can you show me the log of function ub960_log_status?  Especially the reg 0x35(UB960_TR_CSI_STS)?

    Does the reg 0x35 of ds90ub960 indicate the link status of mipi link from 960 to SK-TDA4?

    Thanks.

  • Hi Chenglei Yang,

    The ub960_log_status is tied to the subdev log_status member of v4l2_subdev_core_ops, which is in turn tied to the VIDIOC_LOG_STATUS ioctl. If you call the VIDIOC_LOG_STATUS ioctl, it should execute.

    I do have other questions though. I thought you wanted to set the format to UYVY8_1X16. Is there a reason you are now trying to set it to UYVY8_2X8? Also why are you trying to capture /dev/video3?

    Best,
    Jared

  • Hi,

        Our camera module output is UYVY8_2X8.  The UYVY8_1X16 that I mentioned previously is a mistake.  And I can get UYVY8 frame from /dev/video3  using the command "yavta -c -Fcapture -s 1920x1080 -f UYVY /dev/video3" .  

       Although I can get frame,  I can not preview normally. When I input the command "gst-launch-1.0 v4l2src device="/dev/video3" ! video/x-raw, width=1920, height=1080, format=UYVY ! autovideosink",   the preview image stop and continue, stop for many seconds. Here is the log:

    ___________________________________________________________________________________________________________________

    root@tda4vm-sk:~#
    root@tda4vm-sk:~# gst-launch-1.0 v4l2src device="/dev/video3" ! video/x-raw, width=1920, height=1080, format=UYVY ! autovideosink
    Setting pipeline to PAUSED ...
    libEGL warning: egl: failed to create dri2 screen
    Pipeline is live and does not need PREROLL ...
    Got context from element 'autovideosink0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayWayland\)\ gldisplaywayland0";

    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    Redistribute latency...

    WARNING: from element /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage/GstGLImageSink:sink: A lot of buffers are being dropped.
    Additional debug info:
    ../gstreamer-1.20.7/libs/gst/base/gstbasesink.c(3143): gst_base_sink_is_too_late ():/GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage/GstGLImageSink:sink:There may be a timestamping problem, or this computer is too slow.

    WARNING: from element /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage/GstGLImageSink:sink: A lot of buffers are being dropped.
    Additional debug info:
    ../gstreamer-1.20.7/libs/gst/base/gstbasesink.c(3143): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage/GstGLImageSink:sink:
    There may be a timestamping problem, or this computer is too slow.

    _________________________________________________________________________________________________________________

    Why  many frames are dropped when I use gstream pipeline? 

    (Command "yavta -c -Fcapture -s 1920x1080 -f UYVY /dev/video3" does not cause frames dropped.)

    Do you have other app tools to preview YUV image?

    Thanks

  • Hi Changlei Yang,

    Can you try replacing 'autovideosink' with 'kmssink driver-name=tidss sync=false'?

    Best,
    Jared

  • gst-launch-1.0 v4l2src device="/dev/video3" ! video/x-raw, width=1920, height=1080, format=UYVY ! kmssink driver-name=tidss sync=false

    The commandline above got the following failure:

    root@tda4vm-sk:/opt/edgeai-gst-apps# gst-launch-1.0 v4l2src device="/dev/video3" ! video/x-raw, width=1920, height=1080, format=UYVY ! kmssink driver-name=tidss sync=false
    Setting pipeline to PAUSED ...
    ERROR: from element /GstPipeline:pipeline0/GstKMSSink:kmssink0: Could not get allowed GstCaps of device
    Additional debug info:
    ../gst-plugins-bad-1.20.7/sys/kms/gstkmssink.c(907): gst_kms_sink_start (): /GstPipeline:pipeline0/GstKMSSink:kmssink0:
    driver does not provide mode settings configuration
    ERROR: pipeline doesn't want to preroll.
    ERROR: from element /GstPipeline:pipeline0/GstKMSSink:kmssink0: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.
    Additional debug info:
    ../gstreamer-1.20.7/libs/gst/base/gstbasesink.c(5878): gst_base_sink_change_state (): /GstPipeline:pipeline0/GstKMSSink:kmssink0:
    Failed to start
    ERROR: pipeline doesn't want to preroll.
    Failed to set pipeline to PAUSED.
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@tda4vm-sk:/opt/edgeai-gst-apps#
    root@tda4vm-sk:/opt/edgeai-gst-apps#

  • Hi Changlei Yang,

    Do you have a monitor plugged in? Additionally, is it not connected to /dev/video2?

    Best,
    Jared