artoolkitx / arunityx

artoolkitX for Unity, providing high-performance video acquisition, marker and texture tracking and full Unity Editor support
https://www.artoolkitx.org/
Other
43 stars 22 forks source link

Unable to start AR tracking. Please check that you have a camera connected. #10

Closed chuen1118 closed 1 year ago

chuen1118 commented 6 years ago

I suppose this is an old issue, see this post.

I got Unable to start AR tracking. Please check that you have a camera connected. error when I press Home button then go back to the app

https://github.com/artoolkitx/arunityx/blob/220f00650ee8579877ca791cfa3a91c9d2d5e763/Source/Package/Assets/artoolkitX-Unity/Scripts/ARController.cs#L442-L461 I worked around it by commenting the StartAR() and StopAR() calls which works in iOS. However in Android, I got error messages:

libAR: [error] ARController::androidVideoPushInit: ARVideoSource is either closed or already running.
E/CameraEventListenerUnityImpl: arwAndroidVideoPushInit failed

and the camera freeze.

How can I get the camera back to work when I get back to the application?

If the issue is already solved in this repo, could someone please point me to the part of code that is responsible for this? I am using some mixed Unity .cs from ARUnity6 and ARUnityX and I can't afford the time to replace the whole project with ARUnityX files now. Thanks.

EonStrife commented 6 years ago

In your root object which has "AR Controller (Script)" attached to it, give the value "camera_para" (without quotes) to the "Camera parameters" field