Log in or register to post comments

Vuforia 5.0.5 and Unity 5.1.2: Can't get AR Camera to Work

August 1, 2015 - 2:04pm #1

I am trying to get the AR/VR Sample working with Vuforia 5.0.5 and Unity 5.1.2 on iOS and I'm getting a black screen with no rear-facing camera showing. Looking at the output (posted below), here are some problems I noticed:

  • 2015-08-01 10:47:58.812 arcliff[10697:5076622] VideoBackgroundConfig with screen size of zero received, skipping config step
  • 2015-08-01 10:47:58.891 arcliff[10697:5076622] *** -[AVCaptureVideoDataOutput setVideoSettings:] - videoSettings dictionary contains one or more unsupported (ignored) keys: (Width,Height)
  • View port sizes of left and right camera are not identical. This is currently not supported by Vuforia!
    • I checked the Cardbard left and right cameras and the viewport width and height are identical at (0.5,1.0)

I know it is recommened to revert back to Unity 4.6.7, but this would be very inconvenient as our existing VR projects are already in Unity 5. I did follow the recommendation to enable the Development Build option in the build settings but that didn't help.

 

Here is the log:

 

Setting Unity version 5.1.2
QCAR Extension version 5.0.5
Initializing Vuforia...
2015-08-01 10:47:58.560 arcliff[10697:5076622] QCAR SDK version 5.0.5
2015-08-01 10:47:58.749 arcliff[10697:5076622] DEBUG/AR(10697) UIView has CAEAGLLayer class
2015-08-01 10:47:58.749 arcliff[10697:5076622] DEBUG/AR(10697) UIView does not respond to selector renderFrameQCAR
2015-08-01 10:47:58.749 arcliff[10697:5076622] DEBUG/AR(10697) UIView has CAEAGLLayer class
2015-08-01 10:47:58.749 arcliff[10697:5076622] DEBUG/AR(10697) UIView does not respond to selector renderFrameQCAR
2015-08-01 10:47:58.750 arcliff[10697:5076622] DEBUG/AR(10697) Could not find a UIView with CAEAGLLayer layer class that responds to selector renderFrameQCAR
Vuforia initialization successful
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

trackerManagerInitTracker
trackerManagerInitTracker
Creating a Stereo Camera Configuration (Check for reflection)
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

Detected supported Eyewear device
Vuforia.VuforiaAbstractBehaviour:Start()
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

Unknown screen orientation returned for Eyewear; defaulting to LandscapeLeft
Vuforia.VuforiaAbstractBehaviour:Start()
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

Set screen orientation for Eyewear to LandscapeLeft
Vuforia.VuforiaAbstractBehaviour:Start()
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

2015-08-01 10:47:58.811 arcliff[10697:5076622] VideoBackgroundConfig with screen size of zero received, skipping config step
Creating a Stereo Camera Configuration (Check for reflection)
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

Detected supported Eyewear device
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

Unknown screen orientation returned for Eyewear; defaulting to LandscapeLeft
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

Set screen orientation for Eyewear to LandscapeLeft
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

2015-08-01 10:47:58.812 arcliff[10697:5076622] VideoBackgroundConfig with screen size of zero received, skipping config step
SetHint
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

SetHint
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

SetHint
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

dataSetExists
objectTrackerCreateDataSet
2015-08-01 10:47:58.816 arcliff[10697:5076622] ObjectTracker: Successfully created dataset
Successfully created data set.
dataSetLoad
dataSetGetNumTrackableType
dataSetGetTrackablesOfType
dataSetGetTrackableName
objectTargetGetSize
imageTargetGetNumVirtualButtons
dataSetGetNumTrackableType
dataSetGetNumTrackableType
objectTargetSetSize
Found Trackable named stones with id 1
Vuforia.DatabaseLoadAbstractBehaviour:LoadDatasets()
Vuforia.VuforiaAbstractBehaviour:Start()
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

objectTrackerActivateDataSet
StartVuforia
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

cameraDeviceInitCamera
2015-08-01 10:47:58.891 arcliff[10697:5076622] *** -[AVCaptureVideoDataOutput setVideoSettings:] - videoSettings dictionary contains one or more unsupported (ignored) keys: (
    Width,
    Height
)
cameraDeviceGetVideoMode
cameraDeviceGetCameraFieldOfViewRads
2015-08-01 10:47:58.897 arcliff[10697:5076622] VideoBackgroundConfig with screen size of zero received, skipping config step
cameraDeviceSelectVideoMode
cameraDeviceStartCamera
markerTrackerStart
objectTrackerStart
eyewearGetProjectionMatrix
eyewearGetProjectionMatrix
cameraDeviceGetCameraFieldOfViewRads
cameraDeviceGetCameraFieldOfViewRads
cameraDeviceSetFocusMode
Requested Focus mode FOCUS_MODE_CONTINUOUSAUTO successfully.
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

cameraDeviceGetVideoMode
cameraDeviceGetCameraFieldOfViewRads
eyewearGetProjectionMatrix
eyewearGetProjectionMatrix
Detecting stereo camera setup, setting stereo mode.
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

Trackable stones lost
Vuforia.VuforiaManagerImpl:Update(ScreenOrientation, Boolean)
Vuforia.VuforiaAbstractBehaviour:UpdateStatePrivate(Boolean, Boolean)
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

