none
Why do multiple instances of MediaPlayerElement streaming H.264 video crash app? RRS feed

  • Question

  • The following simple page created to reproduce this problem crashes the app consistently on a PC:

        <Grid Grid.Row="2" Height="600">
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <MediaPlayerElement Source="ms-appx:///Assets/H264encodingdebug.mp4" AutoPlay="True"/>
            <MediaPlayerElement Grid.Row="0" Grid.Column="1" Source="ms-appx:///Assets/H264encodingdebug.mp4" AutoPlay="True"/>
            <MediaPlayerElement Grid.Row="1" Grid.Column="0" Source="ms-appx:///Assets/H264encodingdebug.mp4" AutoPlay="True"/>
            <MediaPlayerElement Grid.Row="1" Grid.Column="1" Source="ms-appx:///Assets/H264encodingdebug.mp4" AutoPlay="True"/>
        </Grid> 


    Single instance of MediaPlayerElement on a page works reliably.  The crash cannot be caught by VS2019.  

    DebugDiag 2 shows the following in its crash analysis:

    In UWPDebug__PID__15828__Date__06_23_2019__Time_02_47_26PM__250__First chance exception 0XC0000374.dmp the assembly instruction at ntdll!RtlReportFatalFailure+9 in C:\Windows\System32\ntdll.dll from Microsoft Corporation has caused a corrupted heap exception (0xC0000374) when trying to perform an unknown operation on memory location 0x00000000 on thread 46
    Please follow up with the vendor Microsoft Corporation for C:\Windows\System32\ntdll.dll

    Could anyone shed some light on this?

    The PC runs Windows 10 1809(Build 17763.592).


    Hong


    Monday, June 24, 2019 1:54 AM

Answers

  • Hi,

    I'm sorry to say that I could not find something useful from the log. If we need to dig it deeper, we'll need more professional support about this. I suggest that you might need to open a support ticket for this. Please contact our paid phone support at MS Support. You will get 1:1 support on that. Please kindly note that your support ticket will be free if it is Microsoft's issue.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Hong (MA, USA) Wednesday, June 26, 2019 12:32 PM
    Wednesday, June 26, 2019 7:50 AM
    Moderator

