Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Zurab_T_1
Beginner
72 Views

I have several problems with intel MSDK

1. I am getting permanently MFX_WRN_VIDEO_PARAM_CHANGED on some live streams.

2. I am getting permanently MFX_WRN_DEVICE_BUSY, which stops repeating only after decode_reset.

3. sometimes program freezes on mfxclose.

4. sometimes libmfxhw64.so crashes with segfault.

I have collected debug informations, stream files and soon, but I couldn't find a way how to give them to Intel to analyze it.

 

here is just one sample output from gdb.

 

(gdb) bt
#0  0x00007fb34cd4b66c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007fb349fba27b in ?? () from /opt/delta/lib/libmfxhw64.so
#2  0x00007fb349fbae07 in ?? () from /opt/delta/lib/libmfxhw64.so
#3  0x00007fb349baf06c in ?? () from /opt/delta/lib/libmfxhw64.so
#4  0x00007fb349bb122c in ?? () from /opt/delta/lib/libmfxhw64.so
#5  0x00007fb349bb1349 in ?? () from /opt/delta/lib/libmfxhw64.so
#6  0x00007fb349b5da84 in ?? () from /opt/delta/lib/libmfxhw64.so
#7  0x00007fb349b5db8e in ?? () from /opt/delta/lib/libmfxhw64.so
#8  0x00007fb349b5deb9 in ?? () from /opt/delta/lib/libmfxhw64.so
#9  0x00007fb349b57610 in MFXClose () from /opt/delta/lib/libmfxhw64.so

 

0 Kudos
10 Replies
Surbhi_M_Intel
Employee
72 Views

Hi Zurab,

Thank you for your question. Can you give us some details about the system you are using to run Intel Media SDK. Also which sample of Media SDK you are using. If you can also tell us about the use case or the pipeline that will be helpful!

-Surbhi

Zurab_T_1
Beginner
72 Views

SURBHI M. (Intel) wrote:

Hi Zurab,

Thank you for your question. Can you give us some details about the system you are using to run Intel Media SDK. Also which sample of Media SDK you are using. If you can also tell us about the use case or the pipeline that will be helpful!

-Surbhi

Hi SURBHI,

Thanks for reply,

I have transcoding some iptv multicast livestreams. 99% of them works fine, but there are few iptv channels which gives me some errors.

I don't know what kind of test to do and what information are needed for you. if you tell me then I will provide it.

Details are below:

We are using Intel Media sdk 2014 R2 on Linux server SUSE enterprise Linux 11sp3 with kernel 3.0.76-0.11-default. We have Intel(R) Xeon(R) CPU E3-1285 v3 into IBM x3250 M5, with 16GB RAM configured 1.5GB for GPU.

there is more details about system.

vainfo

libva info: VA-API version 0.34.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.34 (libva 1.2.0.pre1)
vainfo: Driver version: 16.3.2.22368-ubit
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Baseline           : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice

 

Surbhi_M_Intel
Employee
72 Views

Hi Zurab,

Thank you for giving the system information. Intel Media SDK supports this linux configuration. The information I need from you is -

1. Can you please let us know which existing sample you are referring to develop the pipeline?

2.  I am getting permanently MFX_WRN_VIDEO_PARAM_CHANGED on some live streams.
We see MFX_WRN_VIDEO_PARAM_CHANGED when the decoder detects a new sequence header in the bitstream. Video parameters may have changed. It should either continue decoding after this warning or see MFX_ERR_INCOMPATIBLE_VIDEO_PARAM.
From the Media SDK Manual "The MFXVideoDECODE_DecodeFrameAsync function returns MFX_WRN_VIDEO_PARAM_CHANGED if  the SDK decoder parsed a new sequence header in the bitstream and decoding can continue with existing frame buffers." 

3. I am getting permanently MFX_WRN_DEVICE_BUSY, which stops repeating only after decode_reset.
MFX_WRN_DEVICE_BUSY comes when GPU is occupied and cannot take the next command. It waits for few milliseconds and repeat the same call. It will be good to check the overload at that time on GPU. This is a known issue which we have seen, and we are currently working towards the solution of it. I will keep you posted about this.

