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.

J784S4XEVM: IMX662

Part Number: J784S4XEVM
Other Parts Discussed in Thread: TDA4VM, INA228, SK-AM69

Tool/software:

I tried to run gstreamer command for capturing frames using imx662 without tiovxisp and without explicitly mentioning any io_mode in the command but I couldn't get the frames, below is the command I have used

gst-launch-1.0 v4l2src device=/dev/video-imx662-cam0 num-buffers=60 ! video/x-bayer,width=1920,height=1080,framerate=60/1,format=rggb10 ! absolutetimestamps location=/run/media/User-mmcblk0p4/abs_timestamps_60.log ! filesink location=/run/media/User-mmcblk0p4/output.nv12

I get the below error:

ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
Additional debug info:
../gst-plugins-good-1.20.7/sys/v4l2/gstv4l2src.c(777): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Buffer pool activation failed
Execution ended after 0:00:00.281495940
Setting pipeline to NULL ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.


This kind of gstreamer command(without io-mode mentioning and no tiovxisp) works fine with IMX219, what might be the thing that causes the issue in IMX662 ?

  • Hi Sriram,

    The error logs look similar to the ones in this E2E forum post: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1418056/tda4vl-q1-v4l2src0-failed-to-allocate-required-memory?tisearch=e2e-sitesearch&keymatch=v4l2src0%3A%20Failed%20to%20allocate%20required%20memory.#

    I think the missing piece is that the media-ctl command needs to run beforehand to set up the format. For IMX219, there is a setup_cameras.sh script in the default image that runs the commands on boot, which could be why it is working for IMX219: https://github.com/TexasInstruments/edgeai-gst-apps/blob/main/scripts/setup_cameras.sh

    Regards,

    Takuma

  • Hi Takuma Fujiwara,

    The below command works with imx662 on Aquila board,

    gst-launch-1.0 v4l2src device=/dev/video-imx662-cam0 io-mode=dmabuf-import num-buffers=$FRAMES ! video/x-bayer, width=$WIDTH, height=$HEIGHT, framerate=60/1, format=rggb10 ! tiovxisp sink_0::device=/dev/v4l-imx662-subdev0 sensor-name="SENSOR_SONY_IMX662" dcc-isp-file=/opt/imaging/imx662/linear/dcc_viss.bin sink_0::dcc-2a-file=/opt/imaging/imx662/linear/dcc_2a.bin format-msb=9 ! video/x-raw, format=NV12, width=1920, height=1080, framerate=60/1 ! absolutetimestamps location=$LOG_FILE ! filesink location=$FILE

    v4l2-ctl -d /dev/v4l-imx662-subdev0 --set-ctrl exposure_auto=1

    v4l2-ctl -d /dev/v4l-imx662-subdev0 --set-ctrl exposure_time_absolute=16600



    But I want to know why I couldn't capture raw data without explicitly mentioning about the tiovxisp and io_mode in the command with imx662. That command (without tiovxisp & io_mode explicitly mentioned) works with imx219 on tda4vm board. is it due to the difference in handling buffers by the drivers?

  • Hi Sriram,

    But I want to know why I couldn't capture raw data without explicitly mentioning about the tiovxisp and io_mode in the command with imx662. That command (without tiovxisp & io_mode explicitly mentioned) works with imx219 on tda4vm board.

    That I do not know. io_mode will definitely change how the buffers are handled, and using tiovxisp will convert the image format. Technically, it should be possible to capture raw data without tiovxisp.

    Could you share the GStreamer pipeline you used for IMX219 + TDA4VM board so that we can do a comparison with the new non-working pipeline?

    Regards,

    Takuma

  • Hi Takuma Fujiwara

    Thanks for your quicker responses, below is the gstreamer command used to capture frames using imx219 in TDA4VM

    root@tda4vm-sk:~# gst-launch-1.0 v4l2src device=/dev/video-imx219-cam0 num-buffers=10 ! video/x-bayer,format=rggb,width=1920,height=1080,framerate=30/1 ! filesink location=output_bayer_image_3.raw
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    Redistribute latency...
    Got EOS from element "pipeline0".
    Execution ended after 0:00:00.404877865
    Setting pipeline to NULL ...
    Freeing pipeline ...


    the below is for IMX662

    gst-launch-1.0 v4l2src device=/dev/video-imx662-cam0 num-buffers=10 ! video/x-bayer,format=rggb10,width=1920,height=1080,framerate=30/1 ! filesink location=output_bayer_image_3.raw

    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
    Additional debug info:
    ../gst-plugins-good-1.20.7/sys/v4l2/gstv4l2src.c(777): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    Buffer pool activation failed
    Execution ended after 0:00:00.281495940
    Setting pipeline to NULL ...
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.

     

  • Hi Sriram,

    Nothing seems to stand out between the two. Looks almost identical except for the format of rggb vs rggb10. I doubt this is causing issues since you mention that on "Aquila board" a pipeline with rggb10 is functional.

    Although, one thing that I noticed now was the GStreamer pipeline used with the Aquila board uses environment variables for width and height. 

    For the working pipeline using imx662 and Aquila board, could you echo what the $WIDTH and $HEIGHT environment variables are set to? Perhaps there is a mismatch in resolution set by media-ctl and the resolution used by the pipeline?

    Regards,

    Takuma

  • FILE="/run/media/User-mmcblk0p4/output.nv12"

    LOG_FILE="/run/media/User-mmcblk0p4/abs_timestamps_60.log"

    WIDTH=1920

    HEIGHT=1080

    FRAMES=60

     

    # === Setting up tiovx modules and gstreamer plugins for imx662 Camera ===  #This is a intermediate fix

    /opt/edgeai-gst-apps/scripts/install_gst_plugins.sh

    /opt/edgeai-gst-apps/scripts/install_tiovx_modules.sh

     

    # === Run GStreamer pipeline ===

    echo "Running GStreamer pipeline to collect $FRAMES frames..."

     

    gst-launch-1.0 v4l2src device=/dev/video-imx662-cam0 io-mode=dmabuf-import num-buffers=$FRAMES ! video/x-bayer, width=$WIDTH, height=$HEIGHT, framerate=60/1, format=rggb10 ! tiovxisp sink_0::device=/dev/v4l-imx662-subdev0 sensor-name="SENSOR_SONY_IMX662" dcc-isp-file=/opt/imaging/imx662/linear/dcc_viss.bin sink_0::dcc-2a-file=/opt/imaging/imx662/linear/dcc_2a.bin format-msb=9 ! video/x-raw, format=NV12, width=1920, height=1080, framerate=60/1 ! absolutetimestamps location=$LOG_FILE ! filesink location=$FILE

    v4l2-ctl -d /dev/v4l-imx662-subdev0 --set-ctrl exposure_auto=1

    v4l2-ctl -d /dev/v4l-imx662-subdev0 --set-ctrl exposure_time_absolute=16600

     

    The above is from the .sh file used to  run the gstreamer command to test IMX662 camera

  • The below is the log and the error I got when I tried to run the gstreamer command without tiovxisp and no mentioning of io_mode


    root@j784s4-evm:/usr/cam_test# gst-launch-1.0 v4l2src device=/dev/video-imx662-cam0 num-buffers=10 ! video/x-bayer,format=rggb,width=1920,height=1080,framerate=30/1 ! filesink location=outpu_imx662_bayer.raw

     

    [ 1339.904818] vdec 4210000.video-codec: VPU wakeup(W5_VPU_REMAP_CORE_START) timeout
    [ 1359.915057] vdec 4210000.video-codec: VPU wakeup(W5_VPU_REMAP_CORE_START) timeout

     

     

     

    [ 1379.923491] vdec 4220000.video-codec: VPU wakeup(W5_VPU_REMAP_CORE_START) timeout
    [ 1399.931728] vdec 4220000.video-codec: VPU wakeup(W5_VPU_REMAP_CORE_START) timeout
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PR[ 1409.954402] ------------[ cut here ]------------
    EROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSyst[ 1409.959065] WARNING: CPU: 1 PID: 1997 at drivers/media/common/videobuf2/videobuf2-core.c:1627 vb2_start_streaming+0xe0/0x15c [videobuf2_common]
    emClock
    [ 1409.977444] Modules linked in: rpmsg_ctrl rpmsg_char overlay bluetooth ecdh_generic ecc cfg80211 rfkill cdns_csi2rx st_magn_spi st_accel_spi j721e_csi2rx wave5 st_sensors_spi imx662 st_accel_i2c st_magn_i2c spidev st_magn st_accel omap_rng videobuf2_dma_contig st_sensors_i2c v4l2_mem2mem videobuf2_memops industrialio_triggered_buffer crct10dif_ce v4l2_fwnode videobuf2_v4l2 kfifo_buf videobuf2_common v4l2_async st_sensors ti_k3_r5_remoteproc lm75 ltc2945 ti_k3_dsp_remoteproc at24 mlx90632 videodev k3_j72xx_bandgap lp87565 ina228 virtio_rpmsg_bus spi_sc18is602 optee_rng mc rpmsg_ns rng_core cdns_dphy_rx ti_k3_common pwm_tiehrpwm sa2ul spi_omap2_mcspi rti_wdt cryptodev(O) fuse drm drm_panel_orientation_quirks ipv6
    [ 1410.041065] CPU: 1 PID: 1997 Comm: v4l2src0:src Tainted: G        W  O       6.1.80 #1
    [ 1410.054950] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    [ 1410.061894] pc : vb2_start_streaming+0xe0/0x15c [videobuf2_common]
    [ 1410.068064] lr : vb2_start_streaming+0x68/0x15c [videobuf2_common]
    [ 1410.074231] sp : ffff80000be6bb60
    [ 1410.077531] x29: ffff80000be6bb60 x28: ffff0008c4a9b100 x27: ffff0008c4a414b8
    [ 1410.084649] x26: 0000000000000000 x25: 0000000040045612 x24: 0000000000000000
    [ 1410.091766] x23: ffff80000be6bcc8 x22: ffff0008c03b1800 x21: ffff0008c4a41438
    root@j784s4-evm:/usr/cam_test# gst-launch-1.0 v4l2src device=/dev/video-imx662-cam0 num-buffers=10 ! video/x-bayer,format=rggb,width=1920,height=1080,framerate=30/1 ! filesink location=output_imx662_bayer.raw
    [ 1439.095966] vdec 4210000.video-codec: VPU wakeup(W5_VPU_REMAP_CORE_START) timeout
    [ 1459.106082] vdec 4210000.video-codec: VPU wakeup(W5_VPU_REMAP_CORE_START) timeout
    [ 1479.114445] vdec 4220000.video-codec: VPU wakeup(W5_VPU_REMAP_CORE_START) timeout
    [ 1499.122738] vdec 4220000.video-codec: VPU wakeup(W5_VPU_REMAP_CORE_START) timeout
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PRER[ 1509.141268] ------------[ cut here ]------------
    [ 1509.149991] WARNING: CPU: 0 PID: 2001 at drivers/media/common/videobuf2/videobuf2-core.c:1627 vb2_start_streaming+0xe0/0x15c [videobuf2_common]
    [ 1509.162851] Modules linked in: rpmsg_ctrl rpmsg_char overlay bluetooth ecdh_generic ecc cfg80211 rfkill cdns_csi2rx st_magn_spi st_accel_spi j721e_csi2rx wave5 st_sensors_spi imx662 st_accel_i2c st_magn_i2c spidev st_magn st_accel omap_rng videobuf2_dma_contig st_sensors_i2c v4l2_mem2mem videobuf2_memops industrialio_triggered_buffer crct10dif_ce v4l2_fwnode videobuf2_v4l2 kfifo_buf videobuf2_common v4l2_async st_sensors ti_k3_r5_remoteproc lm75 ltc2945 ti_k3_dsp_remoteproc at24 mlx90632 videodev k3_j72xx_bandgap lp87565 ina228 virtio_rpmsg_bus spi_sc18is602 optee_rng mc rpmsg_ns rng_core cdns_dphy_rx ti_k3_common pwm_tiehrpwm sa2ul spi_omap2_mcspi rti_wdt cryptodev(O) fuse drm drm_panel_orientation_quirks ipv6
    [ 1509.225784] CPU: 0 PID: 2001 Comm: v4l2src0:src Tainted: G        W  O       6.1.80 #1
    [ 1509.239668] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    [ 1509.246611] pc : vb2_start_streaming+0xe0/0x15c [videobuf2_common]
    [ 1509.252782] lr : vb2_start_streaming+0x68/0x15c [videobuf2_common]
    [ 1509.258951] sp : ffff80000b08bb60
    [ 1509.262251] x29: ffff80000b08bb60 x28: ffff0008c5b6df00 x27: ffff0008c4a414b8
    [ 1509.269369] x26: 0000000000000000 x25: 0000000040045612 x24: 0000000000000000
    [ 1509.276487] x23: ffff80000b08bcc8 x22: ffff0008bf6be700 x21: ffff0008c4a41438
    [ 1509.283605] x20: ffff0008c4a41260 x19: 00000000ffffffea x18: 0000000000000000
    [ 1509.290723] x17: 0000000000000000 x16: 0000000000000000 x15: 000000002354e0e0
    [ 1509.297840] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
    [ 1509.304958] x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000
    [ 1509.312076] x8 : 0000000000000000 x7 : 0000000000000005 x6 : 0000000000000012
    [ 1509.319194] x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff0008bc231dc0
    [ 1509.326311] x2 : 0000000000000000 x1 : ffff800000e13000 x0 : 0000000000000004
    [ 1509.333428] Call trace:
    [ 1509.335861]  vb2_start_streaming+0xe0/0x15c [videobuf2_common]
    [ 1509.341683]  vb2_core_streamon+0x90/0x190 [videobuf2_common]
    [ 1509.347331]  vb2_ioctl_streamon+0x5c/0xb0 [videobuf2_v4l2]
    [ 1509.352807]  v4l_streamon+0x24/0x30 [videodev]
    [ 1509.357262]  __video_do_ioctl+0x18c/0x3dc [videodev]
    [ 1509.362232]  video_us1r01]  do_el0_svc+0x20/0x30
    [ 1509.391403]  el0_svc+0x28/0xa0
    [ 1509.394449]  el0t_64_sync_handler+0xbc/0x140
    [ 1509.398705]  el0t_64_sync+0x18c/0x190
    [ 1509.402354] ---[ end trace 0000000000000000 ]---
    OLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
    Additional debug info:
    ../gst-plugins-good-1.20.7/sys/v4l2/gstv4l2src.c(777): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    Buffer pool activation failed
    Execution ended after 0:00:00.269254265
    Setting pipeline to NULL ...
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
    Additional debug info:
    ../gstreamer-1.20.7/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming stopped, reason not-negotiated (-4)
    Freeing pipeline ...
    root@j784s4-evm:/usr/cam_test#



    Thanks for your responses Takuma

  • Hi Sriram,

    HEIGHT and WIDTH look to be same resolution as working pipeline. So I doubt there is mismatch happening during negotiation due to resolution.

    The latest error logs you have shared are strange and interesting. The error seems to be coming from codec, but I did not think the codec accelerator would be used. I guess internally, using filesink is calling codec code.

    Could you do an experiment where instead of filesink, we use fakesink to see if we can narrow down the issue? Something like the following:

    • gst-launch-1.0 v4l2src device=/dev/video-imx662-cam0 num-buffers=10 ! video/x-bayer,format=rggb,width=1920,height=1080,framerate=30/1 ! fakesink

    Regards,

    Takuma

  • Hi Takuma Fujiwara,

    Sorry for the confusions , I have figured that some cores are not mapped to vision apps and hence those codec issues rose. Here is the log for the above command you gave,

    root@j784s4-evm:~# gst-launch-1.0 v4l2src device=/dev/video-imx662-cam0 num-buffers=10 ! video/xbayer,format=rggb,width=1920,height=1080,framerate=30/1 ! fakesink
    WARNING: erroneous pipeline: could not link v4l2src0 to fakesink0, v4l2src0 can't handle caps video/xbayer, format=(string)rggb, width=(int)1920, height=(int)1080, framerate=(fraction)30/1


    the dmesg log for the above,

    root@j784s4-evm:~# dmesg | tail -5 

    [  244.638227] ctrl_id = 00980913 ctrl_val = 300
    [  244.669266] ctrl_id = 009a0901 ctrl_val = 0
    [  245.066272] ctrl_id = 00980911 ctrl_val = 16600
    [  245.187959] ctrl_id = 00980911 ctrl_val = 8000
    [  246.206822] imx662 2-0042: Auto gain and exposure is enabled 
    root@j784s4-evm:~#


    the log of the command that I tested earlier without tiovxisp and io-mode mentioned explicitly is as below,

    root@j784s4-evm:~# gst-launch-1.0 v4l2src device=/dev/video-imx662-cam0 num-buffers=10 ! video/x-bayer,format=rggb,width=1920,height=1080,framerate=30/1 ! filesink location=outpu_imx662_bayer.raw
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    [  462.146217] imx662 2-0042: Auto gain and exposure is enabled 
    [  462.151969] ctrl_id = 00980911 ctrl_val = 8000
    [  462.181752] imx662 2-0042: Auto gain and exposure is enabled 
    [  462.191920] ctrl_id = 00980913 ctrl_val = 0
    [  462.218021] imx662 2-0042: TI ISP Gain and exposure control disabled 
    [  462.228620] ctrl_id = 009a0902 ctrl_val = 8000
    [  462.258204] ctrl_id = 009e0903 ctrl_val = 1
    ^Chandling interrupt.
    Interrupt: Stopping pipeline ...
    Execution ended after 0:00:06.495854375
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@j784s4-evm:~# dmesg | tail -10
    [  245.066272] ctrl_id = 00980911 ctrl_val = 16600
    [  245.187959] ctrl_id = 00980911 ctrl_val = 8000
    [  246.206822] imx662 2-0042: Auto gain and exposure is enabled 
    [  462.146217] imx662 2-0042: Auto gain and exposure is enabled 
    [  462.151969] ctrl_id = 00980911 ctrl_val = 8000
    [  462.181752] imx662 2-0042: Auto gain and exposure is enabled 
    [  462.191920] ctrl_id = 00980913 ctrl_val = 0
    [  462.218021] imx662 2-0042: TI ISP Gain and exposure control disabled 
    [  462.228620] ctrl_id = 009a0902 ctrl_val = 8000
    [  462.258204] ctrl_id = 009e0903 ctrl_val = 1
    root@j784s4-evm:~# 


    It was stalling for sometime so I interuppted. Thanks for your responses

  • Hi Sriram,

    Two comments from my end:

    Firstly, there looks to be a typo for the first pipeline. It should be "video/x-bayer" instead of "video/xbayer". The pipeline should work, since I verified with a dummy video source like this: 

    gst-launch-1.0 videotestsrc ! capsfilter caps="video/x-bayer, format=rggb, width=1920, height=1080, framerate=30/1" ! fakesink
    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    Redistribute latency...
    New clock: GstSystemClock
    ^Chandling interrupt.
    Interrupt: Stopping pipeline ...
    Execution ended after 0:00:05.679225300
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@am67-sk:~#
    

    Could you retry the pipeline?

    Secondly, can I get some clarification on the hardware setup? Specifically, is this on the TI J784S4 EVM, TI SK-AM69, or a custom board? And does the camera capture pipeline work when using the ISP and defining the io-mode on this hardware setup?

    Regards,

    Takuma

  • Hi Takuma Fujiwara,

    Sorry for the typo error, the log of that command is given below,

    root@j784s4-evm:/opt/edgeai-gst-apps# gst-launch-1.0 videotestsrc ! capsfilter caps="video/x-bayer, format=rggb, width=1920, height=1080, framerate=30/1" ! fakesink
    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    Redistribute latency...
    New clock: GstSystemClock
    ^Chandling interrupt.
    Interrupt: Stopping pipeline ...
    Execution ended after 0:00:04.956348930
    Setting pipeline to NULL ...
    Freeing pipeline ...



    We are using a custom board running on image built using the J784S4 EVM SDK. The camera capture is working fine with the ISP and io-mode plugin and below is the log of it, 

    root@j784s4-evm:/run/media/User-mmcblk0p4# gst-launch-1.0 v4l2src device=/dev/video-imx662-cam0 io-mode=dmabuf-import num-buffers=60 ! video/x-bayer, width=1920, height=1080, framerate=60/1, format=rggb10 ! tiovxisp sink_0::device=/dev/v4l-imx662-subdev0 sensor-name="SENSOR_SONY_IMX662" dcc-isp-file=/opt/imaging/imx662/linear/dcc_viss.bin sink_0::dcc-2a-file=/opt/imaging/imx662/linear/dcc_2a.bin format-msb=9 ! video/x-raw, format=NV12, width=1920, height=1080, framerate=60/1 ! absolutetimestamps location=/run/media/User-mmcblk0p4/abs_timestamps_60.log ! filesink location=/run/media/User-mmcblk0p4/output.nv12

    APP: Init ... !!!
    MEM: Init ... !!!
    MEM: Initialized DMA HEAP (fd=6) !!!
    MEM: Init ... Done !!!
    IPC: Init ... !!!
    IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
    278.133434 s: GTC Frequency = 200 MHz
    APP: Init ... Done !!!
    278.133504 s: VX_ZONE_INIT:Enabled
    278.133512 s: VX_ZONE_ERROR:Enabled
    278.133519 s: VX_ZONE_WARNING:Enabled
    278.134507 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:116] Added target MPU-0
    278.134654 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:116] Added target MPU-1
    278.134770 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:116] Added target MPU-2
    278.134882 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:116] Added target MPU-3
    278.134893 s: VX_ZONE_INIT:[tivxInitLocal:136] Initialization Done !!!
    278.135381 s: VX_ZONE_INIT:[tivxHostInitLocal:101] Initialization Done for HOST !!!
    Settin[ 261.784336] ctrl_id = 009e0903 ctrl_val = 0
    g pipeline to PAUSED ...
    Pipeline is live and does not need PRE[ 261.811019] imx662 2-0042: Auto gain and exposure is disabled
    ROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    [ 261.828261] ctrl_id = 009a0902 ctrl_val = 16600
    [ 261.855261] imx662 2-0042: Auto gain and exposure is disabled
    [ 261.865606] imx662 2-0042: TI ISP Gain and exposure control disabled
    [ 261.872036] ctrl_id = 009a0902 ctrl_val = 16600
    [ 261.898256] ctrl_id = 009e0903 ctrl_val = 0
    Redistribute latency...
    [ 261.930256] ctrl_id = 009a0901 ctrl_val = 1
    [ 262.264615] imx662 2-0042: Auto gain and exposure is disabled
    [ 262.425825] imx662 2-0042: Auto gain and exposure is disabled
    Got EOS from element "pipeline0".
    Execution ended after 0:00:01.492500120
    Setting pipeline to NULL ...
    Freeing pipeline ...
    279.764139 s: VX_ZONE_INIT:[tivxHostDeInitLocal:115] De-Initialization Done for HOST !!!
    279.768467 s: VX_ZONE_INIT:[tivxDeInitLocal:204] De-Initialization Done !!!
    APP: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... Done !!!
    IPC: Deinit ... !!!
    IPC: DeInit ... Done !!!
    MEM: Deinit ... !!!
    DDR_SHARED_MEM: Alloc's: 25 alloc's of 38850771 bytes
    DDR_SHARED_MEM: Free's : 25 free's of 38850771 bytes
    DDR_SHARED_MEM: Open's : 0 allocs of 0 bytes
    MEM: Deinit ... Done !!!
    APP: Deinit ... Done !!!
    root@j784s4-evm:/run/media/User-mmcblk0p4# ls -l output.nv12
    -rwxrwx--- 1 root disk 186624000 Apr 28 17:46 output.nv12
    root@j784s4-evm:/run/media/User-mmcblk0p4# 

    Thanks for your responses,

    Regards,

    Sriram

  • Hi Sriram,

    Apologies for the confusion with the extra demo pipeline. Can you run the original pipeline I shared initially using the v4l2src, but without the typo?

    • gst-launch-1.0 v4l2src device=/dev/video-imx662-cam0 num-buffers=10 ! video/x-bayer,format=rggb,width=1920,height=1080,framerate=30/1 ! fakesink
    framerate=60/1, format=rggb10

    ^ Additionally, I see that the working pipeline is using a different framerate and format than the non-working pipeline without tiovxisp and io-mode. So, in addition to my original example pipeline, can you run this pipeline as well:

    • gst-launch-1.0 v4l2src device=/dev/video-imx662-cam0 num-buffers=60 ! video/x-bayer,format=rggb10,width=1920,height=1080,framerate=60/1 ! fakesink

    Regards,

    Takuma

  • rHi Takuma Fujiwara,

    The below is the log for the two commands you have asked for

    root@j784s4-evm:/home/Diagnostics/Out# gst-launch-1.0 v4l2src device=/dev/video-imx662-cam0 num-buffers=10 ! video/x-bayer,format=rggb,width=1920,height=1080,framerate=30/1 ! fakesink
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystem[ 148.473888] imx662 2-0042: Auto gain and exposure is enabled
    Clock
    [ 148.481293] ctrl_id = 00980911 ctrl_val = 8000
    [ 148.511284] imx662 2-0042: Auto gain and exposure is enabled
    [ 148.521458] ctrl_id = 00980913 ctrl_val = 0
    [ 148.550341] imx662 2-0042: TI ISP Gain and exposure control disabled
    [ 148.560937] ctrl_id = 009a0902 ctrl_val = 8000
    [ 148.586333] ctrl_id = 009e0903 ctrl_val = 1
    ^Chandling interrupt.
    Interrupt: Stopping pipeline ...
    Execution ended after 0:01:36.747935320
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@j784s4-evm:/home/Diagnostics/Out# gst-launch-1.0 v4l2src device=/dev/video-imx662-cam0 num-buffers=60 ! video/x-bayer,format=rggb10,width=1920,height=1080,framerate=60/1 ! fakesink
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystem[ 148.618333] ctrl_id = 009a0901 ctrl_val = 1
    Clock
    [ 274.352939] ctrl_id = 009e0903 ctrl_val = 0
    [ 274.387296] imx662 2-0042: Auto gain and exposure is disabled
    [ 274.397290] ctrl_id = 009a0902 ctrl_val = 16600
    [ 274.422347] imx662 2-0042: Auto gain and exposure is disabled
    [ 274.432708] imx662 2-0042: TI ISP Gain and exposure control disabled
    [ 274.439182] ctrl_id = 009a0902 ctrl_val = 16600
    [ 274.466343] ctrl_id = 009e0903 ctrl_val = 0
    Redistribute latency...
    Got EOS from element "pipeline0".
    Execution ended after 0:00:01.393581730
    Setting pipeline to NULL ...
    Freeing pipeline ...

    Thanks for yoour responses,

    Regards,

    Sriram

  • Hi Sriram,

    It looks like the second pipeline received the EOS from the pipeline, which should mean that it reached the end of stream for the 60 frames that is set in the "num-buffers" property. 

    From this, I think the main difference between the non-working pipeline and working pipeline is the format and maybe framerate. I think your original post had rggb10, but it looks like it got switched to rggb somewhere along the experiments. So, the issues that were being seen after May 16, 6 days ago, are most likely due to this mismatch in format.

    Due to this confusion, I will recommend running your pipeline once more with the corrected format and 60/1 framerate, and share the logs/behaviors observed:

    • gst-launch-1.0 v4l2src device=/dev/video-imx662-cam0 num-buffers=60 ! video/x-bayer,format=rggb10,width=1920,height=1080,framerate=60/1 ! filesink location=output_imx662_bayer.raw

    Above pipeline is identical to the fakesink pipeline you have ran in the most recent post, with only one change for filesink. If this pipeline does not work, then there are issues with using filesink which is a generic GStreamer plugin that comes from GStreamer community and not specific to TI.

    Regards,

    Takuma

  • Hi Takuma Fujiwara,

    Thanks for your responses for guiding me through the rectification of the bug evethough I confused with different inappropriate logs and misinformation.

    The below is the working pipeline gstreamer command used to capture frames without the use tiovxisp & no explicit mentioning of the io_mode=DMABUF_import with IMX662,


    root@j784s4-evm:/opt/edgeai-gst-apps# gst-launch-1.0 v4l2src device=/dev/video-imx662-cam0 num-buffers=60 ! video/x-bayer,format=rggb10,width=1920,height=1080,framerate=60/1 ! filesink location=output_imx662_bayer.raw
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    [   38.220706] imx662 2-0042: Auto gain and exposure is enabled 
    [   38.226455] ctrl_id = 00980911 ctrl_val = 8000
    [   38.255972] imx662 2-0042: Auto gain and exposure is enabled 
    [   38.266154] ctrl_id = 00980913 ctrl_val = 0
    [   38.292264] imx662 2-0042: TI ISP Gain and exposure control enabled 
    [   38.302807] ctrl_id = 00980911 ctrl_val = 16600
    [   38.331261] ctrl_id = 00980913 ctrl_val = 300
    Redistribute latency...
    Got EOS from element "pipeline0".
    Execution ended after 0:00:01.419026995
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@j784s4-evm:/opt/edgeai-gst-apps# ls -l output_imx662_bayer.raw 
    -rw-r--r-- 1 root root 248832000 Apr 28 17:43 output_imx662_bayer.raw


    Regards,

    Sriram

  • Hi Sriram,

    Thanks for sharing the update. Apologies from my end, as I missed the change in format while reviewing the pipelines. In any case, glad to hear we got the pipeline working!

    Regards,

    Takuma