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.

Demo_startStop / Stop problem


Hi,
we use DVR_RDK 03.00.00.00, Usecase is MULTICH_PROGRESSIVE_VCAP_VENC_VDEC_VDIS.
Usecase was modified for Steaming of mosaic.
Currently I'm testing start und stop the demo. ( Demo_startStop() )
At stopping the following error occurs:
[m3vpss ] 100752:ERR::linkID:20000031::channelID:-1::errorCode:-9::FileName:links_m3vpss/swMs/swMsLink_drv.c::linuNum:328::errorCondition:(Utils_queIsFull(&pObj->dupObj.dupQue) == TRUE)

I have attached a log, (We have called the demo "dmp-module" for log output)
and multich_progressive_vcap_venc_vdec_vdis.c.

Starting and stopping is running 20...30 times and than it is hanging without any error after
[host] : IpcBitsInLink_tskMain:Entered...
I try to avoid this error but I can not see the reason for the problem.

May 13 09:20:12 192 user.notice DMP_MAIN : Start dmp-module
May 13 09:20:12 192 user.info DMP : dmp_Start: stop dmp-module...
May 13 09:20:12 192 user.info DMP_VCAP_VENC_VDEC_VDIS : Channel details:
May 13 09:20:12 192 user.info DMP_VCAP_VENC_VDEC_VDIS : Capture Channels = 16
May 13 09:20:12 192 user.info DMP_VCAP_VENC_VDEC_VDIS : Primary Encoder Channels   = 17
May 13 09:20:12 192 user.info DMP_VCAP_VENC_VDEC_VDIS : Secondary Encoder Channels = 16
May 13 09:20:12 192 user.info DMP_VCAP_VENC_VDEC_VDIS : Decoder Channels = 16
May 13 09:20:12 192 user.info DMP_VCAP_VENC_VDEC_VDIS : Display Channels = 32
May 13 09:20:12 192 user.notice [host] :  0: SYSTEM: IPC init in progress !!!
May 13 09:20:12 192 user.notice [host] :  28: SYSTEM: Notify register to [DSP] line 0, event 15 ... 
May 13 09:20:12 192 user.notice [host] :  29: SYSTEM: Notify register to [VIDEO-M3] line 0, event 15 ... 
May 13 09:20:12 192 user.notice [host] :  30: SYSTEM: Notify register to [VPSS-M3] line 0, event 15 ... 
May 13 09:20:12 192 user.notice [host] :  30: SYSTEM: IPC init DONE !!!
May 13 09:20:12 192 user.notice [host] :  32: SYSTEM: Creating ListMP [HOST_IPC_OUT_25] in region 0 ...
May 13 09:20:12 192 user.notice [host] :  37: SYSTEM: Creating ListMP [HOST_IPC_OUT_26] in region 0 ...
May 13 09:20:12 192 user.notice [host] :  43: SYSTEM: Creating ListMP [HOST_IPC_OUT_20] in region 0 ...
May 13 09:20:12 192 user.notice [host] :  48: SYSTEM: Creating ListMP [HOST_IPC_OUT_21] in region 0 ...
May 13 09:20:12 192 user.notice [host] :  54: SYSTEM: Creating ListMP [HOST_IPC_OUT_22] in region 0 ...
May 13 09:20:12 192 user.info MULTICH_PROGRESSIVE_VCAP_VENC_VDEC_VDIS : Entered usecase 16CH Progressive <816x> Cap/Enc/Dec/Dis
May 13 09:20:12 192 user.notice TI_VCAP :  Vcap_configVideoDecoder: TVP5158-0 (0x5c): Detected video (720x288@50Hz, 1)
May 13 09:20:12 192 user.notice TI_VCAP :  Vcap_configVideoDecoder: TVP5158-1 (0x5d): Detected video (720x288@50Hz, 1)
May 13 09:20:12 192 user.notice TI_VCAP :  Vcap_configVideoDecoder: TVP5158-2 (0x5e): Detected video (720x288@50Hz, 1)
May 13 09:20:12 192 user.notice TI_VCAP :  Vcap_configVideoDecoder: TVP5158-3 (0x5f): Detected video (720x288@50Hz, 1)
May 13 09:20:17 192 user.info Remote debug client : [m3vpss ]  16797: CAPTURE: VIP0 PortA capture mode is [ 8-bit, Pixel-mux Embedded Sync] !!! 
May 13 09:20:17 192 user.info Remote debug client : [m3vpss ]  16884: CAPTURE: VIP0 PortB capture mode is [ 8-bit, Pixel-mux Embedded Sync] !!! 
May 13 09:20:17 192 user.info Remote debug client : [m3vpss ]  16972: CAPTURE: VIP1 PortA capture mode is [ 8-bit, Pixel-mux Embedded Sync] !!! 
May 13 09:20:17 192 user.info Remote debug client : [m3vpss ]  17060: CAPTURE: VIP1 PortB capture mode is [ 8-bit, Pixel-mux Embedded Sync] !!! 
May 13 09:20:18 192 user.info Remote debug client : [m3vpss ]  17160: CAPTURE: 0: 0xb48c0c80, 736 x 288, 00067800 B --> Extra Frames 
May 13 09:20:18 192 user.info Remote debug client : [m3vpss ]  17160: CAPTURE: 1: 0xb4928480, 736 x 288, 00067800 B --> Extra Frames 
May 13 09:20:18 192 user.info Remote debug client : [m3vpss ]  17160: CAPTURE: 2: 0xb498fc80, 736 x 288, 00067800 B --> Extra Frames 
May 13 09:20:18 192 user.info Remote debug client : [m3vpss ]  17160: CAPTURE: 3: 0xb49f7480, 736 x 288, 00067800 B --> Extra Frames 
May 13 09:20:18 192 user.info Remote debug client : [m3vpss ]  17161: CAPTURE: 4: 0xb4a5ec80, 736 x 288, 00067800 B --> Extra Frames 
May 13 09:20:18 192 user.info Remote debug client : [m3vpss ]  17161: CAPTURE: 5: 0xb4ac6480, 736 x 288, 00067800 B --> Extra Frames 
May 13 09:20:18 192 user.info Remote debug client : [m3vpss ]  UTILS: DMA: Allocated CH (TCC) = 58 (58)
May 13 09:20:18 192 user.info Remote debug client : [c6xdsp ]  18033: SYSTEM: Opening MsgQ [VPSS-M3_MSGQ] ...
May 13 09:20:18 192 user.info Remote debug client : [c6xdsp ]  18037: ALG : Create in progress !!!
May 13 09:20:18 192 user.info Remote debug client : [c6xdsp ]  18045: ALG : Create Done !!!
May 13 09:20:18 192 user.info Remote debug client : [m3vpss ]  17532: DEI     : Loading Up-scaling Co-effs
May 13 09:20:18 192 user.info Remote debug client : [m3vpss ]  17532: DEI     : Co-effs Loading ... DONE !!!
May 13 09:20:18 192 user.info Remote debug client : [m3vpss ]  17884: DEI     : Loading Up-scaling Co-effs
May 13 09:20:18 192 user.info Remote debug client : [m3vpss ]  17884: DEI     : Co-effs Loading ... DONE !!!
May 13 09:20:18 192 user.info Remote debug client : [m3vpss ]  17930: SCLR    : Loading Up-scaling Co-effs ... 
May 13 09:20:18 192 user.info Remote debug client : [m3vpss ]  17930: SCLR    : Co-effs Loading ... DONE !!!
May 13 09:20:18 192 user.info Remote debug client : [c6xdsp ]  19026: ALG : Create in progress !!!
May 13 09:20:18 192 user.info Remote debug client : [c6xdsp ]  19033: UTILS: EDMA RM Opened
May 13 09:20:18 192 user.info Remote debug client : [c6xdsp ] > SCD: Algorithm memory requirements queried ::
May 13 09:20:18 192 user.info Remote debug client : [c6xdsp ] >       Processing Frame Resolution = 352x288 
May 13 09:20:18 192 user.info Remote debug client : [c6xdsp ] >                 Number of buffers = 11 
May 13 09:20:18 192 user.info Remote debug client : [c6xdsp ] >      Number of channels supported = 16 
May 13 09:20:18 192 user.info Remote debug client : [c6xdsp ] >      Persistent Internal Memory   = 11204 bytes
May 13 09:20:18 192 user.info Remote debug client : [c6xdsp ] >      Persistent External Memory   = 10205184 bytes
May 13 09:20:18 192 user.info Remote debug client : [c6xdsp ] >      Scratch Internal Memory      = 61248 bytes
May 13 09:20:18 192 user.info Remote debug client : [c6xdsp ] > SCD: Initializing Scene Change Detection Algorithm... 
May 13 09:20:18 192 user.notice [host] : IpcBitsInLink_tskMain:Entered
May 13 09:20:18 192 user.notice [host] :  6645: IPC_BITS_IN   : ListMPOpen start !!!
May 13 09:20:18 192 user.info Remote debug client : [c6xdsp ]  UTILS: DSP DMA Channle Alloc: EDMA3_RM_allocLogicalChannel call Successful 
May 13 09:20:18 192 user.info Remote debug client : [c6xdsp ] Allocated Chanel 30, Param 30 and TC is 30
May 13 09:20:18 192 user.info Remote debug client : [c6xdsp ]  19110: SCD: Process Tsk Started !!!
May 13 09:20:18 192 user.info Remote debug client : [c6xdsp ]  19110: ALG : Create Done !!!
May 13 09:20:18 192 user.notice [host] :  6649: IPC_BITS_IN   : ListMPOpen done !!!
May 13 09:20:18 192 user.notice [host] :  6651: IPC_BITS_IN   : System_linkGetInfo done !!!
May 13 09:20:18 192 user.info Remote debug client : [m3video]  18044: SYSTEM: Opening MsgQ [HOST_MSGQ] ...
May 13 09:20:18 192 user.info Remote debug client : [m3video]  18072: SYSTEM: Opening MsgQ [VPSS-M3_MSGQ] ...
May 13 09:20:19 192 user.info Remote debug client : [m3vpss ]  18515: SYSTEM: Opening MsgQ [VIDEO-M3_MSGQ] ...
May 13 09:20:19 192 user.info Remote debug client : [m3vpss ]  UTILS: DMA: Allocated CH (TCC) = 59 (59)
May 13 09:20:19 192 user.info Remote debug client : [m3vpss ]  UTILS: DMA: Allocated CH (TCC) = 60 (60)
May 13 09:20:19 192 user.info Remote debug client : [m3vpss ] SWMS: instance 0, sc id 5, start win 0 end win 17
May 13 09:20:19 192 user.info Remote debug client : [m3vpss ]  UTILS: DMA: Allocated CH (TCC) = 61 (61)
May 13 09:20:19 192 user.info Remote debug client : [m3vpss ]  UTILS: DMA: Allocated CH (TCC) = 62 (62)
May 13 09:20:19 192 user.info Remote debug client : [m3vpss ] SWMS: instance 0, sc id 5, start win 0 end win 17
May 13 09:20:19 192 user.info Remote debug client : [m3video] ENCLINK:INFO: !!!Number of output buffers for ch[33] set to [1]
May 13 09:20:19 192 user.notice [host] : IpcBitsInLink_tskMain:Entered
May 13 09:20:19 192 user.notice [host] :  7652: IPC_BITS_IN   : ListMPOpen start !!!
May 13 09:20:19 192 user.notice [host] :  7655: IPC_BITS_IN   : ListMPOpen done !!!
May 13 09:20:19 192 user.notice [host] :  7657: IPC_BITS_IN   : System_linkGetInfo done !!!
May 13 09:20:19 192 user.info Remote debug client : [m3vpss ] ==============FVID2_SETFMT STARTING===================
May 13 09:20:19 192 user.info Remote debug client : [m3vpss ] ==============FVID2_SETFMT STARTED===================
May 13 09:20:19 192 user.info Remote debug client : [m3vpss ] ==============FVID2_SETFMT STARTING===================
May 13 09:20:19 192 user.info Remote debug client : [m3vpss ] ==============FVID2_SETFMT STARTED===================
May 13 09:20:20 192 user.info Remote debug client : [m3vpss ]  19123: DISPLAY: HDDAC(BP0) : 40 fps, Latency (Min / Max) = ( 255 / 0 ), Callback Interval (Min / Max) = ( 255 / 0 ) !!! 
May 13 09:20:20 192 user.info Remote debug client : [m3vpss ]  19123: DISPLAY: UNDERFLOW COUNT: HDMI(BP0) 1, HDDAC(BP0) 1, DVO2(BP1) 1, SDDAC(SEC1) 1 
May 13 09:20:20 192 user.info Remote debug client : [m3vpss ]  19203: DISPLAY: SDDAC(SEC1): 12 fps, Latency (Min / Max) = ( 255 / 0 ), Callback Interval (Min / Max) = ( 255 / 0 ) !!! 
May 13 09:20:20 192 user.info DMP_CAPTURE : Ch:  0: Detected video at CH [0,0] (720x288@50Hz, 1)
May 13 09:20:20 192 user.info DMP_CAPTURE : Ch:  1: Detected video at CH [0,1] (720x288@50Hz, 1)
May 13 09:20:20 192 user.info DMP_CAPTURE : Ch:  2: Detected video at CH [0,2] (720x288@50Hz, 1)
May 13 09:20:20 192 user.info DMP_CAPTURE : Ch:  3: Detected video at CH [0,3] (720x288@50Hz, 1)
May 13 09:20:20 192 user.info DMP_CAPTURE : Ch:  4: Detected video at CH [1,0] (720x288@50Hz, 1)
May 13 09:20:20 192 user.info DMP_CAPTURE : Ch:  5: Detected video at CH [1,1] (720x288@50Hz, 1)
May 13 09:20:20 192 user.info DMP_CAPTURE : Ch:  6: Detected video at CH [1,2] (720x288@50Hz, 1)
May 13 09:20:20 192 user.info DMP_CAPTURE : Ch:  7: Detected video at CH [1,3] (720x288@50Hz, 1)
May 13 09:20:20 192 user.info DMP_CAPTURE : Ch:  8: Detected video at CH [2,0] (720x288@50Hz, 1)
May 13 09:20:20 192 user.info DMP_CAPTURE : Ch:  9: Detected video at CH [2,1] (720x288@50Hz, 1)
May 13 09:20:20 192 user.info DMP_CAPTURE : Ch: 10: Detected video at CH [2,2] (720x288@50Hz, 1)
May 13 09:20:20 192 user.info DMP_CAPTURE : Ch: 11: Detected video at CH [2,3] (720x288@50Hz, 1)
May 13 09:20:20 192 user.info DMP_CAPTURE : Ch: 12: Detected video at CH [3,0] (720x288@50Hz, 1)
May 13 09:20:20 192 user.info DMP_CAPTURE : Ch: 13: Detected video at CH [3,1] (720x288@50Hz, 1)
May 13 09:20:20 192 user.info DMP_CAPTURE : Ch: 14: Detected video at CH [3,2] (720x288@50Hz, 1)
May 13 09:20:20 192 user.info DMP_CAPTURE : Ch: 15: Detected video at CH [3,3] (720x288@50Hz, 1)
May 13 09:20:20 192 user.debug kernel: found best resolution: 1400x1050 (30)
May 13 09:20:21 192 user.notice DMP_CAPTURE : PAL signal at Ch 0
May 13 09:20:21 192 user.notice DMP_CAPTURE : PAL signal at Ch 1
May 13 09:20:21 192 user.notice DMP_CAPTURE : PAL signal at Ch 2
May 13 09:20:21 192 user.notice DMP_CAPTURE : PAL signal at Ch 3
May 13 09:20:21 192 user.notice DMP_CAPTURE : PAL signal at Ch 4
May 13 09:20:21 192 user.notice DMP_CAPTURE : PAL signal at Ch 5
May 13 09:20:21 192 user.notice DMP_CAPTURE : PAL signal at Ch 6
May 13 09:20:22 192 user.notice DMP_CAPTURE : PAL signal at Ch 7
May 13 09:20:22 192 user.notice DMP_CAPTURE : PAL signal at Ch 8
May 13 09:20:22 192 user.notice DMP_CAPTURE : PAL signal at Ch 9
May 13 09:20:22 192 user.notice DMP_CAPTURE : PAL signal at Ch 10
May 13 09:20:22 192 user.notice DMP_CAPTURE : PAL signal at Ch 11
May 13 09:20:22 192 user.notice DMP_CAPTURE : PAL signal at Ch 12
May 13 09:20:22 192 user.notice DMP_CAPTURE : PAL signal at Ch 13
May 13 09:20:22 192 user.notice DMP_CAPTURE : PAL signal at Ch 14
May 13 09:20:22 192 user.notice DMP_CAPTURE : PAL signal at Ch 15
May 13 09:20:24 192 user.notice WIS_STREAMER : Play stream Channel  5 using URL rtsp://192.168.1.10:8556/h264_ch6
May 13 09:20:24 192 user.notice WIS_STREAMER : Play stream Channel  4 using URL rtsp://192.168.1.10:8555/h264_ch5
May 13 09:20:24 192 user.notice WIS_STREAMER : Play stream Channel  2 using URL rtsp://192.168.1.10:8553/h264_ch3
May 13 09:20:24 192 user.notice WIS_STREAMER : Play stream Channel  1 using URL rtsp://192.168.1.10:8552/h264_ch2
May 13 09:20:24 192 user.notice WIS_STREAMER : Play stream Channel  0 using URL rtsp://192.168.1.10:8551/h264_ch1
May 13 09:20:24 192 user.notice WIS_STREAMER : Play stream Channel 10 using URL rtsp://192.168.1.10:8561/h264_ch11
May 13 09:20:24 192 user.notice WIS_STREAMER : Play stream Channel  6 using URL rtsp://192.168.1.10:8557/h264_ch7
May 13 09:20:24 192 user.notice WIS_STREAMER : Play stream Channel 11 using URL rtsp://192.168.1.10:8562/h264_ch12
May 13 09:20:24 192 user.notice WIS_STREAMER : Play stream Channel 16 using URL rtsp://192.168.1.10:8567/h264_ch17
May 13 09:20:24 192 user.notice WIS_STREAMER : Play stream Channel 15 using URL rtsp://192.168.1.10:8566/h264_ch16
May 13 09:20:24 192 user.notice WIS_STREAMER : Play stream Channel 13 using URL rtsp://192.168.1.10:8564/h264_ch14
May 13 09:20:24 192 user.notice WIS_STREAMER : Play stream Channel  8 using URL rtsp://192.168.1.10:8559/h264_ch9
May 13 09:20:24 192 user.notice WIS_STREAMER : Play stream Channel  7 using URL rtsp://192.168.1.10:8558/h264_ch8
May 13 09:20:24 192 user.notice WIS_STREAMER : Play stream Channel  3 using URL rtsp://192.168.1.10:8554/h264_ch4
May 13 09:20:24 192 user.notice WIS_STREAMER : Play stream Channel 14 using URL rtsp://192.168.1.10:8565/h264_ch15
May 13 09:20:24 192 user.notice WIS_STREAMER : Play stream Channel 12 using URL rtsp://192.168.1.10:8563/h264_ch13
May 13 09:20:24 192 user.notice WIS_STREAMER : Play stream Channel  9 using URL rtsp://192.168.1.10:8560/h264_ch10
May 13 09:20:26 192 user.info DMP : dmp_Start: dmp-module started.


