Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NW.js [0.14.0rc1 - v0.19.0] Critical Screen Flickering Bug #5477

Closed
TheRealDannyyy opened this issue Nov 15, 2016 · 21 comments
Closed

NW.js [0.14.0rc1 - v0.19.0] Critical Screen Flickering Bug #5477

TheRealDannyyy opened this issue Nov 15, 2016 · 21 comments
Assignees

Comments

@TheRealDannyyy
Copy link

TheRealDannyyy commented Nov 15, 2016

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.

@AshleyScirra
Copy link

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.

@TobyReeno
Copy link

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.

@TobyReeno
Copy link

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

@rogerwang rogerwang self-assigned this Nov 21, 2016
@rogerwang
Copy link
Member

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

@TobyReeno
Copy link

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

Here's the full source: flickeringBugHtmlVersion.zip

@rogerwang
Copy link
Member

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?

@TobyReeno
Copy link

TobyReeno commented Nov 21, 2016

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.

@rogerwang
Copy link
Member

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:https://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.

@TheRealDannyyy
Copy link
Author

@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.)

@rogerwang
Copy link
Member

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.

@AshleyScirra
Copy link

Filed: https://bugs.chromium.org/p/chromium/issues/detail?id=667731

@TheRealDannyyy
Copy link
Author

TheRealDannyyy commented Nov 22, 2016

@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!

@rogerwang
Copy link
Member

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
#5477 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAKGGf_gj9EN5u5AePAbykKcx2P8V_kwks5rAuqqgaJpZM4KyAff
.

@AshleyScirra
Copy link

The Chrome app export worked fine for me (just 'Load unpacked extension' from chrome:https://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.

@TheRealDannyyy
Copy link
Author

TheRealDannyyy commented Nov 22, 2016

@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)

@rogerwang
Copy link
Member

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.

@AshleyScirra
Copy link

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

@kailniris
Copy link

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

@TheRealDannyyy
Copy link
Author

TheRealDannyyy commented Dec 2, 2016

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

@rogerwang
Copy link
Member

rogerwang commented Dec 2, 2016 via email

@rogerwang
Copy link
Member

rogerwang commented Dec 2, 2016 via email

@TheRealDannyyy TheRealDannyyy changed the title [v0.14.x & Higher] Critical NW.js Screen Flickering Bug NW.js [0.14.0rc1 - v0.19.0] Critical Screen Flickering Bug Sep 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants