Gear VR
Got Mac Native Oculus compiling and working on Gear VR now that new Android SDK was released to fix bug.
Unfortunately Unity 5.1.1f seems to suffer same issue as Unity 5.1 p1 Only left eye renders. Right is black.
This is using the SDK example apps. Works fine on Unity 4.6.5
Is this working for everyone else? Any suggestions?
I’m having the same issue, rolling back to 5.0.2.
We haven’t seen this. QA will try to reproduce today and update here.
Ran into this issue as well. To fix it I had to force OpenGLES2 as the Graphics API. After a lot of effort trying to get things to work though I ended up just disabling the Virtual Reality Supported option and going back to using the Mobile SDK. Once Unity sorts out all the issues with their implementation of Gear VR I’ll give it another go but right now it’s not ready.
There was a similar issue on the S6 with MSAA and GLES3 that was fixed in 5.1.1p1. Can anyone confirm if 5.1.1p1 fixes this issue for them?
Just updated to 5.1.1p1 and it does allow me to run using OpenGLES3 without one of the eyes going black. But it appears that multithreaded rendering is now breaking. I can build & run my project successfully only if it is not enabled. Once enabled it crashes after the splash screen and displaying a random texture.
My current setup is Unity 5.1.1p1 Pro with free version of Android and using the Mobile SDK 0.6.0.1. The relevant part of logcat reports the following:
D/Unity (12798): Unloading 7 Unused Serialized files (Serialized files now loaded: 0)
E/Unity (12798): [EGL] Unable to acquire context: EGL_BAD_ACCESS: EGL cannot access a requested resource (for example
a context is bound in another thread).
E/Unity (12798): UnityEngine.Texture:GetNativeTextureID()
E/Unity (12798): OVRDisplay:UpdateTextures() (at P:\GameDev\GVR_01\Assets\OVR\Scripts\OVRDisplay.cs:589)
E/Unity (12798): OVRDisplay:Update() (at P:\GameDev\GVR_01\Assets\OVR\Scripts\OVRDisplay.cs:145)
E/Unity (12798): OVRManager:Update() (at P:\GameDev\GVR_01\Assets\OVR\Scripts\OVRManager.cs:813)
E/Unity (12798):
E/Unity (12798): [./Runtime/GfxDevice/egl/WindowContextEGL.cpp line 205]
E/Unity (12798): (Filename: P Line: 0)
E/Unity (12798):
E/Unity (12798): [EGL] Unable to acquire context: EGL_BAD_ACCESS: EGL cannot access a requested resource (for example
a context is bound in another thread).
E/Unity (12798):
E/Unity (12798): (Filename: ./Runtime/GfxDevice/egl/WindowContextEGL.cpp Line: 205)
E/Unity (12798):
E/Unity (12798): [EGL] Unable to acquire context: EGL_BAD_ACCESS: EGL cannot access a requested resource (for example
a context is bound in another thread).
E/Unity (12798): UnityEngine.Texture:GetNativeTextureID()
E/Unity (12798): OVRDisplay:UpdateTextures() (at P:\GameDev\GVR_01\Assets\OVR\Scripts\OVRDisplay.cs:589)
E/Unity (12798): OVRDisplay:Update() (at P:\GameDev\GVR_01\Assets\OVR\Scripts\OVRDisplay.cs:145)
E/Unity (12798): OVRManager:Update() (at P:\GameDev\GVR_01\Assets\OVR\Scripts\OVRManager.cs:813)
E/Unity (12798):
E/Unity (12798): [./Runtime/GfxDevice/egl/WindowContextEGL.cpp line 205]
E/Unity (12798): (Filename: P Line: 0)
E/Unity (12798):
E/Unity (12798): [EGL] Unable to acquire context: EGL_BAD_ACCESS: EGL cannot access a requested resource (for example
a context is bound in another thread).
E/Unity (12798):
E/Unity (12798): (Filename: ./Runtime/GfxDevice/egl/WindowContextEGL.cpp Line: 205)
E/Unity (12798):
E/Unity (12736): Unable to find OculusInitPlugin
@chronos78 In 5.1.1p1 when trying to make a GearVR application with Android Personal there is currently a bug with our code. Even when you are using Native GearVR in Unity, the splash is searching for the OVRmanager and OVRCameraRig in your project because of this bug. The splash is intended to use the Native support. I have implemented a fix for this bug, and we are working to get it in for 5.1.1p2.
Because of this, you will not be able to deploy to GearVR with Android Personal on 5.1.1p1. The specific error that you are seeing in your project is that you are using Native support and you have OVRCameraRig and OVRManager scripts in your project. Because of this, The OculusPlugin will take control of the context during the splash screen and when the Native Plugin tries to then use the context in your main scene, it fails.
Until we get this critical fix in, you will need to use the Oculus Legacy Plugin with 5.1.1p1. Sorry.
@anon_62935208 I am using the plugin that is provided by the Mobile SDK or at least I’m trying to. I have noticed that Unity keeps adding the /Plugins/x86_64 folder with the dll’s even though I do not have nor have ever checked the use Virtual Reality Supported option for this project. Even after deletion this folder it is recreated. Could this also be part of the problem that you mentioned that will be fixed in 5.1.1p2? My guess then is that the native drivers are somehow over writing the versions that I import with the Oculus SDK.
The Native VR support doesn’t add any plugins to your project folder. We Include them with your Editor install and Reference the install location when running in the Editor. When you build the player, we copy the plugin from the Editor Install directory to the Player build directory (Directly into the apk for GearVR).
So, that Plugins/x86_64 folder is being generated most likely by the Oculus Legacy Plugin that you are using.
I thought you were trying to use the Native Unity VR Integration for GearVR, but you are using the Legacy Plugin. The splash will definitely work in this case, but I’m haven’t tested Mutli-threaded rendering with the plugin. What happens if you turn off multi-threaded rendering? Do you still crash if so, is it the same callstack?
Once I turn off use multi-threaded rendering it works perfectly. It’s only when it’s enabled that it crashes and I get the EGL_BAD_ACCESS errors.
Just tried Unity 5.1.1p with Oculus 0.6.0.1 and it’s working in both eyes with GL ES 3. I left Multi-threading off as per notes on this thread. Thanks.
Try deleting the folder with unity closed. It’s likely unity is holding the files open and you are unable to actually delete them.
Has this been fixed? I’m getting a similar error in a different context: I’m using Easy Movie Texture to play movies. Sometimes it works and sometimes if fails with the [EGL] Unable to acquire context: EGL_BAD_ACCESS: EGL cannot access a requested resource (for example a context is bound in another thread).
This might be related to this: https://answers.oculus.com/questions/393/gear-vr-aborts-with-plugin.html
Turning multithreading off has no effect.
I’m using 5.2.3f1 and I’ve remove the Oculus code, using the native VR thing.
The bug occurs when calling GetNativeTextureID on a Texture2D I’ll contact the Easy Movie Developper as well
Here is my Unity logcat:
I/Unity (19546): will call GetNativeTextureID
I/Unity (19546): UnityEngine.Debug:Internal_Log(Int32, String, Object)
I/Unity (19546): UnityEngine.Debug:Log(Object)
I/Unity (19546): MediaPlayerCtrl:Update() (at /Users/guigou/Papero/Code/projects/unity/SocialExperiences/Assets/EasyMovieTexture/Scripts/MediaPlayerCtrl.cs:281)
I/Unity (19546):
I/Unity (19546): (Filename: /Users/guigou/Papero/Code/projects/unity/SocialExperiences/Assets/EasyMovieTexture/Scripts/MediaPlayerCtrl.cs Line: 281)
I/Unity (19546):
E/Unity (19546): [EGL] Unable to acquire context: EGL_BAD_ACCESS: EGL cannot access a requested resource (for example a context is bound in another thread).
E/Unity (19546): UnityEngine.Texture:GetNativeTextureID()
E/Unity (19546): MediaPlayerCtrl:Update() (at /Users/guigou/Papero/Code/projects/unity/SocialExperiences/Assets/EasyMovieTexture/Scripts/MediaPlayerCtrl.cs:282)
E/Unity (19546):
E/Unity (19546): [./Runtime/GfxDevice/egl/WindowContextEGL.cpp line 205]
E/Unity (19546): (Filename: /Users/guigou/Papero/Code/projects/unity/SocialExperiences/Assets/EasyMovieTexture/Scripts/MediaPlayerCtrl.cs Line: 282)
E/Unity (19546):
E/Unity (19546): [EGL] Unable to acquire context: EGL_BAD_ACCESS: EGL cannot access a requested resource (for example a context is bound in another thread).
E/Unity (19546):
E/Unity (19546): (Filename: ./Runtime/GfxDevice/egl/WindowContextEGL.cpp Line: 205)
E/Unity (19546):
I/Unity (19546): has called GetNativeTextureID
and here is the corresponding full logcat:
I/Unity (19546): will call GetNativeTextureID
I/Unity (19546): UnityEngine.Debug:Internal_Log(Int32, String, Object)
I/Unity (19546): UnityEngine.Debug:Log(Object)
I/Unity (19546): MediaPlayerCtrl:Update() (at /Users/guigou/Papero/Code/projects/unity/SocialExperiences/Assets/EasyMovieTexture/Scripts/MediaPlayerCtrl.cs:281)
I/Unity (19546):
I/Unity (19546): (Filename: /Users/guigou/Papero/Code/projects/unity/SocialExperiences/Assets/EasyMovieTexture/Scripts/MediaPlayerCtrl.cs Line: 281)
I/Unity (19546):
W/art (19546): Attempt to remove local handle scope entry from IRT, ignoring
I/TimeWarp(19546): preFinish - afterSleepTime = 6.5 ms
I/ActivityManager( 3528): Killing 18599:com.sec.android.app.music:service/u0a42 (adj 15): empty #29
I/ActivityManager( 3528): Killing 18562:com.samsung.dcm:smile:CMService/u0a5 (adj 15): empty #30
E/libEGL (19546): eglMakeCurrent:980 error 3002 (EGL_BAD_ACCESS)
W/TimeWarp(19546): V-sync 850: Eye 1, CPU latency 0.006, GPU latency 0.009, Total latency = 0.016
E/Unity (19546): [EGL] Unable to acquire context: EGL_BAD_ACCESS: EGL cannot access a requested resource (for example a context is bound in another thread).
E/Unity (19546): UnityEngine.Texture:GetNativeTextureID()
E/Unity (19546): MediaPlayerCtrl:Update() (at /Users/guigou/Papero/Code/projects/unity/SocialExperiences/Assets/EasyMovieTexture/Scripts/MediaPlayerCtrl.cs:282)
E/Unity (19546):
E/Unity (19546): [./Runtime/GfxDevice/egl/WindowContextEGL.cpp line 205]
E/Unity (19546): (Filename: /Users/guigou/Papero/Code/projects/unity/SocialExperiences/Assets/EasyMovieTexture/Scripts/MediaPlayerCtrl.cs Line: 282)
E/Unity (19546):
E/libEGL (19546): eglMakeCurrent:980 error 3002 (EGL_BAD_ACCESS)
E/Unity (19546): [EGL] Unable to acquire context: EGL_BAD_ACCESS: EGL cannot access a requested resource (for example a context is bound in another thread).
E/Unity (19546):
E/Unity (19546): (Filename: ./Runtime/GfxDevice/egl/WindowContextEGL.cpp Line: 205)
Happy to open another question if that’s unrelated with what was previously discussed.