Short black screen after Default.png

I’d just like to throw my hat in the ring here. I’m noticing the G2.0 black flash issue on the app I’m working on. If I understood Tom’s most recent post, there have been two different “black screen” issues: one that was fixed in 2155 (where the amount of time the black screen was shown was based on what was loading in main.lua) and one introduced with Graphics 2.0. I have not experienced the longer black screen issue, but I’ve had the “black flash” issue ever since I converted over to G2.0. I just downloaded 2189 (latest public build) today and was disappointed to find that the black flash issue has not been resolved. I’m testing on an iPhone 5 and an iPad 4, both running iOS 7.1.

Any ETA on a fix for this? It’s a show-stopper for me. Until it’s fixed in a public release I can’t release an update for the app I’m working on (I don’t currently have access to daily builds).

I just built an app with a solid white Default-568h@2x.png and a solid red rectangle as a full screen background a few lines from the top of my main.lua.  There is no perceptible black screen on my iPhone 5.  This is with 2189. Older, slower devices might have a perceptable flash.

Even with a black flash, why is this a show stopper?    It might be ugly.  It might be annoying.  It doesn’t prevent your app from working and it’s only on the initial start up and it’s only on older devices.

Rob

I don’t think it is a matter of works or not, but it is a matter of quality. The black flash is really amateur and I refuse to publish an app like that.

Based on Tom response, and after being ignored after my direct question if Corona would fix it or not, I understood that Corona would not fix it so I decided to find a way to solve it myself.

In my case, I changed my splash screen to have a black background and with my logo in the middle, so the black flash kind of became a transition thing and solves my problem.

But recently I found out probably a better way to deal with it. That is to have a loading scene and don’t do anything inside the main.lua (Rob, correct me if I am wrong, but it appears that default splash file is only showed while main.lua is being executed) besides moving the user to your loading scene or other code that needs to be in main. Then in your loading scene you can show your splash screen image.

I did not tried that but that should work. In summary:

  1. Use a black image as splash default image

  2. Create a loading composer/storyboard scene what will show your splash screen image and also do all game loading

  3. Keep the main.lua minimum, only executing there code that needs to be in the main and then redirect the user to your loading scene.

That approach is based on Joshua post here (http://forums.coronalabs.com/topic/34656-splash-screen-transition-not-smooth/)

I believe that we start drawing right away.  But if there isn’t anything to draw…

@Rob  You are correct that apps will still function. And you are also correct that the black flash is ugly and annoying. From a quality standpoint, I’m just not that excited about releasing a version that exhibits the black flash. Don’t get me wrong, G2.0 is a huge step forward, and is fantastic (I’ve fully converted my app to G2.0 for the next update). I’m just hoping that you guys will be able to determine what’s causing this issue and find a fix for it. I appreciate you guys looking at this.

@Renato  Thank you for those suggestions. I would like to avoid using a black “Default” if possible, since everything’s working correctly on the current version of my app (built with a G1.0 release), but it was interesting to read that response from Joshua.

My main.lua is fairly lightweight. I’m using a Default image that is near white and I load my own identical splash screen the very first line of main.lua. My splash screen is held in place for a few seconds and then disappears. I may try moving some code around to see what happens if my main.lua is ultra lightweight, but even if that works I’m nervous that older devices might still see a flash (the oldest Apple device I have to test with is an iPhone 4).

Here are some facts that might help understand what is going on. On iOS the Default.png (splash screen) is loaded by the OS when the app is loaded. The splash screen stays up until the main.lua starts running. After the main.lua executes, the screen is rendered with the display objects created in main.lua. The “black screen” will occur between the time the main.lua starts running and when it finishes and the rendering begins. The length of time the screen is “black” depends on two things: 1) The time it takes to run main.lua and, 2) the speed of the device. For #1, the time depends on what’s occurring in your main.lua code. If you are creating lots of objects and loading large images, it will lengthen the time the screen appears black. For #2, older (slower) devices will take longer to execute the main.lua code and show the black screen for a longer period of time than newer devices.

