Asked by:
MediaExtension deadlock on ARM

Question
-
Hello.
I have problems using MediaExtension based on the sample MediaCapture - GrayscaleTransform.
Briefly, we use this dll to capture the webcam stream and pass it back to the C# application, which process it (AR, write to texture...). The application runs on the PC correctly (both x86 and x64 platforms). The problem occurs on ARM platform - Surface RT. In Debug configuration it process just one sample and stuck. In Release configuration it process few samples (3-6) and then ends the same. Everytime I pause the debugger I can find one similar callstack on one thread:
ntdll.dll!NtWaitForSingleObject() Unknown
ntdll.dll!RtlpWaitOnCriticalSection() Unknown
ntdll.dll!RtlpEnterCriticalSectionContended() Unknown
nvCameraMFT.dll!67d91152() Unknown
nvCameraMFT.dll!67d84a5e() Unknown
> mfreadwrite.dll!CMFReadWriteTransform::SetupOutputBuffers(void) Unknown
mfreadwrite.dll!CMFReadWriteTransform::ProcessOutput(struct IMFSample * * *,unsigned long *,unsigned long *) Unknown
mfreadwrite.dll!CMFReadWriteTransformChain::ProcessSample(unsigned long) Unknown
mfreadwrite.dll!CMFReadWriteTransformChain::OnTransformNeedsInput(unsigned long,struct IMFMediaEvent *) Unknown
mfreadwrite.dll!CMFReadWriteTransformChain::NotifyTransformEvent(struct IMFReadWriteTransform *,struct IMFMediaEvent *) Unknown
mfreadwrite.dll!CMFReadWriteTransform::OnMFTEvent(struct IMFAsyncResult *) Unknown
mfreadwrite.dll!CMFReadWriteTransform::OnMFTEventAsyncCallback::Invoke(struct IMFAsyncResult *) Unknown
mfplat.dll!CSerialWorkQueue::QueueItem::ExecuteWorkItem(struct IMFAsyncResult *) Unknown
mfplat.dll!CSerialWorkQueue::QueueItem::OnWorkItem(struct IMFAsyncResult *) Unknown
mfplat.dll!CSerialWorkQueue::QueueItem::OnWorkItemAsyncCallback::Invoke(struct IMFAsyncResult *) Unknown
mfplat.dll!CBaseWorkQueue::HandleConcurrentMMCSSEnter(class CRealTimeState *) Unknown
ntdll.dll!TppWorkpExecuteCallback() Unknown
ntdll.dll!TppWorkerThread() Unknown
kernel32.dll!BaseThreadInitThunk() Unknown
ntdll.dll!RtlUserThreadStart() Unknown
And it never continues on this thread. I think that WaitForSingleObject never finish, but the question is why. As it is not in my code I can hardly guess, so hope you can give me some hint, what condition may not be satisfied to continue.
Thanks,
Michal LinhartThursday, March 28, 2013 1:47 PM
All replies
-
Hello,
Would you please provide us the whole codes to reproduce this issue,
You can upload your project to SkyDrive
http://skydrive.live.com/It is not necessary that you send out the whole of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business details from it.
If you don't want to upload the sample code, you can try to get the paid support from https://getsupport.microsoft.com/
Best regards,
JesseJesse Jiang
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.Friday, March 29, 2013 4:48 AM -
Hi Jesse.
I have uploaded the sample source on the skydrive: https://skydrive.live.com/redir?resid=7BD0EF0BAAA4EDD7!107&authkey=!AEpBhA7d4zBBfaQ.
It is based on the MediaCapture sample (which BTW, does not work on ARM Surface at all with Grayscale effect on). My sample has the same symptoms as I desribed.
After opening project select the platform ARM, select either Debug and Release and start it on ARM remote machine (we use Surface RT) and after app load press button "StartWebCam". This should start previewing the webcam (left-bottom corner) and also copying the screen to DX texture on the cube zooming in the center of screen. Please notice the screen froze, while application still runs. Pause the app and search for thread with callstack same as written in my first post. App will never leave the wait at the top of the callastack. The question is why? The problem is in the system code and I really think I cannot affect it.
(Sample is not really nice work, but important parts are at the Grayscale.cpp (changes in OnProcessOutput function)).
In case of any problem with the example, let me know please.
Thanks for your help,
Michal Linhart
Friday, March 29, 2013 2:41 PM -
Hello Michal,
I am currently investigating a number of reported issues related to apps with components based on the gray scale sample code on the Microsoft Surface. At this time a root cause is not know. Once I have tracked down the root cause I will post the resolution on my blog: http://blogs.msdn.com/mediasdkstuff
Thank you for your patience as we continue to investigate,
James
Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/
- Proposed as answer by James Dailey - MSFTMicrosoft employee, Moderator Thursday, April 4, 2013 11:46 PM
Thursday, April 4, 2013 11:46 PMModerator