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.

TDA4VM: CSIRX receive data error

Part Number: TDA4VM

hi 

       we use deserializer TI960 and serializer ti933. The resolution is  deserializer  output  is 5120*960, 30 fps, yuv422. we configure 4 lane,800-880M

csi_laneBandSpeed.(we use PSDK8.01)

    sometimes the capture node has no frame data. i read 0x4504048, the value is 0x333300.is there some error in MIPI CLK?

    Is there anything else can debug?

  • Hi fengying li,

    sometimes the capture node has no frame data. i read 0x4504048, the value is 0x333300.is there some error in MIPI CLK?

    Yes, it seems there is no clock, when do you see this error? Any specific sequence/condition when you see this error? 

    Regards,

    Brijesh

  • There is no special opration or condition, i just running single_app demo. Then sometimes csi can't receive any data. 

  • MIPI CLK is prodiced by deserializer, isn't it? When this issue occur, i should debug TI960?

  • Hi,

    There is no special opration or condition, i just running single_app demo. Then sometimes csi can't receive any data. 

    Do you mean just running single-camera demo for longer run you are seeing this issue? Are you seeing this issue on EVM? or is it possible to recreate it on EVM? 

    Regards,

    Brijesh

  • Yes, i just just running single-camera demo, the first frame is can't be received.The refirence hardware is EVM, and we are customiazed boards. correct it,we use PSDK8.1

  • Hi,

    I am bit confused, is it on EVM and is single camera example working fine? 

    or do you see this issue after running single camera example for some time? 

    Regards,

    Brijesh

  • I haven't do test on EVM board. Moreover,on our customized board, this error doesn't necessarily occur,has a low probility.

  • Hi,

    Can you please apply attached patch and check it again? The patch is based on the SDK7.03, but changes are simple. Essentially, when the OpenVX capture node is opened for the first time, it would be reset.. Just to make sure, it is reset only first create time, a reference counted is used. 

    /cfs-file/__key/communityserver-discussions-components-files/791/tiovx.patch

    I have also shared the same patch on below link.

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/999099/tda4vm-camera-stream-not-working-for-different-combination-channel-mask-0xb

    Regards,

    Brijesh

  • Bad news,after we merge the patch, the issue occur every time in open single_app.

     69.222815 s:  VX_ZONE_ERROR:[ownContextSendCmd:815] Command ack message returned failure cmd_status: -1
        69.223025 s:  VX_ZONE_ERROR:[ownContextSendCmd:851] tivxEventWait() failed.
        69.223049 s:  VX_ZONE_ERROR:[ownNodeKernelInit:538] Target kernel, TIVX_CMD_NODE_CREATE failed for node node_95
        69.223066 s:  VX_ZONE_ERROR:[ownNodeKernelInit:539] Please be sure the target callbacks have been registered for this core
        69.223082 s:  VX_ZONE_ERROR:[ownNodeKernelInit:540] If the target callbacks have been registered, please ensure no errors are occurring within the create callback of this kernel
        69.223181 s:  VX_ZONE_ERROR:[ownGraphNodeKernelInit:583] kernel init for node 0, kernel com.ti.capture ... failed !!!
        69.223210 s:  VX_ZONE_ERROR:[vxVerifyGraph:2055] Node kernel init failed
        69.223227 s:  VX_ZONE_ERROR:[vxVerifyGraph:2109] Graph verify failed

  • But this is different error. Can you please share complete log? It seems some capture create is failing, are you sure it is because of newly added code? 

    Regards,

    Brijesh

  • 1. The following code in the tiovx.patch file will cause the tivxCaptResetInstance function call to fail:
    if (CSIRX_INSTANCE_ID_0 == instId)
    {
    module = TISCI_DEV_CSI_RX_IF0;
    }
    else if (CSIRX_INSTANCE_ID_0 == instId)
    {
    module = TISCI_DEV_CSI_RX_IF1;
    }
    else
    {
    VX_PRINT(VX_ZONE_ERROR, "Invalid Instance Id\n");
    status = -1;
    }
    change into:

    if (CSIRX_INSTANCE_ID_0 == instId)
    {
    module = TISCI_DEV_CSI_RX_IF0;
    }
    else if (CSIRX_INSTANCE_ID_1 == instId)
    {
    module = TISCI_DEV_CSI_RX_IF1;
    }
    else
    {
    VX_PRINT(VX_ZONE_ERROR, "Invalid Instance Id\n");
    status = -1;
    }

    is ok.

    2. Every time enter the single-camera demo, there will be the following function calls:
    CsirxDrv_create()
    --> CsirxDrv_modInstObjInit()
    --> instObj->lockSem = SemaphoreP_create(1U, &semParams);
    1) But we found that instObj->lockSem is not equal to null before calling the SemaphoreP_create() function, he has already been created.
    2) In addition, when the single-camera demo exits, instObj->lockSem is not released.

    This will cause the creation of SemaphoreP to fail after entering the single-camera demo multiple times. We have made the following changes, there is no problem at present, please help to confirm whether the changes are reasonable?

    diff --git a/pdk_jacinto/packages/ti/drv/csirx/src/csirx_drvInit.c b/pdk_jacinto/packages/ti/drv/csirx/src/csirx_drvInit.c
    old mode 100644
    new mode 100755
    index fdd9d64ba7..25b5a9f05c
    --- a/pdk_jacinto/packages/ti/drv/csirx/src/csirx_drvInit.c
    +++ b/pdk_jacinto/packages/ti/drv/csirx/src/csirx_drvInit.c
    @@ -500,7 +500,16 @@ int32_t CsirxDrv_modInstObjInit(CsirxDrv_InstObj *instObj, uint32_t instId)
    /* Allocate instance semaphore */
    SemaphoreP_Params_init(&semParams);
    semParams.mode = SemaphoreP_Mode_BINARY;
    - instObj->lockSem = SemaphoreP_create(1U, &semParams);
    + if (instObj->lockSem == NULL)
    + {
    + instObj->lockSem = SemaphoreP_create(1U, &semParams);
    + }
    + else
    + {
    + GT_0trace(
    + CsirxTrace, GT_ERR,
    + ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>lockSem is not null,not alloc sem!!\r\n");
    + }
    if (instObj->lockSem == NULL)
    {
    GT_0trace(

  • Hi, Brijesh Jadav
    After making the above modifications, we have used the single-camera demo to repeatedly open and exit the camera for 50 minutes without the camera getting stuck.Please help to confirm whether the above two modifications are reasonable?

  • Hi,

    I see below code in the Csirx_deInit, which means this semaphore does get deleted, but probable lockSem is not initialized to null after the delete call. Can you please add this statement and check it? 

    if (instObj->lockSem != NULL)
    {
        /* Delete semaphore */
        (void)SemaphoreP_delete(instObj->lockSem);

        instObj->lockSem = NULL;
    }

    Regards,

    Brijesh

  • Hi, Brijesh Jadav

    This does not seem to be the case, as follows:
    1. rtos-sdk/vision_apps/platform/j721e/rtos/common/app_init.c
    Csirx_init() should be called at boot time:
    int32_t appInit()
    -- >int32_t appCsi2RxDeInit(void)
    --> retVal = Csirx_deInit();

    Csirx_deInit() calling relationship:
    void appDeInit()
    --> int32_t appCsi2RxDeInit(void)
    --> retVal = Csirx_deInit();

    boot time log:

    [MCU2_0] 3-21 18:26:34.68322 1.562430 s: CIO: Init ... Done !!!
    [MCU2_0] 3-21 18:26:34.68354 1.562498 s: ### CPU Frequency = 1000000000 Hz
    [MCU2_0] 3-21 18:26:34.68386 1.562546 s: Platform APP: Init ... !!!
    [MCU2_0] 3-21 18:26:34.68409 1.562576 s: SCICLIENT: Init ... !!!
    [MCU2_0] 3-21 18:26:34.68442 1.562947 s: SCICLIENT: DMSC FW version [21.9.1--v2021.09a (Terrific Lla]
    [MCU2_0] 3-21 18:26:34.68477 1.562997 s: SCICLIENT: DMSC FW revision 0x15
    [MCU2_0] 3-21 18:26:34.68502 1.563034 s: SCICLIENT: DMSC FW ABI revision 3.1
    [MCU2_0] 3-21 18:26:34.68527 1.563072 s: SCICLIENT: Init ... Done !!!
    [MCU2_0] 3-21 18:26:34.68551 1.563104 s: UDMA: Init ... !!!
    [MCU2_0] 3-21 18:26:34.68572 1.564509 s: UDMA: Init ... Done !!!
    [MCU2_0] 3-21 18:26:34.68595 1.564572 s: MEM: Init ... !!!
    [MCU2_0] 3-21 18:26:34.68635 1.564617 s: MEM: Created heap (DDR_SHARED_MEM, id=0, flags=0x00000004) @ d9000000 of size 16777216 bytes !!!
    [MCU2_0] 3-21 18:26:34.68668 1.564697 s: MEM: Created heap (L3_MEM, id=1, flags=0x00000000) @ 3600000 of size 262144 bytes !!!
    [MCU2_0] 3-21 18:26:34.68689 1.564760 s: MEM: Init ... Done !!!
    [MCU2_0] 3-21 18:26:34.68718 1.564789 s: IPC: Init ... !!!
    [MCU2_0] 3-21 18:26:34.68742 1.564852 s: IPC: 9 CPUs participating in IPC !!!
    [MCU2_0] 3-21 18:26:34.68766 1.564906 s: IPC: Waiting for HLOS to be ready ... !!!
    [MCU2_0] 3-21 18:26:34.68786 6.128556 s: IPC: HLOS is ready !!!
    [MCU2_0] 3-21 18:26:34.68807 6.152212 s: IPC: Init ... Done !!!
    [MCU2_0] 3-21 18:26:34.68836 6.152278 s: APP: Syncing with 8 CPUs ... !!!
    [MCU2_0] 3-21 18:26:34.68860 6.362895 s: APP: Syncing with 8 CPUs ... Done !!!
    [MCU2_0] 3-21 18:26:34.68882 6.363168 s: REMOTE_SERVICE: Init ... !!!
    [MCU2_0] 3-21 18:26:34.68904 6.364992 s: REMOTE_SERVICE: Init ... Done !!!
    [MCU2_0] 3-21 18:26:34.68930 6.365059 s: ETHFW: Init ... !!!
    [MCU2_0] 3-21 18:26:34.68958 6.387734 s: ETHFW: Shared multicasts (software fanout):
    [MCU2_0] 3-21 18:26:34.68978 6.387806 s: 01:00:5e:00:00:01
    [MCU2_0] 3-21 18:26:34.68999 6.387864 s: 01:00:5e:00:00:fb
    [MCU2_0] 3-21 18:26:34.69021 6.387914 s: 01:00:5e:00:00:fc
    [MCU2_0] 3-21 18:26:34.69049 6.387962 s: 33:33:00:00:00:01
    [MCU2_0] 3-21 18:26:34.69070 6.388009 s: 33:33:ff:1d:92:c2
    [MCU2_0] 3-21 18:26:34.69092 6.388055 s: 01:80:c2:00:00:00
    [MCU2_0] 3-21 18:26:34.69113 6.388101 s: 01:80:c2:00:00:03
    [MCU2_0] 3-21 18:26:34.69135 6.388158 s: ETHFW: Reserved multicasts:
    [MCU2_0] 3-21 18:26:34.69155 6.388189 s: 01:80:c2:00:00:0e
    [MCU2_0] 3-21 18:26:34.69177 6.388239 s: 01:1b:19:00:00:00
    [MCU2_0] 3-21 18:26:34.69200 6.388481 s: EnetMcm: CPSW_9G on MAIN NAVSS
    [MCU2_0] 3-21 18:26:34.69218 6.403682 s:
    [MCU2_0] E3-21 18:26:34.69238 THFW Version : 0.02.00
    [MCU2_0] 3-21 18:26:34.69260 6.403767 s: ETHFW Build Date: May 6, 2022
    [MCU2_0] 3-21 18:26:34.69281 6.403804 s: ETHFW Build Time: 09:41:53
    [MCU2_0] 3-21 18:26:34.69303 6.403832 s: ETHFW Commit SHA: 575d3b43
    [MCU2_0] 3-21 18:26:34.69326 6.403909 s: ETHFW: Init ... DONE !!!
    [MCU2_0] 3-21 18:26:34.69349 6.403946 s: ETHFW: Remove server Init ... !!!
    [MCU2_0] 3-21 18:26:34.69374 6.404159 s: CpswProxyServer: Virtual port configuration:
    [MCU2_0] 3-21 18:26:34.69400 6.404220 s: mpu_1_0 <-> Switch port 0: mpu_1_0_ethswitch-device-0
    [MCU2_0] 3-21 18:26:34.69430 6.404270 s: mcu_2_1 <-> Switch port 1: mcu_2_1_ethswitch-device-1
    [MCU2_0] 3-21 18:26:34.69455 6.404315 s: mpu_1_0 <-> MAC port 1: mpu_1_0_ethmac-device-1
    [MCU2_0] 3-21 18:26:34.69480 6.404358 s: mcu_2_1 <-> MAC port 4: mcu_2_1_ethmac-device-4
    [MCU2_0] 3-21 18:26:34.69507 6.405443 s: CpswProxyServer: initialization completed (core: mcu2_0)
    [MCU2_0] 3-21 18:26:34.69530 6.405511 s: ETHFW: Remove server Init ... DONE !!!
    [MCU2_0] 3-21 18:26:34.69561 6.406677 s: Starting lwIP, local interface IP is dhcp-enabled
    [MCU2_0] 3-21 18:26:34.69585 6.413786 s: Host MAC address: 70:ff:76:1d:92:c3
    [MCU2_0] 3-21 18:26:34.69612 6.418015 s: [LWIPIF_LWIP] Enet LLD netif initialized successfully
    [MCU2_0] 3-21 18:26:34.69638 6.448718 s: [LWIPIF_LWIP_IC] Interface started successfully
    [MCU2_0] 3-21 18:26:34.69661 6.448794 s: [LWIPIF_LWIP_IC] NETIF INIT SUCCESS
    [MCU2_0] 3-21 18:26:34.69682 6.460161 s: FVID2: Init ... !!!
    [MCU2_0] 3-21 18:26:34.69703 6.460262 s: FVID2: Init ... Done !!!
    [MCU2_0] 3-21 18:26:34.69723 6.460321 s: DSS: Init ... !!!
    [MCU2_0] 3-21 18:26:34.69745 6.460357 s: DSS: Display type is eDP !!!
    [MCU2_0] 3-21 18:26:34.69766 6.460389 s: DSS: M2M Path is enabled !!!
    [MCU2_0] 3-21 18:26:34.69787 6.460417 s: DSS: SoC init ... !!!
    [MCU2_0] 3-21 18:26:34.69816 6.460445 s: SCICLIENT: Sciclient_pmSetModuleState module=152 state=2
    [MCU2_0] 3-21 18:26:34.69845 6.460689 s: SCICLIENT: Sciclient_pmSetModuleState success
    [MCU2_0] 3-21 18:26:34.69870 6.460731 s: SCICLIENT: Sciclient_pmSetModuleState module=297 state=2
    [MCU2_0] 3-21 18:26:34.69895 6.460936 s: SCICLIENT: Sciclient_pmSetModuleState success
    [MCU2_0] 3-21 18:26:34.69928 6.460976 s: SCICLIENT: Sciclient_pmSetModuleState module=151 state=2
    [MCU2_0] 3-21 18:26:34.69954 6.461259 s: SCICLIENT: Sciclient_pmSetModuleState success
    [MCU2_0] 3-21 18:26:34.69982 6.461315 s: SCICLIENT: Sciclient_pmSetModuleClkParent module=152 clk=9 parent=11
    [MCU2_0] 3-21 18:26:34.70006 6.461471 s: SCICLIENT: Sciclient_pmSetModuleClkParent success
    [MCU2_0] 3-21 18:26:34.70035 6.461515 s: SCICLIENT: Sciclient_pmSetModuleClkParent module=152 clk=13 parent=18
    [MCU2_0] 3-21 18:26:34.70060 6.461642 s: SCICLIENT: Sciclient_pmSetModuleClkParent success
    [MCU2_0] 3-21 18:26:34.70087 6.461682 s: SCICLIENT: Sciclient_pmSetModuleClkParent module=152 clk=1 parent=2
    [MCU2_0] 3-21 18:26:34.70111 6.461792 s: SCICLIENT: Sciclient_pmSetModuleClkParent success
    [MCU2_0] 3-21 18:26:34.70140 6.461833 s: SCICLIENT: Sciclient_pmSetModuleClkFreq module=152 clk=1 freq=148500000
    [MCU2_0] 3-21 18:26:34.70165 6.463209 s: SCICLIENT: Sciclient_pmSetModuleClkFreq success
    [MCU2_0] 3-21 18:26:34.70194 6.463268 s: SCICLIENT: Sciclient_pmModuleClkRequest module=152 clk=1 state=2 flag=0
    [MCU2_0] 3-21 18:26:34.70219 6.463449 s: SCICLIENT: Sciclient_pmModuleClkRequest success
    [MCU2_0] 3-21 18:26:34.70241 6.463491 s: DSS: SoC init ... Done !!!
    [MCU2_0] 3-21 18:26:34.70262 6.463522 s: DSS: Board init ... !!!
    [MCU2_0] 3-21 18:26:34.70287 6.463550 s: DSS: Board init ... Done !!!
    [MCU2_0] 3-21 18:26:34.70309 6.483370 s: DSS: Init ... Done !!!
    [MCU2_0] 3-21 18:26:34.70336 6.483437 s: VHWA: VPAC Init ... !!!
    [MCU2_0] 3-21 18:26:34.70378 6.483470 s: SCICLIENT: Sciclient_pmSetModuleState module=290 state=2
    [MCU2_0] 3-21 18:26:34.70406 6.483705 s: SCICLIENT: Sciclient_pmSetModuleState success
    [MCU2_0] 3-21 18:26:34.70430 6.483746 s: VHWA: LDC Init ... !!!
    [MCU2_0] 3-21 18:26:34.70454 6.487774 s: VHWA: LDC Init ... Done !!!
    [MCU2_0] 3-21 18:26:34.70482 6.487837 s: VHWA: MSC Init ... !!!
    [MCU2_0] 3-21 18:26:34.70515 6.500286 s: VHWA: MSC Init ... Done !!!
    [MCU2_0] 3-21 18:26:34.70544 6.500351 s: VHWA: NF Init ... !!!
    [MCU2_0] 3-21 18:26:34.70576 6.502570 s: VHWA: NF Init ... Done !!!
    [MCU2_0] 3-21 18:26:34.70608 6.502634 s: VHWA: VISS Init ... !!!
    [MCU2_0] 3-21 18:26:34.70631 6.515013 s: VHWA: VISS Init ... Done !!!
    [MCU2_0] 3-21 18:26:34.70663 6.515082 s: VHWA: VPAC Init ... Done !!!
    [MCU2_0] 3-21 18:26:34.70684 6.515130 s: VX_ZONE_INIT:Enabled

    2. Every time you enter the single-camera demo, the following calls will have the following calling relationships:
    CsirxDrv_create()
    --> CsirxDrv_modInstObjInit()
    --> instObj->lockSem = SemaphoreP_create(1U, &semParams);

    But the sem created here has no function to go back and release it. Entering and exiting the single-camera demo multiple times will cause the SemaphoreP_create() function call to fail.

    log:

    root@j7-evm:/opt/vision_apps# ./run_app_single_cam.sh
    Linux 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 !!!
    885.430455 s: GTC Frequency = 200 MHz
    APP: Init ... Done !!!
    885.430587 s: VX_ZONE_INIT:Enabled
    885.430609 s: VX_ZONE_ERROR:Enabled
    885.430627 s: VX_ZONE_WARNING:Enabled
    885.431135 s: VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
    885.431405 s: VX_ZONE_INIT:[tivxHostInitLocal:86] Initialization Done for HOST !!!
    sensor_selection = [0]
    ldc_enable = [0]
    num_frames_to_run = [1000000000]
    is_interactive = [1]
    IttCtrl_registerHandler: command echo registered at location 0
    IttCtrl_registerHandler: command iss_read_2a_params registered at location 1
    IttCtrl_registerHandler: command iss_write_2a_params registered at location 2
    IttCtrl_registerHandler: command iss_raw_save registered at location 3
    IttCtrl_registerHandler: command iss_yuv_save registered at location 4
    IttCtrl_registerHandler: command iss_read_sensor_reg registered at location 5
    IttCtrl_registerHandler: command iss_write_sensor_reg registered at location 6
    IttCtrl_registerHandler: command dev_ctrl registered at location 7
    IttCtrl_registerHandler: command iss_send_dcc_file registered at location 8
    885.434410 s: ISS: Enumerating sensors ... !!!
    NETWORK: Opened at IP Addr = 1.4.16.64, socket port=5000!!!
    [MCU2_0] 885.963666 s: iss_sensors.c: gISS_Sensor_I2cHandle = a37cc21c
    [MCU2_0] 885.964205 s: read deSerial Device TI960 ID success! regValue=0x60 status=0
    [MCU2_0] 885.964277 s: UB960 config start
    886.511320 s: ISS: Enumerating sensors ... found 0 : ST_UB960_UB933_UYVY
    Select camera port index 0-7 : [MCU2_0] 886.510056 s: ds90ub960 port:2 read ser_id:0xb0 success count:1
    [MCU2_0] 886.510111 s: Enter: Get_ST_Ub933_status() Shengtai module connected
    [MCU2_0] 886.510901 s: ds90ub960 port:3 read ser_id:0xb0 success count:1
    [MCU2_0] 886.510954 s: Enter: Get_ST_Ub933_status() Shengtai module connected
    [MCU2_0] 886.511041 s: Enumerate to a camera module ===>> [num: 2, i: 0, count: 0, sensor name: ST_UB960_UB933_UYVY]
    [MCU2_0] 886.511108 s: ImageSensor_RemoteServiceHandler 2297 return status 0

    Invalid entry
    . Please choose between 0 and 7
    Select camera port index 0-7 : 0
    1 registered sensor drivers
    a : ST_UB960_UB933_UYVY
    Select a sensor above or press '0' to autodetect the sensor : Invalid selection
    . Try again
    1 registered sensor drivers
    a : ST_UB960_UB933_UYVY
    Select a sensor above or press '0' to autodetect the sensor : a
    Sensor selected : ST_UB960_UB933_UYVY
    LDC Selection Yes(1)/No(0) : LDC Selection Yes(1)/No(0) : 0
    Querying ST_UB960_UB933_UYVY
    889.213555 s: ISS: Querying sensor [ST_UB960_UB933_UYVY] ... !!!
    889.214142 s: ISS: Querying sensor [ST_UB960_UB933_UYVY] ... Done !!!
    YUV Input selected. VISS and AEWB nodes will be bypassed.
    889.214182 s: ISS: Initializing sensor [ST_UB960_UB933_UYVY], doing IM_SENSOR_CMD_PWRON ... !!!
    889.214873 s: ISS: Initializing sensor [ST_UB960_UB933_UYVY], doing IM_SENSOR_CMD_CONFIG ... !!!
    889.215546 s: ISS: Initializing sensor [ST_UB960_UB933_UYVY] ... Done !!!
    [MCU2_0] 889.213786 s: ImageSensor_RemoteServiceHandler: IM_SENSOR_CMD_QUERY
    [MCU2_0] 889.213861 s: Received Query for ST_UB960_UB933_UYVY
    [MCU2_0] 889.213937 s: ImageSensor_RemoteServiceHandler 2297 return status 0
    [MCU2_0] 889.214376 s: ImageSensor_RemoteServiceHandler: IM_SENSOR_CMD_PWRON
    [MCU2_0] 889.214434 s: IM_SENSOR_CMD_PWRON : channel_mask = 0x1
    [MCU2_0] 889.214489 s: gz_dsub960_PowerOn start
    [MCU2_0] 889.214523 s: gz_dsub960_PowerOn end
    [MCU2_0] 889.214628 s: ImageSensor_RemoteServiceHandler 2297 return status 0
    [MCU2_0] 889.215083 s: ImageSensor_RemoteServiceHandler: IM_SENSOR_CMD_CONFIG
    [MCU2_0] 889.215140 s: Application requested features = 0x0
    [MCU2_0]
    [MCU2_0] 889.215184 s: Configuring camera # 0
    [MCU2_0] 889.215220 s: Enter func: st_dsub960_Config()
    [MCU2_0] 889.215249 s: Exit func: st_dsub960_Config()
    [MCU2_0] 889.215278 s: IM_SENSOR_CMD_CONFIG returning status = 0
    [MCU2_0] 889.215339 s: ImageSensor_RemoteServiceHandler 2297 return status 0
    [MCU2_0] 889.222207 s: src/csirx_drvInit.c @ Line 508:
    [MCU2_0] 889.222262 s: Instance semaphore create failed!!


    3. By printing the log single-camera demo appInit() and appDeinit() are appInit() and appDeinit() in vision_apps/platform/j721e/linux/app_init.c file.
    So the Csirx_deInit() function will not be called when exiting the single-camera demo

    Enter and exit the single-camera demo log:

    root@j7-evm:/opt/vision_apps# ./run_app_single_cam.sh
    Linux 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 !!!
    53.227964 s: GTC Frequency = 200 MHz
    APP: Init ... Done !!!
    53.234003 s: VX_ZONE_INIT:Enabled
    53.234034 s: VX_ZONE_ERROR:Enabled
    53.234040 s: VX_ZONE_WARNING:Enabled
    53.237936 s: VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
    53.244453 s: VX_ZONE_INIT:[tivxHostInitLocal:86] Initialization Done for HOST !!!
    sensor_selection = [0]
    ldc_enable = [0]
    num_frames_to_run = [1000000000]
    is_interactive = [1]
    IttCtrl_registerHandler: command echo registered at location 0
    IttCtrl_registerHandler: command iss_read_2a_params registered at location 1
    IttCtrl_registerHandler: command iss_write_2a_params registered at location 2
    IttCtrl_registerHandler: command iss_raw_save registered at location 3
    IttCtrl_registerHandler: command iss_yuv_save registered at location 4
    IttCtrl_registerHandler: command iss_read_sensor_reg registered at location 5
    IttCtrl_registerHandler: command iss_write_sensor_reg registered at location 6
    IttCtrl_registerHandler: command dev_ctrl registered at location 7
    IttCtrl_registerHandler: command iss_send_dcc_file registered at location 8
    NETWORK: Opened at IP Addr = 1.4.16.64, socket port=5000!!!
    53.262930 s: ISS: Enumerating sensors ... !!!
    [MCU2_0] 53.263638 s: ImageSensor_RemoteServiceHandler: IM_SENSOR_CMD_CREATE
    [MCU2_0] 53.263725 s: Enter: IssSensor_Dsub960_GpioInit() ...
    [MCU2_0] 53.263767 s: Enter: IssSensor_Dsub960_GpioPowerUpSequence() ...
    [MCU2_0] 53.792340 s: iss_sensors.c: gISS_Sensor_I2cHandle = a37cc61c
    54.340073 s: ISS: Enumerating sensors ... found 0 : ST_UB960_UB933_UYVY
    Select camera port index 0-7 : [MCU2_0] 54.337908 s: ds90ub960 port:1 read ser_id:0xb0 success count:1
    [MCU2_0] 54.337971 s: Enter: Get_ST_Ub933_status() Shengtai module connected
    [MCU2_0] 54.338774 s: ds90ub960 port:2 read ser_id:0xb0 success count:1
    [MCU2_0] 54.338841 s: Enter: Get_ST_Ub933_status() Shengtai module connected
    [MCU2_0] 54.339636 s: ds90ub960 port:3 read ser_id:0xb0 success count:1
    [MCU2_0] 54.339699 s: Enter: Get_ST_Ub933_status() Shengtai module connected
    [MCU2_0] 54.339782 s: Enumerate to a camera module ===>> [num: 2, i: 0, count: 0, sensor name: ST_UB960_UB933_UYVY]
    [MCU2_0] 54.339850 s: ImageSensor_RemoteServiceHandler 2297 return status 0

    Invalid entry
    . Please choose between 0 and 7
    Select camera port index 0-7 : 0
    1 registered sensor drivers
    a : ST_UB960_UB933_UYVY
    Select a sensor above or press '0' to autodetect the sensor : Invalid selection
    . Try again
    1 registered sensor drivers
    a : ST_UB960_UB933_UYVY
    Select a sensor above or press '0' to autodetect the sensor : a
    Sensor selected : ST_UB960_UB933_UYVY
    LDC Selection Yes(1)/No(0) : LDC Selection Yes(1)/No(0) : 1
    Querying ST_UB960_UB933_UYVY
    61.705902 s: ISS: Querying sensor [ST_UB960_UB933_UYVY] ... !!!
    61.706638 s: ISS: Querying sensor [ST_UB960_UB933_UYVY] ... Done !!!
    YUV Input selected. VISS and AEWB nodes will be bypassed.
    61.706670 s: ISS: Initializing sensor [ST_UB960_UB933_UYVY], doing IM_SENSOR_CMD_PWRON ... !!!
    61.707271 s: ISS: Initializing sensor [ST_UB960_UB933_UYVY], doing IM_SENSOR_CMD_CONFIG ... !!!
    61.707935 s: ISS: Initializing sensor [ST_UB960_UB933_UYVY] ... Done !!!
    Enabling LDC
    Creating LDC
    Invalid DCC size for LDC. Disabling DCC
    [MCU2_0] 61.734821 s: VX_ZONE_ERROR:[tivxCaptResetInstance:2204] Instance Id = 0
    [MCU2_0] 61.735479 s: VX_ZONE_ERROR:[tivxCaptResetInstance:2204] Instance Id = 1
    [MCU2_0] 61.735905 s: src/csirx_drv.c @ Line 293:
    [MCU2_0] 61.735948 s: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Creat sub semaphore???
    [MCU2_0] 61.736038 s: src/csirx_drvInit.c @ Line 521:
    [MCU2_0] 61.736073 s: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>lockSem is not null !!
    [MCU2_0] 61.736122 s: src/csirx_drvInit.c @ Line 526:
    [MCU2_0] 61.736158 s: max g_Semmax = 0x360
    [MCU2_0] 61.736192 s: src/csirx_drvInit.c @ Line 530:
    [MCU2_0] 61.736227 s: current g_SemCnt = 0x153
    [MCU2_0] 61.736325 s: src/csirx_drvInit.c @ Line 539:
    [MCU2_0] 61.736362 s: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>lockSem is not null,not alloc sem!!
    [MCU2_0] 61.736414 s: src/csirx_drvInit.c @ Line 550:
    [MCU2_0] 61.736450 s: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Creat semaphore!!
    Scaler is enabled


    ==========================
    Demo : Single Camera w/ 2A
    ==========================

    p: Print performance statistics

    s: Save Sensor RAW, VISS Output and H3A output images to File System

    e: Export performance statistics

    u: Update DCC from File System


    x: Exit

    Enter Choice:
    Unsupported command

    ==========================
    Demo : Single Camera w/ 2A
    ==========================

    p: Print performance statistics

    s: Save Sensor RAW, VISS Output and H3A output images to File System

    e: Export performance statistics

    u: Update DCC from File System


    x: Exit

    Enter Choice: 61.759238 s: ISS: Starting sensor [ST_UB960_UB933_UYVY] ... !!!
    61.791935 s: ISS: Starting sensor [ST_UB960_UB933_UYVY] ... !!!
    get_dcc_dir_size : Could not open directory or directory is empty /opt/vision_apps/dcc/ST_UB960_UB933_UYVY/wdr


    Unsupported command

    ==========================
    Demo : Single Camera w/ 2A
    ==========================

    p: Print performance statistics

    s: Save Sensor RAW, VISS Output and H3A output images to File System

    e: Export performance statistics

    u: Update DCC from File System


    x: Exit

    Enter Choice: x

    62.872402 s: ISS: Stopping sensor [ST_UB960_UB933_UYVY] ... !!!
    62.888943 s: ISS: Stopping sensor [ST_UB960_UB933_UYVY] ... Done !!!
    [MCU2_0] 62.888589 s: End of UB960.c config
    [MCU2_0] 62.888659 s: gz_dsub960_StreamOff end
    [MCU2_0] 62.888717 s: ImageSensor_RemoteServiceHandler 2297 return status 0
    62.970639 s: ISS: Stopping sensor [ST_UB960_UB933_UYVY] ... !!!
    [MCU2_0] 62.970884 s: ImageSensor_RemoteServiceHandler: IM_SENSOR_CMD_STREAM_OFF
    [MCU2_0] 62.970967 s: IM_SENSOR_CMD_STREAM_ON: channel_mask = 0x1
    [MCU2_0] 62.971036 s: st_dsub960_StreamOff start
    [MCU2_0] 62.971075 s: UB960 config start
    62.987922 s: ISS: Stopping sensor [ST_UB960_UB933_UYVY] ... Done !!!
    releasing capture node
    releasing displayNode
    releasing cap_frame # 0
    releasing cap_frame # 1
    releasing cap_frame # 2
    releasing cap_frame # 3
    releasing capt_yuv_image
    releasing Display Param Data Object
    releasing LDC Mesh Image
    releasing LDC Output Image
    releasing LDC Mesh Parameters Object
    releasing LDC Parameters Object
    releasing LDC Region Parameters Object
    releasing LDC Node
    releasing Scaler Output Image
    releasing Scaler Node
    release Scalar coefficient data object
    releasing graph
    [MCU2_0] 62.990215 s: ==========================================================
    [MCU2_0] 62.990366 s: Capture Status: Instance|1
    [MCU2_0] 62.990404 s: ==========================================================
    [MCU2_0] 62.990450 s: overflowCount: 0
    [MCU2_0] 62.990487 s: spuriousUdmaIntrCount: 0
    [MCU2_0] 62.990527 s: frontFIFOOvflCount: 0
    [MCU2_0] 62.990565 s: crcCount: 0
    [MCU2_0] 62.990598 s: eccCount: 0
    [MCU2_0] 62.990632 s: correctedEccCount: 0
    [MCU2_0] 62.990669 s: dataIdErrorCount: 0
    [MCU2_0] 62.990707 s: invalidAccessCount: 0
    [MCU2_0] 62.990746 s: invalidSpCount: 0
    [MCU2_0] 62.990787 s: strmFIFOOvflCount[0]: 0
    [MCU2_0] 62.990820 s: Channel Num | Frame Queue Count | Frame De-queue Count | Frame Drop Count | Error Frame Count |
    releasing graph done
    63.006368 s: ISS: De-initializing sensor [ST_UB960_UB933_UYVY] ... !!!
    63.009675 s: ISS: De-initializing sensor [ST_UB960_UB933_UYVY] ... Done !!!
    63.009713 s: VX_ZONE_INIT:[tivxHostDeInitLocal:100] De-Initialization Done for HOST !!!
    63.016057 s: VX_ZONE_INIT:[tivxDeInitLocal:193] De-Initialization Done !!!
    LinuxLinux APP: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... Done !!!
    IPC: Deinit ... !!!
    IPC: DeInit ... Done !!!
    MEM: Deinit ... !!!
    MEM: Alloc's: 19 alloc's of 64745376 bytes
    MEM: Free's : 19 free's of 64745376 bytes
    MEM: Open's : 0 allocs of 0 bytes
    MEM: Deinit ... Done !!!
    APP: Deinit ... Done !!!

  • int32_t appInit()
    -- >int32_t appCsi2RxDeInit(void)
    --> retVal = Csirx_deInit();

    appinit does not call deinit of the csirx. i dont think this is correct. 

    CsirxDrv_create()
    --> CsirxDrv_modInstObjInit()
    --> instObj->lockSem = SemaphoreP_create(1U, &semParams);

    ok i see, can you please remove call to CsirxDrv_modInstObjInit from CsirxDrv_create? I see it removed from the latest release.

    But this should not cause crash, it will cause semaphore leak.. 

    Regards,

    Brijesh

  • SemaphoreP_create

    Hi,Brijesh Jadav
    Thank you for your response.
    1. We have verified your suggestion, and the verification result failed, as follows:
    1) It is ok to enter and exit the single-camera demo app for the first time;
    2) After entering the single-camera demo for the second time, you cannot exit and will be stuck;
    Is it ok to just remove CsirxDrv_modInstObjInit from CsirxDrv_create in the latest version?

    2. Our preliminary test is that the tiovx.patch file is useful for the camera stuck problem.
    But when we do more single-camera demo entry and exit, the problem of semaphore leak occurs. It will cause the csirx initialization to fail when entering the single-camera demo.
    Therefore, the problem of semaphore leakage must be solved at the same time.

  • Hi,Brijesh Jadav
    We found that if we add the modified content in the tiovx.patch file and delete CsirxDrv_modInstObjInit from CsirxDrv_create at the same time, it will not be able to exit the app after entering the single-camera demo for the second time.
    If we just delete CsirxDrv_modInstObjInit from CsirxDrv_create and do not add the modifications in the tiovx.patch file, it can enter and exit the single-camera demo repeatedly, but the camera will get stuck after a while.
    In this way, the modification in the tiovx.patch file conflicts with the deletion of CsirxDrv_modInstObjInit from CsirxDrv_create.
    So, please help to confirm again, thank you~!

  • Hi,

    Is it possible to check this in the latest release ie SDK8.2? Because of many of them are properly fixed in the this release? 

    Regards,

    Brijesh 

  • Hi, 
    Sorry for the late reply.
    1. We have no plan to upgrade version 8.2, but I downloaded the code of version 8.2. In version 8.2 CsirxDrv_modInstObjInit was indeed removed from CsirxDrv_create, but the modification of tiovx.patch was not integrated.
    2. There is a question I want to know first, when calling
    status = Sciclient_pmSetModuleState(module, TISCI_MSG_VALUE_DEVICE_SW_STATE_AUTO_OFF, TISCI_MSG_FLAG_AOP, SCICLIENT_SERVICE_WAIT_FOREVER);
    Does the csirx driver do some processing? Or does the csirx driver do nothing but the csirx controller inside the TDA4 does a reset?

  • Hi,

    Does the csirx driver do some processing? Or does the csirx driver do nothing but the csirx controller inside the TDA4 does a reset?

    No, driver does not do anything here. This code just resets CSIRX controller. 

    Regards,

    Brijesh