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-AM69A: Camera readout using Arducam V3Link Camera Kitcd

Part Number: PROCESSOR-SDK-AM69A
Other Parts Discussed in Thread: AM69A, SK-AM69

Tool/software:

Dear TI,

I have used the Camera IMX219 part of (Arducam V3Link Camera Kit) and trying to get the basic streaming setup for just 1 camera first(locally and to the NodeJS server)

DK for AM69A (10_00_00)

==

When doing initial configuration for IMX219 camera, in the imx219_cam_example.yaml under /opt/edgeai-gst-apps/configs, we see the input0 (default to kmssink) 

input0:
source: /dev/video0
subdev-id: /dev/v4l-subdev0
width: 1920
height: 1080
format: rggb
framerate: 30

we cannot see or access /dev/video0/ . When we try and write to output2 (outputs to : edgeai-test-data/output/output_image_%04d.jpg)

the video-imx219-cam0 dir/file is also inaccessible within this. 

the file saved 'eg : frame.jpg' is a 0 bit file and cannot be scp'd out of this to be taken a look at. But given it's file size, this is probably not useful.

==

when going into agi-apps

after running 

source /opt/edgeai-gst-apps/scripts/setup_cameras_v3link.sh (runs successfully, ie : no output message)

When we try and see outputs either locally using

v4l2-ctl --device /dev/video0 --set-fmt-video=width=1280,height=720,pixelformat=rggb --stream-mmap --stream-to=frame.jpg --stream-count=1

or be streaming to the listed NodeJS servers (10.42.0.25:8080/.../jpeg)

we get no image output from any of the cameras.

==

We also followed the guide below in our initial configuratio : 

https://www.arducam.com/wp-content/uploads/2023/10/Arducam_V3Link-Quick_Start_Guide.pdf

Following Sec 3.3, we have also checked the IP's correctly of the host orin and the AM69a

===