All replies

  • Hi,

    Well, I have to say I could not reproduce this issue in my side using my own video. Could you please share me a H264 media to reproduce the issue?

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, June 24, 2019 9:44 AM
    Moderator
  • Thanks a lot for looking into this, Roy.

    Here is the VS project including the file

    I have just updated the PC to Windows 10 V1903, but the problem remains.  The video card is GTX 1050. The CPU is AMD Ryzen 7 2700.

    I do not have any other video problems on the PC.


    Hong

    Monday, June 24, 2019 11:17 AM
  • I disabled the video card in Device Manager, and the problem remains.  The debug app usually crashes in 5 within 5 seconds.

    Hong


    Monday, June 24, 2019 12:23 PM
  • I tried a variety of video files and got the same crash.  I get the following error and it shows immediately after I press Continue when running the app in the debug mode:

    exception at 0x6F79177A (d3d11.dll) in UWPDebug.exe: 0xC0000005: Access violation reading location 0x00000008.


    Hong

    Monday, June 24, 2019 1:15 PM
  • Hi,

    I'm test both your sample project and a new project with your code snippet and video in a 1809 device . But what confused me is that I still could not reproduce this issue. Both apps run well, not crash for them. The behavior I got is that there are 4 videos playing in the app, the app runs well even after the playing is finished. What I want to confirm is that is there anything that might lead the crash of the app? Do you just run the app and the app will crash soon?

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, June 25, 2019 7:11 AM
    Moderator
  • I really appreciate all your effort, Roy.

    I am glad to report the problem has been resolved. I first rolled back many Windows updates because the PC did not have this problem until recently, but the problem remained.  Then I forced the PC to update to Windows 10 V1903, then updated the audio driver and BIOS of the motherboard, and the problem was gone.

    The actual problem of using multiple instances of MediaPlayerElement in a published app is complicated.  It happens to many different PCs.  It would take a lot of space to explain it here.  I will report back if I figure our a pattern.


    Hong

    Tuesday, June 25, 2019 1:38 PM
  • Hi,

    Well, it's a good news. Thanks for sharing it here. Having a nice day.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, June 26, 2019 4:40 AM
    Moderator
  • Hi Roy,

    I used DebugDiag over a dozen times to collect crashes before it was fixed, and the results were very consistent as following:

    In UWPDebug__PID__988__Date__06_25_2019__Time_01_48_40PM__98__First chance exception 0X40080201.dmp the assembly instruction at KERNELBASE!RaiseException+62 in C:\Windows\System32\KERNELBASE.dll from Microsoft Corporation
    This exception originated from combase!SendReport.  has caused an unknown exception (0x40080201) on thread 8
    
    This exception originated from combase!SendReport+d2dc5. 


    Thread 8 - System ID 11756
    
    
    
    Entry point   SHCore!_WrapperThreadProc 
    Create time   2019-06-25 13:48:36 
    Time spent in user mode   0 Days 00:00:00.078 
    Time spent in kernel mode   0 Days 00:00:00.046 
    
    
    
    
    
    KERNELBASE!RaiseException+62 
    combase!SendReport+d2dc5 
    combase!RoOriginateErrorW+3e 
    msvproc!XvpOriginateError<56>+7e 
    msvproc!CxCodeVideoProcMFTDataHandler::GetValidArea+1269c 
    msvproc!CxCodeVideoProcMFTDataHandler::GetBehaviorHints+165 
    msvproc!CxCodeVideoProcMFT::GetBehaviorHints+5d 
    mfsvr!CXVPDrawDevice::GetBehaviorHints+1f0 
    mfsvr!CSimpleVRStreamSink::GetTripleBufferHint+3e 
    mfsvr!CSimpleVRStreamSink::SelectPresentBufferCount+d7 
    mfsvr!CSimpleVRStreamSink::CreatePresentationConfig+64 
    mfsvr!CSimpleVRStreamSink::RecreateOrResizePresentBuffers+108 
    mfsvr!CSimpleVRStreamSink::UpdateVideoInternal+84a 
    mfsvr!CSimpleVRStreamSink::UpdateVideo+231 
    mfsvr!CSimpleVRSink::UpdateVideo+e4 
    MFMediaEngine!CMediaEngine::UpdateVideoStream+261 
    Windows_Media_Playback_MediaPlayer!MediaPlayerImpl::put_NormalizedSourceRect+313 
    Windows_Media_Playback_MediaPlayer!MediaPlaybackSessionImpl::put_NormalizedSourceRect+11e 
    Windows_UI_Xaml!CMediaPlayerPresenter::UpdateVideoStream+1bf 
    Windows_UI_Xaml!CMediaPlayerPresenter::CalculateDCompParameters+9d 
    Windows_UI_Xaml!CMediaPlayerPresenter::SetMediaPlayerSwapChain+2f 
    Windows_UI_Xaml!CMediaPlayerPresenter::UpdateState+14 
    Windows_UI_Xaml!CCoreServices::UpdateDirtyState+29e733 
    Windows_UI_Xaml!CCoreServices::NWDrawTree+565 
    Windows_UI_Xaml!CCoreServices::NWDrawMainTree+8e 
    Windows_UI_Xaml!CWindowRenderTarget::Draw+58 
    Windows_UI_Xaml!CXcpBrowserHost::OnTick+c1 
    Windows_UI_Xaml!CXcpDispatcher::Tick+8c 
    Windows_UI_Xaml!CXcpDispatcher::OnReentrancyProtectedWindowMessage+3d 
    Windows_UI_Xaml!CXcpDispatcher::ProcessMessage+c6 
    Windows_UI_Xaml!CDeferredInvoke::DispatchQueuedMessage+cf 
    Windows_UI_Xaml!CXcpDispatcher::MessageTimerCallbackStatic+1d 
    CoreMessaging!Microsoft__CoreUI__DispatchGroupHandler$CallbackThunk+41 
    CoreMessaging!System::Action::Invoke+3b 
    CoreMessaging!Microsoft::CoreUI::Dispatch::TimeoutManager::Callback_OnDispatch+a6 
    CoreMessaging!Microsoft::CoreUI::Dispatch::Dispatcher::DispatchNextItem+e7 
    CoreMessaging!Microsoft::CoreUI::Dispatch::Dispatcher::Callback_DispatchLoop+51 
    CoreMessaging!Microsoft::CoreUI::Dispatch::EventLoop::Callback_RunCoreLoop+e2 
    CoreMessaging!Microsoft::CoreUI::Dispatch::UserAdapterBase::DrainCoreMessagingQueue+ac 
    CoreMessaging!Microsoft::CoreUI::Dispatch::UserAdapter::OnUserDispatch+a3 
    CoreMessaging!Microsoft::CoreUI::Dispatch::UserAdapter::OnUserDispatchRaw+4f 
    CoreMessaging!Microsoft::CoreUI::Dispatch::UserAdapter_DoWork+40 
    CoreMessaging!Microsoft::CoreUI::Dispatch::UserAdapter_HandleDispatchNotifyMessage+a5 
    CoreMessaging!Microsoft::CoreUI::Dispatch::UserAdapter_WindowProc+75 
    user32!_InternalCallWinProc+2b 
    user32!UserCallWinProcCheckWow+3ac 
    user32!DispatchClientMessage+ea 
    user32!__fnDWORD+3f 
    ntdll!KiUserCallbackDispatcher+4d 
    win32u!NtUserPeekMessage+c 
    user32!_PeekMessage+2e 
    user32!PeekMessageW+160 
    Windows_UI!Windows::UI::Core::CDispatcher::ProcessMessage+79 
    Windows_UI!Windows::UI::Core::CDispatcher::WaitAndProcessMessagesInternal+9d 
    Windows_UI!Windows::UI::Core::CDispatcher::ProcessEvents+65 
    Windows_UI_Xaml!DirectUI::FrameworkView::Run+8c 
    twinapi_appcore!Windows::ApplicationModel::Core::CoreApplicationView::Run+32 
    twinapi_appcore!<lambda_a740d69e4550265529206848c8e72a27>::<lambda_invoker_stdcall>+8b 
    SHCore!_WrapperThreadProc+e0 
    kernel32!BaseThreadInitThunk+19 
    ntdll!__RtlUserThreadStart+2f 
    ntdll!_RtlUserThreadStart+1b 
    

    Do you happen to know how this is related to any hardware driver?


    Hong

    Wednesday, June 26, 2019 4:50 AM
  • Hi,

    I'm sorry to say that I could not find something useful from the log. If we need to dig it deeper, we'll need more professional support about this. I suggest that you might need to open a support ticket for this. Please contact our paid phone support at MS Support. You will get 1:1 support on that. Please kindly note that your support ticket will be free if it is Microsoft's issue.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Hong (MA, USA) Wednesday, June 26, 2019 12:32 PM
    Wednesday, June 26, 2019 7:50 AM
    Moderator
  • Thank you again for all your help, Roy.

    Hong

    Wednesday, June 26, 2019 12:32 PM