Other Parts Discussed in Thread: TVP7002
I am trying to restart the capture - encode using the below script.
ISSUE: After capture-encode restart, the components move to Executing state, and then the application hangs/crashes. Please help me identify the cause of this issue.
#omx omtb_dbg_lvl 0x00
#omx omtb_dbg_lvl 0x04
#omx omtb_dbg_lvl 0x08
#omx omtb_dbg_lvl 0x10
#omx omtb_dbg_lvl 0x80
omx api init
omx setp 0 vfcc compname OMX.TI.VPSSM3.VFCC
omx setp 0 tvp compname OMX.TI.VPSSM3.CTRL.TVP
#I/P Port or O/P Port Params for VFCC
omx setp 0 vfcc numoutbuf 6
omx setp 0 vfcc frame_width 1280
omx setp 0 vfcc frame_height 720
omx setp 0 vfcc op_chromat_format 420SP
omx setp 0 vfcc outbufalign 0
omx setp 0 vfcc outbuf_contig disable
omx setp 0 vfcc outbufsize 3110400
omx setp 0 vfcc data_opmode driver
omx setp 0 vfcc outbuf allocate
omx setp 0 vfcc outbufsize_flag disable
omx setp 0 vfcc numoutbuf 8
omx setp 0 vfcc outbuf_contig disable
omx setp 0 h264venc numinbuf 8
omx setp 0 h264venc frame_width 1280
omx setp 0 h264venc frame_height 720
omx setp 0 h264venc inbufsize 4147200
omx setp 0 h264venc numoutbuf 4
omx setp 0 h264venc outbufsize_flag enable
omx setp 0 h264venc outbufsize 3110400
omx setp 0 h264venc data_opmode driver
#To enable write to SD card change mode to file
omx setp 0 h264venc data_opmode file
omx setp 0 h264venc outfile /mnt/omtb/encoder_output.264
omx api gethandle tvp 0 0
omx api gethandle vfcc 0 0
omx api gethandle h264venc 0 0
#SET ALL THE PARAMS FOR TVP
omx setp 0 tvp OMX_TI_IndexParamVFCCHwPortID eHwPortId vip1_porta
omx api setparam tvp 0 0 0 OMX_TI_IndexParamVFCCHwPortID
omx setp 0 tvp OMX_TI_IndexParamVFCCHwPortProperties eCaptMode sc_non_mux
omx setp 0 tvp OMX_TI_IndexParamVFCCHwPortProperties eVifMode 16_bit
omx setp 0 tvp OMX_TI_IndexParamVFCCHwPortProperties eInColorFormat 422YUYV
omx setp 0 tvp OMX_TI_IndexParamVFCCHwPortProperties eScanType progressive
omx setp 0 tvp OMX_TI_IndexParamVFCCHwPortProperties nMaxWidth 1280
omx setp 0 tvp OMX_TI_IndexParamVFCCHwPortProperties nMaxHeight 720
omx setp 0 tvp OMX_TI_IndexParamVFCCHwPortProperties nMaxChnlsPerHwPort 1
omx api setparam tvp 0 0 0 OMX_TI_IndexParamVFCCHwPortProperties
omx setp 0 tvp OMX_TI_IndexParamCTRLVidDecInfo videoStandard 720P60
omx setp 0 tvp OMX_TI_IndexParamCTRLVidDecInfo videoDecoderId tvp7002
omx setp 0 tvp OMX_TI_IndexParamCTRLVidDecInfo videoSystemId auto_detect
omx api setparam tvp 0 0 0 OMX_TI_IndexParamCTRLVidDecInfo
#************************************************************
#SET ALL THE PARAMS FOR VFCC
omx setp 0 vfcc OMX_TI_IndexParamVFCCHwPortID eHwPortId vip1_porta
omx api setparam vfcc 0 0 0 OMX_TI_IndexParamVFCCHwPortID
omx setp 0 vfcc OMX_TI_IndexParamVFCCHwPortProperties eCaptMode sc_non_mux
omx setp 0 vfcc OMX_TI_IndexParamVFCCHwPortProperties eVifMode 16_bit
omx setp 0 vfcc OMX_TI_IndexParamVFCCHwPortProperties eInColorFormat 422YUYV
omx setp 0 vfcc OMX_TI_IndexParamVFCCHwPortProperties eScanType progressive
omx setp 0 vfcc OMX_TI_IndexParamVFCCHwPortProperties nMaxWidth 1280
omx setp 0 vfcc OMX_TI_IndexParamVFCCHwPortProperties nMaxHeight 720
omx setp 0 vfcc OMX_TI_IndexParamVFCCHwPortProperties nMaxChnlsPerHwPort 1
omx api setparam vfcc 0 0 0 OMX_TI_IndexParamVFCCHwPortProperties
omx setp 0 vfcc OMX_TI_IndexParamBuffMemType eBufMemoryType default
omx api setparam vfcc 0 0 0 OMX_TI_IndexParamBuffMemType
omx setp 0 vfcc OMX_IndexParamCompBufferSupplier eBufferSupplier unspecified
#omx api setparam vfcc 0 0 0 OMX_IndexParamCompBufferSupplier
omx setp 0 vfcc OMX_TI_IndexConfigVFCCFrameSkip frameSkipMask 0
#omx api setconfig vfcc 0 0 0 OMX_TI_IndexConfigVFCCFrameSkip
omx setp 0 vfcc OMX_IndexParamVideoInit nPorts 16
omx setp 0 vfcc OMX_IndexParamVideoInit nStartPortNumber 0
#omx api setparam vfcc 0 0 0 OMX_IndexParamVideoInit
omx api getparam h264venc 0 0 0 OMX_IndexParamPortDefinition
omx setp 0 h264venc OMX_IndexParamPortDefinition video.nStride 1280
omx api setparam h264venc 0 0 0 OMX_IndexParamPortDefinition
#************************************************************
#SET ALL THE PARAMS FOR DC#0
omx api sendcommand port vfcc 0 enable 0
omx api sendcommand port vfcc 0 waitforsem 0
omx api sendcommand port h264venc 0 enable 0
omx api sendcommand port h264venc 0 waitforsem 0
omx api sendcommand port h264venc 0 enable 1
omx api sendcommand port h264venc 0 waitforsem 1
omx api connect vfcc 0 0 h264venc 0 0
omx api sendcommand state vfcc 0 idle
omx api sendcommand state vfcc 0 waitforsem
omx api sendcommand state tvp 0 idle
omx api sendcommand state tvp 0 waitforsem
omx api sendcommand state h264venc 0 idle
omx api sendcommand state h264venc 0 waitforsem
omx api sendcommand state vfcc 0 exec
omx api sendcommand state vfcc 0 waitforsem
omx api sendcommand state h264venc 0 exec
omx api sendcommand state h264venc 0 waitforsem
omx api sendcommand state tvp 0 exec
omx api sendcommand state tvp 0 waitforsem
sleep 5000
omx api sendcommand state h264venc 0 idle
omx api sendcommand state h264venc 0 waitforsem
omx api sendcommand state vfcc 0 idle
omx api sendcommand state vfcc 0 waitforsem
omx api sendcommand state tvp 0 idle
omx api sendcommand state tvp 0 waitforsem
omx api sendcommand state h264venc 0 loaded
omx api sendcommand state h264venc 0 waitforsem
omx api sendcommand state vfcc 0 loaded
omx api sendcommand state vfcc 0 waitforsem
omx api sendcommand state tvp 0 loaded
omx api sendcommand state tvp 0 waitforsem
#### Restarting capture-encode ####
omx api sendcommand state vfcc 0 idle
omx api sendcommand state vfcc 0 waitforsem
omx api sendcommand state tvp 0 idle
omx api sendcommand state tvp 0 waitforsem
omx api sendcommand state h264venc 0 idle
omx api sendcommand state h264venc 0 waitforsem
omx api sendcommand state vfcc 0 exec
omx api sendcommand state vfcc 0 waitforsem
omx api sendcommand state h264venc 0 exec
omx api sendcommand state h264venc 0 waitforsem
omx api sendcommand state tvp 0 exec
omx api sendcommand state tvp 0 waitforsem
sleep 10000
omx api sendcommand state h264venc 0 idle <------------------ HANGS HERE
omx api sendcommand state h264venc 0 waitforsem
omx api sendcommand state vfcc 0 idle
omx api sendcommand state vfcc 0 waitforsem
omx api sendcommand state tvp 0 idle
omx api sendcommand state tvp 0 waitforsem
omx api sendcommand state h264venc 0 loaded
omx api sendcommand state h264venc 0 waitforsem
omx api sendcommand state vfcc 0 loaded
omx api sendcommand state vfcc 0 waitforsem
omx api sendcommand state tvp 0 loaded
omx api sendcommand state tvp 0 waitforsem
omx api freehandle vfcc 0
omx api freehandle tvp 0
omx api freehandle h264venc 0
omx api uninit