locked
Are there known problems with 8.1 MediaCapture InitializeAsync? RRS feed

  • Question

  • My Lumia 920 keeps needing to be soft reset with volume down and power for 15 seconds, as it randomly completely locks up while debugging.

    I'm awaiting MediaCapture.IntializeAsync followed by awaiting MediaCapture.StartPreviewAsync

    I'm running the developer preview version.  Anyone else run against this, or got it to work successfully?

    If it's of any help, occasionally the phone gets into a state where InitializeAsync throws an exception with Hresult 0xE8010014

    My initialization CapSettings are:

    capSettings
    {Windows.Media.Capture.MediaCaptureInitializationSettings}
        AudioDeviceId: ""
        AudioProcessing: Default
        AudioSource: null
        MediaCategory: Other
        PhotoCaptureSource: Auto
        StreamingCaptureMode: Video
        VideoDeviceId: "\\\\?\\DISPLAY#QCOM_AVStream#3&2e24c17&0&UID32768#{e5323777-f976-4f5b-9b55-b94699c46e44}\\Front Sensor"
        VideoSource: null
     
    
    

    I have yesterday's latest WP8.1 preview now installed, and the problem still exists.
    The program is particularly prone to locking up the entire phone when re-initializing.

    Several times before crashing I've had a green background on the phone that flashed or just got stuck, but I've had the same problem without actually enabling the preview at all, and just initializing.



    Anthony Wieser | Wieser Software Ltd | www.wieser-software.com

    Tuesday, June 3, 2014 2:37 PM

