After a while decoding a video stream with significant packet loss in it (here random 10%, but also happens for other values), the decoder hangs and stops returning any buffers. The decoder returns a lot of errors while running (as expected, given the nature of the stream). Here is the last bit of log from the video M3 core (filtered to remove the spammy Start/StopInstance messages):
N:Video P:1 #:30089 T:000000132bd39355 S:OMX_TI_VIDDEC_Process::Line 2582::omxHandle 0x9dc82500::Error->Decoder returned error 0x2000a00
N:Video P:1 #:30090 T:000000132bdc60b3 S:OMX_TI_VIDDEC_CB_ProcessDone::Line 2935::omxHandle 0x9dc82500::Error->Decoder returned error 0x2000a00
N:Video P:1 #:30112 T:000000132fcfe28f S:OMX_TI_VIDDEC_Process::Line 2582::omxHandle 0x9dc82500::Error->Decoder returned error 0x80000000
N:Video P:1 #:30113 T:000000132fd85d3b S:OMX_TI_VIDDEC_CB_ProcessDone::Line 2935::omxHandle 0x9dc82500::Error->Decoder returned error 0x80000000
N:Video P:1 #:30131 T:0000001332d372b7 S:OMX_TI_VIDDEC_Process::Line 2582::omxHandle 0x9dc82500::Error->Decoder returned error 0x80000000
N:Video P:1 #:30132 T:0000001332eaf105 S:OMX_TI_VIDDEC_CB_ProcessDone::Line 2935::omxHandle 0x9dc82500::Error->Decoder returned error 0x80000000
N:Video P:1 #:30163 T:00000013390ee915 S:OMX_TI_VIDDEC_Process::Line 2582::omxHandle 0x9dc82500::Error->Decoder returned error 0x2000a00
N:Video P:1 #:30165 T:00000013391ad443 S:OMX_TI_VIDDEC_CB_ProcessDone::Line 2935::omxHandle 0x9dc82500::Error->Decoder returned error 0x2000a00
N:Video P:1 #:30170 T:0000001339b33305 S:OMX_TI_VIDDEC_Process::Line 2582::omxHandle 0x9dc82500::Error->Decoder returned error 0x80000000
N:Video P:1 #:30171 T:0000001339bb8151 S:OMX_TI_VIDDEC_CB_ProcessDone::Line 2935::omxHandle 0x9dc82500::Error->Decoder returned error 0x80000000
N:Video P:1 #:30209 T:00000013400f7b07 S:OMX_TI_VIDDEC_Process::Line 2582::omxHandle 0x9dc82500::Error->Decoder returned error 0x2000a00
N:Video P:1 #:30211 T:00000013401bf721 S:OMX_TI_VIDDEC_CB_ProcessDone::Line 2935::omxHandle 0x9dc82500::Error->Decoder returned error 0x2000a00
N:Video P:1 #:30231 T:0000001343416c8b S:OMX_TI_VIDDEC_Process::Line 2582::omxHandle 0x9dc82500::Error->Decoder returned error 0x2000a00
N:Video P:1 #:30232 T:0000001343507f3d S:OMX_TI_VIDDEC_CB_ProcessDone::Line 2935::omxHandle 0x9dc82500::Error->Decoder returned error 0x2000a00
N:Video P:1 #:30248 T:00000013465883a9 S:OMX_TI_VIDDEC_Process::Line 2582::omxHandle 0x9dc82500::Error->Decoder returned error 0x8008000
N:Video P:1 #:30249 T:000000134658fc91 S:Module<OMX.TI.DUCATI.VIDDEC> Entering<OMX_BASE_CB_ReturnEventNotify> @line<100>
N:Video P:1 #:30250 T:0000001346596745 S:Module<OMX.TI.DUCATI.VIDDEC> @<OMX_BASE_CB_ReturnEventNotify> @line<158> msg<Notify client for error>
N:Video P:1 #:30251 T:000000134659d6fd S: hComponent: 0x9dc82500; EventHandler: 0x9e36b2b1
N:Video P:1 #:30252 T:0000001346618775 S:Module<OMX.TI.DUCATI.VIDDEC> Leaving<OMX_BASE_CB_ReturnEventNotify> @line<224> with error<0:ErrorNone>
The final error code, 0x8008000, is IH264VDEC_ERR_HDVICP2_IMPROPER_STATE | XDM_FATALERROR. None of the other error returns from the decoder have this value, nor do any of them have either of those error bits set. From the last few thousand lines:
$ cat log | grep "Decoder returned" | sed 's/.* //' | sort | uniq -c
128 0x2000a00
8 0x401
180 0x80000000
748 0x80001080
1 0x8008000
22 0x82000a00
172 0x82001a80
This 0x8008000 error is consistently the last thing in the log, and is also returned to userspace as an error callback (OMX_ErrorStreamCorrupt). After this point, the decoder accepts further input buffers but doesn't appear to do anything with them, so they quickly run out on the application side. No output buffers are returned either.
So:
- Have I made some error in using the decoder to cause it to enter this error state?
- If not, how can I recover from this error to continue decoding the stream?
Other details which may or may not be relevant:
- It only seems to happen when running all of our application code - extracting H.264 from a failing RTP stream and running it through the decoder on its own does not fail.
- There is also an MJPEG decoder and an H.264 encoder running on the video M3 at the same time as the decoder when this fails.
- The H.264 input stream is 1280x720, 30fps, 1.4Mb/s (though 10% of RTP packets are dropped and slice reassembly will have dropped more, possibly reducing those numbers significantly).
- It is baseline profile, and consistently has two slices per frame.
- The whole system runs correctly for some time (from a few minutes to maybe an hour or so) before the above failure happens.
- The decoder binary is built from EZSDK 5.04, h264dec 01.00.00.08.
- The hardware is a DM8168 revision 2.0 on our own board.
Thanks,
- Mark