The key is to make the inline code in main.lua as fast as possible. You can then load the rest of the assets using functions called with timer.performWithDelay.

As a side note, the reason G2.0 shows this problem when G1.0 didn’t (at least not as much on slower devices), is because we are now waiting for the OS to signal when when we can render the screen. In G1.0 we were not correctly waiting (which could have caused other issues).

Telling us to lean out our main.lua and that G1 actually had it wrong and G2 now has it fixed etc etc is really not helping.

A solution could be to somehow delay the unloading of Default.png until the OS signals that you can render the next screen. I am sure with all the clever people onboard you can find the solution to this issue.

Can Corona Labs kindly try to be the solution company rather than the workaround company? Can’t you at least try?

Thank you. 

I can appreciate everybody’s frustration, but I don’t think CoronaLabs can do anything about “holding on” to Default.png as it’s handled internally by the OS.

I can confirm though, by keeping the main.lua lean-and-mean that this isn’t much of an issue for all but the slowest devices (think iPhone 3GS). Even with those I’ve only noticed a split-second flash which is barely noticeable.

@Tom Thank you very much for the detailed information about what is causing this issue.

After much testing this evening, this is what I’ve found. In main.lua, if I load only the splash screen display object, center it, and hide the status bar, then load the rest of main.lua with a delay, there is no black flash on my iPhone 5. On my iPad 4, there is a very brief flash the first time the app runs, and sometimes thereafter (not always). On my iPhone 4, the black flash occurs nearly every time. Splash screen to main menu timing is the same for me, even with the delay. Before, I was waiting 2 seconds before going to the main menu of the app. Now I’m waiting 1 second to initialize most of main.lua, then another 1 second before going to the main menu of the app. So my delay that initializes most of main.lua is 1000 milliseconds. I played around with 1, 20, 100, 500, and 1000 and settled on 1000, which seemed to give the best results (I think 500 was ok as well). I found that if you don’t delay long enough, the black flashes still occur, even on newer devices.

While the fastest devices seem ok with this workaround, it still bothers me that slightly older devices are not. I’m not sure what’s possible in regard to going back to the way G1 initialized the screen, but at this point I’d rather see G2 go back to initializing the way G1 did. Tom, you mentioned that “in G1.0 we were not correctly waiting (which could have caused other issues).” My question is, did you guys ever see any bugs or issues with not waiting to get the signal from the OS? In other words, did changing to the new G2 method fix any known or reported bugs? It seems to me that you’d want to render the screen behind the “Default” image ASAP so it’s ready and waiting, and not wait for a “signal” from the OS.

So just to be clear.  Who ever made the comment about a quality presentation has hit the nail on the head.

I want my game to have a dramatic fade in not a stutter to pop in.

This was not an issue a few months/builds ago therefore something was changed that broke this.

I did skinny my main.lua down to loading the splash screen first thing and I still get a black screen with a green cursor up in the right hand corner.

I am only building for the Ipad.  I am testing on an Ipad 3.

I’m really concerned that the Corona folks seems to think this accetpable.  This worked before.  Please fix it.

Regards,

Arthur

@aaroberts

I agree what you describe does sound unacceptable, and I think that the guys at CoronaLabs would also agree.

I have a number of projects and none of them exhibit what you’re describing with a black screen/green cursor, so unfortunately it seems to be unique to your particular project.

The bottom line is that for CoronaLabs to be able to fix it, they need to be able to reproduce the problem.

Hi,

Ingemar.  The cursor part is different, but the black screen is not.  I think at least a dozen people have reported it. 

Usually I can work around this stuff.  This one I can not.

Regards,

Arthur

Hi Tom.

Glad that you were able to reproduce it. I just didn’t get what is the Corona position about the bug.

Will Corona fix it or not?

Thanks,

Renato

