Android device displays everything in purple tones

Today a friend of mine installed my game on his device and something is wrong. All the game is tinted in purple tones. At the beggining I thought there was some color channel switching, but there’s a strange behaviour:
A screen capture shows the colors correctly. When the game is minimizing, the colors are ok. The colors are also good in the android task manager. The colors are only wrong when the game is active.
This behaviour makes think that: the color information and the texture format are correct and the shaders are ok (and are very simple).
As anyone ever experienced something similar?

Yes: https://bugzilla.libsdl.org/show_bug.cgi?id=2291

And it is not yet resolved.

Regards,
RetoOn 26.02.2015 18:22, Limanima wrote:

As anyone ever experienced something similar?

Reto Schneider wrote:> On 26.02.2015 18:22, Limanima wrote:

As anyone ever experienced something similar?

Yes: https://bugzilla.libsdl.org/show_bug.cgi?id=2291

And it is not yet resolved.

Regards,
Reto

Ok thanks. At least I have some clues of what is going on.

IT’S NOT PURPLE, IT’S WHITE AND GOLD!!! :smiley:

Anyway, try changing #if ANDROID to #ifdef ANDROID in src/video/SDL_egl.c. It’s possible that the NDK simply defines ANDROID instead of setting it to 1 (I’m not exactly sure about this, but another macro, ANDROID, is defined by NDK-Build with -DANDROID, not -DANDROID=1).

SiPlus wrote:

IT’S NOT PURPLE, IT’S WHITE AND GOLD!!! :smiley:

Anyway, try changing #if ANDROID to #ifdef ANDROID in src/video/SDL_egl.c. It’s possible that the NDK simply defines ANDROID instead of setting it to 1 (I’m not exactly sure about this, but another macro, ANDROID, is defined by NDK-Build with -DANDROID, not -DANDROID=1).

I don’t think that will solve the problem. It’s seems to be a render target problem.

Limanima wrote:

SiPlus wrote:

IT’S NOT PURPLE, IT’S WHITE AND GOLD!!! :smiley:

Anyway, try changing #if ANDROID to #ifdef ANDROID in src/video/SDL_egl.c. It’s possible that the NDK simply defines ANDROID instead of setting it to 1 (I’m not exactly sure about this, but another macro, ANDROID, is defined by NDK-Build with -DANDROID, not -DANDROID=1).

I don’t think that will solve the problem. It’s seems to be a render target problem.

Actually yes, I just tried, ANDROID is set to 1.

SiPlus wrote:

Limanima wrote:

SiPlus wrote:

IT’S NOT PURPLE, IT’S WHITE AND GOLD!!! :smiley:

Anyway, try changing #if ANDROID to #ifdef ANDROID in src/video/SDL_egl.c. It’s possible that the NDK simply defines ANDROID instead of setting it to 1 (I’m not exactly sure about this, but another macro, ANDROID, is defined by NDK-Build with -DANDROID, not -DANDROID=1).

I don’t think that will solve the problem. It’s seems to be a render target problem.

Actually yes, I just tried, ANDROID is set to 1.

Sorry, I’ve checked the code and you may actually be right. I’m going to try that. Maybe this should be fixed in the head?

SiPlus wrote:

Limanima wrote:

SiPlus wrote:

IT’S NOT PURPLE, IT’S WHITE AND GOLD!!! :smiley:

Anyway, try changing #if ANDROID to #ifdef ANDROID in src/video/SDL_egl.c. It’s possible that the NDK simply defines ANDROID instead of setting it to 1 (I’m not exactly sure about this, but another macro, ANDROID, is defined by NDK-Build with -DANDROID, not -DANDROID=1).

I don’t think that will solve the problem. It’s seems to be a render target problem.

Actually yes, I just tried, ANDROID is set to 1.

I forced a compile error in the piece of code and the compiler reports the error. That code is compiling in Android. That’s not the problem after all.

Limanima wrote:

SiPlus wrote:

Limanima wrote:

SiPlus wrote:

IT’S NOT PURPLE, IT’S WHITE AND GOLD!!! :smiley:

Anyway, try changing #if ANDROID to #ifdef ANDROID in src/video/SDL_egl.c. It’s possible that the NDK simply defines ANDROID instead of setting it to 1 (I’m not exactly sure about this, but another macro, ANDROID, is defined by NDK-Build with -DANDROID, not -DANDROID=1).

I don’t think that will solve the problem. It’s seems to be a render target problem.

Actually yes, I just tried, ANDROID is set to 1.

I forced a compile error in the piece of code and the compiler reports the error. That code is compiling in Android. That’s not the problem after all.

I did this (like Hak Matsuda suggested in the bugzilla entry):

SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);

After creating the rendering and it solved the problem on the faulting device. It doesn’t seem to have broken the other devices.

Limanima wrote:

Limanima wrote:

SiPlus wrote:

Limanima wrote:

SiPlus wrote:

IT’S NOT PURPLE, IT’S WHITE AND GOLD!!! :smiley:

Anyway, try changing #if ANDROID to #ifdef ANDROID in src/video/SDL_egl.c. It’s possible that the NDK simply defines ANDROID instead of setting it to 1 (I’m not exactly sure about this, but another macro, ANDROID, is defined by NDK-Build with -DANDROID, not -DANDROID=1).