4. sometimes program freezes on mfxclose.
It's hard to tell like why would you see this. Can you please narrow down this issue and also describe the scenarios when you see this issue. Also I would need a code which can replicate this issue with the input file used when this issue happens to debug this issue.

5. sometimes libmfxhw64.so crashes with segfault.
Again, it's hard to tell why libmfxhw64.so crashes, the code to reproduce this problem with the input file would be helpful to debug this issue.

Thanks,
-Surbhi

 


 


 

 

Zurab_T_1
Beginner
72 Views

1. Can you please let us know which existing sample you are referring to develop the pipeline?

whole code is made on c by me and there is no code copy pasted from examples. I just followed documentation. I will explain how I am doing pipeline and more.

there is process dispatcher which forks new process for one session. for example if I need transcode 4 live stream than I fork 4 separate process in which each is 4 independent mfxsession for decode, vpp(in case we need deinterlace) and encode. we use vaapi for memory allocation and asyncdepth=4, we allocate more memory then needed, because sometimes we get error no such surface. so memory allocation is: DecRequest.NumFrameSuggested+EncRequest.NumFrameSuggested+mfxEncParams.AsyncDepth*2.

2. yes i know what does the MFX_WRN_VIDEO_PARAM_CHANGED mean, but i couldn't understand why I am getting this warning on every h264 key frame? you mean that every key_frame have different extra_data?

3. regarding device_busy, I have recorded elementary stream from live stream and when I received permanent decode_busy I stopped recording of it and than i tried to decode/transcode from the samples, but i get segfault-s in samples.

4. when some forked process going to close and that time other process are going to issue INIT. than some of process freeze on mfxclose and when I gdb attach to that process the backtrace is

#0  0x00007fb34cd4b66c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0

#1  0x00007fb349fba27b in ?? () from /opt/delta/lib/libmfxhw64.so

#2  0x00007fb349fbae07 in ?? () from /opt/delta/lib/libmfxhw64.so

#3  0x00007fb349baf06c in ?? () from /opt/delta/lib/libmfxhw64.so

#4  0x00007fb349bb122c in ?? () from /opt/delta/lib/libmfxhw64.so

#5  0x00007fb349bb1349 in ?? () from /opt/delta/lib/libmfxhw64.so

#6  0x00007fb349b5da84 in ?? () from /opt/delta/lib/libmfxhw64.so

#7  0x00007fb349b5db8e in ?? () from /opt/delta/lib/libmfxhw64.so

#8  0x00007fb349b5deb9 in ?? () from /opt/delta/lib/libmfxhw64.so

#9  0x00007fb349b57610 in MFXClose () from /opt/delta/lib/libmfxhw64.so

5. if there is available any debug symbols i can collect core dumps and send you for analyzing.

Zurab_T_1
Beginner
72 Views

little bit more about my code. I'm not using mfxdispatcher I am directly loading (dlopen) the share object library.

Surbhi_M_Intel
Employee
72 Views

Hi Zurab,