Our goal currently is just to get 1 camera read out to (video0 for eg) as a streaming output.

  • Just to re state we want to see just the camera. So we changed the  imx219.yaml file in config directory to the devices that appeared under /dev. It was /dev/video1  to /dev/video9.

    Then we ran the edge AI app in Python directory. However we don't see any pictures or video.

  • Hi Tapan,

    Assuming you're using the latest Edge AI SDK version for AM69A, enable the overlays for the V3Link fusion board and the imx219 sensors being used. The CSI header on SK-AM69 that the V3Link is connected to and the FPDLink port being used by your sensor on the V3Link will let you know which v3link imx219 overlay to enable because the naming convention is as follows: k3-v3link-imx219-<CSI header>-<FPDLink port>.dtbo

    To keep things simple, I recommend connecting the the ribbon cable to CSI0 (on SK-AM69) and CS0 (on V3Link). Connect IMX219 to RX0 (on V3Link) and enable k3-am68-sk-v3link-fusion.dtbo and k3-v3link-imx219-0-0.dtbo. Once you have added the overlays to uEnv.txt, reboot and run ./scripts/setup_cameras_v3link.sh and you should be able to see that the sensor is detected.

    Take a look at this FAQ for more details: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1452909/faq-am67a-enabling-csi2-sensors-via-fusion-board-on-am6x

    If you have any further questions, please let me know.

    Thank you,

    Fabiana

  • Hi Fabian,

    Yes. I did the same steps as above. On login it says 

    IMX219 Camera 0 detected
    device = /dev/video-imx219-cam0
    name = imx219
    format = [fmt:SRGGB8_1X8/1920x1080]
    subdev_id = /dev/v4l-imx219-subdev0
    isp_required = yes

    Then I connected HDMI. I saw the standard EdgeAi GUI. On selecting the custom tab and selecting CAM0 from the input nothing showed. it hanged there.

    Then I thought to save output to a JPG . So I changed the imx219_cam_example.yaml.

    flows:
    flow0: [input0,model0,output2,[320,150,1280,720]]

    And ran the following command

    ./app_edgeai.py ../configs/imx219_cam_example.yaml

    It gave the following error

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

    /app_edgeai.py ../configs/imx219_cam_example.yaml
    2025-03-27 19:19:01,784 INFO Could not find libdlr.so in model artifact. Using dlr from /usr/lib/python3.12/site-packages/dlr/libdlr.so
    APP: Init ... !!!
    2131.739982 s: APP_LOG: ERROR: Unable to map memory @ 0xaf000000 of size 262144 bytes !!!
    APP: ERROR: Log writer init failed !!!
    APP_LOG: ERROR: Unable to map memory @ 0xb1000000 of size 3288576 bytes !!!
    APP: ERROR: File IO writer init failed !!!
    APP: Init ... Done !!!
    TIDL_RT_OVX: ERROR: appInit failed
    [19:19:02] /dlr/arch64/neo-ai-dlr/src/dlr.cc:343: Error: [19:19:02] /dlr/arch64/neo-ai-dlr/3rdparty/tvm/src/runtime/contrib/tidl/tidl_runtime.cc:264: Failed to initialize TIDLRT for subgraph 0

    Stack trace:
    [bt] (0) /usr/lib/python3.12/site-packages/dlr/libdlr.so(+0x13290c) [0xffff7890290c]
    [bt] (1) /usr/lib/python3.12/site-packages/dlr/libdlr.so(tvm::runtime::detail::LogFatal::Entry::Finalize()+0x6c) [0xffff7880dbbc]
    [bt] (2) /usr/lib/python3.12/site-packages/dlr/libdlr.so(tvm::runtime::TIDLJ7Module::GetFunction(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)+0x624) [0xffff788c70b4]
    [bt] (3) /usr/lib/python3.12/site-packages/dlr/libdlr.so(+0x1354bc) [0xffff789054bc]
    [bt] (4) /usr/lib/python3.12/site-packages/dlr/libdlr.so(tvm::runtime::ConstLoaderModuleNode::GetFunction(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)+0x4e0) [0xffff788206c0]
    [bt] (5) /usr/lib/python3.12/site-packages/dlr/libdlr.so(+0x1354bc) [0xffff789054bc]
    [bt] (6) /usr/lib/python3.12/site-packages/dlr/libdlr.so(+0x1960b0) [0xffff789660b0]
    [bt] (7) /usr/lib/python3.12/site-packages/dlr/libdlr.so(+0x19a06c) [0xffff7896a06c]
    [bt] (8) /usr/lib/python3.12/site-packages/dlr/libdlr.so(+0x19b71c) [0xffff7896b71c]


    2025-03-27 19:19:02,281 ERROR error in DLRModel instantiation
    Traceback (most recent call last):
    File "/usr/lib/python3.12/site-packages/dlr/api.py", line 89, in __init__
    self._impl = DLRModelImpl(model_path, dev_type, dev_id, error_log_file, use_default_dlr)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.12/site-packages/dlr/dlr_model.py", line 79, in __init__
    self._check_call(self._lib.CreateDLRModel(byref(self.handle),
    File "/usr/lib/python3.12/site-packages/dlr/dlr_model.py", line 160, in _check_call
    raise DLRError(self._lib.DLRGetLastError().decode('ascii'))
    dlr.dlr_model.DLRError
    Traceback (most recent call last):
    File "/opt/edgeai-gst-apps/apps_python/./app_edgeai.py", line 67, in <module>
    main(sys.argv)
    File "/opt/edgeai-gst-apps/apps_python/./app_edgeai.py", line 46, in main
    demo = EdgeAIDemo(config)
    ^^^^^^^^^^^^^^^^^^
    File "/opt/edgeai-gst-apps/apps_python/edge_ai_class.py", line 108, in __init__
    model_obj.create_runtime()
    File "/usr/lib/python3.12/site-packages/edgeai_dl_inferer.py", line 315, in create_runtime
    self.run_time = RunTime(self.artifacts,
    ^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.12/site-packages/edgeai_dl_inferer.py", line 68, in __init__
    self.model = _DLRModel(artifacts, "cpu")
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.12/site-packages/dlr/api.py", line 92, in __init__
    raise ex
    File "/usr/lib/python3.12/site-packages/dlr/api.py", line 89, in __init__
    self._impl = DLRModelImpl(model_path, dev_type, dev_id, error_log_file, use_default_dlr)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.12/site-packages/dlr/dlr_model.py", line 79, in __init__
    self._check_call(self._lib.CreateDLRModel(byref(self.handle),
    File "/usr/lib/python3.12/site-packages/dlr/dlr_model.py", line 160, in _check_call
    raise DLRError(self._lib.DLRGetLastError().decode('ascii'))
    dlr.dlr_model.DLRError
    *******************************************************************************************************************************************

    The output crashed. Is there a command that I can use to RSTP to remote host the live camera stream with out using any AI Inference/

  • Hi Tapan,

    Could you please share the complete configuration file you are using?

    Thank you,

    Fabiana

  • Here it is

    title: "IMX219 Camera"                                      
    log_level: 2                                                
    inputs:                                                                                                        
        # RPi camera is supported only in Starter Kit                                                              
        # To enable imx219 camera, apply the overlay in /run/media/BOOT-mmcblk1p1/uEnv.txt (Refer to Documentation)
        input0:                                                                        
            source: /dev/video-imx219-cam0                                            
            subdev-id: /dev/v4l-imx219-subdev0                                        
            width: 1920                                                              
            height: 1080                                        
            format: rggb                                                              
            framerate: 30                                                              
    models:                                                                          
        model0:                                                  
            model_path: /opt/model_zoo/TVM-CL-3090-mobileNetV2-tv                      
            topN: 5                                                                    
        model1:                                                                      
            model_path: /opt/model_zoo/ONR-OD-8200-yolox-nano-lite-mmdet-coco-416x416
            viz_threshold: 0.6                                                        
        model2:                                                                        
            model_path: /opt/model_zoo/ONR-SS-8610-deeplabv3lite-mobv2-ade20k32-512x512
            alpha: 0.4              
    outputs:                        
        output0:                                                    
            sink: kmssink                                          
            width: 1920            
            height: 1080            
            overlay-perf-type: graph                                
        output1:                                                    
            sink: /opt/edgeai-test-data/output/output_video.mkv
            width: 1920            
            height: 1080            

        output2:                                                                      
            sink: /opt/edgeai-test-data/output/output_image_%04d.jpg                  
            width: 1920                                                                
            height: 1080                                                              
        output3:                                                    
            sink: remote                                            
            width: 1920                                            
            height: 1080                                            
            port: 8081                                              
            host: 127.0.0.1                                        
            encoding: jpeg                                          
            overlay-perf-type: graph                                
                                                                   
    flows:                                                          
        flow0: [input0,model0,output2,[320,150,1280,720]]   
  • Dear Fabian,

    Do you have any explanation of the Error.  Conversely, is there a simple utility to view the 3 camera in the remote host machine through RSTP.

  • Hi Tapan,

    Thank you for sharing. I do not see anything wrong with this config file upon first glance. Could you try running the following?

    gst-launch-1.0 \
    v4l2src device=/dev/video-imx219-cam0 io-mode=5 ! queue leaky=2 ! \
    video/x-bayer, width=1920, height=1080, framerate=30/1, format=rggb ! \
    tiovxisp sink_0::device=/dev/v4l-subdev2 sensor-name="SENSOR_SONY_IMX219_RPI" \
    dcc-isp-file=/opt/imaging/imx219/linear/dcc_viss_1920x1080.bin \
    sink_0::dcc-2a-file=/opt/imaging/imx219/linear/dcc_2a_1920x1080.bin format-msb=7 ! \
    video/x-raw, format=NV12, width=1920, height=1080, framerate=30/1 ! \
    kmssink driver-name=tidss sync=false

    See the following FAQs and documentations:

    Thank you,

    Fabiana

  •  This is the op of the command.  Not following what you did. It gives similar error unable to map memory..

    APP: Init ... !!!
    373072.777244 s: APP_LOG: ERROR: Unable to map memory @ 0xaf000000 of size 262144 bytes !!!
    APP: ERROR: Log writer init failed !!!
    APP_LOG: ERROR: Unable to map memory @ 0xb1000000 of size 3288576 bytes !!!
    APP: ERROR: File IO writer init failed !!!
    APP: Init ... Done !!!
    **
    ERROR:../gst-libs/gst/tiovx/gsttiovxcontext.c:146:gst_tiovx_context_init: assertion failed: (0 == ret)
    Bail out! ERROR:../gst-libs/gst/tiovx/gsttiovxcontext.c:146:gst_tiovx_context_init: assertion failed: (0 == ret)
    Aborted (core dumped)

  • Hi Tapan,

    Did you make any changes aside from enabling the sensor in the uboot environment? Could you share the output of the following command?

    ls /dev/dma_heap/carveout_edgeai_shared-memories

    My suggestion would be for you to try re-flashing your SD card with the latest Edge AI Linux SDK for AM69A to see if the issue persists.

    https://www.ti.com/tool/download/PROCESSOR-SDK-LINUX-AM69A

    Thank you,

    Fabiana

  • Hello Fabiana,

    1. I want to run the command 'ls /dev/dma_heap/carveout_edgeai_shared-memories', but there are only linux,cma and system under /dev/dma_heap, no such 'carveout_edgeai_shared-memories'.

    2. I already used the latest SDK, which is 10.01.00.05's

    tisdk-edgeai-image-j784s4-evm.wic.xz  — 1121949 K

    Best,

    Tapan

  • Dear Fabiana,

    After flash this is the op

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

    orinnano@orinnano-desktop:~$ ssh root@10.42.0.26
    Unable to setup formats: Invalid argument (22)
    Unable to setup formats: Invalid argument (22)
    IMX219 Camera 0 detected
        device = /dev/video-imx219-cam0
        name = imx219
        format = [fmt:SRGGB8_1X8/1920x1080]
        subdev_id = /dev/v4l-imx219-subdev0
        isp_required = yes
    root@am69-sk:/opt/edgeai-gst-apps#

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

    A simple thing like running a V3 link has taken a month. Either the documentation is not correct. I do not see any other issue.

         BTW I also noticed that in Arducam website getting started with AM62A says a few more steps. Eg loads few kernel modules in i2c. In the latest sdk I do not see 5.10.168..but 6.** version. There is no im219.ko in  /kernel/drivers/media/i2c/.   The following ko are not there modules/ds90ub960.ko and modules/im219.ko to /lib/modules/5.10.168-g2c23e6c538/kernel/drivers/media/i2c/

    Would it be possible for a call. I am losing patience over the slow churn.

  • Hi Tapan,

    I am currently out of office on business travel. Please expect a ~1-2 day delay in my response.

    Thank you,

    Fabiana

  • Hi Tapan,

    Are you running the setup_cameras_v3link.sh script each time upon boot? Can you verify that you are carefully completing all the steps I previously outlined? 

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1493345/processor-sdk-am69a-camera-readout-using-arducam-v3link-camera-kitcd/5738070#5738070

    Thank you,

    Fabiana

  • Thank you Fabiana for coming for a meeting.  We saw the same error message on Mar31 onwards.

    373072.777244 s: APP_LOG: ERROR: Unable to map memory @ 0xaf000000 of size 262144 bytes !!!
    APP: ERROR: Log writer init failed !!!
    APP_LOG: ERROR: Unable to map memory @ 0xb1000000 of size 3288576 bytes !!!
    APP: ERROR: File IO writer init failed !!!
    APP: Init ... Done !!!

    Fabiana debugged this to incorrect initialization in uEnv.txt

    It was written

    name_overlays=ti/k3-j784s4-edgeai-apps.dtbo ti/k3-am68-sk-v3link-fusion.dtbo

    name_overlays=ti/k3-v3link-imx219-0-0.dtbo

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

    The above line was not correct. They should be in one line as below.

    name_overlays=ti/k3-j784s4-edgeai-apps.dtbo ti/k3-am68-sk-v3link-fusion.dtbo ti/k3-v3link-imx219-0-0.dtbo.

    keeping it here for Posterity.

  • Hi Tapan,

    Glad we were able to find the issue! name_overlays should only be defined once in uEnv.txt, otherwise the overlays that were enabled prior will get overwritten by what was defined last.

    If you have any further questions or run into any issues, ask a new or related question on E2E. I will be closing this thread.

    Thank you,

    Fabiana