I had an app working based on Image Target example. It did everything great on a Google Nexus 4 with Android 4.2.1. But after updating to 4.2.2 it won't display the camera's image but it will still track and display the models. I've tried the unmodified example and it's the same thing.
- Sort Posts
- 27 replies
- Last post
Android 4.2.2 No Camera Display
Android 4.2.2 No Camera Display
I would like to report a very similar issue.
I am using a Nexus 4 as device, with Android 4.2.2, Unity 4 and Vuforia 2.0.31.
In order to clarify a bit more the problem, here is the description: when I run my application I get a black screen after the splash screen. I can not see the Camera view on my app. However, everything works. When I find a trackable, the hidden objects show. In my app, OnTrackingFound() launches a small animation of a car moving and entering the scene. After 5sec it stops and a menu is shown. This menu uses NGUI. The depth value of the NGUI Camera is put to be rendered on top, but what I get is my menu masked by the objects.
This is what I see in my app with Nexus 4:

This is what should be seen (and is seen in a Samsung Galaxy SII or any other device I have tryed):
In addition to this, when I use the Dalvik Debug Monitor to capture screen shots, I get the correct image in all devices. Same, when I tap the "menu" key or hold the "power" hardware button of my Nexus 4 and let the switch off menu be shown, I can see the camera view working correctly in the back.
I copy here a piece of the log that may be useful:
03-12 19:13:09.606: I/AwesomePlayer(161): setDataSource_l(URL suppressed)
Thank you for your help
Android 4.2.2 No Camera Display
This does seem to be an extension of the same problem I'm having, I'm sort of relieved it's not just me. Interesting extra information about the NGUI layer being clipped though. Have you tried just their sample scene, that's what I went back to and still identical problem with that.
Android 4.2.2 No Camera Display
Yes, same problem, what really bothers me is that, when I hold the power button and the window with "switch off" and "airplane mode" options appear on the front, my app works in the back, and I get the image from the camera and the trackables working....It's giving me a big headache!
Android 4.2.2 No Camera Display
I think this is a wider issue, not related to Android 4.2.2.
I'm experiencing the exact same problem with my app on some devices, so far 2 devices had this problem out of many that I tested. My app works perfectly on a Galaxy Nexus using 4.2.2, but has this issue on other devices.
I have found that I can temporarily solve this issue by checking the "Disable Hardware Overlays" option in the Developer Options. Hope this helps someone else.
Here is an example: a Galaxy S3 running Android 4.1.1 has this issue where the camera view is black, but a different S3 running 4.1.2 works great.
NON WORKING DEVICE:
- Device Model: Galaxy S3
- Model Number: SGH-I747
- Android Version: 4.1.1
- Basband version: I747UCDLK3
- Kernel Version: 3.0.31-274808
- se.infra@SEP-103 #1
- Build number: JRO03L.I747UCDLK3
WORKING DEVICE
- Device Model: Galaxy S3
- Model Number: GT-I9300
- Android Version: 4.1.2
- Basband version: I9300JKELK4
- Kernel Version: 3.0.31-566833
- se.infra@SEP-64 #1
- Build number: JZO54K.I9300XXELL4
I haven't had a chance to update both devices to run the same OS version so I can confirm my theory, but I'm pretty sure this issue is more than just OS version.
Android 4.2.2 No Camera Display
Thanks for the report. Which Unity version are you using?
We've isolated the Nexus 4 issue to builds from Unity 4 and 4.1, and have engaged Unity on this problem.
Please test our Background Texture Access sample on affected devices. This renders the camera image to a texture in the Unity scene and is a workaround for the N4 problem. It will also help us to isolate the issues affecting these other devices.
Android 4.2.2 No Camera Display
I found a solution to my own blackscreen problem:
I got no black on a galaxy nexus, but on a nexus4, the camera was black.
The Solution:
Disable blending! If you have a transparent model or need blending in the overlay, you can enable blending before you start drawing the foreground - just remember to disable blending afterwards.
GLES20.glEnable(GLES20.GL_BLEND);
GLES20.glDisable(GLES20.GL_BLEND);
I am not sure, but i think it could be the camera's fault: different phones has different cameras, and perhaps some uses a 24bit color format, which doesn't have an alpha channel, while some uses 32bit. If the alpha channel would get filled with zeros - it would be completely transparent, and only the background color would be displayed. By disabling blending, the alpha channel is not regarded, and only the rgb values are drawn.
Hope this can help others.
cheers
Christian
Android 4.2.2 No Camera Display
Android 4.2.2 No Camera Display
Yes,
- Galaxy Nexus runs (4.2.1) - also tested on (4.1.2): same result, no problemo. camera shows fine and overlay draws fine
- LG Nexus4 (4.2.2): no camera/black background, fixed by disabling blending.
- HTC One-X (4.0.4): no camera/black background, fixed by disabling blending.
Both of these had the camera running and working, as the targets got recognized just fine, it was just that the camera did not get drawn.
Cheers
Christian
Android 4.2.2 No Camera Display
Yes,
- Galaxy Nexus runs (4.2.1) - also tested on (4.1.2): same result, no problemo. camera shows fine and overlay draws fine
- LG Nexus4 (4.2.2): no camera/black background, fixed by disabling blending.
- HTC One-X (4.0.4): no camera/black background, fixed by disabling blending.
Both of these had the camera running and working, as the targets got recognized just fine, it was just that the camera did not get drawn.
Cheers
Christian
But how do you do this within Unity? (e.g which parts of the script, or editing the generated code in eclipse?)
1
|
GLES20.glEnable(GLES20.GL_BLEND); |
1
|
GLES20.glDisable(GLES20.GL_BLEND); |
For the record, I solved it as others have said: just workaround it by uncheking the 32bit and 24bit display buffer options in the Player Setting pane in Unity.
Edit: This thread here might be related (not with Vuforia but with Unity on Android in general):
http://answers.unity3d.com/questions/131195/destination-alpha-blending-on-android-device.html
Regards,
B.
Android 4.2.2 No Camera Display
Hi,
you say "LG Nexus4 (4.2.2): no camera/black background, fixed by disabling blending."
Can you explain more precisely please how to solve this problem for the Nexus4 ?
I begin in vuforia and unity and i don't understand how to "disable blending.."
Excuse my bad english, i am french !
Thanks a lot
Bye
Android 4.2.2 No Camera Display
Try changing the display buffer settings in Player Settings first. If that doesn't work, you may be able to disable blending using the GL class - http://docs.unity3d.com/Documentation/ScriptReference/GL.html
Android 4.2.2 No Camera Display
Thanks a lot, it works...
But i have another problem with the nexus 4...
When i launch the application, and use it, it is ok.. But then, if a press the home button... And then, restart the application (which is again started in background...) the camera does not work... it display me lot of bad graphics elements... like if the camera does not reinitialize correctly.
An idea please?
Android 4.2.2 No Camera Display
Hi Alessandro,
Thanks for your answer. When you say this issue should be fixed.. What issue do you speak about ?
The black screen of the Nexus 4 ...? Or my other problem of very strange screen of the camera when i press home and go back to the application... ?
I hope it will solve both !!
Bye
Android 4.2.2 No Camera Display
Hi all,
this issue should be fixed in the upcoming Unity 4.1.3 release, which is expected very soon; check this Thread for updates or check the Unity website for the official release.
Hi,
Just to confirm I've just downloaded Unity 4.1.3 and it definitive fixes the OpenGL 32 bit buffer issue with the Nexus 4.
Hurray!! :-D
Android 4.2.2 No Camera Display
Hi,
I have tried the new Unity version : 4.1.3 but i have again my problem :
"When i launch the application, and use it, it is ok.. But then, if a press the home button... And then, restart the application (which is again started in background...) the camera does not work... it display me lot of bad graphics elements... like if the camera does not reinitialize correctly."
Android 4.2.2 No Camera Display
We recently encountered the same problem. We where able to fix it with somewhat of a hack. What you have to do is when the application comes back from being paused render a new object in the cameras view.
Very basic code were we enable an object when we come back. The object sits right in front of the camera.
void OnApplicationPause(bool pauseStatus) { if (pauseStatus) { test.gameObject.SetActive(false); } else { test.gameObject.SetActive(true); } }
Android 4.2.2 No Camera Display
Hi folks
first time I post here :D
quick presentation of me, myself and I
me : was a student in 5th year of study, with a intership of 6 months, whose 3 months w/ Vuforia, then a break of 3 months,
myself : has got a job in the same company, until 31 January
and I : will enrol for a PhD, more or less w/ augmented reality
---
Like some other, I've got a pb of black background comming from the camera, which wasn't post-rendered.
I hadn't that pb with Unity 4.0 & Vuforia 2.0.7
Now with Unity 4.2.0 I got pb, but upgrading Vuforia to 2.6.7 (for Unity !) solved the problem of black background.
for developer (not using Unity), you should try using the last version of Vuforia.
The pb I had was because some applications didn't wanted to work on 3 smartphones (recent ones)
So I supposed that both Unity & Vuforia mades updates for such phones
---
Do you know why Vuforia 4.6.10 doesn't exist for Unity ? although exists for iOS & Android dev ?
CU
Thanks for the report. Is this using the current Unity extension or the 1.5 version? Also which version of Unity did you use to build the APK?