8000 The Gio rewrite doesn't display anything in Chrome · Issue #1 · theclapp/go-life · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

The Gio rewrite doesn't display anything in Chrome #1

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

Open
xparq opened this issue Dec 15, 2016 · 28 comments
Open

The Gio rewrite doesn't display anything in Chrome #1

xparq opened this issue Dec 15, 2016 · 28 comments

Comments

@xparq
Copy link
xparq commented Dec 15, 2016

[UPDATE: The issue's subject has changed, and it's no longer about the problem described right below. See the other comments for the actual topic (which is what the new Issue title indicates)!]

I just tried toying a bit with your nice & interesting experiment, but unfortunately I'm neither a Go nor a JS programmer, so can't quite tell immediately from the code: should the auto-update actually work?

It gets stuck like:

event is refresh({"delay":198.500000,"stop":0})
event recieved for req 0x119589a0, pageId 4; event is refresh({"delay":198.500000,"stop":0})
Updates finished for req 0x119589a0, pageId 4
starting Updates, pageId is 4, req is 0x11958a80
exit status 2

Manual page refresh works fine. (The last log line above is just a Ctrl-C after waiting a while.)

Thanks & all the best!

@theclapp
Copy link
Owner
theclapp commented Aug 8, 2019

I completely rewrote it using Gio. Give it another shot. Thanks for trying it.

(Sorry for the ridiculously long response time. Once again I'm reminded that even if you own a project, you still have to "follow" it to get notifications about issues, etc. Again, my apologies.)

If you want to try it right in your browser, check the readme for the hotkeys, and visit http://theclapp.github.io/go-life/www/.

@xparq
Copy link
Author
xparq commented Aug 9, 2019

Hey, no worries/apologies, you can't imagine how grateful I am for your 2-3-year response time! It's so reassuring that it's not just me! :)

I get a blank white image (not just an empty HTML, if it matters) in my Chrome for the link, BTW.

@theclapp
Copy link
Owner
theclapp commented Aug 9, 2019

Hey, no worries/apologies, you can't imagine how grateful I am for your 2-3-year response time! It's so reassuring that it's not just me! :)

:)

I get a blank white image in my Chrome for the link, BTW.

