Spritesheet bug - Sprite image is replaced by white square of the same size

Hi folks.
Playing around with new spritesheet features (Jon Beebe explained here: http://blog.anscamobile.com/2012/03/image-sheets-image-groups-and-sprites/ ) I have this issue:

In simulator - everything seems to be fine.
When I build this for Android and install apk to my device (HTC Desire) at first run - its ok, but when I press home button and relaunch the app, instead of image from spritesheet (local buddy) I see white square.
Background image (local bg) is presented fine.
SDK version 2012.776

Any ideas what I did wrong?
Thanks for your help.
Here is a simplified version of my code:

[lua]_W=display.contentWidth
_H=display.contentHeight
local options =
{
– array of tables representing each frame (required)
frames = {
{
x = 673,
y = 1310,
width = 408,
height = 607,

},
},

– optional params; used for dynamic resolution support
sheetContentWidth = 2048,
sheetContentHeight = 2048
}
local imageSheet = graphics.newImageSheet( “data.png”, options)

local bg = display.newImage(“bg.jpg”)
bg:setReferencePoint(display.CenterReferencePoint);
bg.x = _W*0.5; bg.y = _H*0.5+100;

local buddy = display.newImage( imageSheet, 1 )
buddy.x=_W*0.5;buddy.y=_H*0.5;[/lua] [import]uid: 123209 topic_id: 24187 reply_id: 324187[/import]

Did you find the cause of this? same thing is happening to me randomly. Some times the texture load just fine when resuming the app but some times just draw a white rectangle where the image is supposed to be. [import]uid: 141981 topic_id: 24187 reply_id: 102532[/import]

Unfortunately no, I did not. In my case it is happened always - HTC Desire - Android 2.2 - when app is resumed, instead of texture from a spritesheet I see a white square.
I would appreciate if someone can check my code in first post and test it on a device (use your own assets/spritesheet).
But it is good to know that someone else is also experiencing this issue. I thought I am the only one… Thanks for response chamogames. [import]uid: 123209 topic_id: 24187 reply_id: 102563[/import]

I just reported a bug describing this issue - bug #13733. [import]uid: 123209 topic_id: 24187 reply_id: 102572[/import]

I am seeing this on a number of devices too. I am sure it affecting more devices, but this is what I have tested it on.
Htc Desire HD - Adnroid 2.2
HTc Evo 4G - Android 2.3.7 (Cynogen mod 7.1)
Nexus One - Android 2.2.2
Dell Streak - Android 2.3.7 (Cynogen mod 7.1)
Motorola milestone

All of these devices are randomly replacing sprites with white square/rectangles at the same size as the sprite that goes missing.

Thought it may be that we were using too much memory. So for testing we have paired the vRam memory usage down to about 18.16mb, which of course did not solve the problem.

This seems to be logged as bug:
12674 Graphics replace with blank rectangles on android 480x800 resolution devices.
Plus
You have mentioned that you have logged it as bug #13733, but I can’t see that listed in the bug listing, so not sure what happened there.

Obviously we can’t ship with this bug.
Is there any update on this?
Any likely fix coming?

Ben

[import]uid: 28534 topic_id: 24187 reply_id: 113591[/import]

Hi Ben.
Thanks for your post. Ansca closed my bug because they were unable to reproduce this issue for debugging (see email below). I suggest you post a new bug to tracker - as I see you are experiencing this problem on number of devices so they can try to reproduce on some of these. My HTC Desire still shows white square in my app after resume - running latest build of Corona SDK. So no progress for now… I am sorry.

Honza
[text]
Hello,
I wasn’t able to reproduce the issue you gave us using the newest daily build. We’ve made several rendering fixes in the past couple of weeks, so I suggest that you download the newest daily build (see link below) and attempt to try it with your app again.
http://developer.anscamobile.com/downloads/daily-builds

Regards,
Joshua Quick
[/text] [import]uid: 123209 topic_id: 24187 reply_id: 113600[/import]

Thanks for the reply Honza. Yes, I will post another bug report, but will need to wait till Monday as I will need to create a stripped down version of the app the submit with the report.

Glad I found your post actually, because I totally missed the trigger of needing to exit the app and go back in, which just added confusion as to which devices were showing the problem, because some quick tests would not show the problem as they were only run once. Of course if you force close the app and then run it again, there is no problem for that session too.

Yes, the latest daily builds definitely still have this problem.

Ben [import]uid: 28534 topic_id: 24187 reply_id: 113603[/import]

Update:

I was putting together a cut down version of our app to submit with the bug report and managed to see the bug happen without re-running the app. So I guess that is not the only way to manifest the bug. But I guess it is a quick way to see the bug.

Bug. [import]uid: 28534 topic_id: 24187 reply_id: 113850[/import]

Thanks for update, Ben.
If you will have any feedback from CoronaLabs about solving this bug - please post in this thread.
Thanks & Regards.
Honza [import]uid: 123209 topic_id: 24187 reply_id: 113874[/import]

This bug has now been logged as:
(Case 15389) Sprite image randomly missing. July 2, 2012.

No reply from ANSCA at this point.

So it seems this bug has now been logged at least 3 separate times now, 15389, 13733 & 12674, so hopefully we can get some action on it, because you simply can’t ship an app with sprites going missing on a bunch of devices.

Ben [import]uid: 28534 topic_id: 24187 reply_id: 114247[/import]

Honza… Is it possible to change the title of the thread?

The reason for asking is that I have seen this bug happen many times now, without the need to relaunch the app.

p.s. I like the way I inadvertently showed my salutation as Bug in post #7 above. Bugs must be really playing on my mind right now. :wink:

Ben [import]uid: 28534 topic_id: 24187 reply_id: 114372[/import]

Sure. You are right, Ben.
Hope that new title is now better describing the issue… [import]uid: 123209 topic_id: 24187 reply_id: 114394[/import]

Update:
I received a response from ANSCA just saying that they could not replicate the problem as the project was incomplete. I think there may have been a problem with their bug system perhaps not allowing the upload or something, because the test project certainly works here on a number of devices that I tested on before uploading the zip file.

Anyway, at least it has made it that far.

Ben [import]uid: 28534 topic_id: 24187 reply_id: 114404[/import]

Update:
I have now been told that ANSCA will not look at the cut down sample we sent. They insist on something very simple to replicate the problem. ARRRRRRG.

This seems like standard support fare I guess, as they want us to eliminate the chance of it being our own bug… But this is a problem with the same APK showing very different and buggy behaviour on some devices and running fine on others. That would seem to be a lower level issue rather than an lua code issue of our own doing because we really should not even be capable of showing different behaviour on different devices. Well not without devices checking and casing to do so anyway. Hardly an accidental thing.

So now we are supposed to find time to try and create a very simple sample that will show the problem. In the end it may be a complex sample as it may be a complex set of circumstances that invoke the bug.

Anyway, sorry, but no joy at this stage.

Ben [import]uid: 28534 topic_id: 24187 reply_id: 114888[/import]

hi,

I’d just like to confirm that this IS an outstanding bug, even on the most recent daily build. The issue appears for me on an HTC Incredible device.

Darren [import]uid: 94684 topic_id: 24187 reply_id: 119678[/import]

Hi everybody,

I’m also confirming this bug on Motorola Atrix and Motorola RAZR devices. This is a serious bug. Hey, ANSCA people, staffs, help us!!! I’m losing users!! [import]uid: 143834 topic_id: 24187 reply_id: 119706[/import]

If it helps, this bug happens not only when I relanch the app, but when I load any of my spritesheets for the second time. So, if I release memory, unloading spritesheets that are not in use, when I load them back, blank squares are shown.

Guilherme. [import]uid: 143834 topic_id: 24187 reply_id: 119707[/import]

We are still working on isolating this Corona bug because ANSCA refuses to look at the bug until they can be given a very small exact instance of what produces the bug.

Things that seem to be obvious to us:

  1. It must be a Corona bug as it manifest as different behaviour on different devices using the same code. I.e works fine on some devices and not on others.
  2. It happens every time the app is run.
  3. The behaviour is random in that it replaces different things each time.
  4. It is not limited to sprites. In fact it seems to be objects that are replaced with blanks squares. This means it can be an image, sprite or text object.
  5. if you push the app to the background using the standard Android home button and then return to the app, the objects that were missing will now be ok, but other objects during this same app session will go missing randomly.
  6. We are having quite bad sound issues on the same devices that exhibit this bug, but not sure if it is related. Would be happy hear from others on this sound issue.

Ben
[import]uid: 28534 topic_id: 24187 reply_id: 119830[/import]

Everyone,

We have recently discovered an OpenGL driver bug that is common on many HTC devices that can cause the blank images that you are referring to. This explains why this issue only occurs on particular Android devices. Even then, it took very particular circumstances to trigger this issue, making it difficult to isolate and reproduce. That is why it took us so long to resolve this issue.

The next daily build, #882, will work-around this OpenGL driver bug. If you can let us know if this daily build fixes this issue for you, then that would be much appreciated. Thanks! [import]uid: 32256 topic_id: 24187 reply_id: 120373[/import]

That’s good news Joshua.

I have tested a #882 based build on the problem devices that we have:
Nexus One - Tested OK now.
HTC Desire HD - Tested OK now.
HTC Evo 4G - Tested OK now.
Dell Streak - Tested OK now.

So I would say that has fixed this problem, thanks. Which also covers case #15389, but that was not listed in the cases affected on the daily build notes.

Now to find out why sound is really bad and breaking up all the time on these same devices.

Ben [import]uid: 28534 topic_id: 24187 reply_id: 120401[/import]