Few versions back I used to see the green thing once in a while in the upper right corner, haven’t seen it in a while though. No idea what that was.

This “green thing” in the top right hand corner you are all talking about…

For me that was the status bar icon for how much battery you have left. Would be red if your battery was low.  =)

Even though I had display.hiddenStatusBar code, the status bar would show with the black screen for that instant.

As I said before, for me this issue was fixed by using build 2109.

It does appear that the green thing is the battery indicator seeping through the Default.png. I see it on 2189.

So this is what we get for $600 per year, surely there is a solution for this ? it shouldn’t take the community to beg for one either.

Edit: This bug just started happening on my Iphone 4 Ios 7.1, I created a test version of main.lua with only the following code:

[lua]

display.setStatusBar( display.HiddenStatusBar )

display.setDefault( “background”, 247, 247, 247 )

[/lua]

and only Default.png images included in folder when compiling, this bug/problem still exists as before with no change in speed regarding the length of the black flash or any other differences.

Corona labs are/will you be fixing this bug/quality issue with your framework?

Regards

+1 +1 +1 +1 +1 +1 +1

Corona Staff,

We are still waiting for a resolution to this issue.

As we have all posted earlier and Tom has noted this black screen issue was not evident with older builds.  Tom made the statement:

As a side note, the reason G2.0 shows this problem when G1.0 didn’t (at least not as much on slower devices), is because we are now waiting for the OS to signal when when we can render the screen. In G1.0 we were not correctly waiting (which could have caused other issues).

Well… maybe you should stop waiting for the OS signal because it’s screwing up our applications.

Can you please give us some kind of acknowledgment that you are going to fix this issue and possibly and ETA as to when it will be fixed.

Arthur

I understand where you all are coming from. Definitely being able to create an impression of a quality app is important. 

Let me just summarize what we know and we’ve done so far.

First, we did have a serious regression issue in Graphics 2.0, causing a 2-3 second delay black screen issue. This regression existed in daily builds 2119 through 2154. It has been fixed starting in 2155. 

(Thanks to Ingemar and Naomi for submitting bugs and providing reproducible test projects in cases 30332 and 30361!)

Second, there is another black screen that seems intermittent and seems to be project-specific. 

It took awhile for us to identify a pattern. The pattern is around older (slower) devices like the initial retina iPhone4. In particular, having a lot of activity in the initial main.lua seems to make the delay much more apparent.

For this intermittent issue, I’ve done a deep dive with a colleague, and here’s what we have found:

  1. This seems to be related to our use of GLKit. We used this built-in iOS library starting in Graphics 2.0, per Apple’s recommendation. It’s the preferred way in iOS for handling OpenGL-ES. Unfortunately, this library seems to have timing delays between application start and when GLKit renders on the initial screen. 

  2. Apple does not allow you to extend the lifetime of the launch image. The launch image disappears when iOS wants it to. As explained in Human Interface Guidelines, Apple states:

Supply a plain launch image that improves the user experience. In particular, the launch image isn’t an opportunity to provide:

An “app entry experience,” such as a splash screen

An About window

Branding elements, unless they are a static part of your app’s first screen

Because users are likely to switch among apps frequently, you should make every effort to cut launch time to a minimum, and you should design a launch image that downplays the experience rather than drawing attention to it.

 

Apple enforces this policy by deliberately NOT providing an official way in the iOS API to extend the time that a launch image appears. 

Translating this to what this means to you as Corona developers, it is always good practice to minimize what happens in main.lua.

  1. We believe we have found a way to improve the intermittent black screen issue, at least we are no longer seeing the issue in the test cases we have. For those of you still experiencing issues, you can give this a shot in the next daily build (2221 or after).

Now, I do want to set expectations here. As you can see from above, we’re fighting an uphill battle against Apple’s stated policies, so keep in mind, there will be some issues where you may have to make changes to your code to minimize launch time, as Apple is pushing everyone to do.