:( Bummer. For me it "just works" in macOS Chrome, Safari, and Firefox, and also iOS Chrome & Safari.

Random things to check:

  • Are you on latest Chrome?
  • Do you somehow have webassembly / wasm disabled? Go to chrome://flags/ (you'll have to type it into the address bar yourself; Chrome doesn't let random Internet sites link you to it, as a security measure) and search for "webassembly" and see if anything's disabled. On my end, Chrome Version 76.0.3809.87 (Official Build) (64-bit), everything is "default".
  • It is a ~4mb webassembly download -- did you give it enough time to download? (Admittedly grasping at straws, there. :)
  • Do you see anything in the JS console? (On a Mac, View->Developer->Javascript Console.)
  • Or take a look at the network panel (you probably need to reload after opening the console to see anything in the network panel) -- has everything downloaded, are there any errors, etc?
  • Are you behind a firewall or have other plugins installed that might block webassemby downloads or execution?

Thanks for trying it! The app, Gio itself (the GUI toolkit I'm using), and even webassembly in Go are all still pretty experimental, so pretty much anything at any point in the chain might've gone wrong. (I mean, it was probably my code, but you never know.)

@xparq
Copy link
Author
xparq commented Aug 9, 2019

I get a blank white image in my Chrome for the link, BTW.

:( Bummer. For me it "just works" in macOS Chrome, Safari, and Firefox, and also iOS Chrome & Safari.

  • Are you on latest Chrome?

Google Chrome is up to date
Version 76.0.3809.100 (Official Build) (64-bit)

  • Do you somehow have webassembly / wasm disabled? Go to chrome://flags/ (you'll have to type it into the address bar yourself; Chrome doesn't let random Internet sites link you to it, as a security measure) and search for "webassembly" and see if anything's disabled. On my end, Chrome Version 76.0.3809.87 (Official Build) (64-bit), everything is "default".

Same here. (I even played with WASM a week ago or so. BTW, did you notice that there's no trivial place to go for an instant browser checkup? Googling for e.g. "webassembly browser test" yields only implementation tidbits, not a single page I could open and freak out if I have it disabled etc. Most shamefully of all, webassembly.org itself doesn't seem to offer one, either... Or am I just grossly missing something obvious here? Like, accidentally woke up into this subtly different, neighboring alternative universe somehow?... ;-o )

  • It is a ~4mb webassembly download -- did you give it enough time to download? (Admittedly grasping at straws, there. :)

Hey, I immediately thought this one was quite a good straw, actually: my net is total crap, and I'm impatient AF... :) But, alas, nope: this doesn't seem to be the culprit.

  • Do you see anything in the JS console? (On a Mac, View->Developer->Javascript Console.)

Oh yes, indeed! :-o Your favicon is missing... OK, but seriously, nothing. Clean as a baby's ass in a TV commercial.

  • Or take a look at the network panel (you probably need to reload after opening the console to see anything in the network panel) -- has everything downloaded, are there any errors, etc?

I've got the index, and wasm_exe.js, and I suppose this should just work there in the page:

if (!WebAssembly.instantiateStreaming) { // polyfill
	WebAssembly.instantiateStreaming = async (resp, importObject) => {
		const source = await (await resp).arrayBuffer();
		return await WebAssembly.instantiate(source, importObject);
	};
}
const go = new Go();
WebAssembly.instantiateStreaming(fetch("main.wasm"), go.importObject).then((result) => {
	go.run(result.instance);
});
  • Are you behind a firewall or have other plugins installed that might block webassemby downloads or execution?

Nope.

Thanks for trying it! The app, Gio itself (the GUI toolkit I'm using), and even webassembly in Go are all still pretty experimental, so pretty much anything at any point in the chain might've gone wrong. (I mean, it was probably my code, but you never know.)

If you add some alerts or some console logs to the error cases, I'll gladly hit a Refresh on the URL. :)

(BTW, another dev. here, so no need to go that deep with the meticulously detailed instructions, which were amazingly thorough, BTW, nice job! :) )

@theclapp
Copy link
Owner
theclapp commented Aug 9, 2019

BTW, did you notice that there's no trivial place to go for an instant browser checkup?

Yes! It was annoying.

I've got the index, and wasm_exe.js, and I suppose this should just work there in the page:

Hmm. But do you actually see main.wasm in the network tab?

image

If you add some alerts or some console logs to the error cases, I'll gladly hit a Retry on the URL. :)

All my code runs in the wasm bits. I tend to think if you got any of it, you'd get all of it. I suppose I could add some kind of else to that then((result) ... bit. If you know how to do that, give it a shot; otherwise I'll take a look later.

(BTW, another dev. here, so no need to go that deep with the meticulously detailed instructions, which were amazingly thorough, BTW, nice job! :) )

Well, in your initial ticket (... going on three years ago) you said otherwise, so I went with that on the theory it was safest. Glad you liked 'em, even if they weren't necessary.

@xparq
Copy link
Author
xparq commented Aug 9, 2019

Hmm. But do you actually see main.wasm in the network tab?

Yes:

image

@xparq
Copy link
Author
xparq commented Aug 9, 2019

BTW, this demo of the Magnum Framework runs here fine: https://magnum.graphics/showcase/bullet/
But this thing, again, apparently does nothing: http://enjoytools.net/wasm/
[UPDATE: it does emit the "Hello, WebAssembly!" message, after all, I just missed it initially!]

Wait, just a thought: I only have WebGL1 here!
(Also, I had accelerated 2D enabled, which I have never confirmed actually working, but relaunching Chrome after disabling it made no difference.)

@theclapp
Copy link
Owner
theclapp commented Aug 9, 2019

Yeah, the 4mb was from the raw space on disk, before I looked at the Chrome console.

BTW, this demo of the Magnum Framework runs here fine: https://magnum.graphics/showcase/bullet/

That's a cool demo!

But this thing, again, apparently does nothing: http://enjoytools.net/wasm/

Hmmmm. Curious. It turns out that that one's a from a Go 1.11.1 demo. Check the JS console. After clicking the "run" button I got this:

Console was cleared
Hello, WebAssembly!

In the Network tab for that page, if I click the "test.wasm" line, and the "response" sub-tab, it specifically mentions Go 1.11.1.

image

... Just saw your update about WebGL1. I guess that could be a problem? I'm not sure. The Gio webpage mentions WebGL but not a specific version.

This page says I can do v1 & v2. So maybe you need v2?

Edit: That'd be weird if this problem was actually hardware / driver.

@theclapp
Copy link
Owner
theclapp commented Aug 9, 2019

Hey, @eliasnaur can you weigh in at all here?

@xparq
Copy link
Author
xparq commented Aug 9, 2019

Yeah, the 4mb was from the raw space on disk, before I looked at the Chrome console.

(Ah, yes, realized it a minute later, and removed that part of my comment.)

BTW, this demo of the Magnum Framework runs here fine: https://magnum.graphics/showcase/bullet/

That's a cool demo!

It sure is! Did you see the original Unreal Tournament intro, circulating somewhere online? It works better than it did on my PC at the time! :) Amazing, how far this has gone.

But this thing, again, apparently does nothing: http://enjoytools.net/wasm/

Hmmmm. Curious. It turns out that that one's a from a Go 1.11.1 demo. Check the JS console. After clicking the "run" button I got this:

Console was cleared
Hello, WebAssembly!

Ah, thanks... So, your didactic instructions are still not all wasted then! 👍 :)
(I didn't immediately see it in the JS console, or I must have automatically switched to the error view, before noticing the message, dunno. And I think I've never explicitly opened the "User messages" category before, so didn't go and check it now either.)

But then, with that knowledge I looked harder for the go-life wasm, and seen these, FWIW:

image

@eliasnaur
Copy link
Contributor

It looks like something is running, but there is just no graphical output. Perhaps you could verify that by outputting something when receiving pointer events.

It's probably a driver or WebGL 1 problem, although Gio does runs in Safari where WebGL 2 is not supported.

@theclapp
Copy link
Owner
theclapp commented Aug 9, 2019

So the wasm code is definitely downloading and running, it's just not displaying anything for some reason. And yet your log shows things like requestAnimationFrame and setTimeout and so on, so it sure looks like it thinks it's displaying something.

The displayed text is fairly small. If you're on a 4k monitor, for example, it might be all but invisible. And the cells are in bright green on a white background ... um ... any chance you're color-blind? (I mean, talk about grasping at straws ... :). Or have your display set in such a way that that color scheme just wouldn't show up? ("Night mode"???) (Though I wouldn't expect an HTML canvas to care about that; I can tell you my code certainly has no allowance for that.)

