-
Notifications
You must be signed in to change notification settings - Fork 286
PosterCalibration Camera Not Working in Unity 2018 #299
Comments
@dberrett Hey Doug. Any thoughts on this? Is this happening in the unmanaged plugin? The plugin still compiles, but it appears to not be getting the expected pointer back, and a NotImplementedException seems rather unexpected. |
Forgive my ignorance on this one, but why is the C++ plugin project compiling correctly if the method signature changed? |
That’s Unity that is failing, correct? Not the C++ plugin. Unity takes the photo and passes the image data to the plugin. In Unity 2017.x the method signature of the photo capture changed. I don’t recall the exact change, but I think it was just removing a Boolean on the front of one of the calls.
Adding @troy Ferrell<mailto:[email protected]> who recently ran this successfully on Unity 2018.
From: Jared Bienz [MSFT] <[email protected]>
Sent: Wednesday, August 15, 2018 7:06 AM
To: Microsoft/MixedRealityCompanionKit <[email protected]>
Cc: Doug Berrett <[email protected]>; Mention <[email protected]>
Subject: Re: [Microsoft/MixedRealityCompanionKit] PosterCalibration Camera Not Working in Unity 2018 (#299)
Forgive my ignorance on this one, but why is the C++ plugin project compiling correctly if the method signature changed?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2FMixedRealityCompanionKit%2Fissues%2F299%23issuecomment-413207972&data=02%7C01%7Cdberrett%40microsoft.com%7C88c55e7e06214c7ed51a08d602b83519%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636699387527823765&sdata=gUCELieuHSndy97KWzkTTV7VwcMpjaIX6c9Y7ojX8nQ%3D&reserved=0>, or mute the thread<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAHSBQLqjHNNhy8am6cGaRRKtuKga3dg5ks5uRCq4gaJpZM4V9FCV&data=02%7C01%7Cdberrett%40microsoft.com%7C88c55e7e06214c7ed51a08d602b83519%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636699387527823765&sdata=mi3JBtnGErwarpkP2vsO2SE8nw9y6XyZKFDwnM35754%3D&reserved=0>.
|
Actually, I was pretty sure this was in the C++ code. I could be wrong, but the first exception is the System.NotImplementedException which at least appears to have occurred in PosterCalibrationSampleVS.Release_x86. AdditionalInfo:MarshalFirstFieldIntoNativePtr type: UnityEngine.XR.WSA.WebCam.PhotoCaptureFrame I could be wrong about that, but that's the info we're getting in the output window. |
Maybe I’m missing something. The “NotImplementedException” was in “PosterCalibrationSampleVS.Release_x86” – which is the Unity VS project. And this line seems to indicate a failure in the Unity engine when it goes to make a capture and marshal the parameters to the WinRTBridge - not the C++ plugin side.
AdditionalInfo:MarshalFirstFieldIntoNativePtr type: UnityEngine.XR.WSA.WebCam.PhotoCaptureFrame
From: Jared Bienz [MSFT] <[email protected]>
Sent: Wednesday, August 15, 2018 8:38 AM
To: Microsoft/MixedRealityCompanionKit <[email protected]>
Cc: Doug Berrett <[email protected]>; Mention <[email protected]>
Subject: Re: [Microsoft/MixedRealityCompanionKit] PosterCalibration Camera Not Working in Unity 2018 (#299)
Actually, I was pretty sure this was in the C++ code. I could be wrong, but the first exception is the System.NotImplementedException which at least appears to have occurred in PosterCalibrationSampleVS.Release_x86.
AdditionalInfo:MarshalFirstFieldIntoNativePtr type: UnityEngine.XR.WSA.WebCam.PhotoCaptureFrame
I could be wrong about that, but that's the info we're getting in the output window.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2FMixedRealityCompanionKit%2Fissues%2F299%23issuecomment-413237407&data=02%7C01%7Cdberrett%40microsoft.com%7C39c183dac15f497ff5e108d602c51df1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636699442968175111&sdata=XwBlY1izngdihARpKVfaJmRMaXqrCCykqeE29g5JJrw%3D&reserved=0>, or mute the thread<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAHSBQO8geofVoADxrhzM9SWlsU70tSddks5uREBmgaJpZM4V9FCV&data=02%7C01%7Cdberrett%40microsoft.com%7C39c183dac15f497ff5e108d602c51df1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636699442968175111&sdata=0x7wtFqqH3n%2Boz7prX6COAUGUgpAO5q1s%2FcY0HhN2Mc%3D&reserved=0>.
|
No, you're right @dberrett . For some reason I was thinking the VS project was the C++ project but you're right that it's the Unity project exported to VS. Is this a new Unity bug that we need to open with them? Before we decide that for sure, I just want to make sure we're not doing something we shouldn't be. I noticed this message as well:
Perhaps there is a bug trying to initialize the camera twice? |
@jbienzms : I think this is a Unity problem. I have been trying to resolve this for few days. Last successful line of code is photoCaptureObject.TakePhotoAsync(OnCapturedPhotoToMemory). But it actually never enters the OnCapturedPhotoToMemory method. After figuring out where it is failing, I copied unity sample exactly as shown in their website https://docs.unity3d.com/Manual/windowsholographic-photocapture.html and it still fails. I will update you when I figure out something. |
Hi all, I was able to get the project working in Unity 2018.1.9f2 and HoloLens April 2018. I did the following to get it working:
I have the configuration for building as follows (under PlayerSettings/OtherSettings): Further, make sure you have capabilities enabled for WebCam and Microphone under PlayerSettings/Publishing Settings Try to match to this parity. Thanks, |
@Troy-Ferrell Thank you for your help. My issue is a little different, I was trying to use the camera directly to take photos. I apologize for posting my issue here. I saw that @jbienzms has the same camera problem even though we are doing two different things.
|
Thank you so much @MSAlshair for your workaround and taking the time to publish a sample. By any chance have you submitted this bug to Unity? And if not, any chance you could submit it? We'd like to know the bug number so we can start tracking it. |
@jbienzms : You are very welcome. I didn't create a bug with Unity, but as I stated in my last post, I found an active bug that was already submitted since April 2018 and it is still open Unity Bug:https://issuetracker.unity3d.com/issues/windowsmr-failure-to-take-photo-capture-in-hololens Unity forms discussing same issue:https://forum.unity.com/threads/hololens-photo-capturing-failing.548845/ https://forum.unity.com/threads/photocapture-not-called-while-running-in-hololens.541825/ |
I have been working on updating the PosterCalibration Sample to Unity 2018. I have everything compiling, I have all gestures working with the new APIs and I have voice commands working. However, I cannot get the camera feed to work and therefore posters are not detected.
My fork (and branch) for this work can be found here:
https://github.com/jbienzms/MixedRealityCompanionKit/tree/PosterUnity2018
The code deploys to the HoloLens and mostly runs, but when you say "Align Poster 1" the camera feed is just a white square. When connected to the Visual Studio debugger, the following is printed in the Output window:
The text was updated successfully, but these errors were encountered: