OpenGL goes green on tablets - android

Description:
My OpenGL game runs fine on phones. However, after a couple of seconds of running on a tablet the 3D rendering goes all green. The 2D overlays (gl) are mostly fine.
This might be triggered by rotation, I can't be sure; no access to a tablet.
A user kindly recording it happening, which I have posted online:
http://www.youtube.com/watch?v=DRfDM673TRA
Questions:
Has anyone seen this before, or know of a possible cause/cure?
Also, can anyone confirm this is is still happening? (BB Rally Lite is free).
Other info:
The game is locked into landscape mode so I wouldn't expect it to do anything on rotation.
Update:
This was a bug in my code.
Tablets have a different default orientation,
which was triggering conditional (bugged) code that never got run on a phone.
The green screen was a result of the bug causing the model's matrix to contain nan (or inf, I can't recall).
If you suffer from a green screen I suggest you start by looking at your matrices.

Related

Unity Android Screen Glitch

I have a bug plaguing my project that I can't find any resources to online. There are 2 scenes in my app, Menu and Game. Menu has this behavior 100% of the time, whereas Game only loads with this glitch occasionally. It appears that once it happens once in Game, it will happen multiple times consecutively, and then eventually fix itself. Here is the image of what I am seeing: Menu scene --- Game scene
There are no scripts on my Canvas that are not standard Unity scripts, everything is stock. I have also checked the logcat log via command prompt and no errors are thrown.
If you have any information as to why this glitch is happening, please let me know. I think it has something to do with Canvas settings or a missing dependency/package conflict, but no settings that I changed caused the glitch to go away. Thank you for the assistance!
Change UI Scale mode of canvas to scale with screen size instead of constant pixel size
Answered my own question.
If you are making an AR app and have UI in the app, you NEED a regular Unity Camera in the scene alongside your AR Camera. The AR Camera should be tagged 'Main'.
For some reason, UI cannot attach to AR cameras, and while I don't understand why, the solution still works.

VirtualDisplay Screen Flicker

A while back I asked this question and #fadden was gracious enough to give me an answer. So, now I have a VirtualDisplay which is using an intermediary Surface that I create and when the SurfaceTexture that backs the Surface receives an onFrameAvailable call, I make OpenGL calls to put draw that texture to an EGLSurface which is created from the Surface generated by the MediaCodec. Phew.
All of this is running in a Service (so it sticks around in the background). It all works, but I'm having some screen flickering occasionally on some devices. The flickering does not carry through to the data sent to the MediaCodec so it seems to be an issue with just the screen. The flickering also causes the "soft buttons" on Nexus devices to disappear/reappear on Nexus devices (but even when the buttons are gone on screen, the soft buttons appear in the output of the MediaCodec.
If I swap out my intermediary Surface so that the VirtualDisplay just outputs to the MediaCodec's input Surface then the flicker happens significantly less (happened one time in 50 or so minutes vs. flickering a few times a second periodically). The flickering also seems to happen in certain apps more so than other apps (Google Maps is a good culprit) or when certain UI appears/disappears in apps.
Anyone have have any ideas on what could cause the flickering in this scenario and only one some devices (that I've seen)? I can post some source code if that would be helpful.
EDIT: So, I've found that, on my Nexus 5x at least, if I go to "Developer Options" and enable "Disable HW Overlays" (the text says "Always use GPU for screen compositing") that the screen flicker goes away. Obviously this is a workaround, but I'd like to fix the issue programatically if at all possible.

Low performance maybe related with images

I don't know exactly what happened, I developed a simple memory game that mostly uses ImageViews, at some point all ok in performance terms, but after exported and signed, the game looks so laggy in my xperia sola, it takes too long to press buttons when you just open the game, after 3-4 buttons pressed all go back to normal performance, those issues aren't so noticeable on better devices (xperia sp or lg optimus g as testing examples).
But, the fact is that I have not changed nothing on code either before or after last testings (when game was ok), I just made changes on Images, used a picture editor to remove imperfections on all images and get something more polished, of course game size increased (from 826kb to 1.85mb after edit) and nothing else.
I'd really like to show you code but is too long.
Maybe can you help me to identify the issue?

Camera is being rotated 90 degree in air for android

In my AS3 Flex Mobile application for Android, I am using camera and it is being automatically rotated 90 degrees before I even done any video rotation by myself, it seems like it's a known bug in AIR. But I was wondering if anyone found a solution since it's really pretty important feature for mobile application developer.
I've tried to do some rotation manually in my code, but it is only fixes the view on my display, but still sends the wrong video to the receiver.
If any code is required I will add the snippets
Please let me know.
As you mentioned, this is a known bug with AIR. It is not consistent, either. On some devices, it is in the correct orientation but in some (and all iOS devices, I believe, though I haven't fully tested that), it is rotated as you are seeing. For example, it was always oriented correctly on my Nexus 4 and on my Nexus 5, but a friends Moto X is rotated incorrectly.
Unfortunately, I don't believe there is anything you can do short of having the user do a calibration (i.e. overlay a straight line and tell them to place it horizontally and click a button) and rotating the camera display and any images you take with the display.
That being said, if you are using the camera to take photos, I highly recommend using CameraUI instead, which is the native implementation.
I've faced the same issue today but i'm developping in Java, not with AIR so i don't know if it the same, for me the solution was to add this line before starting the recording.
mMediaRecorder.setOrientationHint(90);

Android: Frame rate drops in landscape mode

I am trying out the (latest) Android SDK, and noticed some strange behavior.
I've written a skeletal SurfaceView app: Activity, SurfaceView and a rendering thread. It doesn't actually do any painting, and only writes out the framerate to logcat once a second. When it runs in portrait mode, I get around 60 fps. However, when I flip it to landscape the framerate drops to about 30 fps.
I have also tested it on the LunarLender sample, and got similiar results. All of the testing are done on the emulator, since I don't have a physical device.
What's it all about? I can't seem to find any mentioning to this on Google, have anyone else experienced that? Is it just an emulator quirk or does it apply to physical hardware too?
Guessing here- in landscape mode, is there extra "blank" space on either side of the rendered content? If so there could be an effective increase in the amount of processing just to paint the screen. Don't know if that should account for a 50% decrease in framerate, but it's possible.
Another guess- landscape mode may be deliberately throttled because it's intended primarily for video viewing. No reason to go up to 60fps for 30fps content. Configuration?

Categories

Resources