I'm acing an issue with LG Nexus4 terminal that when playing a game I put the screen to sleep and when trying to open it again nothing happens. Terminla has to be powered off and on again. Errors visible at Android logs are:
W/Adreno200-GSL( 9607): <gsl_ldd_control:226>: ioctl code 0x400c0907 (IOCTL_KGSL_DEVICE_WAITTIMESTAMP_CTXTID) failed: errno 110 Connection timed out
W/Adreno200-EGL( 9607): <eglFreeSurface:1344>: eglTimestampWait timestamp failed
W/Adreno200-GSL( 158): <gsl_ldd_control:226>: ioctl code 0x400c0907 (IOCTL_KGSL_DEVICE_WAITTIMESTAMP_CTXTID) failed: errno 22 Invalid argument
E/Adreno200-ES20( 158): <rb_timestamp_wait_on_timestamp:353>: gsl_device_waittimestamp failed in rb_timestamp_wait_on_timestamp
W/Adreno200-GSL( 158): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 16 Device or resource busy
W/Adreno200-ES20( 158): <glFlush:56>: GL_OUT_OF_MEMORY
W/SurfaceTexture( 158): [NavigationBar] updateTexImage: clearing GL error: 0x505
W/Adreno200-GSL( 158): <gsl_ldd_control:226>: ioctl code 0x400c0907 (IOCTL_KGSL_DEVICE_WAITTIMESTAMP_CTXTID) failed: errno 22 Invalid argument
E/Adreno200-ES20( 158): <rb_timestamp_wait_on_timestamp:353>: gsl_device_waittimestamp failed in rb_timestamp_wait_on_timestamp
W/Adreno200-GSL( 7590): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 16 Device or resource busy
W/Adreno200-ES20( 7590): <glFlush:56>: GL_OUT_OF_MEMORY
W/Adreno200-GSL( 7590): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 16 Device or resource busy
Any ideas what happens?
Sorry this is occuring. Could you let us know which game this happens with, and if other games have the same behavior? I assume you are manually turning off the screen. Does the same effect happen when the screen turns off by it self, or when you go back to the home screen, and then back to the game?
thanks
Thanks for the quick reply on this matter. This has occurred only with Bike Race game. It also does not happen when going to some other screen and then coming back to the game. It happens only in a case when during the game the screen is turned manually off (to sleep) and then game is tried to be continued by turning the screen after awhile manually back on. And of course this does not happen constantly though at least three times in past couple of weeks which has made the end user to react to this issue.
We can do some testing here, but it sounds like it could be an application error (not handling a suspend/resume graphics scenerio), but its definitely worth our investigating..
I'm assuming the game is: "Bike Race Free" from Google Play store?
Thaks again for the quick reply. Your assumption is correct. The game is "Bike Race Free" from Google Play store. Let me know if you manage to find out the same issue.
Hi, I’m having a similar problem. I’m developing an OpenGL ES 2.0 application and I get this error in my Nexus 4.
04-18 16:13:11.332: W/Adreno200-GSL(4077): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 35 Resource deadlock would occur
04-18 16:13:11.332: W/Adreno200-GSL(4077): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 35 Resource deadlock would occur
04-18 16:13:11.332: W/Adreno200-EGL(4077): <eglSwapBuffers:3498>: EGL_CONTEXT_LOST
04-18 16:13:11.352: W/Adreno200-GSL(4077): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 35 Resource deadlock would occur
I get this error when I use a sampler array and try to access it dynamically in the fragment shader (random access)
.” uniform sampler2D T[8]
float v1 = texture2D( T[x], texPos1 ) ”
and the GL Context is destroy and recreated and sometimes the application stops, and also the texture information that I’m getting have some artifacts.
But if I do an static access
float v1 = texture2D( T[1], texPos1 ).
The application runs with no errors and the texture information is mapped correctly.
what could be the problem? a driver problem?
It's hard to tell exactly where the problem is, but I agree it looks a bit suspious - we would want to see the full shader code.
Can you provide us with an apk?
Can you let us know if you've run/tested on other Android devices - Qualcomm Snapdragon or other?
thanks
Hello,
I had a new occurence of the problem. I've added a bit more of logging from the Bike Race also below:
I/ActivityManager( 512): START u0 {cmp=com.topfreegames.bikeracefreeworld/com.topfreegames.bikerace.activities.MultiplayerMainActivity (has extras)} from pid 2906
I/ActivityManager( 512): START u0 {cmp=com.topfreegames.bikeracefreeworld/com.topfreegames.bikerace.activities.MultiplayerMainActivity (has extras)} from pid 2906
I/ActivityManager( 512): START u0 {cmp=com.topfreegames.bikeracefreeworld/com.topfreegames.bikerace.activities.MultiplayerMainActivity (has extras)} from pid 2906
W/ActivityManager( 512): Duplicate finish request for ActivityRecord{41c89cc0 u0 com.topfreegames.bikeracefreeworld/com.topfreegames.bikerace.activities.PlayActivity}
W/ActivityManager( 512): Duplicate finish request for ActivityRecord{41c89cc0 u0 com.topfreegames.bikeracefreeworld/com.topfreegames.bikerace.activities.PlayActivity}
W/ActivityManager( 512): Duplicate finish request for ActivityRecord{41c89cc0 u0 com.topfreegames.bikeracefreeworld/com.topfreegames.bikerace.activities.PlayActivity}
D/dalvikvm( 2906): GC_EXPLICIT freed 329K, 35% free 21493K/32784K, paused 4ms+6ms, total 71ms
D/dalvikvm( 2906): GC_EXPLICIT freed 29K, 35% free 21466K/32784K, paused 2ms+3ms, total 61ms
D/dalvikvm( 2906): GC_EXPLICIT freed 538K, 37% free 20931K/32784K, paused 3ms+3ms, total 64ms
D/dalvikvm(31888): GC_FOR_ALLOC freed 1526K, 18% free 21533K/26068K, paused 90ms, total 90ms
I/dalvikvm-heap(31888): Grow heap (frag case) to 21.151MB for 103696-byte allocation
V/TAG ( 512): bug 7643792: fitSystemWindows([0,0][0,0])
D/dalvikvm(31888): GC_FOR_ALLOC freed 21K, 18% free 21612K/26172K, paused 157ms, total 157ms
I/USERIAL_LINUX( 847): USERIAL_Open(): exit
D/dalvikvm(31888): GC_FOR_ALLOC freed 225K, 18% free 21657K/26172K, paused 80ms, total 80ms
I/dalvikvm-heap(31888): Grow heap (frag case) to 21.271MB for 102416-byte allocation
W/ActivityManager( 512): Activity pause timeout for ActivityRecord{41c89cc0 u0 com.topfreegames.bikeracefreeworld/com.topfreegames.bikerace.activities.PlayActivity}
D/dalvikvm(31888): GC_FOR_ALLOC freed 2K, 18% free 21755K/26276K, paused 98ms, total 98ms
D/alsa_ucm( 161): snd_use_case_set(): uc_mgr 0x40850d58 identifier _verb value Inactive
D/alsa_ucm( 161): Set mixer controls for HiFi Lowlatency enable 0
D/alsa_ucm( 161): snd_use_case_set(): uc_mgr 0x40850d58 identifier _disdev value DMIC Endfire
D/alsa_ucm( 161): disdev: device DMIC Endfire not enabled, no need to disable
D/alsa_ucm( 161): snd_use_case_set(): uc_mgr 0x40850d58 identifier _disdev value Speaker
D/alsa_ucm( 161): Set mixer controls for Speaker enable 0
W/Adreno200-GSL( 158): <gsl_ldd_control:226>: ioctl code 0x400c0907 (IOCTL_KGSL_DEVICE_WAITTIMESTAMP_CTXTID) failed: errno 110 Connection timed out
W/Adreno200-GSL( 158): <gsl_ldd_control:226>: ioctl code 0x400c0907 (IOCTL_KGSL_DEVICE_WAITTIMESTAMP_CTXTID) failed: errno 22 Invalid argument
E/Adreno200-ES20( 158): <rb_timestamp_wait_on_timestamp:353>: gsl_device_waittimestamp failed in rb_timestamp_wait_on_timestamp
W/Adreno200-GSL( 158): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 16 Device or resource busy
W/Adreno200-ES20( 158): <glFlush:56>: GL_OUT_OF_MEMORY
W/SurfaceTexture( 158): [NavigationBar] updateTexImage: clearing GL error: 0x505
W/Adreno200-GSL( 158): <gsl_ldd_control:226>: ioctl code 0x400c0907 (IOCTL_KGSL_DEVICE_WAITTIMESTAMP_CTXTID) failed: errno 22 Invalid argument
E/Adreno200-ES20( 158): <rb_timestamp_wait_on_timestamp:353>: gsl_device_waittimestamp failed in rb_timestamp_wait_on_timestamp
W/Adreno200-GSL(31888): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 16 Device or resource busy
W/Adreno200-ES20(31888): <finish_current_fbo_rendering:183>: GL_OUT_OF_MEMORY
D/OpenGLRenderer(31888): Could not allocate texture for layer (fbo=4 1196x328)
W/Adreno200-GSL(31888): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 16 Device or resource busy
W/Adreno200-GSL(31888): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 16 Device or resource busy
W/Adreno200-GSL(31888): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 16 Device or resource busy
W/Adreno200-ES20(31888): <finish_current_fbo_rendering:183>: GL_OUT_OF_MEMORY
W/Adreno200-GSL(31888): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 16 Device or resource busy
W/Adreno200-GSL(31888): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 16 Device or resource busy
W/Adreno200-GSL(31888): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 16 Device or resource busy
W/Adreno200-GSL(31888): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 16 Device or resource busy
W/Adreno200-GSL(31888): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 16 Device or resource busy
W/Adreno200-GSL(31888): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 16 Device or resource busy
D/OpenGLRenderer(31888): GL error from OpenGLRenderer: 0x505
E/OpenGLRenderer(31888): Out of memory!
W/Adreno200-GSL(31888): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 16 Device or resource busy
W/Adreno200-ES20(31888): <gl2_surface_swap:43>: GL_OUT_OF_MEMORY
W/Adreno200-EGL(31888): <eglSwapBuffers:3498>: EGL_BAD_ALLOC
W/HardwareRenderer(31888): EGL error: EGL_BAD_ALLOC
Then every now and then the below error is visible:
E/Adreno200-ES11( 2906): <glDeleteTextures:375>: GL_INVALID_VALUE
Thank you,
kind regards,
jperttul
Hi, mhfeldma thanks for the fast reply, I Have attach the links to download the apk file, and also folder with files that is needed to be stored in /mnt/sdcard/Download, so you can run the app.
for example:
/mnt/sdcard/Download/bonsai
Link to download apk file:
http://kiwi6.com/file/580ircsfr6
Link to download files need to run the app:
http://kiwi6.com/file/7iaz50s68m
I have also did a test
If in the shader I code something like this
float v1 = texture2D( T[1], texPos1 ).r;
it works correctly.
but if code this:
int u1= 1;
float v1 = texture2D( T[u1], texPos1 ).r;
I have the problem that I have said before
here is the complete fragment shader
Hiprecision highp float;
//vector de texturas con el modelo
uniform sampler2D T[8];
//número total de lonchas del modelo
uniform float S;
//dimensiones de cada mosaico
uniform float Mx;
uniform float My;
uniform int numSamples;
uniform mat4 uNMatrix;
uniform vec3 posCamara;
//número máximo de canales de color
uniform float Maxch; //RGBA
varying vec4 Position;
varying vec4 Position2;
float maxDist = sqrt(3.0);
const float DELTA=0.0000000001;
const float THRESHOLD=0.1;
const float BaseSampleDist = 0.5;
const float ActualSampleDist = 0.5;
float getValue( vec3 p2, int ch1, int u1 )
{
float Stex = min( Mx * My, S );
float aux3 = floor( p2.z * Stex );
float aux4 = mod( aux3 + 1.0, Stex );
vec2 texPos1, texPos2;
texPos1.x = aux3/Mx + p2.x/Mx;
texPos1.y = floor(aux3/My)/My + p2.y/My;
texPos2.x = fract(aux4/Mx) + p2.x/Mx;
texPos2.y = floor(aux4/My)/My + p2.y/My;
//control desbordamiento 2o acceso textura
float next = float( ch1+int(step(aux4,aux3)) );
int u2 = u1 + int( step(Maxch, next) );
int ch2 = int( mod(next,Maxch) );
//leer colores con interpolacion bilineal
//u1+1 igual para u2
float v1 = texture2D( T[u1+1], texPos1 )[ch1];
float v2 = texture2D( T[u2+1], texPos2 )[ch2];
//simular interpolacion trilineal
return mix( v1, v2, (p2.z*Stex)-aux3 );
//return 0.f;
}
float ACT(vec3 p)
{
float Mxy = Mx * My;
float aux1 = floor( S * p.z );
//primera loncha de la que leer
float aux2 = floor( aux1 / Mxy );
//porcentaje de Z dentro de cada textura
float depth = min( 1.0, Mxy / S );
//Z del primer texel de la loncha a leer
float zini = aux2 * depth;
//Z residual de p dentro del mosaico actual
float zres = (p.z-zini) / depth;
int u1 = int( floor(aux2/Maxch) );
int ch1 = int( mod(aux2, Maxch) );
vec3 p2 = vec3( p.xy, zres );
//return 0.f;
return getValue( p2, ch1, u1 );
}
vec3 shading(vec3 N, vec3 V, vec3 L, vec3 mat)
{
vec3 ka = vec3(0.1);
vec3 kd = vec3(0.6);
vec3 ks = vec3(0.2);
float n=50.0;//shininess
//propiedades de la luz
vec3 lightColor=vec3(1.0);
vec3 ambientLight=vec3(0.3);
//calculo del vector halfway
vec3 H = normalize(L + V);
//calculo del termino ambiente
vec3 ambiente = ka*mat * ambientLight;
//calculo del termino difuso
float diffuseLight = max(dot(L, N), 0.0);
vec3 diffuse = kd * mat * lightColor * diffuseLight;
//compute the specular term
float specularLight = pow(max(dot(H, N),0.0),n);
if(diffuseLight <= 0.0)
specularLight = 0.0;
vec3 specular = ks * mat * lightColor * specularLight;
return ambiente + diffuse +specular;
}
vec3 calcularGradiente(vec3 pos)
{
vec3 sample1, sample2, alpha1, alpha2;
// seis accesos a textura para el calculo del gradiente
sample1.x = ACT(pos-vec3(DELTA,0.0,0.0));
sample2.x = ACT(pos+vec3(DELTA,0.0,0.0));
sample1.y = ACT(pos-vec3(0.0,DELTA,0.0));
sample2.y = ACT(pos+vec3(0.0,DELTA,0.0));
sample1.z = ACT(pos-vec3(0.0,0.0,DELTA));
sample2.z = ACT(pos+vec3(0.0,0.0,DELTA));
//seis accesos a textura para la funcon de transferencia
alpha1.x = texture2D(T[0], vec2(sample1.x,0.0)).r;
alpha2.x = texture2D(T[0], vec2(sample2.x,0.0)).r;
alpha1.y = texture2D(T[0], vec2(sample1.y,0.0)).r;
alpha2.y = texture2D(T[0], vec2(sample2.y,0.0)).r;
alpha1.z = texture2D(T[0], vec2(sample1.z,0.0)).r;
alpha2.z = texture2D(T[0], vec2(sample2.z,0.0)).r;
return alpha2-alpha1;
}
bool IntersectBox ( in vec3 pos, in vec3 direction /* ray origin and direction */,
in vec3 minimum /* minimum point of a box */,
in vec3 maximum /* maximum point of a box */,
out float start /* time of 1st intersection */,
out float final /* time of 2nd intersection */)
{
vec3 invR = 1.0 / direction;
vec3 tbot = invR * (minimum-pos);
vec3 ttop = invR * (maximum-pos);
vec3 tmin = min(ttop, tbot);
vec3 tmax = max(ttop, tbot);
vec2 t = max(tmin.xx, tmin.yz);
start = max(t.x, t.y);
t = min(tmax.xx, tmax.yz);
final = min(t.x, t.y);
return start <= final;
}
void main()
{
vec3 LightPosition = vec3(0.5, 200.0, 20.0);
//vec3 LightPosition = vec3(posCamara);
vec2 texC = Position.xy / Position.w;
texC.xy *=0.5;
texC.xy +=0.5;
vec3 rayStart = Position2.xyz;
//gl_FragColor = vec4(rayStart,1.0);
//return;
/*if (rayStart == rayStop)
{
gl_FragColor = vec4(0.0);
return;
}*/
float stepSize = maxDist / float(numSamples);
vec3 pos = rayStart;
vec3 direction = normalize(pos-posCamara);
vec3 step = direction* stepSize;//normalize(rayStop-rayStart) * stepSize;
float tnear, tfar;
IntersectBox(pos, direction,vec3(0.0), vec3(1.0), tnear, tfar);
vec3 rayStop = pos + direction *tfar;
float travel = distance(rayStop, rayStart);
vec3 L = normalize(LightPosition-pos);
vec3 V = direction;
vec4 value = vec4(0.0);
vec4 dst = vec4(0.0);
for (int i=0; i < numSamples && travel > 0.0; ++i, pos += step , travel -= stepSize)
{
float scalar= ACT(pos);
vec4 src= texture2D(T[0],vec2(scalar,0.0));
vec3 mat = src.rgb;
src.a = 1.0 - pow((1.0 - src.a), ActualSampleDist / BaseSampleDist);
if (src.a > THRESHOLD)
{
vec3 gradiente = calcularGradiente(pos);
// central difference and normalization
vec3 N = normalize(mat3(uNMatrix) * gradiente).xyz;
//iluminacion local
//if(length(gradiente)>0.0)
src.rgb += shading(N,V,L, mat);
src.rgb*=src.a;
}
//front to back composition
dst = (1.0 - dst.a) * src + dst;
//early ray termination
if(dst.a>=0.95)
break;
}
gl_FragColor=dst;
}
mhfeldma I forgot to tell that I have also tested on other android devices like the Galaxy S3 that has a mali-400 GPU, and also I have tried in the emulator and it works correctly in both cases.
thanks
Thanks for bringing the array issue to our attention.
Turns out that we only support a constant expression for indexing the array, which is ok according to the OpenGL-ES2 spec.
https://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1....
Appendix A: Limitations for ES 2.0:
“GLSL ES 1.00 supports both arrays of samplers and arrays of structures which contain samplers. In both these cases, for ES 2.0, support for indexing with a constant-index-expression is mandated but support for indexing with other values is not mandated.”
Never the less, the shader compiler should have detected this and reported an error, so we'll get that fixed.
Could you let us know exactly which device and build you are seeing this problem on (i.e. what the "About phone" page shows)? Also any other information you might have on reproducing the problem?
thanks
Thanks for troubleshooting the issue still. Here's the info (hopefully visible for you also):
cheers,
jperttul
Hi,
I guess the snapshot was not visible. So the model is LG Nexus4, Android 4.2.2, Baseband version M9615A-CEFWMAZM-2.0.1700.48, kernel version 3.4.0-perf-g7cellcd [email protected] #1 Tue Jan 29 11:41:33 PST 2013, Build number JDQ39.
kind regards,
jperttul