All replies

  • Hello Anthony,

    I can confirm that 0xE8010014 represents a driver fault. Unfortunately without a dump or some other trace file it is going to be difficult to track this down. If you can reproduce the error and then create a dump file, zip it up, put it on your OneDrive and then post the link here I can grab it and take a look.

    Thanks,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Wednesday, June 4, 2014 1:12 AM
  • any suggestion on how to do that on a retail phone?


    Anthony Wieser | Wieser Software Ltd | www.wieser-software.com

    Wednesday, June 4, 2014 4:07 AM
  • If you can connect via the debugger and reproduce the problem you can generate a dump file at the point of the exception under the "debug" menu. If you app is currently in the store and you are seeing a large number of crashes due to this exception you will see triage dumps in the form of .cab files in your dashboard.

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Tuesday, June 10, 2014 5:35 PM
  • The debugging connection is immediately lost when the phone enters this state.

    I wouldn't dream of releasing an app that crashes this often on my phone into the store.

    Is there a beta program yet for universal phone apps?  The w8 app appears to work fine.


    Anthony Wieser | Wieser Software Ltd | www.wieser-software.com

    Thursday, June 12, 2014 11:08 AM
  • Hello,

    It is possible that you are passing an incorrect parameter to the driver causing it to crash. This might explain why we haven't seen wide spread reports of this problem and the fact that the problem was not caught in testing (we do test on physical devices).

    If you can provide some sample code that reproduces the problem I can debug it for you. Please create a small Visual Studio 2013 sample that reproduces the problem, zip it up, upload it to your OneDrive and then post a link to it here. I will grab it, take a look and let you know what I find.

    Thanks,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Friday, June 13, 2014 1:02 AM
  • I'm also experiencing these crashes on my device. My phone will did without fail every third test I do. I'm initialising once and toggling the visibility of the preview during photo shots, I'll see if I can create a dump to help with this too if that's okay as I also refuse go release anything so buggy. I know it's the 8.1 RTM but usually they are solid builds in my experience. This camera API is just really flakey on devices.

    Somewhere out there...


    Tuesday, June 24, 2014 7:13 PM
  • I've made a small app that demonstrates the huge disparity between the emulator and device functionality of the API, well at least on my Lumia 1020 that I've had to reboot about 10 times already today, which worries me as it also gets stupidly hot.

    http://npsoftware.s3.amazonaws.com/cameraui/CameraUI.zip


    Somewhere out there...

    Wednesday, June 25, 2014 8:25 AM
  • I've got a slightly more improved version here,

    http://npsoftware.s3.amazonaws.com/cameraui/CameraUI_2.zip

    This one doesn't crash anywhere near as much, but it is still really sluggish.  It now sets the capture and preview resolutions to 640x480.  Via the following code,

            private struct SetCaptureResolutionResult
            {
                public Boolean CaptureSet;
                public IMediaEncodingProperties CaptureProps;
                public Boolean PreviewSet;
                public IMediaEncodingProperties PreviewProps;
            }
    
            private async Task<SetCaptureResolutionResult> SetCaptureResolution(Size iSize)
            {
                SetCaptureResolutionResult pCRRResult = new SetCaptureResolutionResult();
                System.Collections.Generic.IReadOnlyList<IMediaEncodingProperties> res = cMCeCapture.VideoDeviceController.GetAvailableMediaStreamProperties(MediaStreamType.Photo);
    
                if (res.Count >= 1)
                {
                    for (int i = 0; i < res.Count; i++)
                    {
                        if (res[i] is ImageEncodingProperties)
                        {
                            ImageEncodingProperties ip = (ImageEncodingProperties)res[i];
    
                            if (ip.Width == iSize.Width && ip.Height == iSize.Height)
                            {
                                await cMCeCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(MediaStreamType.Photo, res[i]);
                                pCRRResult.CaptureSet = true;
                                pCRRResult.CaptureProps = ip;
                                break;
                            }
                        }
                        else if (res[i] is VideoEncodingProperties)
                        {
                            VideoEncodingProperties vp = (VideoEncodingProperties)res[i];
    
                            if (vp.Width == iSize.Width && vp.Height == iSize.Height)
                            {
                                await cMCeCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(MediaStreamType.Photo, res[i]);
                                pCRRResult.CaptureSet = true;
                                pCRRResult.CaptureProps = vp;
                                break;
                            }
                        }
                    }
                }
    
                res = cMCeCapture.VideoDeviceController.GetAvailableMediaStreamProperties(MediaStreamType.VideoPreview);
    
                if (res.Count >= 1)
                {
                    for (int i = 0; i < res.Count; i++)
                    {
                        if (res[i] is ImageEncodingProperties)
                        {
                            ImageEncodingProperties ip = (ImageEncodingProperties)res[i];
    
                            if (ip.Width == iSize.Width && ip.Height == iSize.Height)
                            {
                                await cMCeCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(MediaStreamType.VideoPreview, res[i]);
                                pCRRResult.PreviewSet = true;
                                pCRRResult.PreviewProps = ip;
                                break;
                            }
                        }
                        else if (res[i] is VideoEncodingProperties)
                        {
                            VideoEncodingProperties vp = (VideoEncodingProperties)res[i];
    
                            if (vp.Width == iSize.Width && vp.Height == iSize.Height)
                            {
                                await cMCeCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(MediaStreamType.VideoPreview, res[i]);
                                pCRRResult.PreviewSet = true;
                                pCRRResult.PreviewProps = vp;
                                break;
                            }
                        }
                    }
                }
                return (pCRRResult);
            }

    One odd thing to note from this code is that in the emulator it return the resolutions for MediaStreamType.Photo as ImageEncodingProperties, on the phone it returns them as VideoEncodingProperties, why the difference?


    Somewhere out there...


    • Edited by Firkinfedup Wednesday, June 25, 2014 10:07 AM Missed info rEGARDING MediaStreamType.Photo
    Wednesday, June 25, 2014 10:03 AM
  • I am also facing the same problem. I've tried on 520 & 1020. Phone gets heated & soft reset is the only option to restart the phone. There's nothing in output window and no exception being throwen. 
    Saturday, June 28, 2014 9:19 AM
  • Hello everyone,

    Thanks for all the additional reports. I am trying to track down a Nokia contact to confirm that they are tracking this problem. If / when I have more information I will let you know.

    Again thanks to everyone for letting us know how wide spread this issue has become.

    -James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Tuesday, July 1, 2014 10:31 PM
  • I am seeing this crash consistently on my Nokia Lumia 920 running Windows Phone 8.1 Update, OS version 8.10.14192.280

    The code is straightforward:

                this.mediaCapture = new MediaCapture();

                var rearCamera = (from item in await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(DeviceClass.VideoCapture)
                                  where item.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Back
                                  select item).FirstOrDefault();

                var settings = new MediaCaptureInitializationSettings
                {
                    MediaCategory = MediaCategory.Other,
                    PhotoCaptureSource = PhotoCaptureSource.VideoPreview,
                    VideoDeviceId = rearCamera.Id
                };

                // this next line is consistently crashing my Nokia Lumia 920
                await this.mediaCapture.InitializeAsync(settings);


    <p>Michael S. Scherotter<br/> Media Experience Evangelist, Microsoft Corporation<br/> <a href="http://blogs.msdn.com/synergist">Blog</a>, <a href="http://twitter.com/synergist"> Twitter</a>, <a href="http://facebook.com/synergist">Facebook</a> </p>

    Sunday, November 2, 2014 3:25 PM
  • Hello everyone,

    Just a quick update. We are currently pursuing this issue as a driver code defect on certain Microsoft (formerly Nokia) Lumia devices. We are coordinating closely between the camera team and the Microsoft Lumia team to try and resolve this issue. Unfortunately at this time I am not able to say when or if we will address this issue. Please rest assured that we are aware of it and actively working on it.

    Thanks much,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Wednesday, November 5, 2014 10:39 PM
  • Good to see that MS knows about the issue. On my Lumia 820 the odds of the device freezing are the same as flipping a coin. Does anyone know any other ways to capture a photo using Windows Runtime?

    Normally I'd go with Silverlight but unfortunately a library that I need to use is exclusively available for RT.




    • Edited by Nilkku Wednesday, November 12, 2014 9:29 PM
    Wednesday, November 12, 2014 7:44 PM
  • Using MediaCapture APIs is the only way to capture images in Windows Runtime apps. This issue occurs at the driver level so unfortunately moving to SL won't solve the problem. As I said we are looking into it.

    Thanks for your patience,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Wednesday, November 12, 2014 9:42 PM
  • We are also getting an exception when calling MediaCapture.InitializeAsync(MediaCaptureInitializationSettings). 

    First-chance exception at 0x76D235D7 in vstest.executionengine.appcontainer.exe: Microsoft C++ exception: Platform::COMException ^ at memory location 0x0762EE28. HRESULT:0xE8010001 The text associated with this error code could not be found.

    This exception occurs every time. Rebooting the device does not help. 

    Testing with Nokia Lumia 925 (test device) running Windows Phone 8.1 update. Firmware 3051.50009.1424.0004. Developing with Windows Phone 8.1 SDK using Visual Studio 2013 update 4.

    Strangely, after receiving this error, attempting to open the Camera app on the phone also fails. Resetting the phone did not help either.

    I would have attached a dmp file only it is 130MB... 

    Edit: 

    After recovering the phone using Nokia Software Recovery Tool I could access the camera again.

    • Edited by rubnov Friday, November 21, 2014 3:35 PM
    Friday, November 21, 2014 11:36 AM
  • Hey James, is this issue resolved? If yes, then which version of OS is stable. I am stuck due to camera issue to launch the app.
    Friday, December 12, 2014 9:02 AM
  • Hello,

    Unfortunately I can't offer much detail concerning specifics of our efforts to resolve this issue until the next GDR or full release of the product. Since this issue is due to a problem with the hardware driver you likely won't see the issue fully resolved in a dev build. While I can't make any guarantees, future dev builds may offer some relief but may not fully resolve the issue.

    Doing a soft reset on the device should allow the camera to recover. You should be able to then use the camera for a while until it locks up again. Soft resetting the device will again restore camera functionality.

    Thanks,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Saturday, December 13, 2014 12:31 AM
  • Could this driver issue also be causing the memory leak that I am seeing when taking a large (30+) sequence of photos? 

    https://social.msdn.microsoft.com/Forums/en-US/39a2c567-e2c0-42fc-98a9-494515b2007b/mediacapture-capturephototostoragefileasync-memory-leak?forum=wpdevelop

    Monday, January 5, 2015 2:42 AM
  • No, that sounds like a different issue. Please start a new thread.

    -James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Thursday, January 8, 2015 7:17 PM
  • Got the same problem using MediaCapture in 8.1.

    This is a showstopper - is there a fix for this yet available?

    Regards,

    Sam

    Wednesday, March 11, 2015 10:28 AM
  • Hello,

    This issue should be resolved in the latest version of WP8.1 for Lumia phones. All carriers have or will have this update available to them. It is up to the carrirer to evaluate and push out the update if / when they see fit. Some carriers may choose to wait for deployment or they have the option to not deploy this latest update at all. Please check with your local carriers for their WP8.1 GDR update plans.

    Thanks,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Wednesday, March 11, 2015 11:51 PM
  • Today I installed the latest developer preview on my Lumia 620, but I saw no improvement. Crashes and green screens are still there.
    Monday, March 23, 2015 12:35 PM
  • Version?

    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Monday, March 23, 2015 8:35 PM
  • After the update, version number is 8.10.14219.341 which is basically the same as before. But some kind of update was actually downloaded and installed.

    Is there another update version we should be looking for?

    Monday, March 23, 2015 8:56 PM
  • Hello,

    Can you confirm your Lumia model and carrier?

    If you have the Lumia Icon and Verizon or 1520 and AT&T, that should be the latest version and should contain the fix.

    -James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Wednesday, March 25, 2015 6:26 PM
  • Here is a screenshot with all details:

    Wednesday, March 25, 2015 8:27 PM
  • Hello,

    Yes, according to my records that should be the latest version and should contain the camera driver update:

    Lumia 620 | Country variant | 8.10.14219.341 | 3058.50000.1425.0004

    Unfortunately I can't explain why it would not be working. I will pass along your feedback.

    Thanks,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Thursday, March 26, 2015 10:52 PM
  • Thank you for informing us.

    Let me note that I only have crashes/green screens while suspending or resuming my app, though I've followed MSDN guidelines carefully.

    I look forward to a definite solution to this issue, which is what's been preventing me from updating my app for quite some time.

    Thursday, March 26, 2015 11:58 PM
  • look its was programs are more simple then you think first things first uninstall your update and reinstall if that don't work ditch the update and shoot for bigger go and find a player that dose all you want start with this form if you aren't happy go to xda
    Saturday, March 28, 2015 4:31 AM
  • Good evening again.

    After endless hours of research and testing, I think I have found a clue to this issue that's been tormenting me for long.

    In my app, I need to use the camera, the compass and the inclinometer, all at the same time. This combination seems to be too heavy for the camera, unless the sensors' ReportInterval is long enough. A ReportInterval of 300ms or higher seems to be working without any trouble. If I set it to its minimum value (16ms in my phone), then the app crashes as soon as the MediaCapture object is initialized, and I get a green screen. With any values inbetween, the crashes become less frequent as the ReportInterval's value is increased.

    I'm going to perform some further tests, in order to ensure that green screens don't come back.

    Friday, April 10, 2015 5:55 PM