Tool/software:
Hello,
I want to convert the output of srv to NV12, and then go through scaler nodes, mosaic nodes, and display nodes. I encountered some problems during this process and hope to get your help.
I did the following test. SDK:08-04
1. capture(yuv422)->ldc(NV12)->srv(RGBX)->m2m(NV12)->display
The screen is as shown in Figure 1. When I delete vxReplicateNode() in "app_fmt_cnv_module.c" obtained from [FAQ] TDA4VM: How to use DSS M2M for format conversion? - Processors forum - Processors - TI E2E support forums, the screen can output normally.
2. capture(yuv422)->ldc(NV12)->srv(RGBX)->m2m(NV12)->scaler->mosaic->display
When deleting vxReplicateNode() in "app_fmt_cnv_module.c",
some of the logs are as follows.
69.713375 s: ISS: Initializing sensor [SG2-IMX390C-5200-FPDLINK] ... Done !!! Sensor init done! captureObj->params.numDataLanes = 4 captureObj->params.dataLanesMap[0] = 1 captureObj->params.dataLanesMap[1] = 2 captureObj->params.dataLanesMap[2] = 3 captureObj->params.dataLanesMap[3] = 4 sensorObj->sensor_dcc_enabled=1 sensorObj->sensor_name=SG2-IMX390C-5200-FPDLINK sensorObj->sensor_wdr_enabled=0 sensorObj->sensorParams.dccId=6100 LDC init done! capture init done! Reading calmat file Calmat size for cnt 0 = 48 Calmat size for cnt 1 = 48 Calmat size for cnt 2 = 48 Calmat size for cnt 3 = 48 For Camera = 0 Ref calmat[0] = 1072386015 Ref Calmat[11] = -2545998 For Camera = 1 Ref calmat[0] = 4014387 Ref Calmat[11] = -2127016 For Camera = 2 Ref calmat[0] = -1071093409 Ref Calmat[11] = 2069336 For Camera = 3 Ref calmat[0] = 5995671 Ref Calmat[11] = 2050034 file read completed --------------out_gpulut_array done ------------ --------in_params.SVInCamFrmHeight, weight:1080,1920 srv init done! [FMT-CONV-MODULE]: Num Channels 1 WxH 1920x1080 FMT conversion init done! Creating VX_DF_IMAGE_NV12 image! scaler init done! Img Mosaic init done! -----------DISPLAY1 target enable Display init done! App Init Done! Graph create done! Capture graph done! dcc->config nonempty LDC graph done! GPU LUT Graph Verify successful!Adding SRV write node on graph .. SRV write node added! srv graph done! fmt conversion graph done! scaler output number:1 output1------------------ scaler graph done! enable_mosaic and enable_scaler! Img Mosaic graph done! Display graph done! ldc Pipeline params setup done! SRV Pipeline params setup done! 69.738939 s: VX_ZONE_ERROR:[tivxSetNodeParameterNumBufByIndex:2325] Invalid parameters fmt conversion Pipeline params setup done! scaler Pipeline params setup done! MOSAIC Pipeline params setup done! App Create Graph Done! EGL: version 1.5 ----------verify status:0 Graph verify done! App Verify Graph Done! APP GPU LUT Graph Done app_pipeline_params_defaults returned 70.278618 s: ISS: Starting sensor [SG2-IMX390C-5200-FPDLINK] ... !!! ========================= Demo : Camera Demo ========================= s: Save CSIx, VISS and LDC outputs p: Print performance statistics x: Exit Enter Choice: ========================= Demo : Camera Demo ========================= s: Save CSIx, VISS and LDC outputs p: Print performance statistics x: Exit Enter Choice: 70.919367 s: ISS: Starting sensor [SG2-IMX390C-5200-FPDLINK] ... !!! appStartImageSensor returned with status: 0 [MCU2_0] 71.069698 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed [MCU2_0] 71.103433 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed [MCU2_0] 71.137479 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed [MCU2_0] 71.178563 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed [MCU2_0] 71.208685 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed [MCU2_0] 71.242017 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed x[MCU2_0] 95.508683 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed [MCU2_0] 95.574592 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed [MCU2_0] 95.607612 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed [MCU2_0] 95.641344 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed [MCU2_0] 95.707529 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed [MCU2_0] 95.741622 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed [MCU2_0] 95.774668 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed [MCU2_0] 95.841347 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed [MCU2_0] 95.874431 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed [MCU2_0] 95.907657 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed ... [MCU2_0] 95.974664 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed [MCU2_0] 96.007589 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed [MCU2_0] 96.040724 s: VX_ZONE_ERROR:[tivxVpacMscScaleProcess:698] NULL Params check failed 96.059319 s: ISS: Stopping sensor [SG2-IMX390C-5200-FPDLINK] ... !!! 96.187352 s: ISS: Stopping sensor [SG2-IMX390C-5200-FPDLINK] ... Done !!! App Run Graph Done! Capture delete done! VISS delete done! AEWB delete done! LDC delete done! srv delete done! fmt conversion detele done scaler deinit done! Img Mosaic delete done! Display delete done! [MCU2_0] 96.239175 s: ========================================================== [MCU2_0] 96.239274 s: Capture Status: Instance|0 [MCU2_0] 96.239315 s: ========================================================== [MCU2_0] 96.239363 s: overflowCount: 0 [MCU2_0] 96.239399 s: spuriousUdmaIntrCount: 0 [MCU2_0] 96.239438 s: frontFIFOOvflCount: 0 [MCU2_0] 96.239474 s: crcCount: 1 [MCU2_0] 96.239506 s: eccCount: 0 [MCU2_0] 96.239539 s: correctedEccCount: 0 [MCU2_0] 96.239574 s: dataIdErrorCount: 0 [MCU2_0] 96.239613 s: invalidAccessCount: 0 [MCU2_0] 96.239650 s: invalidSpCount: 0 [MCU2_0] 96.239688 s: strmFIFOOvflCount[0]: 0 [MCU2_0] 96.239722 s: Channel Num | Frame Queue Count | Frame De-queue Count | Frame Drop Count | Error Frame Count | [MCU2_0] 96.239799 s: 0 | 754 | 754 | 2 | 0 | [MCU2_0] 96.239878 s: 1 | 754 | 754 | 1 | 0 | [MCU2_0] 96.239957 s: 2 | 754 | 754 | 2 | 0 | [MCU2_0] 96.240036 s: 3 | 754 | 754 | 2 | 0 | [MCU2_0] 96.259885 s: ========================================================== [MCU2_0] 96.259982 s: Display M2M Status: Instance|0 [MCU2_0] 96.260023 s: ========================================================== [MCU2_0] 96.260224 s: Queue Count: 752 [MCU2_0] 96.260274 s: De-queue Count: 752 [MCU2_0] 96.260316 s: Write-back Frames Count: 752 [MCU2_0] 96.260355 s: Underflow Count: 0 Graph delete done! App Delete Graph Done! 96.273705 s: ISS: De-initializing sensor [SG2-IMX390C-5200-FPDLINK] ... !!! 96.274177 s: ISS: De-initializing sensor [SG2-IMX390C-5200-FPDLINK] ... Done !!! Sensor deinit done! Capture deinit done! LDC deinit done! srv deinit done! fmt conversion deinit done! scaler deinit done! Img Mosaic deinit done! Display deinit done! appGrpxDeInit done Kernels unload done! Release context done! App De-init Done! 96.759960 s: VX_ZONE_INIT:[tivxHostDeInitLocal:100] De-Initialization Done for HOST !!! 96.764491 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 ... !!! DDR_SHARED_MEM: Alloc's: 85 alloc's of 183982428 bytes DDR_SHARED_MEM: Free's : 85 free's of 183982428 bytes DDR_SHARED_MEM: Open's : 0 allocs of 0 bytes DDR_SHARED_MEM: Total size: 536870912 bytes MEM: Deinit ... Done !!! APP: Deinit ... Done !!!
the first error VX_ZONE_ERROR:[tivxSetNodeParameterNumBufByIndex:2325] Invalid parameters in code:
if (status == VX_SUCCESS) {
status = tivxSetNodeParameterNumBufByIndex(obj->fmtConvObj.node, 1, APP_BUFFER_Q_DEPTH);
status = tivxSetNodeParameterNumBufByIndex(obj->fmtConvObj.node, 2, APP_BUFFER_Q_DEPTH);
} .
My graph create code as:
if(obj->sensorObj.enable_ldc == 1) { vx_object_array ldc_in_arr; if(1 == obj->enable_viss) { ldc_in_arr = obj->vissObj.output_arr; } else { ldc_in_arr = obj->captureObj.raw_image_arr[0]; } if (status == VX_SUCCESS) { status = app_create_graph_ldc(obj->graph, &obj->ldcObj, ldc_in_arr); APP_PRINTF("LDC graph done!\n"); } // obj->imgMosaicObj.input_arr[idx++] = obj->ldcObj.output_arr; } if(obj->enable_srv == 1 && status == VX_SUCCESS) { status = app_create_graph_srv(obj->context, obj->graph, &obj->srvObj, obj->ldcObj.output_arr); APP_PRINTF("srv graph done!\n"); } if(obj->enable_m2m == 1 && status == VX_SUCCESS) { status = app_create_graph_fmt_conv(obj->graph, &obj->fmtConvObj, obj->srvObj.output_img_arr); APP_PRINTF("fmt conversion graph done!\n"); } if(obj->enable_scaler == 1 && status == VX_SUCCESS) { status = app_create_graph_scaler(obj->context, obj->graph, &obj->scalerObj, obj->fmtConvObj.arr); APP_PRINTF("scaler graph done!\n"); } vx_int32 idx = 0; vx_image display_in_image; if(obj->enable_mosaic == 1) { if(obj->enable_scaler == 1) { obj->imgMosaicObj.input_arr[idx++] = obj->scalerObj.output[0].arr; APP_PRINTF("enable_mosaic and enable_scaler!\n"); } else { obj->imgMosaicObj.input_arr[idx++] = obj->fmtConvObj.arr; } obj->imgMosaicObj.num_inputs = idx; if(status == VX_SUCCESS) { status = app_create_graph_img_mosaic(obj->graph, &obj->imgMosaicObj, NULL); APP_PRINTF("Img Mosaic graph done!\n"); } display_in_image = obj->imgMosaicObj.output_image[0]; } else{ display_in_image = (vx_image)vxGetObjectArrayItem(obj->fmtConvObj.arr, 0); } if(status == VX_SUCCESS) { if(obj->enable_mosaic) { status = app_create_graph_display(obj->graph, &obj->displayObj, display_in_image); } else { printf("m2m output\n"); status = app_create_graph_display(obj->graph, &obj->displayObj, display_in_image); } APP_PRINTF("Display graph done!\n"); }
Next, I delete 'status = tivxSetNodeParameterNumBufByIndex(obj->fmtConvObj.node, 1, APP_BUFFER_Q_DEPTH);' ,the first error VX_ZONE_ERROR:[tivxSetNodeParameterNumBufByIndex:2325] Invalid parameters has disappeared while the other errors still exist. The screen is as shown in Figure 2.
Then I try to add vxReplicateNode() in "app_fmt_cnv_module.c", the error seems to have disappeared, but there is still an issue with the display.
Sensor selected : SG2-IMX390C-5200-FPDLINK
Querying SG2-IMX390C-5200-FPDLINK
202.951709 s: ISS: Querying sensor [SG2-IMX390C-5200-FPDLINK] ... !!!
202.952131 s: ISS: Querying sensor [SG2-IMX390C-5200-FPDLINK] ... Done !!!
LDC Selection Yes(1)/No(0)
1
Max number of cameras supported by sensor SG2-IMX390C-5200-FPDLINK = 4
Please enter number of cameras to be enabled
4
WDR mode is not supported. Defaulting to linear
Sensor DCC is enabled
Sensor width = 1920
Sensor height = 1080
Sensor DCC ID = 6100
Sensor Supported Features = 0x00000100
Sensor Enabled Features = 0x00000120
YUV Input selected. VISS, AEWB and Mosaic nodes will be bypassed.
Creating context done!
Kernel loading done!
----------------is enable gui
204.928524 s: ISS: Initializing sensor [SG2-IMX390C-5200-FPDLINK], doing IM_SENSOR_CMD_PWRON ... !!!
204.928907 s: ISS: Initializing sensor [SG2-IMX390C-5200-FPDLINK], doing IM_SENSOR_CMD_CONFIG ... !!!
[MCU2_0] 205.572675 s: ===ub953_cfgScript chId=0 i2cAddrSer=74
[MCU2_0] 206.065674 s: ===ub953_cfgScript chId=1 i2cAddrSer=76
[MCU2_0] 206.558672 s: ===ub953_cfgScript chId=2 i2cAddrSer=78
[MCU2_0] 207.051670 s: ===ub953_cfgScript chId=3 i2cAddrSer=7a
207.412906 s: ISS: Initializing sensor [SG2-IMX390C-5200-FPDLINK] ... Done !!!
Sensor init done!
captureObj->params.numDataLanes = 4
captureObj->params.dataLanesMap[0] = 1
captureObj->params.dataLanesMap[1] = 2
captureObj->params.dataLanesMap[2] = 3
captureObj->params.dataLanesMap[3] = 4
sensorObj->sensor_dcc_enabled=1
sensorObj->sensor_name=SG2-IMX390C-5200-FPDLINK
sensorObj->sensor_wdr_enabled=0
sensorObj->sensorParams.dccId=6100
LDC init done!
capture init done!
Reading calmat file
Calmat size for cnt 0 = 48
Calmat size for cnt 1 = 48
Calmat size for cnt 2 = 48
Calmat size for cnt 3 = 48
For Camera = 0 Ref calmat[0] = 1072386015 Ref Calmat[11] = -2545998
For Camera = 1 Ref calmat[0] = 4014387 Ref Calmat[11] = -2127016
For Camera = 2 Ref calmat[0] = -1071093409 Ref Calmat[11] = 2069336
For Camera = 3 Ref calmat[0] = 5995671 Ref Calmat[11] = 2050034
file read completed
--------------out_gpulut_array done ------------
--------in_params.SVInCamFrmHeight, weight:1080,1920
srv init done!
[FMT-CONV-MODULE]: Num Channels 1 WxH 1920x1080
FMT conversion init done!
Creating VX_DF_IMAGE_NV12 image!
scaler init done!
Img Mosaic init done!
-----------DISPLAY1 target enable
Display init done!
App Init Done!
Graph create done!
Capture graph done!
dcc->config nonempty
LDC graph done!
GPU LUT Graph Verify successful!Adding SRV write node on graph ..
SRV write node added!
srv graph done!
fmt conversion graph done!
scaler output number:1
output1------------------
scaler graph done!
enable_mosaic and enable_scaler!
Img Mosaic graph done!
Display graph done!
ldc Pipeline params setup done!
SRV Pipeline params setup done!
fmt conversion Pipeline params setup done!
scaler Pipeline params setup done!
MOSAIC Pipeline params setup done!
App Create Graph Done!
EGL: version 1.5
----------verify status:0
Graph verify done!
App Verify Graph Done!
APP GPU LUT Graph Done
app_pipeline_params_defaults returned
207.967265 s: ISS: Starting sensor [SG2-IMX390C-5200-FPDLINK] ... !!!
=========================
Demo : Camera Demo
=========================
s: Save CSIx, VISS and LDC outputs
p: Print performance statistics
x: Exit
Enter Choice:
=========================
Demo : Camera Demo
=========================
s: Save CSIx, VISS and LDC outputs
p: Print performance statistics
x: Exit
Enter Choice: 208.607893 s: ISS: Starting sensor [SG2-IMX390C-5200-FPDLINK] ... !!!
appStartImageSensor returned with status: 0
x
350.913897 s: ISS: Stopping sensor [SG2-IMX390C-5200-FPDLINK] ... !!!
351.041879 s: ISS: Stopping sensor [SG2-IMX390C-5200-FPDLINK] ... Done !!!
App Run Graph Done!
Capture delete done!
VISS delete done!
AEWB delete done!
LDC delete done!
srv delete done!
fmt conversion detele done
scaler deinit done!
Img Mosaic delete done!
Display delete done!
[MCU2_0] 351.113825 s: ==========================================================
[MCU2_0] 351.113921 s: Capture Status: Instance|0
[MCU2_0] 351.113960 s: ==========================================================
[MCU2_0] 351.114008 s: overflowCount: 0
[MCU2_0] 351.114045 s: spuriousUdmaIntrCount: 0
[MCU2_0] 351.114083 s: frontFIFOOvflCount: 0
[MCU2_0] 351.114118 s: crcCount: 1
[MCU2_0] 351.114148 s: eccCount: 0
[MCU2_0] 351.114182 s: correctedEccCount: 0
[MCU2_0] 351.114218 s: dataIdErrorCount: 0
[MCU2_0] 351.114255 s: invalidAccessCount: 0
[MCU2_0] 351.114292 s: invalidSpCount: 0
[MCU2_0] 351.114332 s: strmFIFOOvflCount[0]: 0
[MCU2_0] 351.114363 s: Channel Num | Frame Queue Count | Frame De-queue Count | Frame Drop Count | Error Frame Count |
[MCU2_0] 351.114445 s: 0 | 4269 | 4269 | 2 | 0 |
[MCU2_0] 351.114524 s: 1 | 4269 | 4269 | 2 | 0 |
[MCU2_0] 351.114658 s: 2 | 4269 | 4269 | 1 | 0 |
[MCU2_0] 351.114746 s: 3 | 4269 | 4269 | 1 | 0 |
[MCU2_0] 351.131209 s: ==========================================================
[MCU2_0] 351.131307 s: Display M2M Status: Instance|0
[MCU2_0] 351.131347 s: ==========================================================
[MCU2_0] 351.131398 s: Queue Count: 1067
[MCU2_0] 351.131435 s: De-queue Count: 1067
[MCU2_0] 351.131476 s: Write-back Frames Count: 1067
[MCU2_0] 351.131514 s: Underflow Count: 0
Graph delete done!
App Delete Graph Done!
351.154918 s: ISS: De-initializing sensor [SG2-IMX390C-5200-FPDLINK] ... !!!
351.155310 s: ISS: De-initializing sensor [SG2-IMX390C-5200-FPDLINK] ... Done !!!
Sensor deinit done!
Capture deinit done!
LDC deinit done!
srv deinit done!
fmt conversion deinit done!
scaler deinit done!
Img Mosaic deinit done!
Display deinit done!
appGrpxDeInit done
Kernels unload done!
Release context done!
App De-init Done!
351.597698 s: VX_ZONE_INIT:[tivxHostDeInitLocal:100] De-Initialization Done for HOST !!!
351.602214 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 ... !!!
DDR_SHARED_MEM: Alloc's: 85 alloc's of 183982428 bytes
DDR_SHARED_MEM: Free's : 85 free's of 183982428 bytes
DDR_SHARED_MEM: Open's : 0 allocs of 0 bytes
DDR_SHARED_MEM: Total size: 536870912 bytes
MEM: Deinit ... Done !!!
APP: Deinit ... Done !!!
Can M2M be considered as a single channel input when accepting the output of SRV? When do I need to use vxReplicateNode()? Why set node parameters for m2m input? How can I modify it? Can you give me some suggestions?
Thanks.