CSI camera not working on BeagleBoard ai-64 using TI model Zoo

I am using CSI camera on Beeagleboard ai-64. The model I am using is yolo5 from Ti Model Zoo.
I have done the configuration of CSI camera on Beagleboard. When testing with CSI camera works fine. For this I executed below command:

sudo gst-launch-1.0 v4l2src device=/dev/video2 \
! video/x-bayer, width=640, height=480, format=rggb \
! tiovxisp sink_0::device=/dev/v4l-subdev2 sensor-name=SENSOR_SONY_IMX219_RPI \
dcc-isp-file=/opt/imaging-REL.PSDK.JACINTO.09.00.00.02/sensor_drv/src/imx219/dcc_bins/dcc_viss_640x480.bin \
sink_0::dcc-2a-file=/opt/imaging-REL.PSDK.JACINTO.09.00.00.02/sensor_drv/src/imx219/dcc_bins/dcc_2a_640x480.bin \
format-msb=7 ! autovideosink

But my main work is to do object detection. I am executing below command for object detection:
sudo /opt/edge_ai_apps/apps_python/app_edgeai.py configs/object_detection.yaml

And it doesn’t give any output, but bunch of messages:

Number of subgraphs:1 , 129 nodes delegated out of 129 nodes 
 
APP: Init ... !!!
MEM: Init ... !!!
MEM: Initialized DMA HEAP (fd=5) !!!
MEM: Init ... Done !!!
IPC: Init ... !!!
IPC: Init ... Done !!!
REMOTE_SERVICE: Init ... !!!
REMOTE_SERVICE: Init ... Done !!!
  1372.717094 s: GTC Frequency = 200 MHz
APP: Init ... Done !!!
  1372.717402 s:  VX_ZONE_INIT:Enabled
  1372.717425 s:  VX_ZONE_ERROR:Enabled
  1372.717430 s:  VX_ZONE_WARNING:Enabled
  1372.718230 s:  VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
  1372.722929 s:  VX_ZONE_INIT:[tivxHostInitLocal:86] Initialization Done for HOST !!!
[GST SRC STR]
[FLOW 0]
v4l2src device=/dev/video2 ! queue leaky=2 ! video/x-bayer, width=1920, height=1080, format=rggb ! tiovxisp sink_0::device=/dev/v4l-subdev2 sensor-name=SENSOR_SONY_IMX219_RPI dcc-isp-file=/opt/imaging/imx219/dcc_viss.bin sink_0::dcc-2a-file=/opt/imaging/imx219/dcc_2a.bin format-msb=7 ! video/x-raw, format=NV12 !tiovxmultiscaler name=split_01 
split_01. ! queue ! video/x-raw, width=480, height=320 ! tiovxmultiscaler ! video/x-raw, width=320, height=320 ! tiovxdlpreproc data-type=3 target=0 channel-order=1 tensor-format=rgb out-pool-size=4 ! application/x-tensor-tiovx ! appsink name=pre_0 max-buffers=2 drop=true 
split_01. ! queue ! video/x-raw, width=1280, height=720 ! tiovxdlcolorconvert target=1 out-pool-size=4 ! video/x-raw, format=RGB ! appsink name=sen_0 max-buffers=2 drop=true 

[GST SINK STR]
appsrc format=GST_FORMAT_TIME is-live=true block=true do-timestamp=true name=post_0 ! tiovxdlcolorconvert ! video/x-raw,format=NV12, width=1280, height=720 ! queue ! mosaic_0.sink_0 
tiovxmosaic name=mosaic_0 background=/tmp/background_0
sink_0::startx=320  sink_0::starty=180  sink_0::width=1280   sink_0::height=720  
! video/x-raw,format=NV12, width=1920, height=1080 ! kmssink sync=false driver-name=tidss 

  1379.170143 s:  VX_ZONE_INIT:[tivxHostDeInitLocal:100] De-Initialization Done for HOST !!!
  1379.173713 s:  VX_ZONE_INIT:[tivxDeInitLocal:193] De-Initialization Done !!!
APP: Deinit ... !!!
REMOTE_SERVICE: Deinit ... !!!
REMOTE_SERVICE: Deinit ... Done !!!
IPC: Deinit ... !!!
IPC: DeInit ... Done !!!
MEM: Deinit ... !!!
MEM: Alloc's: 28 alloc's of 70656496 bytes 
MEM: Free's : 28 free's  of 70656496 bytes 
MEM: Open's : 0 allocs  of 0 bytes 
MEM: Deinit ... Done !!!
APP: Deinit ... Done !!!

PS: when I did the same for USB camera, the object detection was working.’

Kindly help if there’s any solution or am i doing something wrong.

Hi. I guess I can help you with RPi camera:
Please try this as for your RPi camera input in /opt/edge_ai_apps/config/image_classification.yaml:

    input0:
        source: /dev/video2
        format: rggb
        width: 1920
        height: 1080
        sen_id: imx219
        framerate: 30

And you should check your /opt/edge_ai_apps/apps_python/gst_wrapper.py script for dcc-iso-file and sink_0 files paths.
Because in my case they point to /opt/imaging/%sen_id%/dcc_viss.bin and /opt/imaging/%sen_id%/dcc_2a.bin
So I had to take those files from: imaging.zip to /opt/imaging/imx219 folder.
But as I can see you already have them in /opt/imaging-REL.PSDK.JACINTO.09.00.00.02/sensor_drv/src/imx219/dcc_bins/

2 Likes


2 Likes