Thank your for the more detailed information of your project. 

  • so memory allocation is: DecRequest.NumFrameSuggested+EncRequest.NumFrameSuggested+mfxEncParams.AsyncDepth*2.
    For the memory allocation, you might wanna consider NumFrameSuggested by VPP.  That is requiredif you are doing de-interlacing. I am not sure the reason behind considering this mfxEncParams.AsyncDepth*2, but you should be able to query for the surfaces required for decode, encode and VPP and this should be automatically taken care of.
  • why I am getting this warning on every h264 key frame? you mean that every key_frame have different extra_data?
    To understand this, it will be a good idea to any other decoder like ffmpeg to decode these streams. It might be possible that there is some corruption in the video which is causing the decoder to give this warning. This has come up in the past as well, that our decoder behaves little indifferent for the corrupted streams. So using a different decoder can help us understand this issue better. Another way to find out also can be use a known good bitstream and see if you encounter this issue.
  • I received permanent decode_busy I stopped recording of it and than i tried to decode/transcode from the samples, but i get segfault-s in samples.
    This again leads to the point of might be decoding corrupted streams which results into device busy or it can also be a memory allocation issue as well. You should check the GPU usage at the time of this error using any online tool. My advice would be to start of with best known code you have( in our case it is the existing sample and tutorials) and add the functions to develop your pipeline, it will help to debug the code better and figure out if the functions are working the way it is expected to. By that way we would know where it broke. Since your code is not based on any of the examples we really can't point what could have caused the problem. In general, the documentation is not helpful enough to build the complete code, we are working towards improving it. The better way to understand the functions is to look into simpler tutorials and then complex sample. 
  • I'm not using mfxdispatcher I am directly loading (dlopen) the share object library. 
    It is advisable to use mfx dispatcher as there has been dependency on it, even though it i snot clear enough in our documentation. It is might possible that above errors can be solved using mfxdispatcher.
  • If there is available any debug symbols i can collect core dumps and send you for analyzing.
    There is tracer utility in windows which records the Intel Media SDK API calls and parameters to a log file. Unfortunately, we don't have this in Linux for now. So if you can base your code of on the existing sample/tutorial and give us a reproducer code, we would be able to debug this issue more. 

Thanks,
-Surbhi

Jeffrey_M_Intel1
Employee
72 Views

Hi Zurab,

This thread has more info on MFX_WRN_VIDEO_PARAM_CHANGED.  Basically, this warning indicates that a sequence header has been parsed but decode can proceed with existing frame buffers.  In many cases this is simply due to extra headers encoded by the source for error recovery, but if things like resolution might change for your inputs you can check if parameters are still the same with GetVideoParam.

While MFX_WRN_DEVICE_BUSY is expected in normal operation, Media SDK should proceed after a very short wait.  If this state persists more than a few milliseconds this could indicate a problem.

We're currently working toward a fix for some known scenarios where corrupted input can cause behavior like you've described.  More inputs can help us be sure we have a complete fix.  As Surbhi indicated, if this is the problem it should be possible to isolate a short section of the stream and replicate the behavior with the samples and tutorials.  If you're seeing this problem occasionally for network streams, one way to isolate the section causing the problem is to save all bitstream data sent to Media SDK decode to a file as well, then extract a short section before the problem started.

Regards, Jeff  

Zurab_T_1
Beginner
72 Views

hi surbhi,

  • For the memory allocation, you might wanna consider NumFrameSuggested by VPP

if we are using deinterlace than i am using DecRequest.NumFrameSuggested+VPPRequest.NumFrameSuggested+mfxVPPParams.AsyncDepth*2
if we are not using deinterlace and any vpp then we are using EncRequest.NumFrameSuggested instead of VPPRequest.NumFrameSuggested.
if i don't add mfxVPPParams.AsyncDepth*2, then I am getting no more free surfaces periodically.

  • This has come up in the past as well, that our decoder behaves little indifferent for the corrupted streams. So using a different decoder can help us understand this issue better. Another way to find out also can be use a known good bitstream and see if you encounter this issue.

I have checked it with ffmpeg and there is nothing to warn, but i have analyzed the stream and yes you are right there is little differences in the sps and thats why I am getting that warning.

Zurab_T_1
Beginner
72 Views

Hi Jeffrey and Subrhi,

Yesterday one of my transcode processes has freazed on MFXVideoDECODE_Reset. I made core dump of the process, killed and run again.

Software made MFXVideoDECODE_Reset after continuous device_busy. I can give you the core-dump file for analysis.

from tomorrow I will start collecting elementary stream payload for MFX_WRN_DEVICE_BUSY analysis.

please give me any private channel to send core-dump file and my program to analyze what happen in MFXVideoDECODE_Reset freeze.

I think in the coredump file you could find more details about decoder state why I get decoder_busy.

Surbhi_M_Intel
Employee
72 Views

Hi Zurab, 

That's great! Please send us the reproducer code and the stream by attaching it to the private message or you can send us through syncplicity also. Also please give us details to how to run your code.

-Surbhi

Reply