locked
Performance question regarding MFT_MESSAGE_SET_D3D_MANAGER RRS feed

  • Question

  • Hi there,

     

    i´m currently facing some really strange behavior. 

    when i try to open a video stream on my development machine, everything works smooth and fine. as soon as i try the same on other machines, there is a delay of about a second (sometimes event two). i was able to pin the lag using mftrace.

    on my machine the part where the D3dManager is set looks like this:

     

    6208,23EC 08:31:36.93231 COle32ExportDetours::CoCreateInstance @ Created {98455561-5136-4D28-AB08-4CEE40EA2781} MF Video Presenter (C:\Windows\SysWOW64\evr.dll) @051110C8 - traced interfaces: 

    6208,23EC 08:31:36.93238 CMFTransformDetours::ProcessMessage @0510DFA4 Message type=0x00000002 MFT_MESSAGE_SET_D3D_MANAGER, param=05111930

    6208,23EC 08:31:36.93377 CMFActivateDetours::ActivateObject @06834380 New sink @0A8527F8

    as you can see, everything just takes a few milliseonds and the rest is fine.

    doing the same thing on a machine with the same hardware/os, its (reproducably) something like :

     

    3648,18C8 09:19:13.62633 COle32ExportDetours::CoCreateInstance @ Created {98455561-5136-4D28-AB08-4CEE40EA2781} MF Video Presenter (C:\Windows\SysWOW64\evr.dll) @12977528 - traced interfaces: 

    3648,18C8 09:19:13.62640 CMFTransformDetours::ProcessMessage @13379384 Message type=0x00000002 MFT_MESSAGE_SET_D3D_MANAGER, param=12977D90

    3648,18C8 09:19:14.42108 CMFActivateDetours::ActivateObject @1386F0B0 New sink @004C90F0

     

    i.e. the ProcessMessage call MFT_Message_Set_D3D_MANAGER takes about a secons.

     

    looking even further (mftrace -l 16) the methods wher the time goes by can be determined:

     

    296,4F0 10:10:13.06917 CMFTransformDetours::ProcessMessage @04E3AD34 Message type=0x00000002 MFT_MESSAGE_SET_D3D_MANAGER, param=04E3DC90

    296,4F0 10:10:13.06917 CMFTransformDetours::ProcessMessage @04E3AD34 - exit

    296,4F0 10:10:13.06917 CMFTransformDetours::GetAttributes @04E3AD34 - enter

    296,4F0 10:10:13.06917 CMFTransformDetours::GetAttributes @04E3AD34 - exit

    296,4F0 10:10:13.06918 CMFAttributesDetours::SetBlob @04F337A0 - enter

    296,4F0 10:10:13.06918 CMFAttributesDetours::SetBlob @04F337A0 - exit

    296,4F0 10:10:13.06918 CMFTransformDetours::GetOutputAvailableType @04E3AD34 - enter

    296,4F0 10:10:13.06919 CMFTransformDetours::GetOutputAvailableType @04E3AD34 - exit (failed hr=0xC00D6D60 MF_E_TRANSFORM_TYPE_NOT_SET)

    296,4F0 10:10:13.06920 CMFTransformDetours::GetInputStreamInfo @04E3AD34 - enter

    296,4F0 10:10:13.06920 CMFTransformDetours::GetInputStreamInfo @04E3AD34 - exit

    296,4F0 10:10:13.91458 CMFTransformDetours::GetOutputAvailableType @04E3AD34 - enter

    296,4F0 10:10:13.91459 CMFTransformDetours::GetOutputAvailableType @04E3AD34 - exit (failed hr=0xC00D6D60 MF_E_TRANSFORM_TYPE_NOT_SET)

    i.e. a second is lost between GetInputStreamInfo and GetOutputAvailableType. Just not on my development machine.

    maybe some MF guru knows what happens in there and what may be the reason for this kind of delay.

     

    now my question: is there any setting i may have set that increases performance for this kind of thing? I tried with several graphic cards, the delay is there all the time except on my machine (using the same player program, same video file, same decoder MFT).

    I even recognized some differences when starting the player on different monitors (i.e. multi monitor setup) whereas the second or third monitors are always slowe when creating a new Sink using ActivateObject, except on my machine.

    i´d be glad if someone has an idea what the performance difference could be and how i can use this to increase playback starting speed on the other machines.

    thanks

     

    joachim


    Friday, October 7, 2011 9:30 AM

All replies

  • Hell again,

    i made another observation which could be a bug within MF. i noticed (on several systems, with different hardware, GPU´s, all Windows 7 (some 32, some 64bit)

    that the MFT_MESSAGE_SET_D3D_MANAGER call mentioned above also blocks (at least rendering) of the whole OS. other processes (e.g. IE showing an animation) will also lag and show some blockings/stutterings until the call is finished. i just don´t know if it´s MF related or depending on the GPUs (however, i tried Matrox M9140, Intel HD Media Accelerator and ATI Radeon 36xx cards, so i guess it has something to do with MF/Windows itself rather than gpu drivers).

    any ideas would be appreciated

    regards

    joachim

    Tuesday, October 11, 2011 8:04 AM
  • Have you tried this with DXVA disabled on the topology or disabling DXVA in WMP (Options->Performance, 'Turn on DXVA acceleration for WMV files)?  DXVA sounds like the likely culprit here, but it would be good to make sure that its not just something else going on in the background that makes it look like the D3D manager message is slow.

    This does sound like a driver issue, given the differences between machines and especially the blocking of the whole machine.  The SET_D3D_MANAGER message typically just opens a device handle and attempts to get the video decoder service.  This results in calls down to the driver.

    Monday, October 31, 2011 9:52 PM
  • Thanks for your reply.

    i tried disabling DXVA on the topology itself as i don´t use WMP (custom media player, same in MFPlayer2 sample from SDK).

    i had a few more tests running. when having a Radeon GPU, disabling DXVA removes the lag, however, disabling DXVA on an Intel HD Graphics 3000 does not remove it. 

    Interesting fact ist that disabling DXVA when using a Matrox 9120 GPU (no DXVA decoding available) has no effect at all (works on one machine, doesn´t on another one).

    the more detailed log looks something like (mftrace -l 16)

    296,4F0 10:10:13.06920 CMFTransformDetours::GetInputStreamInfo @04E3AD34 - exit

    296,4F0 10:10:13.91458 CMFTransformDetours::GetOutputAvailableType @04E3AD34 - enter

    but i have no idea what happens inside MF beweet these two calls (where the time is lost) as i cannot get more verbose information.

    Another observation was that the lag duration is not stable when rendering the Video on multi-monitor machines, i.e. First Screen has lower lag than second, third or fourth screen. At first i thought it was due to GPU drivers, but the issue is the same for different GPU´s of different vendors.

    maybe someone could shed light onto what happens between the two calls mentioned above

    thanks a lot

    joachim

    Wednesday, November 2, 2011 7:25 AM