cameraDeviceGetVideoMode
cameraDeviceGetVideoMode
cameraDeviceGetCameraFieldOfViewRads
eyewearGetProjectionMatrix
eyewearGetProjectionMatrix
eyewearGetProjectionMatrix
eyewearGetProjectionMatrix
System memory in use before: 6.5 MB.
System memory in use after: 6.5 MB.

Unloading 9 unused Assets to reduce memory usage. Loaded Objects now: 848.
Total: 4.074000 ms (FindLiveObjects: 0.150125 ms CreateObjectMapping: 0.072750 ms MarkObjects: 3.349666 ms  DeleteObjects: 0.497958 ms)

cameraDeviceGetVideoMode
cameraDeviceGetCameraFieldOfViewRads
eyewearGetProjectionMatrix
eyewearGetProjectionMatrix
cameraDeviceGetVideoMode
cameraDeviceGetCameraFieldOfViewRads
eyewearGetProjectionMatrix
eyewearGetProjectionMatrix
View port sizes of left and right camera are not identical. This is currently not supported by Vuforia!
CardboardEye:Setup()
CardboardEye:Render()
StereoController:OnPreCull()
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

eyewearGetProjectionMatrix
eyewearGetProjectionMatrix
cameraDeviceGetVideoMode
cameraDeviceGetCameraFieldOfViewRads
eyewearGetProjectionMatrix
eyewearGetProjectionMatrix
eyewearGetProjectionMatrix
eyewearGetProjectionMatrix
Trackable stones found
Vuforia.VuforiaManagerImpl:Update(ScreenOrientation, Boolean)
Vuforia.VuforiaAbstractBehaviour:UpdateStatePrivate(Boolean, Boolean)

 

Vuforia 5.0.5 and Unity 5.1.2: Can't get AR Camera to Work

August 9, 2015 - 5:59am #6

In iOSVRDevice.cs, in the OnFocus method you should find a line of code like:

launchOnboardingDialog();

remove (or comment out that line), and you should see the app start correctly in Unity 4.6.7, assuming you have followed all the other steps documented here:.

https://developer.vuforia.com/library//articles/Solution/Integrating-Cardboard-to-the-ARVR-Sample

 

 

Vuforia 5.0.5 and Unity 5.1.2: Can't get AR Camera to Work

August 3, 2015 - 9:26am #5

AlessandroB,

Thank you for the very informative response. I have checked the MainCamera, MainCameraLeft and MainCameraRight and they all have the same settings as the AR Camera: Near = 0.05 and Far = 300. Perhaps there is a minor bug where the right camera is offset until the first target is acquired!?

Anyway, that is not the main issue. Do you have any idea why the rear-facing camera is not initializing properly on my iPhone 6? I have followed the instructions exactly according to the Vuforia website.

Thank you,

Shawn

Vuforia 5.0.5 and Unity 5.1.2: Can't get AR Camera to Work

August 2, 2015 - 10:46pm #4

I'm having the same black screen issue too. Even though I'm using Unity 4.6.7. I've also follwed the integration steps. Do you have any ideas?

Vuforia 5.0.5 and Unity 5.1.2: Can't get AR Camera to Work

August 2, 2015 - 12:04am #3

Hi,

the fact that the rendered viewports are smaller than the available screen space is normal and expected;  the Cardboard camera field of view is set to 80 degrees, whereas the camera video background texture corresponds to the field of view of your device camera (which is typically in the range 50 - 60 degrees or so, depending ont he camera and device).

That is, the device camera field of view and the video background only fill a sub-portion of the available field of view; this results in the scaling effect that you see in the viewport.

Additionally, Cardboard itself adjust the viewport size depending on the physical screen size, as it tries to guess the right viewport size for correct visualization of the stereo images when you put your iPhone into the physical Cardboard headset.  For example, if you were running on an iPad, you would see that the viewports are way smaller than the available iPad screen; this is because the screen size largely exceeds the expected size that works correctly with the cardboard lenses.

 

Note that, when you switch from AR to VR, the video background is no longer rendered, and at that point you will see that the rendered scene is filling the entire 80-degrees field of view. The important point is that the field of view always remain 80 degrees across AR and VR, thus ensuring that the perspective projection does not change and the experience appears seamless.

 

On the difference between left and right eye, please check that ALL of the Cardboard cameras under CardboardMain  (MainCamera, MainCameraLeft and MainCameraRight) all have the same settings of the Near and Far clipping planes:

- Near = 0.05

- Far = 300

 

On Unity 5: while it is recommended to use Unity 4.6.7 (primarily for performance reasons), it is possible to build and run a correct Cardboard AR/VR sample on Unity 5 too.

 

Vuforia 5.0.5 and Unity 5.1.2: Can't get AR Camera to Work

August 1, 2015 - 2:30pm #2

Here is a screenshot of the issue in the Unity editor. The issues I see are:

  • Both of the stereo camera views are much smaller than the Google Cardboard VR equivalents
  • Before the first target is recognized the left and right cameras are not evenly spaced. The right camera is way off to the right of the Cardboard alignment line (top image)
  • Once the target is acquired, the stereo cameras seem to align properly, but are still too small (bottom image)

Shawn

AttachmentSize
Image icon editorIssuesCombined.jpg156.35 KB
Log in or register to post comments