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.

PROCESSOR-SDK-AM62X: Using GStreamer for AM62X SKEVM with OV5647 Camera

Part Number: PROCESSOR-SDK-AM62X
Other Parts Discussed in Thread: AM625, AM69A, AM68A

Hello TI exports !!! 

For AM625 ISP Tuning Guide i am refering this pdf which is provided by ti only:- /cfs-file/__key/communityserver-discussions-components-files/791/sprad86a-_2800_1_2900_.pdf

It mentioned that The ISP tuning procedure described in this report applies to all SoCs in the AM6xA vision processor family, including AM62A, AM68A, and AM69A. Examples using the AM62A Starter Kit EVM are provided in the report. 

Model:- AM62X EVK with SDK Version :- 09.02.01.09 

I can able to see the camera position here:- 

root@am62xx-evm:~# v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-mbus-codes pad=0
ioctl: VIDIOC_SUBDEV_ENUM_MBUS_CODE (pad=0,stream=0)
        0x3007: MEDIA_BUS_FMT_SBGGR10_1X10

Both media-ctl -p and v4l2-ctl --list-devices output:- 

root@am62xx-evm:~# media-ctl -p
Media controller API version 6.1.80

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 (5 pads, 5 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/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
        pad1: Source
                [stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                -> "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]

- entity 7: 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/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                <- "ov5647 4-0036":0 [ENABLED,IMMUTABLE]
        pad1: Source
                [stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
        pad2: Source
        pad3: Source
        pad4: Source

- entity 13: ov5647 4-0036 (1 pad, 1 link, 0 route)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev2
        pad0: Source
                [stream:0 fmt:SBGGR10_1X10/640x480 field:none colorspace:srgb
                 crop.bounds:(16,16)/2592x1944
                 crop:(32,16)/2560x1920]
                -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]

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

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

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

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

root@am62xx-evm:~# v4l2-ctl --list-devices
j721e-csi2rx (platform:30102000.ticsi2rx):
        /dev/video0
        /dev/video1
        /dev/video2
        /dev/video3
        /dev/media0

root@am62xx-evm:~#

Now problem is i am not able to find /opt/edgeai-tiovx-modules/src/ tiovx_sensor_module.c on EVK do we need to manually create this .c file or how to edit this file.

i have try to add tiovxisp but getting below errors:- 

root@am62xx-evm:/opt/edgeai-gst-apps/scripts# vi /opt/edgeai-gst-plugins/ext/tiovx/gsttiovxisp.c
root@am62xx-evm:/opt/edgeai-gst-apps/scripts# export SOC=am62a
root@am62xx-evm:/opt/edgeai-gst-apps/scripts# ./install_tiovx_modules.sh
Cloning into 'edgeai-tiovx-modules'...
fatal: unable to access 'https://git.ti.com/cgit/edgeai/edgeai-tiovx-modules/': Could not resolve host: git.ti.com
root@am62xx-evm:/opt/edgeai-gst-apps/scripts# vi /opt/edgeai-tiovx-modules/src/tiovx_sensor_module.c
root@am62xx-evm:/opt/edgeai-gst-apps/scripts# vi /opt/edgeai-gst-plugins/ext/tiovx/gsttiovxisp.c
root@am62xx-evm:/opt/edgeai-gst-apps/scripts# ./install_gst_plugins.sh
edgeai-gst-plugins
The Meson build system
Version: 0.61.3
Source dir: /opt/edgeai-gst-plugins
Build dir: /opt/edgeai-gst-plugins/build
Build type: native build
Project name: GstTIOVX
Project version: 0.7.0
C compiler for the host machine: cc (gcc 11.4.0 "cc (GCC) 11.4.0")
C linker for the host machine: cc ld.bfd 2.38.20220708
C++ compiler for the host machine: c++ (gcc 11.4.0 "c++ (GCC) 11.4.0")
C++ linker for the host machine: c++ ld.bfd 2.38.20220708
Host machine cpu family: aarch64
Host machine cpu: aarch64
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Run-time dependency gstreamer-1.0 found: YES 1.20.7
Run-time dependency gstreamer-base-1.0 found: YES 1.20.7
Run-time dependency gstreamer-video-1.0 found: YES 1.20.7
Run-time dependency gstreamer-check-1.0 found: YES 1.20.7
Run-time dependency gstreamer-allocators-1.0 found: YES 1.20.7
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: https://github.com/mesonbuild/meson/issues/9300
Run-time dependency imaging found: YES 0.1.0
Run-time dependency tiovx found: YES 0.1.0
Run-time dependency ti_vision_apps found: YES 0.1.0
Run-time dependency edgeai_tiovx_modules found: YES 0.1.0
Run-time dependency edgeai_tiovx_kernels found: YES 0.1.0
Run-time dependency ti_stereo_perception found: YES 0.1.0
Run-time dependency edgeai_dl_inferer found: YES 0.1.0
Run-time dependency edgeai_apps_utils found: YES 0.1.0
Library m found: YES
Compiler for C supports arguments -Wmissing-declarations: YES
Compiler for C++ supports arguments -Wmissing-declarations: YES
Compiler for C supports arguments -Wmissing-prototypes: YES
Compiler for C++ supports arguments -Wmissing-prototypes: NO
Compiler for C supports arguments -Wundef: YES
Compiler for C++ supports arguments -Wundef: YES
Compiler for C supports arguments -Wwrite-strings: YES
Compiler for C++ supports arguments -Wwrite-strings: YES
Compiler for C supports arguments -Wformat: YES
Compiler for C++ supports arguments -Wformat: YES
Compiler for C supports arguments -Wformat-nonliteral: YES
Compiler for C++ supports arguments -Wformat-nonliteral: YES
Compiler for C supports arguments -Wformat-security: YES
Compiler for C++ supports arguments -Wformat-security: YES
Compiler for C supports arguments -Wold-style-definition: YES
Compiler for C++ supports arguments -Wold-style-definition: NO
Compiler for C supports arguments -Winit-self: YES
Compiler for C++ supports arguments -Winit-self: YES
Compiler for C supports arguments -Wmissing-include-dirs: YES
Compiler for C++ supports arguments -Wmissing-include-dirs: YES
Compiler for C supports arguments -Waddress: YES
Compiler for C++ supports arguments -Waddress: YES
Compiler for C supports arguments -Waggregate-return: YES
Compiler for C++ supports arguments -Waggregate-return: YES
Compiler for C supports arguments -Wno-multichar: YES
Compiler for C++ supports arguments -Wno-multichar: YES
Compiler for C supports arguments -Wdeclaration-after-statement: YES
Compiler for C++ supports arguments -Wdeclaration-after-statement: NO
Compiler for C supports arguments -Wvla: YES
Compiler for C++ supports arguments -Wvla: YES
Compiler for C supports arguments -Wpointer-arith: YES
Compiler for C++ supports arguments -Wpointer-arith: YES
Compiler for C supports arguments -Wuninitialized: YES
Compiler for C++ supports arguments -Wuninitialized: YES
Compiler for C supports arguments -Wunknown-pragmas: YES
Compiler for C++ supports arguments -Wunknown-pragmas: YES
Compiler for C supports arguments -Wunused-function: YES
Compiler for C++ supports arguments -Wunused-function: YES
Compiler for C supports arguments -Wunused-label: YES
Compiler for C++ supports arguments -Wunused-label: YES
Compiler for C supports arguments -Wunused-value: YES
Compiler for C++ supports arguments -Wunused-value: YES
Compiler for C supports arguments -Wunused-variable: YES
Compiler for C++ supports arguments -Wunused-variable: YES
Compiler for C supports arguments -Werror: YES
meson.build:242: WARNING: Consider using the built-in werror option instead of using "-Werror".
Compiler for C++ supports arguments -Werror: YES
meson.build:246: WARNING: Consider using the built-in werror option instead of using "-Werror".
Has header "dlfcn.h" : YES
Has header "inttypes.h" : YES
Has header "memory.h" : YES
Has header "poll.h" : YES
Has header "stdint.h" : YES
Has header "stdlib.h" : YES
Has header "stdio_ext.h" : YES
Has header "strings.h" : YES
Has header "string.h" : YES
Has header "sys/param.h" : YES
Has header "sys/poll.h" : YES
Has header "sys/prctl.h" : YES
Has header "sys/socket.h" : YES
Has header "sys/stat.h" : YES
Has header "sys/times.h" : YES
Has header "sys/time.h" : YES
Has header "sys/types.h" : YES
Has header "sys/utsname.h" : YES
Has header "sys/wait.h" : YES
Has header "ucontext.h" : YES
Has header "unistd.h" : YES
Has header "sys/resource.h" : YES
Program python3 found: YES (/usr/bin/python3)
Configuring config.h using configuration
Program hotdoc skipped: feature doc disabled
Message: Hotdoc not found, not building the documentation
Build targets in project: 24
NOTICE: Future-deprecated features used:
 * 0.56.0: {'Dependency.get_pkgconfig_variable'}

GstTIOVX 0.7.0

  User defined options
    pkg_config_path: pkgconfig
    prefix         : /usr

Found ninja-1.10.2 at /usr/bin/ninja

ERROR: Clock skew detected. File /opt/edgeai-gst-plugins/build/../meson.build has a time stamp 1520595884.8494s in the future.

A full log can be found at /opt/edgeai-gst-plugins/build/meson-logs/meson-log.txt
root@am62xx-evm:/opt/edgeai-gst-apps/scripts# cd
root@am62xx-evm:~# gst-inspect-1.0 tiovxisp
No such element or plugin 'tiovxisp'
root@am62xx-evm:~# cd /opt/edgeai-gst-apps/scripts
root@am62xx-evm:/opt/edgeai-gst-apps/scripts# gst-inspect-1.0 tiovxisp
No such element or plugin 'tiovxisp'
root@am62xx-evm:/opt/edgeai-gst-apps/scripts#

how to resolve them ? 

also try to capture raw images but getting error as unable to start streaming:- 

root@am62xx-evm:~# media-ctl --set-v4l2 '"ov5647 4-0036":0 [fmt:SBGGR10_1X10/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]'
root@am62xx-evm:~# yavta -c -Fcapture -s 640x480 -f SBGGR10 /dev/video2
Device /dev/video2 opened.
Device `j721e-csi2rx' on `platform:30102000.ticsi2rx' (driver 'j721e-csi2rx') supports video, capture, without mplanes.
Video format set: SBGGR10 (30314742) 640x480 (stride 1280) field none buffer size 614400
Video format: SBGGR10 (30314742) 640x480 (stride 1280) field none buffer size 614400
8 buffers requested.
length: 614400 offset: 0 timestamp type/source: mono/EoF
Buffer 0/0 mapped at address 0xffff956ca000.
length: 614400 offset: 614400 timestamp type/source: mono/EoF
Buffer 1/0 mapped at address 0xffff95634000.
length: 614400 offset: 1228800 timestamp type/source: mono/EoF
Buffer 2/0 mapped at address 0xffff9559e000.
length: 614400 offset: 1843200 timestamp type/source: mono/EoF
Buffer 3/0 mapped at address 0xffff95508000.
length: 614400 offset: 2457600 timestamp type/source: mono/EoF
Buffer 4/0 mapped at address 0xffff95472000.
length: 614400 offset: 3072000 timestamp type/source: mono/EoF
Buffer 5/0 mapped at address 0xffff953dc000.
length: 614400 offset: 3686400 timestamp type/source: mono/EoF
Buffer 6/0 mapped at address 0xffff95346000.
length: 614400 offset: 4300800 timestamp type/source: mono/EoF
Buffer 7/0 mapped at address 0xffff952b0000.
Unable to start streaming: No such device (19).
8 buffers released.
root@am62xx-evm:~# yavta -c -Fcapture -s 640x480 -f SBGGR10 /dev/video2 -F#.uyvy
Device /dev/video2 opened.
Device `j721e-csi2rx' on `platform:30102000.ticsi2rx' (driver 'j721e-csi2rx') supports video, capture, without mplanes.
Video format set: SBGGR10 (30314742) 640x480 (stride 1280) field none buffer size 614400
Video format: SBGGR10 (30314742) 640x480 (stride 1280) field none buffer size 614400
8 buffers requested.
length: 614400 offset: 0 timestamp type/source: mono/EoF
Buffer 0/0 mapped at address 0xffffafdca000.
length: 614400 offset: 614400 timestamp type/source: mono/EoF
Buffer 1/0 mapped at address 0xffffafd34000.
length: 614400 offset: 1228800 timestamp type/source: mono/EoF
Buffer 2/0 mapped at address 0xffffafc9e000.
length: 614400 offset: 1843200 timestamp type/source: mono/EoF
Buffer 3/0 mapped at address 0xffffafc08000.
length: 614400 offset: 2457600 timestamp type/source: mono/EoF
Buffer 4/0 mapped at address 0xffffafb72000.
length: 614400 offset: 3072000 timestamp type/source: mono/EoF
Buffer 5/0 mapped at address 0xffffafadc000.
length: 614400 offset: 3686400 timestamp type/source: mono/EoF
Buffer 6/0 mapped at address 0xffffafa46000.
length: 614400 offset: 4300800 timestamp type/source: mono/EoF
Buffer 7/0 mapped at address 0xffffaf9b0000.
Unable to start streaming: No such device (19).
8 buffers released.
root@am62xx-evm:~# ls *.uyvy
ls: cannot access '*.uyvy': No such file or directory
root@am62xx-evm:~#