I'm trying to add an Onsemi OV5647 CSI-2 image sensor camera that needs support from the VPAC/ISP cores. The camera is configured to output a 10-bit Bayer BGGR pattern. The SD card image used was "tisdk-edgeai-image-am62axx-evm.wic.xz"
The image sensor driver is natively in the Linux kernel provided in the SDK and has been enabled as a module. The kernel, dtbo and modules were built and copied over to the SD card, following the instructions on the Academy here and using the kernel build process described in section 3.2 of the downloadable SDK documentation.
Next, I implemented the changes described in the SPRAD86 AM6xA ISP Tuning Guide.
Changes to tiovx_init-sensor() fucntion in tiovx_sensor_module.c:
.... else if(strcmp(sensorObj->sensor_name, "SENSOR_SONY_IMX219_RPI") == 0) { sensorObj->sensorParams.dccId=219; } else if(strcmp(sensorObj->sensor_name, "SENSOR_ONSEMI_OV5647") == 0) { sensorObj->sensorParams.dccId=5647; } ....
Changes to gsttiovxisp.c:
.... g_object_class_install_property (gobject_class, PROP_SENSOR_NAME, g_param_spec_string ("sensor-name", "Sensor name", "TIOVX camera sensor string ID. Below are the supported sensors\n" " SENSOR_SONY_IMX390_UB953_D3\n" " SENSOR_ONSEMI_AR0820_UB953_LI\n" " SENSOR_ONSEMI_AR0233_UB953_MARS\n" " SENSOR_SONY_IMX219_RPI\n" " SENSOR_ONSEMI_OV5647\n" " SENSOR_OV2312_UB953_LI", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | GST_PARAM_MUTABLE_READY)); ....
I'm not sure what other sensor settings are required so far but I was hoping this would be enough to provide a basic image.
(Note: I found that Ninja will continuously loop when running the install_gst_plugins.sh using the TI provided edgeai image. I was able to get it to run to completion after connecting the device to the internet and running the "setup_script.sh" in the "/opt/edgai_gst_apps/" folder . This seems like a bug or it would at least be better if running the setup script wasn't required, in my opinion).
Here are the commands I used to accomplish the above:
root@am62axx-evm:/opt/edgeai-gst-apps/scripts# vi /opt/edgeai-tiovx-modules/src/tiovx_sensor_module.c root@am62axx-evm:/opt/edgeai-gst-apps/scripts# export SOC=am62a root@am62axx-evm:/opt/edgeai-gst-apps/scripts# ./install_tiovx_modules.sh root@am62axx-evm:/opt/edgeai-gst-apps/scripts# vi /opt/edgeai-gst-plugins/ext/tiovx/gsttiovxisp.c root@am62axx-evm:/opt/edgeai-gst-apps/scripts# ./install_gst_plugins.sh
I checked that the sensor was now listed in using "gst-inspect-1.0 tiovxisp".
Lastly, I created the bin files in the Imaging folder using the ti-processor-sdk-rtos-j721e-evm-08_06_00_12. Here are the "ov5647_properties.txt" file contents created in the "configs" folder:
WIDTH 1920 HEIGHT 1280 BAYER_PATTERN 3 SENSOR_ID OV5647 PRJ_DIR ../../../../imaging/sensor_drv/src/ov5647/ SENSOR_NAME ov5647 SENSOR_DCC_NAME SENSOR_ONSEMI_OV5647
And here are the commands to make the bin images that I used:
cd ~/ti/ti-processor-sdk-rtos-j721e-evm-08_06_00_12/imaging/sensor_drv/src/ mkdir ov5647 cd ~/ti/ti-processor-sdk-rtos-j721e-evm-08_06_00_12/imaging/tools/default_DCC_profile_gen/scripts python ctt_def_xml_gen.py ../configs/ov5647_properties.txt cd ../../../sensor_drv/src/ov5647/dcc_xmls/linear/ sudo chmod 755 generate_dcc.sh ./generate_dcc.sh
Then the dcc_2a.bin and dcc_viss.bin files were copied to a created /opt/imaging/ov5647 folder on the SD card from the "dcc_bins" folder. It seems like this is potentially the issue as it may be configured to use the incorrect processor and/or VPAC ISP cores but I haven't found information on changing the configuration specifically for the AM62A. The AM62A states that is supported in the Imaging Release Notes.
When running the following commands, I don't see it open a video window or ever going through the tiovxisp0 element using gst_tracers:
media-ctl --set-v4l2 "'ov5647 4-0036':0[fmt:SBGGR10_1X10/1920x1080 field:none]" GST_DEBUG_FILE=/run/trace.log GST_DEBUG_NO_COLOR=1 GST_DEBUG="GST_TRACER:7" GST_TRACERS="latency(flags=element)" gst-launch-1.0 v4l2src io-mode=dmabuf device=/dev/video2 ! video/x-bayer, width=1920, height=1080, format=bggr10 ! tiovxisp sink_0::device=/dev/v4l-subdev2 sensor-name=SENSOR_ONSEMI_OV5647 dcc-isp-file=/opt/imaging/ov5647/dcc_viss_10b.bin sink_0::dcc-2a-file=/opt/imaging/ov5647/dcc_2a_10b.bin format-msb=9 ! kmssink driver-name=tidss -e 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 !!! 7657.802761 s: GTC Frequency = 200 MHz APP: Init ... Done !!! 7657.803241 s: VX_ZONE_INIT:Enabled 7657.803369 s: VX_ZONE_ERROR:Enabled 7657.803460 s: VX_ZONE_WARNING:Enabled 7657.804293 s: VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!! 7657.805132 s: VX_ZONE_INIT:[tivxHostInitLocal:93] Initialization Done for HOST !!! Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstSystemClock ^Chandling interrupt. Interrupt: Stopping pipeline ... EOS on shutdown enabled -- Forcing EOS on the pipeline ^C
gst_tracers script output:
And here is the media-ctl configuration:
root@am62axx-evm:/opt/edgeai-gst-apps/scripts# media-ctl -p Media controller API version 5.10.168 Media device information ------------------------ driver j721e-csi2rx model TI-CSI2RX serial bus info platform:30102000.ticsi2rx hw revision 0x1 driver version 5.10.168 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/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] 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, 0 route) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev1 pad0: Sink [stream:0 fmt:SBGGR10_1X10/1920x1080 field:none colorspace:srgb] <- "ov5647 4-0036":0 [ENABLED,IMMUTABLE] pad1: Source [stream:0 fmt:SBGGR10_1X10/1920x1080 field:none colorspace:srgb] -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE] pad2: Source [stream:0 fmt:SBGGR10_1X10/1920x1080 field:none colorspace:srgb] pad3: Source [stream:0 fmt:SBGGR10_1X10/1920x1080 field:none colorspace:srgb] pad4: Source [stream:0 fmt:SBGGR10_1X10/1920x1080 field:none colorspace:srgb] - entity 15: 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/1920x1080 field:none colorspace:srgb crop.bounds:(16,16)/2592x1944 crop:(364,450)/1928x1080] -> "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/video2 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/video3 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/video4 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/video5 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/video6 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/video7 pad0: Sink <- "30102000.ticsi2rx":6 [ENABLED,IMMUTABLE]
Any ideas why gstreamer isn't using tiovxisp or outputing a video stream in this configuration?
Thank you