Livio Posted April 13, 2018 Share Posted April 13, 2018 We're working on a Unity app that uses the raw data from the Vive Focus cameras to show a "camera passthrough" experience. We use this to help the user set up our app and configure it if they're having trouble with it. We used the camera passthrough sample that came with the SDK (unity plugin), and it mostly works great. But occassionally the camera data just stops working in certain builds, and we're having a very difficult time detecting what's going wrong. Here's our experience: In one build, camera data comes in. We check in our code into version control. We make changes to the project's code. Build again, this time camera doesn't work. We undo the changes we made (we tell source control to undo all changes, reverting to the build where camera was confirmed to work). Then we build again, and this time camera STILL doesn't work. We maintain an archive of all of our builds, and when we load old builds, camera DOES work. But when we re-compile the code for those same builds, then it breaks again. There must be something outside of our source control that we're not aware of that is affecting camera. Maybe it's a bug in the build system? When I look at the logs I don't see a clear error that seems related to the camera functionality. Is there a particular keyword that I should search for in the logs that might help me troubleshoot this? Other things we've tried: In Unity, doing Assets > Reimport All didn't fix it. Doing a fresh clone of our repository DID fix it. Changing our build settings broke it again. The only settings we changed were Package Name and Product Name (we wanted to have two builds installed side-by-side for comparison). Reverting the changes to the build settings DOES NOT fix it. Restarting Unity, restarting our computers, and restarting the Vive Focus has no effect. Deleting the Library folder doesn't work, though we are using Unity Cache Server, which makes us think that "Reimport" would have had a greater effect, but as stated above, it didn't work either. This does seem like a bug with the build system. Any other ideas on how to solve this? Thanks. Link to comment Share on other sites More sharing options...
_Alex Posted April 25, 2018 Share Posted April 25, 2018 Recently got my hands on Focus and playing with Unity, seems like I may have same problem, camera didn't work from the start even on examples. What I did basically is load CameraTexture_Test example scene, looked at the white cube, realized that I currently have no camera permissions, got them through PermissionMgr_Test example, tried to load CameraTexture_Test back just to find that it is not working anymore. ~5 seconds of completely black screen after Unity logo and then autoexit to launcher. Unity 2017.4.0f1, wavesdk 2.0.32, ROM 1.21.1405.1 Don't know how to check logs yet. Link to comment Share on other sites More sharing options...
Tony PH Lin Posted April 26, 2018 Share Posted April 26, 2018 could you use logcat to dump all logs when you hit the issue? Not sure if it's caused by Unity version? Build system or else, thus logs may help for the hint. Thanks. Link to comment Share on other sites More sharing options...
Livio Posted April 26, 2018 Author Share Posted April 26, 2018 I attached two logs. One from a build where the camera works, another from a build where the camera doesn't work. When the program boots up, I print the message "WE DID IT!" to the log, so you can search for that as a marker. I'm using Unity version 2017.3.1f1. Our app overrides the default Android activity (we made sure to extend WVRUnityVRActivity), both builds do this. Specifically we create an AAR file in android studio that contains our custom activity, we import that into Unity, and in Unity we configure the Android build system to use Gradle instead of "Internal" (internal runs into manifest merge issues on activity names even though the activity that triggers the error has identical package names in both manifests) Link to comment Share on other sites More sharing options...
Tony PH Lin Posted May 4, 2018 Share Posted May 4, 2018 Please check if you include permission request code before you initial camera. Let us know if it's resolved on your side. Thanks. Link to comment Share on other sites More sharing options...
Livio Posted May 7, 2018 Author Share Posted May 7, 2018 Thanks! The problem was in fact the permissions. We had defined it in the manifest, but they weren't auto-granted. For troubleshooting, a quick workaround is to go into Android system menu > apps > [our app] > permissions, and then grant the camera permission manually. When installing the APK over ADB, you can add -g option to auto-grant all runtime permissions. For production, you can use the WaveVR SDK sample called "VR Permissions" to display an android system prompt to the user asking for them to grant the app the appropriate permissions. Link to comment Share on other sites More sharing options...
Tony PH Lin Posted May 8, 2018 Share Posted May 8, 2018 thanks for your great summary for both trouble shooting and formal design. I believe it's very helpful for many developers. Link to comment Share on other sites More sharing options...
_Alex Posted May 10, 2018 Share Posted May 10, 2018 Played a little more with the rawdata and found the following: CameraTexture is working for me as far as "Development build" option is unchecked. Which pretty much proves that I did all permissions stuff right, if I understand correctly. If I check "Development build" before building, app crashes when I'm enabling GameObject which has CameraTextureSample.cs on it, or instantly, if it is enabled from the start. I also found another scenario. After reloading scene (by SceneManager.LoadScene(SceneManager.GetActiveScene().name); ), it also crashes on making Gameobject with CameraTexture active. Message me if more info required to reproduce that behaviour Link to comment Share on other sites More sharing options...
Tony PH Lin Posted May 11, 2018 Share Posted May 11, 2018 I've PM you for more info., please check. Link to comment Share on other sites More sharing options...
tobiaslatta Posted February 9, 2019 Share Posted February 9, 2019 I am having the same issue with the crash of CameraTexture_Test scene when development build is ticked. How did you resolve the problem? I am running Wave SDK 2.1.8 on Unity 2018.3.0f2 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.