May 13 09:20:26 192 user.debug LAUNCHER : Wait 15 seconds for DMP initialization
May 13 09:20:26 192 user.info LAUNCHER : startup: starting DMP_ADAPTOR
May 13 09:20:26 192 user.debug LAUNCHER : Wait 1 seconds for DMP_ADAPTOR initialization
May 13 09:20:26 192 user.info LAUNCHER : startup: starting DMP_EVENT_HANDLER
May 13 09:20:26 192 user.debug LAUNCHER : Wait 1 seconds for DMP_EVENT_HANDLER initialization
May 13 09:20:26 192 user.info LAUNCHER : startup: starting DVR
May 13 09:20:26 192 user.info Remote debug client : [c6xdsp ]  28307: SYSTEM: Opening MsgQ [HOST_MSGQ] ...
May 13 09:20:26 192 user.debug LAUNCHER : Wait 1 seconds for DVR initialization
May 13 09:20:26 192 user.info LAUNCHER : startup: starting TIMERD
May 13 09:20:26 192 user.info LAUNCHER : startup: starting EVTSYSD
May 13 09:20:26 192 user.err TRASYS_IPCSOCK : ipc_send_to: 111 Connection refused
May 13 09:20:31 192 user.warn CONFPROT : Got timeout while waiting for result telegram.
May 13 09:20:31 192 user.debug LAUNCHER : Wait 6 seconds for EVTSYSD initialization
May 13 09:20:31 192 user.info LAUNCHER : startup: starting INPSW
May 13 09:20:31 192 user.info LAUNCHER : startup: starting STM32F103_DEBUG
May 13 09:20:32 192 user.notice ACTION_HANDLER : action_start_evtsys
May 13 09:20:32 192 user.debug INSPW : --> inpsw_init
May 13 09:20:32 192 user.debug INSPW : <-- inpsw_init
May 13 09:21:32 192 user.info DMP : dmp_Stop: stop dmp-module...
May 13 09:21:32 192 user.info DMP_VDEC_VDIS_IPCAM : dmp_IPcamCaptureChannelStop: IP-camera channel 0 is not capturing!
May 13 09:21:32 192 user.info DMP_VDEC_VDIS_IPCAM : dmp_IPcamCaptureChannelStop: IP-camera channel 1 is not capturing!
May 13 09:21:32 192 user.info DMP_VDEC_VDIS_IPCAM : dmp_IPcamCaptureChannelStop: IP-camera channel 2 is not capturing!
May 13 09:21:32 192 user.info DMP_VDEC_VDIS_IPCAM : dmp_IPcamCaptureChannelStop: IP-camera channel 3 is not capturing!
May 13 09:21:33 192 ftp.info pure-ftpd: (?@192.168.1.30) [INFO] New connection from 192.168.1.30
May 13 09:21:34 192 user.debug AUDIO_RECORD : Exit Thread Audio_Record_Thread
May 13 09:21:34 192 user.debug AUDIO_PLAYBACK : Exit Thread Audio_Playback_Thread
May 13 09:21:36 192 user.debug DMP_SCD : Exit Thread Scd_Process_Thread
May 13 09:21:36 192 ftp.info pure-ftpd: (?@192.168.1.30) [INFO] root is now logged in
May 13 09:21:36 192 user.debug OSD_CAPTURE : Exit Thread OSD_Capture_Process_Thread
May 13 09:21:37 192 user.notice WIS_STREAMER : WIS-Streamer Caught SIGINT: shutting down
May 13 09:21:37 192 user.notice WIS_STREAMER : WIS-Streamer Caught SIGINT: shutting down
May 13 09:21:37 192 user.notice WIS_STREAMER : WIS-Streamer Caught SIGINT: shutting down
May 13 09:21:37 192 user.notice WIS_STREAMER : WIS-Streamer Caught SIGINT: shutting down
May 13 09:21:37 192 user.notice WIS_STREAMER : WIS-Streamer Caught SIGINT: shutting down
May 13 09:21:37 192 user.notice WIS_STREAMER : WIS-Streamer Caught SIGINT: shutting down
May 13 09:21:37 192 user.notice WIS_STREAMER : WIS-Streamer Caught SIGINT: shutting down
May 13 09:21:37 192 user.notice WIS_STREAMER : WIS-Streamer Caught SIGINT: shutting down
May 13 09:21:37 192 user.notice WIS_STREAMER : WIS-Streamer Caught SIGINT: shutting down
May 13 09:21:37 192 user.notice WIS_STREAMER : WIS-Streamer Caught SIGINT: shutting down
May 13 09:21:37 192 user.notice WIS_STREAMER : WIS-Streamer Caught SIGINT: shutting down
May 13 09:21:37 192 user.notice WIS_STREAMER : WIS-Streamer Caught SIGINT: shutting down
May 13 09:21:37 192 user.notice WIS_STREAMER : WIS-Streamer Caught SIGINT: shutting down
May 13 09:21:37 192 user.notice WIS_STREAMER : WIS-Streamer Caught SIGINT: shutting down
May 13 09:21:37 192 user.notice WIS_STREAMER : WIS-Streamer Caught SIGINT: shutting down
May 13 09:21:37 192 user.notice WIS_STREAMER : WIS-Streamer Caught SIGINT: shutting down
May 13 09:21:37 192 user.notice WIS_STREAMER : WIS-Streamer Caught SIGINT: shutting down
May 13 09:21:40 192 user.debug AVSERVER_STREAM : Exit Thread Msg_CTRL
May 13 09:21:40 192 user.debug AVSERVER_MAIN_THREAD : Exit Task AVSERVER_tskMain
May 13 09:21:40 192 user.info AVSERVER_MAIN_THREAD : AVSERVER_mainDelete:
May 13 09:21:40 192 user.debug DISPLAY_PROCESS : Exit Thread Display_Process_Thread
May 13 09:21:41 192 user.info Remote debug client : [m3vpss ]  100204: DISPLAY: UNDERFLOW COUNT: HDMI(BP0) 4850, HDDAC(BP0) 4828, DVO2(BP1) 4828, SDDAC(SEC1) 0 
May 13 09:21:41 192 user.info Remote debug client : [c6xdsp ]  121831: ALG : Delete in progress !!!
May 13 09:21:41 192 user.info Remote debug client : [m3vpss ]  UTILS: DMA: Free'ed CH (TCC) = 58 (58)
May 13 09:21:41 192 user.info Remote debug client : [c6xdsp ]  121831: ALG : Delete Done !!!
May 13 09:21:41 192 user.info Remote debug client : [m3vpss ]  100206: PRF : IPC_FRAMES_OUT0 : t: 1077 ms, c: 5036, f: 64355, fps: 59753, fpc: 12 
May 13 09:21:41 192 user.info Remote debug client : [c6xdsp ]  121834: ALG : Delete in progress !!!
May 13 09:21:41 192 user.info Remote debug client : [c6xdsp ]  121834: SCD: Process Tsk Stopping !!!
May 13 09:21:41 192 user.info Remote debug client : [m3vpss ]  100208: PRF : IPC_FRAMES_OUT1 : t: 77 ms, c: 888, f: 2155, fps: 27987, fpc: 2 
May 13 09:21:41 192 user.info Remote debug client : [c6xdsp ]  121834: SCD: Process Tsk Stopped !!!
May 13 09:21:41 192 user.info Remote debug client : [c6xdsp ]  121834: SCD: Process Tsk Stopping  DONE !!!
May 13 09:21:41 192 user.info Remote debug client : [c6xdsp ]  UTILS: DMA: Free'ed CH (TCC) = 30 (30)
May 13 09:21:41 192 user.info Remote debug client : [c6xdsp ]  121838: ALG : Delete Done !!!
May 13 09:21:41 192 user.notice [host] : IpcBitsInLink_tskMain:Entered
May 13 09:21:41 192 user.info Remote debug client : [c6xdsp ]  121838: PRF : IPC_BITS_OUT0 : t: 64 ms, c: 757, f: 2155, fps: 33671, fpc: 2 
May 13 09:21:41 192 user.info Remote debug client : [m3video] 100220:WARN
May 13 09:21:41 192 user.info Remote debug client : [m3video] IRES_TILER:Unregistering handle not previously registered,links_m3video/codec_utils/src/iresman_tiledmemory.c:302
May 13 09:21:41 192 user.info Remote debug client : [m3video] 100221:WARN
May 13 09:21:41 192 user.info Remote debug client : [m3video] IRES_TILER:Unregistering handle not previously registered,links_m3video/codec_utils/src/iresman_tiledmemory.c:302
May 13 09:21:41 192 user.info Remote debug client : [m3video] 100223:WARN
May 13 09:21:41 192 user.info Remote debug client : [m3video] IRES_TILER:Unregistering handle not previously registered,links_m3video/codec_utils/src/iresman_tiledmemory.c:302
May 13 09:21:41 192 user.info Remote debug client : [m3video] 100224:WARN
May 13 09:21:41 192 user.info Remote debug client : [m3video] IRES_TILER:Unregistering handle not previously registered,links_m3video/codec_utils/src/iresman_tiledmemory.c:302
May 13 09:21:41 192 user.info Remote debug client : [m3video] 100225:WARN
May 13 09:21:41 192 user.info Remote debug client : [m3video] IRES_TILER:Unregistering handle not previously registered,links_m3video/codec_utils/src/iresman_tiledmemory.c:302
May 13 09:21:41 192 user.info Remote debug client : [m3video] 100227:WARN
May 13 09:21:41 192 user.info Remote debug client : [m3video] IRES_TILER:Unregistering handle not previously registered,links_m3video/codec_utils/src/iresman_tiledmemory.c:302
May 13 09:21:41 192 user.info Remote debug client : [m3video] 100228:WARN
May 13 09:21:41 192 user.info Remote debug client : [m3video] IRES_TILER:Unregistering handle not previously registered,links_m3video/codec_utils/src/iresman_tiledmemory.c:302
May 13 09:21:41 192 user.info Remote debug client : [m3video] 100230:WARN
May 13 09:21:41 192 user.info Remote debug client : [m3video] IRES_TILER:Unregistering handle not previously registered,links_m3video/codec_utils/src/iresman_tiledmemory.c:302
May 13 09:21:41 192 user.info Remote debug client : [m3video] 100231:WARN
May 13 09:21:41 192 user.info Remote debug client : [m3video] IRES_TILER:Unregistering handle not previously registered,links_m3video/codec_utils/src/iresman_tiledmemory.c:302
May 13 09:21:41 192 user.info Remote debug client : [m3video] 100233:WARN
May 13 09:21:41 192 user.info Remote debug client : [m3video] IRES_TILER:Unregistering handle not previously registered,links_m3video/codec_utils/src/iresman_tiledmemory.c:302
May 13 09:21:41 192 user.info Remote debug client : [m3video] 100234:WARN
May 13 09:21:41 192 user.info Remote debug client : [m3video] IRES_TILER:Unregistering handle not previously registered,links_m3video/codec_utils/src/iresman_tiledmemory.c:302
May 13 09:21:41 192 user.info Remote debug client : [m3video] 100235:WARN
May 13 09:21:41 192 user.info Remote debug client : [m3video] IRES_TILER:Unregistering handle not previously registered,links_m3video/codec_utils/src/iresman_tiledmemory.c:302
May 13 09:21:41 192 user.info Remote debug client : [m3video] 100237:WARN
May 13 09:21:41 192 user.info Remote debug client : [m3video] IRES_TILER:Unregistering handle not previously registered,links_m3video/codec_utils/src/iresman_tiledmemory.c:302
May 13 09:21:41 192 user.info Remote debug client : [m3video] 100238:WARN
May 13 09:21:41 192 user.info Remote debug client : [m3video] IRES_TILER:Unregistering handle not previously registered,links_m3video/codec_utils/src/iresman_tiledmemory.c:302
May 13 09:21:41 192 user.info Remote debug client : [m3video] 100240:WARN
May 13 09:21:41 192 user.info Remote debug client : [m3video] IRES_TILER:Unregistering handle not previously registered,links_m3video/codec_utils/src/iresman_tiledmemory.c:302
May 13 09:21:41 192 user.info Remote debug client : [m3video] 100241:WARN
May 13 09:21:41 192 user.info Remote debug client : [m3video] IRES_TILER:Unregistering handle not previously registered,links_m3video/codec_utils/src/iresman_tiledmemory.c:302
May 13 09:21:41 192 user.info Remote debug client : [m3video] 100242:WARN
May 13 09:21:41 192 user.info Remote debug client : [m3video] IRES_TILER:Unregistering handle not previously registered,links_m3video/codec_utils/src/iresman_tiledmemory.c:302
May 13 09:21:41 192 user.info Remote debug client : [m3video]  100253: PRF : IPC_BITS_OUT0 : t: 1372 ms, c: 9760, f: 67347, fps: 49086, fpc: 6 
May 13 09:21:41 192 user.info Remote debug client : [m3vpss ]  UTILS: DMA: Free'ed CH (TCC) = 59 (59)
May 13 09:21:41 192 user.info Remote debug client : [m3vpss ]  UTILS: DMA: Free'ed CH (TCC) = 60 (60)
May 13 09:21:41 192 user.info Remote debug client : [m3vpss ]  
May 13 09:21:41 192 user.info Remote debug client : [m3vpss ] 100752:ERR::linkID:20000031::channelID:-1::errorCode:-9::FileName:links_m3vpss/swMs/swMsLink_drv.c::linuNum:328::errorCondition:(Utils_queIsFull(&pObj->dupObj.dupQue) == TRUE)
May 13 09:21:41 192 user.info Remote debug client : [m3vpss ]  UTILS: DMA: Free'ed CH (TCC) = 61 (61)
May 13 09:21:41 192 user.info Remote debug client : [m3vpss ]  UTILS: DMA: Free'ed CH (TCC) = 62 (62)
May 13 09:21:41 192 user.info Remote debug client : [c6xdsp ]  
May 13 09:21:41 192 user.info Remote debug client : [m3video]  
May 13 09:21:41 192 user.info Remote debug client : [m3vpss ]  
May 13 09:21:41 192 user.info Remote debug client : [c6xdsp ]  122521: LOAD: CPU: 17.9% HWI: 0.3%, SWI:0.1% 
May 13 09:21:41 192 user.info Remote debug client : [m3video]  100758: LOAD: CPU: 35.5% HWI: 1.8%, SWI:2.8% 
May 13 09:21:41 192 user.info Remote debug client : [m3vpss ]  100757: LOAD: CPU: 60.8% HWI: 10.6%, SWI:3.7% 
May 13 09:21:41 192 user.info Remote debug client : [c6xdsp ]  
May 13 09:21:41 192 user.info Remote debug client : [m3video]  
May 13 09:21:41 192 user.info Remote debug client : [m3vpss ]  
May 13 09:21:41 192 user.debug DMP_SCD_BITS_WR : Exit Thread Scd_bitsWriteMain_Thread
May 13 09:21:41 192 user.debug DMP_VIDEO_RECORD : Exit Thread VcapVenc_Thread
May 13 09:21:41 192 user.debug DMP_VIDEO_PLAYBACK : Exit Thread VdecVdis_VideoPlayback_Thread
May 13 09:21:41 192 user.debug DMP_VDEC_VDIS_IPCAM : Exit Thread VdecVdis_IPcam_Thread 0
May 13 09:21:42 192 user.debug DMP_VDEC_VDIS_IPCAM : Exit Thread VdecVdis_IPcam_Thread 1
May 13 09:21:43 192 user.debug DMP_VDEC_VDIS_IPCAM : Exit Thread VdecVdis_IPcam_Thread 2
May 13 09:21:44 192 user.debug DMP_VDEC_VDIS_IPCAM : Exit Thread VdecVdis_IPcam_Thread 3
May 13 09:21:45 192 user.notice [host] :  93456: SYSTEM: IPC de-init in progress !!!
May 13 09:21:45 192 user.debug [host] : Exit Thread System_ipcMsgQTaskMain
May 13 09:21:45 192 user.notice [host] :  93488: SYSTEM: IPC de-init DONE !!!
May 13 09:21:45 192 user.info DMP : dmp_Stop: dmp-module stopped.

