Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

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.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. 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. 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
    Accepted 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
    Accepted 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.