@theclapp
Copy link
Owner
theclapp commented Aug 9, 2019

@lunakid Can you try in a different browser / your phone?

I tried again in Safari, and can confirm that Safari doesn't do WebGL v2 (according to https://webglreport.com/ linked above), but this app chugs right along.

@eliasnaur Thanks for taking a look!

@xparq
Copy link
Author
xparq commented Aug 9, 2019

@lunakid Can you try in a different browser / your phone?

Now, that's a black-belt move, indeed! :) Firefox works just fine! 👍

(Let me know if you want to continue debugging the Chrome issue.)

@xparq
Copy link
Author
xparq commented Aug 9, 2019

Shall we rename the issue, BTW? :) I don't even have the slightest idea now, what the original report was about...

@theclapp
Copy link
Owner
theclapp commented Aug 9, 2019

WooHoo!

How odd, though.

I think I'm willing to let this issue rest. :) Though @eliasnaur may want to keep it in mind as a data point; it's his library, I'm just a user. Thank you for the offer, though.

@theclapp theclapp changed the title Updates are stuck The Gio rewrite doesn't display anything Aug 9, 2019
@theclapp theclapp changed the title The Gio rewrite doesn't display anything The Gio rewrite doesn't display anything in Chrome Aug 9, 2019
@eliasnaur
Copy link
Contributor

If you can, please create an issue on https://todo.sr.ht/~eliasnaur/gio (or by sending an email to ~eliasnaur/gio@todo.sr.ht) with as much information about your system: Chrome version, Operating system and version, Video card etc.

Perhaps a dump of information from a site like https://webglreport.com/.

Thank you.

@xparq
Copy link
Author
xparq commented Aug 9, 2019