6661.multich_progressive_vcap_venc_vdec_vdis.c



  • The error

    [m3vpss ] 100752:ERR::linkID:20000031::channelID:-1::errorCode:-9::FileName:links_m3vpss/swMs/swMsLink_drv.c::linuNum:328::errorCondition:(Utils_queIsFull(&pObj->dupObj.dupQue) == TRUE)

    is unrelated to the issue you are seeing. The error indicates display has not freed back all buffers to SwMs before SwMs is deleted. This is expected since dislayLink is not flushed. Yoou can ignore this print.

     

    Is System_linkCreate for ipcBitsInLink bloked forever when you see the issue.Can you add a OSA_ASSERT check in

    /dvr_rdk/mcfw/src_linux/osa/src/osa_thr.c

     

    OSA_thrCreate()

    to confirm all thread creates are successful.

    status = pthread_create(&hndl->hndl, &thread_attr, entryFunc, prm);
     
      if(status != OSA_SOK) {
        OSA_ERROR("OSA_thrCreate() - Could not create thread [%d]\n", status);
        OSA_assert(status == OSA_SOK);
      }
     

  •  

    Thats what I have already done.

    This means the thread was created with success. We can not see any error output here.

    status = pthread_create(&hndl->hndl, &thread_attr, entryFunc, prm);

        if(status != OSA_SOK)
        {
            OSA_LOG(LOG_ERR, "%s: Could not create thread! Status: %d %s", __FUNCTION__, status, strerror(status));
        }



  • I added some debug output and I have found that a problem occurs in System_ipcMsgQTskDelete().
    The thread System_ipcMsgQTaskMain is left but OSA_thrDelete(&gSystem_ipcObj.msgQTask); never returns.
    I have modified System_ipcMsgQTskDelete() and *System_ipcMsgQTaskMain() to see if the thread was left.
    The problem is that OSA_thrJoin() in OSA_thrDelete() does not return after starting / stopping some times.

    Has anyone else got this problem ?



    static volatile Bool ipc_msgq_thread_exit_done;


    Int32 System_ipcMsgQTskDelete()
    {
        Int32 status;
        int n;

        /* unblock task */
        MessageQ_unblock(gSystem_ipcObj.selfMsgQ);

        /* Wait for command to be received and task to be exited */
        n = 0;
        while( !ipc_msgq_thread_exit_done )
        {
            OSA_waitMsecs(10);
            n = n + 1;
            if(n > 500)  /* Avoid endless loop */
            {
                OSA_LOG(LOG_ERR, "%s: Exit thread failed!", __FUNCTION__);
                break;
            }
        }

        status = OSA_thrDelete(&gSystem_ipcObj.msgQTask);
        if( status != OSA_SOK )
        {
            OSA_LOG(LOG_ERR, "%s: Delete thread %s failed!", __FUNCTION__, THREAD_NAME);
        }

        status = OSA_mutexDelete ( &gSystem_ipcObj.msgQLock );
        if( status != OSA_SOK )
        {
            OSA_LOG(LOG_ERR, "%s: Delete mutex failed!", __FUNCTION__);
        }

         return OSA_SOK;
    }


    Void *System_ipcMsgQTaskMain(Void *arg)
    {
        UInt32 prmSize;
        SystemIpcMsgQ_Msg *pMsgCommon;
        Void *pPrm;
        Int32 status;


        while( 1 )
        {
            status = MessageQ_get(gSystem_ipcObj.selfMsgQ, (MessageQ_Msg*)&pMsgCommon, OSA_TIMEOUT_FOREVER);

            if(status == MessageQ_E_UNBLOCKED)
            {
                OSA_printf("\n MessageQ_E_UNBLOCKED");
                break;
            }

            if(status != MessageQ_S_SUCCESS)
            {
                /* TODO: Commenting this print for release purpose. Need to enable &
                            * fix this failure occurring on disp resolution change */
               OSA_printf(" %u: MSGQ: MsgQ get failed !!!\n", OSA_getCurTimeInMsec());
               continue;
            }

    #ifdef SYSTEM_DEBUG_MSGQ
            OSA_printf(" %u: MSGQ: Received command [0x%04x] (prmSize = %d) for [%s][%02d] (waitAck=%d)\n",
                OSA_getCurTimeInMsec(),
                pMsgCommon->cmd,
                pMsgCommon->prmSize,
                System_getProcName(SYSTEM_GET_PROC_ID(pMsgCommon->linkId)),
                SYSTEM_GET_LINK_ID(pMsgCommon->linkId),
                pMsgCommon->waitAck);
    #endif

            prmSize = pMsgCommon->prmSize;

            pPrm = SYSTEM_IPC_MSGQ_MSG_PAYLOAD_PTR(pMsgCommon);

            if(pMsgCommon->cmd==SYSTEM_CMD_GET_INFO)
            {
                UTILS_assert(prmSize == sizeof(System_LinkInfo));

                pMsgCommon->status = System_linkGetInfo_local(pMsgCommon->linkId, pPrm);
            }
            else
            {
                pMsgCommon->status = System_linkControl_local(
                                        pMsgCommon->linkId,
                                        pMsgCommon->cmd,
                                        pPrm,
                                        prmSize,
                                        pMsgCommon->waitAck
                                     );
            }
            if(pMsgCommon->waitAck)
            {
                MessageQ_QueueId replyMsgQ;

                replyMsgQ = MessageQ_getReplyQueue(pMsgCommon);

                status = MessageQ_put(replyMsgQ, (MessageQ_Msg)pMsgCommon);

                if(status != MessageQ_S_SUCCESS)
                {
                    OSA_printf(" %u: MSGQ: MsgQ Ack put failed !!!\n", OSA_getCurTimeInMsec());
                    MessageQ_free((MessageQ_Msg)pMsgCommon);
                }
            }
            else
            {
                MessageQ_free((MessageQ_Msg)pMsgCommon);
            }
        }

        ipc_msgq_thread_exit_done = TRUE;
        OSA_LOG(LOG_DEBUG, "Exit Thread %s",__FUNCTION__);
        return(NULL);
    }

  • Can you monitor /proc/<pid>/task folder on the target to check if the number of threads remain constant or keep increasing after each iteration of Demo_start/Demo_stop .

    If any thread is left then print the TID during thread create to check which thread is not getting deleted. Attached patch prints TID for all RDK link threads. You cancheck if you are able to merge in this change for debugging.

     

    diff --git a/demos/mcfw_api_demos/mcfw_demo/demo.c b/demos/mcfw_api_demos/mcfw_demo/demo.c
    index 06ef8c0..7818a02 100755
    --- a/demos/mcfw_api_demos/mcfw_demo/demo.c
    +++ b/demos/mcfw_api_demos/mcfw_demo/demo.c
    @@ -6,6 +6,7 @@
     #include <execinfo.h>
     #include <ucontext.h>
     #include <unwind.h>
    +#include <osa.h>
     
     #define DEMO_ENABLE_SPL_USECASES             (TRUE)
     
    @@ -307,6 +308,8 @@ int Demo_run(int demoId)
     
         while(!done)
         {
    +        OSA_printTID(__func__);
    +
             printf(gDemo_runMenu);
     
             ch = Demo_getChar();
    diff --git a/demos/mcfw_api_demos/mcfw_demo/demo_audio.c b/demos/mcfw_api_demos/mcfw_demo/demo_audio.c
    index 96baf66..ac80334 100755
    --- a/demos/mcfw_api_demos/mcfw_demo/demo_audio.c
    +++ b/demos/mcfw_api_demos/mcfw_demo/demo_audio.c
    @@ -466,6 +466,11 @@ static Void *App_playbackTaskFxn(Void * prm)
         UInt32 timeTotal;
         UInt32 timeLast;
         UInt32 playbackTime = 0;
    +    char                  threadName[128];
    +
    +    snprintf(threadName,sizeof(threadName),"%s_%x",__func__,0);
    +    threadName[sizeof(threadName) - 1] = 0;
    +    OSA_printTID(threadName);
     
         gAppPlaybackThreadExitFlag = FALSE;
         memset(&playStats, 0, sizeof(playStats));
    @@ -705,6 +710,11 @@ static Void *App_captureTaskFxn(Void * prm)
         Int32 bytesAvailable;
         Int8  notifyPlayback = 1, bufferedNo = 0;
     	Int32 status;
    +    char                  threadName[128];
    +
    +    snprintf(threadName,sizeof(threadName),"%s_%x",__func__,0);
    +    threadName[sizeof(threadName) - 1] = 0;
    +    OSA_printTID(threadName);
     
         gAppCaptureThreadExitFlag = FALSE;
     
    diff --git a/demos/mcfw_api_demos/mcfw_demo/demo_audio_decode.c b/demos/mcfw_api_demos/mcfw_demo/demo_audio_decode.c
    index 64fc553..f5e4a45 100755
    --- a/demos/mcfw_api_demos/mcfw_demo/demo_audio_decode.c
    +++ b/demos/mcfw_api_demos/mcfw_demo/demo_audio_decode.c
    @@ -76,6 +76,11 @@ static Void *App_decodeTaskFxn(Void * prm)
         Int32                 inBufSize, outBufSize;
         Audio_DecInfo         *info = prm;
         Bool                  isSharedRegion = FALSE;
    +    char                  threadName[128];
    +
    +    snprintf(threadName,sizeof(threadName),"%s_%x",__func__,0);
    +    threadName[sizeof(threadName) - 1] = 0;
    +    OSA_printTID(threadName);
     
         if (!prm)
         {
    diff --git a/demos/mcfw_api_demos/mcfw_demo/demo_audio_encode.c b/demos/mcfw_api_demos/mcfw_demo/demo_audio_encode.c
    index b0235e7..a3840bf 100755
    --- a/demos/mcfw_api_demos/mcfw_demo/demo_audio_encode.c
    +++ b/demos/mcfw_api_demos/mcfw_demo/demo_audio_encode.c
    @@ -19,6 +19,11 @@ static Void *App_encodeTaskFxn(Void * prm)
         Void                  *encHandle = NULL;
         Audio_EncInfo         *info = prm;
         Bool                  isSharedRegion = FALSE;
    +    char                  threadName[128];
    +
    +    snprintf(threadName,sizeof(threadName),"%s_%x",__func__,0);
    +    threadName[sizeof(threadName) - 1] = 0;
    +    OSA_printTID(threadName);
     
         if (!prm)
         {
    diff --git a/demos/mcfw_api_demos/mcfw_demo/demo_scd_bits_wr.c b/demos/mcfw_api_demos/mcfw_demo/demo_scd_bits_wr.c
    index 4ca178e..94830cb 100755
    --- a/demos/mcfw_api_demos/mcfw_demo/demo_scd_bits_wr.c
    +++ b/demos/mcfw_api_demos/mcfw_demo/demo_scd_bits_wr.c
    @@ -601,6 +601,12 @@ void *Scd_bitsWriteMain(void *pPrm)
     #endif
     
         VSYS_PARAMS_S sysContextInfo;
    +    char                  threadName[128];
    +
    +    snprintf(threadName,sizeof(threadName),"%s_%x",__func__,0);
    +    threadName[sizeof(threadName) - 1] = 0;
    +    OSA_printTID(threadName);
    +
         Vsys_getContext(&sysContextInfo);
     
     #if DEMO_SCD_ENABLE_FILE_WRITE
    diff --git a/demos/mcfw_api_demos/mcfw_demo/demo_vcap_venc_vdec_vdis_bits_rdwr.c b/demos/mcfw_api_demos/mcfw_demo/demo_vcap_venc_vdec_vdis_bits_rdwr.c
    index c24d4e2..15c9045 100755
    --- a/demos/mcfw_api_demos/mcfw_demo/demo_vcap_venc_vdec_vdis_bits_rdwr.c
    +++ b/demos/mcfw_api_demos/mcfw_demo/demo_vcap_venc_vdec_vdis_bits_rdwr.c
    @@ -519,6 +519,7 @@ static Void *VcapVencVdecVdis_ipcBitsRecvFxn(Void * prm)
         UInt32 printStatsInterval = OSA_getCurTimeInMsec();
         UInt32 elapsedTime;
     
    +    OSA_printTID(__func__);
         while (FALSE == thrObj->exitBitsInThread)
         {
             OSA_semWait(&thrObj->bitsInNotifySem,OSA_TIMEOUT_FOREVER);
    diff --git a/mcfw/src_linux/links/audio/audio_capture.c b/mcfw/src_linux/links/audio/audio_capture.c
    index f23aa7f..c8fa462 100755
    --- a/mcfw/src_linux/links/audio/audio_capture.c
    +++ b/mcfw/src_linux/links/audio/audio_capture.c
    @@ -492,6 +492,12 @@ Void *Audio_captureTaskFxn(Void * prm)
         UInt16            *captureBuf;
         Int32             len, err, buffering;
         Int32             readLen;  
    +    char                  threadName[128];
    +
    +    snprintf(threadName,sizeof(threadName),"%s_%x",__func__,0);
    +    threadName[sizeof(threadName) - 1] = 0;
    +    OSA_printTID(threadName);
    +
     
         ctx = prm;
     
    diff --git a/mcfw/src_linux/links/ipcBitsIn/ipcBitsInLink_tsk.c b/mcfw/src_linux/links/ipcBitsIn/ipcBitsInLink_tsk.c
    index 13d375f..a115401 100755
    --- a/mcfw/src_linux/links/ipcBitsIn/ipcBitsInLink_tsk.c
    +++ b/mcfw/src_linux/links/ipcBitsIn/ipcBitsInLink_tsk.c
    @@ -29,6 +29,12 @@ Void *IpcBitsInLink_periodicTaskFxn(Void * prm)
     {
         IpcBitsInLink_Obj *pObj = (IpcBitsInLink_Obj *) prm;
         Int32 status;
    +    char threadName[128];
    +
    +    snprintf(threadName,sizeof(threadName),"%s_%x",__func__,pObj->tskId);
    +    threadName[sizeof(threadName) - 1] = 0;
    +    OSA_printTID(threadName);
    +
     
         while (FALSE == pObj->prd.exitThread)
         {
    @@ -353,8 +359,14 @@ Int IpcBitsInLink_tskMain(struct OSA_TskHndl * pTsk, OSA_MsgHndl * pMsg,
         Bool ackMsg, done;
         Int status = IPC_BITS_IN_LINK_S_SUCCESS;
         IpcBitsInLink_Obj *pObj = (IpcBitsInLink_Obj *) pTsk->appData;
    +    char threadName[128];
     
         OSA_printf("%s:Entered", __func__);
    +
    +    snprintf(threadName,sizeof(threadName),"%s_%x",__func__,pObj->tskId);
    +    threadName[sizeof(threadName) - 1] = 0;
    +    OSA_printTID(threadName);
    +
         if (cmd != SYSTEM_CMD_CREATE)
         {
             OSA_tskAckOrFreeMsg(pMsg, OSA_EFAIL);
    diff --git a/mcfw/src_linux/links/ipcBitsOut/ipcBitsOutLink_tsk.c b/mcfw/src_linux/links/ipcBitsOut/ipcBitsOutLink_tsk.c
    index ad63c1d..57c4f68 100755
    --- a/mcfw/src_linux/links/ipcBitsOut/ipcBitsOutLink_tsk.c
    +++ b/mcfw/src_linux/links/ipcBitsOut/ipcBitsOutLink_tsk.c
    @@ -55,6 +55,11 @@ Void *IpcBitsOutLink_periodicTaskFxn(Void * prm)
         IpcBitsOutLink_Obj *pObj = (IpcBitsOutLink_Obj *) prm;
         Int32 status;
         UInt32 printWarnCounter = 0;
    +    char threadName[128];
    +
    +    snprintf(threadName,sizeof(threadName),"%s_%x",__func__,pObj->tskId);
    +    threadName[sizeof(threadName) - 1] = 0;
    +    OSA_printTID(threadName);
     
         while (FALSE == pObj->prd.exitThread)
         {
    @@ -1106,6 +1111,11 @@ Int IpcBitsOutLink_tskMain(struct OSA_TskHndl * pTsk, OSA_MsgHndl * pMsg,
         Bool ackMsg, done;
         Int32 status = IPC_BITSOUT_LINK_S_SUCCESS;
         IpcBitsOutLink_Obj *pObj = (IpcBitsOutLink_Obj *) pTsk->appData;
    +    char threadName[128];
    +
    +    snprintf(threadName,sizeof(threadName),"%s_%x",__func__,pObj->tskId);
    +    threadName[sizeof(threadName) - 1] = 0;
    +    OSA_printTID(threadName);
     
         if (cmd != SYSTEM_CMD_CREATE)
         {
    diff --git a/mcfw/src_linux/links/ipcFramesIn/ipcFramesInLink_tsk.c b/mcfw/src_linux/links/ipcFramesIn/ipcFramesInLink_tsk.c
    index 2f362e3..a6447bb 100755
    --- a/mcfw/src_linux/links/ipcFramesIn/ipcFramesInLink_tsk.c
    +++ b/mcfw/src_linux/links/ipcFramesIn/ipcFramesInLink_tsk.c
    @@ -118,6 +118,11 @@ Void *IpcFramesInLink_periodicTaskFxn(Void * prm)
     {
         IpcFramesInLink_Obj *pObj = (IpcFramesInLink_Obj *) prm;
         Int32 status;
    +    char threadName[128];
    +
    +    snprintf(threadName,sizeof(threadName),"%s_%x",__func__,pObj->tskId);
    +    threadName[sizeof(threadName) - 1] = 0;
    +    OSA_printTID(threadName);
     
         while (FALSE == pObj->prd.exitThread)
         {
    @@ -874,6 +879,12 @@ Int IpcFramesInLink_tskMain(struct OSA_TskHndl * pTsk, OSA_MsgHndl * pMsg,
         Bool ackMsg, done;
         Int status = IPC_FRAMES_IN_LINK_S_SUCCESS;
         IpcFramesInLink_Obj *pObj = (IpcFramesInLink_Obj *) pTsk->appData;
    +    char threadName[128];
    +
    +    snprintf(threadName,sizeof(threadName),"%s_%x",__func__,pObj->tskId);
    +    threadName[sizeof(threadName) - 1] = 0;
    +    OSA_printTID(threadName);
    +
     
         OSA_printf("%s:Entered", __func__);
     
    diff --git a/mcfw/src_linux/links/ipcFramesOut/ipcFramesOutLink_tsk.c b/mcfw/src_linux/links/ipcFramesOut/ipcFramesOutLink_tsk.c
    index e21cf45..eb47175 100755
    --- a/mcfw/src_linux/links/ipcFramesOut/ipcFramesOutLink_tsk.c
    +++ b/mcfw/src_linux/links/ipcFramesOut/ipcFramesOutLink_tsk.c
    @@ -47,6 +47,12 @@ Void *IpcFramesOutLink_periodicTaskFxn(Void * prm)
     {
         IpcFramesOutLink_Obj *pObj = (IpcFramesOutLink_Obj *) prm;
         Int32 status;
    +    char threadName[128];
    +
    +    snprintf(threadName,sizeof(threadName),"%s_%x",__func__,pObj->tskId);
    +    threadName[sizeof(threadName) - 1] = 0;
    +    OSA_printTID(threadName);
    +
     
         while (FALSE == pObj->prd.exitThread)
         {
    @@ -473,6 +479,11 @@ Int IpcFramesOutLink_tskMain(struct OSA_TskHndl * pTsk, OSA_MsgHndl * pMsg,
         Bool ackMsg, done;
         Int status = IPC_FRAMESOUT_LINK_S_SUCCESS;
         IpcFramesOutLink_Obj *pObj = (IpcFramesOutLink_Obj *) pTsk->appData;
    +    char threadName[128];
    +
    +    snprintf(threadName,sizeof(threadName),"%s_%x",__func__,pObj->tskId);
    +    threadName[sizeof(threadName) - 1] = 0;
    +    OSA_printTID(threadName);
     
         if (cmd != SYSTEM_CMD_CREATE)
         {
    diff --git a/mcfw/src_linux/links/system/systemLink_tsk.c b/mcfw/src_linux/links/system/systemLink_tsk.c
    index 7d0dc6a..364f272 100755
    --- a/mcfw/src_linux/links/system/systemLink_tsk.c
    +++ b/mcfw/src_linux/links/system/systemLink_tsk.c
    @@ -161,6 +161,12 @@ Int32 SystemLink_tskMain(struct OSA_TskHndl *pTsk, OSA_MsgHndl *pMsg, Uint32 cur
         Int32 status = OSA_EFAIL;
         SystemLink_Obj *pObj = (SystemLink_Obj*)pTsk->appData;
         Uint16 cmd = OSA_msgGetCmd(pMsg);
    +    char threadName[128];
    +
    +    snprintf(threadName,sizeof(threadName),"%s_%x",__func__,pObj->tskId);
    +    threadName[sizeof(threadName) - 1] = 0;
    +    OSA_printTID(threadName);
    +
     
         if (SYSTEM_LINK_IS_SLAVE_CORE_EXCEPTION(cmd))
         {
    diff --git a/mcfw/src_linux/mcfw_api/ti_vdis_hdmi_ctrl_priv.c b/mcfw/src_linux/mcfw_api/ti_vdis_hdmi_ctrl_priv.c
    index 116ca5c..58c5136 100755
    --- a/mcfw/src_linux/mcfw_api/ti_vdis_hdmi_ctrl_priv.c
    +++ b/mcfw/src_linux/mcfw_api/ti_vdis_hdmi_ctrl_priv.c
    @@ -645,6 +645,11 @@ static void *Vdis_hdmiControlThread(void * ctrlInst)
         struct ti81xxhdmi_status hdmiStatus;
         OSA_MsgHndl *pMsg;
         int sendEvent;
    +    char                  threadName[128];
    +
    +    snprintf(threadName,sizeof(threadName),"%s_%x",__func__,0);
    +    threadName[sizeof(threadName) - 1] = 0;
    +    OSA_printTID(threadName);
     
         hdmiStatus.is_hpd_detected = 0x0;
         hdmiStatus.is_hdmi_streaming = 0x0;
    diff --git a/mcfw/src_linux/osa/inc/osa.h b/mcfw/src_linux/osa/inc/osa.h
    index f46b1a0..c878ec4 100755
    --- a/mcfw/src_linux/osa/inc/osa.h
    +++ b/mcfw/src_linux/osa/inc/osa.h
    @@ -82,6 +82,7 @@ void   OSA_waitMsecs(Uint32 msecs);
     int    OSA_attachSignalHandler(int sigId, void (*handler)(int ) );
     Int32 OSA_mapMem(UInt32 physAddr, UInt32 memSize , Ptr *pMemVirtAddrPtr);
     Int32 OSA_unmapMem(Ptr pMemVirtAddrPtr,UInt32 memSize);
    +void  OSA_printTID(const char *threadName);
     
     int xstrtoi(char *hex);
     
    diff --git a/mcfw/src_linux/osa/src/osa.c b/mcfw/src_linux/osa/src/osa.c
    index cf50d30..c5e9301 100755
    --- a/mcfw/src_linux/osa/src/osa.c
    +++ b/mcfw/src_linux/osa/src/osa.c
    @@ -146,3 +146,17 @@ int xstrtoi(char *hex)      // hex string to integer
     {
       return HextoDec(hex,0);
     }
    +
    +
    +#include <unistd.h>
    +#include <sys/syscall.h>
    +#include <sys/types.h>
    +
    +void
    +OSA_printTID(const char *threadName)
    +{
    +    pid_t tid;
    +
    +    tid = syscall(SYS_gettid);
    +    printf("[HOST] \nThreadName:%s,ThreadID:%d\n",threadName,tid);
    +}
    

  • Thanks for the patch.
    I added thread debug output from the patch.
    Monitoring /proc/pid/task shows me that the number of threads is constant.

    The problem is visible in the log.
    If stopping is sucessfull, than "System_ipcMsgQTskDelete: Thread System_ipcMsgQTaskMain deleted" follows
    after "Exit Thread System_ipcMsgQTaskMain". If OSA_thrDelete hangs, the problem occur.

    I am a little bit confuse about the thread ID of SystemLink_tskMain.
    At the first start the ID is 205. At the next start it is 206.
    But we have a thread with the same ID.
    "Shell_Process_Thread_0, ThreadID:206", this our own thread and it is started only once, and is not deleted at stop.
    This thread handles a mcfw function api and start and stop for us.

    6840.log.txt

    To be sure that no application thread brings a problem, I disabled the audio and video capture and playback, OSD and scd
    threads. The threads are not created. But the problem still occurs.
    For example my VcapVencVdecVdis_stop() is minimal:



    void VcapVencVdecVdis_stop(void)
    {

    //    display_process_DeInitialize();

        /* Stop components */
        Vcap_stop();
        Venc_stop();
        Vdec_stop();
        Vdis_stop();


        /* Close display side OSD */
        grpx_fb_exit();
        Vsys_deConfigureDisplay();


        /* Delete instances of links */
        Vsys_delete();


    //    if( vsysParams.enableScd )
    //       Scd_bitsWriteDelete();

    //    dmp_VcapVencDeInitialize();

    //    dmp_VideoPlaybackDeInitialize();

    //    dmp_IPcamDeInitialize();

        /* De-initialize components */
        Vcap_exit();
        Venc_exit();
        Vdec_exit();
        Vdis_exit();
        Vsys_exit();
    }


  • Sorry, I made a mistake for the TID.

    SystemLink_tskMain gets other TID then our thread "Shell_Process_Thread".

    I will try to add some debug output to monitor the create and delete of all threads and tasks.

  • Do you have the ability to run strace on your target. If so can you attach it to the process and monitor. OSA_thrJoin not unblocking when thread has exited could indicate some data structure is corrupted.I want to check if a SEG FAULT occurs but kernel is for some reason unable to termintate the process.

  • I think You are right.
    Anything here must be corrupted.
    I try to run "strace" for ARM.
    Also I will do code rewiew for the parts still active.
    Most parts of application are disabled for my tests.

  • hi Holger:

    Can you share DVR_RDK3.0  package with me? now I also use DM8168 evm,thanks a lot!  

    my email:  xiaodeo@126.com

  • Hi, what do You mean with DVR_RDK package?

    You can get DVR_RDK 3.0 from UDWorks.

    Best rgds

  • After code review I went back to the roots to find the start / stop problem.
    I use the original Linux kernel from DVR_RDK 03.00.00.00 package,
    and an unmodified MCFW from DVR_RDK 03.00.00.00. I disabled all application threads and functions.
    After some start and stops (20...50) we always get the following error at the last start:
    (No crash dump file is written.)

    May 23 16:35:50 192 user.debug [host] : SystemLink_tskMain: TID=730
    May 23 16:35:50 192 user.notice [host] :   4457953:!!!SLAVE CORE [VPSS-M3] DOWN!!!
    May 23 16:35:50 192 user.notice [host] : SystemLink_copySlaveCoreExceptionContext:129
    May 23 16:35:50 192 user.notice [host] : SystemLink_copySlaveCoreExceptionContext:136
    May 23 16:35:50 192 user.info Remote debug client : [m3vpss ]  4468260: Assertion @ Line: 240 in links_common/dup/dupLink_tsk.c: pOrgFrame != NULL : failed !!!

    I got the same behavior if I use the changed MCFW (Mosaic via RTSP) and our modified Linux kernel.
    But to be sure that the problems do not come form this parts I went back to DVR_RDK original.

    Can a code coruption be a reason for this behavior or do we have an other effect ?

  • This looks like a different issue compared to what you reported initially. This looks like some link is not deleted or stopped in right sequence.I don't have RDk 3,0 codebase with me. Some code modifications are required to ensure all links that are created are deleted. You can refer /dvr_rdk/mcfw/src_linux/mcfw_api/usecases/ti816x/multich_hybrid_dvr.c for example code.

    Relevant postion is pasted below:

    typedef struct MultichHybridDVR_Context
    {
        UInt32 createdLinkCount;
        UInt32 createdLinks[MULTICH_HYBRID_DVR_USECASE_MAX_NUM_LINKS];
    }  MultichHybridDVR_Context;

    MultichHybridDVR_Context gHybridDVRUsecaseContext =
    {
        .createdLinkCount           = 0
    };

    static Void multich_hybriddvr_register_created_link(MultichHybridDVR_Context *pContext,
                                                        UInt32 linkID)
    {
        OSA_assert(pContext->createdLinkCount < OSA_ARRAYSIZE(pContext->createdLinks));
        pContext->createdLinks[pContext->createdLinkCount] = linkID;
        pContext->createdLinkCount++;
    }

    #define MULTICH_HYBRIDDVR_CREATE_LINK(linkID,createPrm,createPrmSize)           \
        do                                                                          \
        {                                                                           \
            System_linkCreate(linkID,createPrm,createPrmSize);                      \
            multich_hybriddvr_register_created_link(&gHybridDVRUsecaseContext,      \
                                                    linkID);                        \
        } while (0)

     

    and replace all calls to System_linkCreate by  MULTICH_HYBRIDDVR_CREATE_LINK.

     

    and in code in MultiCh_deleteProgressiveVcapVencVdecVdis shoudl be

        for (i = 0; i < gHybridDVRUsecaseContext.createdLinkCount; i++)
        {
            System_linkStop (gHybridDVRUsecaseContext.createdLinks[i]);
        }

        for (i = 0; i < gHybridDVRUsecaseContext.createdLinkCount; i++)
        {
            System_linkDelete (gHybridDVRUsecaseContext.createdLinks[i]);
        }
        gHybridDVRUsecaseContext.createdLinkCount = 0;

     


  • I replaced System_linkCreate() by a defined MULTICH_PROGRESSIVE_CREATE_LINK()
    in the same way like in Your template.
    Start / Stop is running uninterrupted now.
    Thank You Badri for this advice.