I don’t think that will solve the problem. It’s seems to be a render target problem.

Actually yes, I just tried, ANDROID is set to 1.

I forced a compile error in the piece of code and the compiler reports the error. That code is compiling in Android. That’s not the problem after all.

I did this (like Hak Matsuda suggested in the bugzilla entry):

SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);

After creating the rendering and it solved the problem on the faulting device. It doesn’t seem to have broken the other devices.

Correction to the previous post: it’s not AFTER, it’s BEFORE creating the renderer.

From what I remember, setting 565 is a workaround, because it will choose
indirectly a different “egl-configuration”.

But that’s the best thing to do currently.

I spend some time to help in this ticket and the problem as I understandood
it, is:

  • the device S3 provides many egl-configurations.
  • the application is in landscape and choose/request an egl-configuration.

At first, the selected “egl-config” seems correct (regarding colors, depth,
etc.), but, in fact,when running, the application appears to be bad (red
screen problem).

Can you tell if you hardware device is a S3 ? and if you application is
also landscape ?

Another issue that happens to me is this one:
https://bugzilla.libsdl.org/show_bug.cgi?id=2774

The application is landscape. The java layer calls incorrectly
"onSurfaceChanged()" with (width, height) instead of (height, width).
Then the screen is distorded.
But it is only problematic with some egl-configurations and some device.

You may want to try the path attached in this ticket. Please, tell if you
try it and the result !On Tue, Mar 3, 2015 at 1:00 PM, Limanima <jorge.raposo.lima at gmail.com> wrote:

Limanima wrote:

Limanima wrote:

SiPlus wrote:

Limanima wrote:

SiPlus wrote:

IT’S NOT PURPLE, IT’S WHITE AND GOLD!!! [image: Very Happy]

Anyway, try changing #if ANDROID to #ifdef ANDROID in
src/video/SDL_egl.c. It’s possible that the NDK simply defines ANDROID
instead of setting it to 1 (I’m not exactly sure about this, but another
macro, ANDROID, is defined by NDK-Build with -DANDROID, not -DANDROID=1).

I don’t think that will solve the problem. It’s seems to be a render
target problem.

Actually yes, I just tried, ANDROID is set to 1.

I forced a compile error in the piece of code and the compiler reports the
error. That code is compiling in Android. That’s not the problem after all.

I did this (like Hak Matsuda suggested in the bugzilla entry):

SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);

After creating the rendering and it solved the problem on the faulting
device. It doesn’t seem to have broken the other devices.

Correction to the previous post: it’s not AFTER, it’s BEFORE creating the
renderer.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker

slvn wrote:

From what I remember, setting 565 is a workaround, because it will choose indirectly a different “egl-configuration”.

But that’s the best thing to do currently.

I spend some time to help in this ticket and the problem as I understandood it, is:??

  • the device S3 provides many egl-configurations.
  • the application is in landscape and choose/request an egl-configuration.

At first, the selected “egl-config” seems correct (regarding colors, depth, etc.), but, in fact,when running, the application appears to be bad (red screen problem).

Can you tell if you hardware device is a S3 ? and if you application is also landscape ?

Another issue that happens to me is this one: https://bugzilla.libsdl.org/show_bug.cgi?id=2774 (https://bugzilla.libsdl.org/show_bug.cgi?id=2774)

The application is landscape. The java layer calls incorrectly “onSurfaceChanged()” with (width, height) instead of (height, width).
Then the screen is distorded.
But it is only problematic with some egl-configurations and some device.

You may want to try the path attached in this ticket. Please, tell if you try it and the result !
Sylvain Becker

It is an S3 but my application is in portait not in landscape (not my phone).

I’ve never experienced the distorted issue in my phone (Galaxy Fresh) nor the red screen problem.

Limanima wrote:

slvn wrote:

From what I remember, setting 565 is a workaround, because it will choose indirectly a different “egl-configuration”.

But that’s the best thing to do currently.

I spend some time to help in this ticket and the problem as I understandood it, is:??

  • the device S3 provides many egl-configurations.
  • the application is in landscape and choose/request an egl-configuration.

At first, the selected “egl-config” seems correct (regarding colors, depth, etc.), but, in fact,when running, the application appears to be bad (red screen problem).

Can you tell if you hardware device is a S3 ? and if you application is also landscape ?

Another issue that happens to me is this one: https://bugzilla.libsdl.org/show_bug.cgi?id=2774 (https://bugzilla.libsdl.org/show_bug.cgi?id=2774)

The application is landscape. The java layer calls incorrectly “onSurfaceChanged()” with (width, height) instead of (height, width).
Then the screen is distorded.
But it is only problematic with some egl-configurations and some device.

You may want to try the path attached in this ticket. Please, tell if you try it and the result !
Sylvain Becker

It is an S3 but my application is in portait not in landscape (not my phone).

I’ve never experienced the distorted issue in my phone (Galaxy Fresh) nor the red screen problem.

I also confirm that this workaround fixed another issue in an Samsung S2 where the game was running very slow. Now it is running smoothly.