Sure. I'll just add the missing bits here (e.g. for the convenience of immediately uploading screenshots etc.), and link this issue over there.

Chrome (as said above): Version 76.0.3809.100 (Official Build) (64-bit)
(See logs, WebGL1 examples tested fine etc. above. Accelerated 2D canvas turned on/off didn't matter.)

Windows 7 Pro/64, with
ATI Mobility Radeon HD 3400, with the "switchable" driver:
image

WebGL report of the failing Chrome:
image

WebGL report of the working Firefox (notice the D11 here, vs D9 for Chrome, which is quite puzzling to me, especially that it is Firefox here, which e.g. can't even play YouTube videos at all, after an earlier upgrade... But maybe this difference is due to the fact that I've disabled "Accelerated 2D canvas" for Chrome for messing with this issue. I'm going to reenable it to see if it's related....... Nope, it isn't. Strange. Tried looking up if Chrome blacklists this ATI driver perhaps, but found nothing."):
image

@theclapp
Copy link
Owner
theclapp commented Aug 9, 2019

The same output for your Firefox might also be useful.

Here's my Chrome:

Chrome

@theclapp
Copy link
Owner
theclapp commented Aug 9, 2019

If you run into other WebGL issues (other than this one little demo :), this thread may be of some use:

https://www.minecraftforum.net/forums/archive/legacy-support/1755447-how-to-fix-opengl-problems-in-ati-drivers

Long story short:

For:

  • ATI Radeon HD 4xxx and ATI Radeon Mobility equivalent series of products (and many others)
  • Windows 7 64-bit Edition (and many others)

Install this driver: http://downloads.guru3d.com/ATI-Catalyst-10.7-Beta-Win-7-%7C-Vista--XP-(32%7C64-bit)-download-2594.html (or even something newer, but that's what the Minecraft Forum thread mentions success with)

(USE AT YOUR OWN RISK. I haven't tried it.)

@xparq
Copy link
Author
xparq commented Aug 9, 2019

Thanks, I'm aware of that, and would love to change drivers, but need to stick with the "switchable" one, for there are two video adapters in my machine, and having a separate Catalyst driver + a separate Intel driver was said to be a recipe for trouble (at least for this laptop), AFAICR.

(I'm pasting the Firefox GL report to that comment above, thanks for the tip!)

@eliasnaur
Copy link
Contributor

From your Chrome report it seems that the EXT_sRGB extension is missing, which would explain the blank screen.
@theclapp I pushed a change that checks that the required extensions are available. Can you please update your dependencies with

go get gioui.org/ui@2a0b0077da6f

and upload a new version? If my theory is right, @lunakid should then see an error in the console instead of a blank window. The program still won't run, but at least we'll have an explanation.

@eliasnaur
Copy link
Contributor

Btw, I'm quite impressed that Firefox manages to make it work on a 10 years old driver and gfx card :D

@theclapp
Copy link
Owner
theclapp commented Aug 9, 2019

I pushed a change that checks that the required extensions are available. Can you please update your dependencies with go get gioui.org/ui@2a0b0077da6f and upload a new version?

Neat. Done. (Well, I realize now I updated the wasm but not the go.mod, but for now that's good enough.) Hope it works! Thanks!

@eliasnaur
Copy link
Contributor

@lunakid can you confirm that the updated version prints out an error about EXT_sRGB not supported on your chrome?

@theclapp
Copy link
Owner

@lunakid can you confirm that the updated version prints out an error about EXT_sRGB not supported on your chrome?

Sorry, I should've mentioned: It probably doesn't. It's not working on my Windows vm either.

@theclapp
Copy link
Owner

This is webglreport.com for my Windows VM in Chrome:

chrome

I get nothing in the JS console, trying to run go-life in Chrome (again, in my Windows 10 vm -- where, as I'm sure you recall at the moment, but for others and/or posterity: go-life native doesn't run either; see here). Firefox works.

@xparq
Copy link
Author
xparq commented Aug 18, 2019

@eliasnaur

@lunakid can you confirm that the updated version prints out an error about EXT_sRGB not supported on your chrome?

Sorry about the delay, no, as Larry suggested. I can see no change in Chrome.

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

3 participants
0