What this time?

Continuing to share some weirdness I stumbled upon lately with Flash. This time it is about two weird things with Firefox and wmode again. Whole combination actually  is Firefox + wmode + spike in CPU usage = weird rendering issues + fullscreen not turning on properly.

I encountered it few times, it was not frequent and I could not reproduce, so I did not pay attention. But with some projects lately it become frequent.

Example

Steps to reproduce:

  1. Click on “More” until number raises to at least 60ms, though it may different depending on computer or Flash version. I can reproduce it at weaker notebook with Flash 10 but not at home desktop with Flash 10.1
  2. Try turning fullscreen on, at this stage Flash should turn fullscreen on but will not render anything, it will be transparent on fullscreen… Click not working on anything and all, as if computer hanged.
  3. Hit Esc button to exit fullscreen and notice a weird thing. Now Flash renders only when you move mouse…

So here they are. Two problems that arise with wmode+firefox+laggs. Interesting thing is that if you drop CPU usage back it will start rendering normally again and fullscreen will turn on normally. Also here we go to big extents to simulate it as 60ms+ per frame with 3oFps target means you use 2x more time to calculate frames then you have. But in reality I seen this happening in projects where average CPU usage is smaller. So my guess is that it is enough to have a spike in CPU usage to sometimes tiger this problem. Also turning on fullscreen creates those spikes even in projects that don’t use resources much. Though there are also intensive projects that don’t trigger it and I guess there is no way to properly narrow it down to some things you should be careful around in Flash.

As I mentioned though it is harder to reproduce it at some computer. May be it has to do with Flash 10.1 improvements. Will try to test it later by installing 10.1 on notebook.

Code

Also here is code for above example.

Conclusion

If you have application that for whatever the reasons should work in wmode set to transparent|opaque + you have fullscreen + it uses CPU constantly know that your visitors that use Firefox may experience that kind of issues.

Solution

At the moment I don’t have any perfect one. One thing I do try is to turn off everything I can for few frames before going fullscreen and after it so that spike of resizing and all will be smaller and distributed over longer period of time. Also trying to drop CPU usage for small period of time could also help to reverse rendering bug, only problem is that it is impossible to detect that such rendering problem happens to try and react to it.

May be someone has some ideas|insights to share?