Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

PhotoCapture.CreateAsync() never executed

Hi,
I'm using the HoloLens and Unity and I try to take a photo.

I have the same problem as in this discussion
https://forums.hololens.com/discussion/897/locatable-camera-known-issue-photocapture-createasync-doesnt-start

This code in a MonoBehaviour in Unity :
void Start() { Debug.LogError("CreateAsync start"); Debug.LogError(WebCam.Mode); Debug.LogError(PhotoCapture.SupportedResolutions); foreach (Resolution resolution in PhotoCapture.SupportedResolutions) { Debug.LogError(resolution); } Debug.LogError("END"); PhotoCapture.CreateAsync(false, delegate (PhotoCapture captureObject) { Debug.LogError("CreateAsync done"); } }

Print this output :

CreateAsync start
None
UnityEngine.Resolution[]
END

Here is my "Capabilities" part of the Package.appxmanifest :
<Capabilities> <Capability Name="internetClient" /> <uap2:Capability Name="spatialPerception" /> <DeviceCapability Name="webcam" /> <DeviceCapability Name="microphone" /> </Capabilities>

Here is the "Module information" part of the log :

Module information:
Built with Compiler Ver '190023918'
Built from '5.5/release' branch
Version is '5.5.3f1 (4d2f809fd6f3)'
Release build
Application type 'D3D11'
Used 'UWP'

OS 'Windows 10 (10.0.14393)'

Do you see my problem ?
Can some other script block the execution ?

Best Answer

  • KandoharKandohar
    Answer ✓

    On the hololens :

    Settings/Privacy/Camera/"Let apps use my camera" => ON

    It's works...
    I wish there was an explict error message in this case.

Answers

  • KandoharKandohar
    edited April 2017

    With some breakpoints, I have this error :

    Failed to initialize IMediaCapture

    when the code reach the line :

    PhotoCapture.CreateAsync()

  • KandoharKandohar
    Answer ✓

    On the hololens :

    Settings/Privacy/Camera/"Let apps use my camera" => ON

    It's works...
    I wish there was an explict error message in this case.

  • Hi, I got the same error message while I call "PhotoCapture.CreateAsync()". Have you solve this problem? Help me, Please.

Sign In or Register to comment.