@Illia_Pikin
Thank you so much for your reply.

Well, I have two folders: Imaging and imaging-REL.PSDK.JACINTO.09.00.00.02.
But in gst_wrapper.py, the path is set for Imaging [ /opt/imaging]. Please see below image:

So am I doing something wrong?

1 Like

Hi. You can either edit the path in the gst_wrapper.py or simply copy /opt/imaging-REL.PSDK.JACINTO.09.00.00.02/sensor_drv/src/imx219/dcc_bins/dcc_viss.bin and /opt/imaging-REL.PSDK.JACINTO.09.00.00.02/sensor_drv/src/imx219/dcc_bins/dcc_2a.bin to /opt/imaging/imx219 folder.

sudo mkdir -p /opt/imaging/imx219
sudo cp /opt/imaging-REL.PSDK.JACINTO.09.00.00.02/sensor_drv/src/imx219/dcc_bins/dcc_viss.bin /opt/imaging-REL.PSDK.JACINTO.09.00.00.02/sensor_drv/src/imx219/dcc_bins/dcc_2a.bin /opt/imaging/imx219
2 Likes

i did the same.
I have set the path :

This is my folder:

After executing this command:
sudo /opt/edge_ai_apps/apps_python/app_edgeai.py configs/object_detection.yaml

The screen is stuck in this for few seconds

and outputs below logs:

debian@BeagleBone:/opt/edge_ai_apps$ sudo /opt/edge_ai_apps/apps_python/app_edgeai.py configs/object_detection.yaml 
libtidl_onnxrt_EP loaded 0x2a3d6810 
Final number of subgraphs created are : 1, - Offloaded Nodes - 391, Total Nodes - 391 
APP: Init ... !!!
MEM: Init ... !!!
MEM: Initialized DMA HEAP (fd=4) !!!
MEM: Init ... Done !!!
IPC: Init ... !!!
IPC: Init ... Done !!!
REMOTE_SERVICE: Init ... !!!
REMOTE_SERVICE: Init ... Done !!!
 22241.275562 s: GTC Frequency = 200 MHz
APP: Init ... Done !!!
 22241.288885 s:  VX_ZONE_INIT:Enabled
 22241.288944 s:  VX_ZONE_ERROR:Enabled
 22241.288959 s:  VX_ZONE_WARNING:Enabled
 22241.308291 s:  VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
 22241.311096 s:  VX_ZONE_INIT:[tivxHostInitLocal:86] Initialization Done for HOST !!!
[GST SRC STR]
[FLOW 0]
v4l2src device=/dev/video2 ! queue leaky=2 ! video/x-bayer, width=640, height=480, format=rggb ! tiovxisp sink_0::device=/dev/v4l-subdev2 sensor-name=SENSOR_SONY_IMX219_RPI dcc-isp-file=/opt/imaging/src/imx219/dcc_viss.bin sink_0::dcc-2a-file=/opt/imaging/imx219/dcc_2a.bin format-msb=7 ! video/x-raw, format=NV12 !tiovxmultiscaler name=split_01 
split_01. ! queue ! video/x-raw, width=640, height=480 ! videoscale ! video/x-raw, width=640, height=640 ! tiovxdlpreproc data-type=3 target=0 channel-order=0 tensor-format=rgb out-pool-size=4 ! application/x-tensor-tiovx ! appsink name=pre_0 max-buffers=2 drop=true 
split_01. ! queue ! video/x-raw, width=640, height=480 ! tiovxdlcolorconvert target=1 out-pool-size=4 ! video/x-raw, format=RGB ! appsink name=sen_0 max-buffers=2 drop=true 

[GST SINK STR]
appsrc format=GST_FORMAT_TIME is-live=true block=true do-timestamp=true name=post_0 ! tiovxdlcolorconvert ! video/x-raw,format=NV12, width=640, height=480 ! queue ! mosaic_0.sink_0 
tiovxmosaic name=mosaic_0 background=/tmp/background_0
sink_0::startx=0  sink_0::starty=0  sink_0::width=640   sink_0::height=480  
! video/x-raw,format=NV12, width=640, height=480 ! kmssink sync=false driver-name=tidss 

 22248.027693 s:  VX_ZONE_INIT:[tivxHostDeInitLocal:100] De-Initialization Done for HOST !!!
 22248.032311 s:  VX_ZONE_INIT:[tivxDeInitLocal:193] De-Initialization Done !!!
APP: Deinit ... !!!
REMOTE_SERVICE: Deinit ... !!!
REMOTE_SERVICE: Deinit ... Done !!!
IPC: Deinit ... !!!
IPC: DeInit ... Done !!!
MEM: Deinit ... !!!
MEM: Alloc's: 25 alloc's of 49847828 bytes 
MEM: Free's : 25 free's  of 49847828 bytes 
MEM: Open's : 0 allocs  of 0 bytes 
MEM: Deinit ... Done !!!
APP: Deinit ... Done !!!

Any help would be highly appreciated!

Try to use 1920 x 1080 camera resolution as input. It should be downscaled by gstreamer.
Or you can try to run this line (metioned here) in console before running your edgeai script:

media-ctl -d 0 --set-v4l2 '"imx219 6-0010":0[fmt:SRGGB8_1X8/640x480]'

thank you for your help.

I followed your steps and I got the below result.

I would like to know

  1. why there are 3 input videos and what does it mean?
  2. ALso it works with 1920x1080, but i want to do 640x480. it does not work for 640x480.
    can you help?
1 Like

any answer for this?