Nw.js: NW.js [0.14.0rc1 - v0.19.0] Critical Screen Flickering Bug

Created on 15 Nov 2016  Â·  21Comments  Â·  Source: nwjs/nw.js

General Information:

  • Using NWjs version 0.14.x and higher
  • Windows 7; Windows 8+; Windows 10, all with latest drivers
  • GPU's affected: _AMD_, _Intel_ and _Nvidia_
  • Package.nw file to reproduce the bug (package.zip)
  • _Youtube_ Video (Click Here)
  • _Construct 2_ Forum Bug Report (including response from the developer found on page 2)

Problem Description:
When I'm trying to run a packaged _Construct 2_ game (HTML5) in fullscreen mode, there is a chance that the window flickers, mostly in an unpredictable random pattern.

Observed Result:
All NWjs releases mentioned above seem to have this issue and multiple tests to reproduce this bug were successful using the attached package.nw file. Some setups which used Win7 or Win8 did remain unaffected.
Our tests also came to the result that the playback of audio seems to affect and trigger this bug on the majority of the tested setups.

Expected Result:
NWjs should run fine without any screen flickering in fullscreen mode.

Steps To Reproduce Bug:

  1. Run the package.nw file using one of the NWjs versions mentioned above
  2. Notice the game going fullscreen and playing back an audio file (0.5sec. loop)
  3. Notice the bug occurring in a random pattern, mostly when the audio stops

Additional Information:
Members of the C2 community are still actively trying to figure out a reliable way to reproduce this bug.
There have been speculations that C2's audio plugin might be at fault, however the developer behind the software didn't provide a clear statement about that yet.

Most helpful comment

All 21 comments

I could reproduce this on Windows 10 with an nVidia GTX 1070, but it's sporadic and hard to get to reproduce reliably.

I doubt that audio has anything to do with it specifically, I would guess it is some kind of threading race condition and in some cases another thread (e.g. audio processing thread) can steal enough time to make the rendering skip a frame.

Chrome is not affected however, so this appears to be an issue specific to NW.js's particular implementation of fullscreen.

Adding --disable-gpu to chromium-args fixes the flickering issue, but significally reduces the overall performance of the app and brings graphic issues with blend modes. So this can't be a final solution, but hopefully it's some hint for you.

Just to be more precise. The last not affected version is 0.13.4 and the first affected version is 0.14.0-rc1.

Do we have a version that runs well in Chromium browser so I can make comparison?

Here is a pure HTML version, tested on many browsers including Chromium: http://flickbug.wtfgamesgroup.com

Here's the full source: flickeringBugHtmlVersion.zip

Is it related to the audio. If you remove audio playing from the case, does it reproduce? And how would I remove it from here?

It does not reproduce if you remove audio
Still @AshleyScirra says

I doubt that audio has anything to do with it specifically.

So maybe there is also another way to reproduce it, but I haven't found it yet.

This example actually does nothing besides playing audio. I can give you a source of version without an Audio plugin, but it will be just an idle background image.

I tried to wrap the HTML sources flickeringBugHtmlVersion.zip into a Chrome app, but it fails to start with a black window. Could you please fix this? @TobyReeno @AshleyScirra

I unzip it; added the following 2 files to the directory and then click "Extensions"->"load unpacked extensions" in Chrome.

manifest.json:
{ "manifest_version": 2, "name": "Window State Sample", "version": "4.2", "app": { "background": { "scripts": ["background.js"] } }, "permissions": ["fullscreen", "alwaysOnTopWindows", "http://flickbug.wtfgamesgroup.com/"] }
background.js
chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('index.html', { id: "mainwin", state: 'fullscreen', innerBounds: { width: 700, height: 600 } }); });

Making it a chrome app rules out differences between the window in NW.js and the window in Chrome browser.

@rogerwang Using the chromewebapp exporter that comes with C2 is also leading to the same result.
Might have to do something with the recently added service workers feature @AshleyScirra ?

Not sure if this will help but here is C2's exported version of a chromewebapp with offline support.
Critical NW.js Screen Flickering Bug.zip (_Press "F9" to go into fullscreen._)

So this is an upstream issue. Please report to https://bugs.chromium.org/p/chromium/issues/list as well. In the meantime I'll see what I can do in NW.

@rogerwang I think there was a misunderstanding, I didn't mean to confirm that the flickering bug is also occuring using Chrome. What I meant was that I cannot run the chromewebapp in offline mode at all, just like you couldn't.

I tried to wrap the HTML sources flickeringBugHtmlVersion.zip into a Chrome app, but it fails to start with a black window.

Either way it's a good thing to report it to the chromium bugs thread as well, thanks a lot!

I confirmed that the Chrome app flickers in Chrome browser as well.

On Tue, Nov 22, 2016, 9:14 PM TheRealDannyyy [email protected]
wrote:

@rogerwang https://github.com/rogerwang I think there was a
misunderstanding, I didn't mean to confirm that the flickering bug is also
occuring on Chrome. What I meant was that I cannot run the chromewebapp in
offline mode at all, just like you couldn't.

Either way it's a good thing to report it to the chromium bugs thread as
well, thanks a lot!

—
You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/nwjs/nw.js/issues/5477#issuecomment-262237156, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAKGGf_gj9EN5u5AePAbykKcx2P8V_kwks5rAuqqgaJpZM4KyAff
.

The Chrome app export worked fine for me (just 'Load unpacked extension' from chrome://extensions and click Launch), but I only observed a single flicker. It's sporadic and hard to reproduce so I didn't see any more flickers, but I assume that confirms it's a Chrome app/extension issue.

@rogerwang Alright, sorry I got a little confused there. Thanks for confirming the bug and looking forward to future progress from your side as well.

@AshleyScirra Thanks that did the trick for me and thanks for the doing the reporting work.

As always, it's running fine on my end without a single flicker.
Here are some specs from someone who doesn't experience this at all, might be helpful. (DxDiag.txt)

I cherry-picked the upstream fix in the 0.19 branch. This is fixed in git and will be available in the next nightly build.

Great, thanks Roger. I guess this missed 0.19? I guess it should make 0.19.1?

chromium team said they are working to fix the issue too.
https://bugs.chromium.org/p/chromium/issues/detail?id=667731

Sounds good, thanks again to everybody that participated in this report.

That's right.

On Fri, Dec 2, 2016, 6:25 PM Ashley (Scirra) notifications@github.com
wrote:

Great, thanks Roger. I guess this missed 0.19? I guess it should make
0.19.1?

—
You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub
https://github.com/nwjs/nw.js/issues/5477#issuecomment-264422378, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAKGGdLfs7sJ9PDxWAn6mtVEMVa0UXdKks5rD_IygaJpZM4KyAff
.

Yeah and that's where I cherry-pick the commit.

A work around for the previous versions is disabling direct composition
using the command line argument mentioned in the issue.

On Fri, Dec 2, 2016, 6:29 PM kailniris notifications@github.com wrote:

chromium team said they are working to fix the issue too.
https://bugs.chromium.org/p/chromium/issues/detail?id=667731

—
You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub
https://github.com/nwjs/nw.js/issues/5477#issuecomment-264423085, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAKGGRJxGRmVh9E89x7SiDcslfAD_XBzks5rD_MOgaJpZM4KyAff
.

Was this page helpful?
0 / 5 - 0 ratings