JSBeeb corruption in various browsers

feedback, questions and discussion relating to www.bbcmicro.co.uk
User avatar
leenew
Posts: 4900
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

JSBeeb corruption in various browsers

Post by leenew »

Hi,

UPDATE: I AM SEEING CORRUPTION IN VARIOUS BROWSERS WITH VARIOUS GAMES. COULD ANYONE SEEING SCREEN CORRUPTION IN JSBEEB PLEASE POST THE DETAILS.

Would people mind playing "MAGIC EEL" from BEEBUG: http://www.bbcmicro.co.uk/game.php?id=621
I am experiencing graphical glitches around the play area but can't pin down why.
It could be browser related? I see glitches to the sides of the play area and sometimes a large glitch below the play area.
I get glitches with EDGE on WIN10 64bit.
I also see glitches with CHROME with WIN10 64bit.
FIREFOX seems fine with WIN10 64bit.
On my laptop WIN10 32 bit, EDGE seems fine.

Could I get some more results please?
You only have to play for 2 seconds. The glitches are very obvious from the beginning.
If it doesn't look like the screenshot in the link above then it is glitchy.
Please let me know if it does or doesn't work for you.


Lee.
Last edited by leenew on Fri Apr 23, 2021 6:29 pm, edited 2 times in total.
Deleted User 9295

Re: Fault with BEEBUG MAGIC EEL?

Post by Deleted User 9295 »

leenew wrote: Sat Jan 23, 2021 5:34 pmCould I get some more results please?
I see nothing obviously wrong here (MS Edge, Windows 10, 64-bits). Have you tried changing your graphics acceleration settings (if any)?

What happens with David Williams's rather more modern snake program here?
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Fault with BEEBUG MAGIC EEL?

Post by lurkio »

Beebug's Magic Eel runs without any problems in Safari, Chrome and Firefox on 64-bit macOS Mojave.

Beebug's Magic Eel also runs without any problems in Chrome on Windows 7 in a 32-bit VM on macOS.

:idea:
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Fault with BEEBUG MAGIC EEL?

Post by lurkio »

No problems running Beebug's Magic Eel in JSBeeb on a real (non-VM) 64-bit Windows 8 PC in Chrome, Firefox, and Edge.

:idea:
User avatar
BeebMaster
Posts: 7379
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Fault with BEEBUG MAGIC EEL?

Post by BeebMaster »

You'll be glad to know I can break it.
Screenshot_2021-01-29_22-48-02.png
That's on Firefox with Ubuntu 20.04.
Image
User avatar
BeebMaster
Posts: 7379
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Fault with BEEBUG MAGIC EEL?

Post by BeebMaster »

I'm not sure it is even playing correctly, can you not change direction between left and right, or up and down without losing a life?
Image
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Fault with BEEBUG MAGIC EEL?

Post by lurkio »

BeebMaster wrote: Fri Jan 29, 2021 10:49 pm You'll be glad to know I can break it ... That's on Firefox with Ubuntu 20.04.
Do you have similar issues with any other games on bbcmicro.co.uk?

Magic Eel is playing normally for me, in JSBeeb on bbcmicro.co.uk, in several different browsers, on macOS and Windows. Plays like a normal Snake-type game.

:idea:
User avatar
BeebMaster
Posts: 7379
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Fault with BEEBUG MAGIC EEL?

Post by BeebMaster »

Some big problem with it generally I think, screen corruption on every mode change, and the cursor is wrong in mode 3 & 6:
Screenshot_2021-01-29_23-21-09.png
Unless it's emulating a Beeb with knackered DRAMs?
Image
User avatar
leenew
Posts: 4900
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: Fault with BEEBUG MAGIC EEL?

Post by leenew »

BeebMaster wrote: Fri Jan 29, 2021 11:06 pm I'm not sure it is even playing correctly, can you not change direction between left and right, or up and down without losing a life?
That's standard behaviour for all "Snake" games.
To change direction from up to down, you have to press UP then LEFT (or right) then DOWN.
You can't just press UP then DOWN as it is classed as "crashing into yourself"...

Lee.
jimmy
Posts: 149
Joined: Tue May 06, 2008 7:37 pm
Contact:

Re: Fault with BEEBUG MAGIC EEL?

Post by jimmy »

It breaks on my Ubuntu 20LTS Firefox 84 install as well...
MagicEel1.png
Different corruption each time I try too. NVidia graphics card installed if that helps.
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Fault with BEEBUG MAGIC EEL?

Post by lurkio »

jimmy wrote: Sat Jan 30, 2021 7:33 pm It breaks on my Ubuntu 20LTS Firefox 84 install as well... Different corruption each time I try too. NVidia graphics card installed if that helps.
Do you have similar issues with any other games on bbcmicro.co.uk?


Are you seeing the same issues as BeebMaster? These issues don't seem to affect Magic Eel specifically -- they affect JSBeeb generally:
BeebMaster wrote: Fri Jan 29, 2021 11:23 pm Some big problem with it [JSBeeb, the BBC Micro emulator in Javascript] generally I think, screen corruption on every mode change, and the cursor is wrong in mode 3 & 6
:?:
User avatar
BeebMaster
Posts: 7379
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Fault with BEEBUG MAGIC EEL?

Post by BeebMaster »

My computer has an Nvidia graphics card as well.

But I just tried on the laptop with Ubuntu 18.04 and I still get screen corruption.
Image
User avatar
leenew
Posts: 4900
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: Fault with BEEBUG MAGIC EEL?

Post by leenew »

jimmy wrote: Sat Jan 30, 2021 7:33 pm It breaks on my Ubuntu 20LTS Firefox 84 install as well...
MagicEel1.png
Different corruption each time I try too. NVidia graphics card installed if that helps.
That appears to be very similar to the corruption that I see.
RobC
Posts: 3816
Joined: Sat Sep 01, 2007 10:41 pm
Contact:

Re: JSBeeb corruption in UBUNTU/FIREFOX with BEEBUG MAGIC EEL?

Post by RobC »

I see it too using Chrome on Windows 10.
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: JSBeeb corruption in UBUNTU/FIREFOX with BEEBUG MAGIC EEL?

Post by lurkio »

RobC wrote: Sun Jan 31, 2021 12:42 pm I see it too using Chrome on Windows 10.
Do you see it only in Magic Eel or in other games too? And/or in JSBeeb generally?

:?:
Deleted User 9295

Re: JSBeeb corruption in UBUNTU/FIREFOX with BEEBUG MAGIC EEL?

Post by Deleted User 9295 »

RobC wrote: Sun Jan 31, 2021 12:42 pm I see it too using Chrome on Windows 10.
I had not tried it in Chrome, but now I have (Windows 10, Dell XPS-13 laptop) and again I can't make it misbehave. This has the feel of not being a JSBeeb or browser issue, but something more fundamental in the graphics backend (e.g. GPU or WebGL drivers). If it was happening here I'd want to check if any updated drivers are available for download.
User avatar
BeebMaster
Posts: 7379
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: JSBeeb corruption in UBUNTU/FIREFOX with BEEBUG MAGIC EEL?

Post by BeebMaster »

When you change modes to a graphics mode on a real Beeb, you often get screen corruption for a fraction of a second until the screen finishes clearing. It's almost as if that is happening here, but the screen clearing part isn't working successfully, and something is also causing part of the corruption to occur in the border area which isn't normally accessible.
Image
User avatar
BeebMaster
Posts: 7379
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: JSBeeb corruption in UBUNTU/FIREFOX with BEEBUG MAGIC EEL?

Post by BeebMaster »

Also I'm finding it drops a lot of keystrokes, don't know if that is related to the same thing, it seems to drop the 3rd keystroke quite often: 9 times out of 10 typing "MODE3" (for example) will give "MOE3".
Image
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Fault with BEEBUG MAGIC EEL?

Post by lurkio »

jimmy wrote: Sat Jan 30, 2021 7:33 pm It breaks on my Ubuntu 20LTS Firefox 84 install as well ... MagicEel1.png ...
Not too long ago, I was seeing similar artefacts in JSBeeb on bbcmicro.co.uk in Firefox on macOS.

I found that the Firefox setting labelled "Use hardware acceleration" under "Performance" was unticked. (Whether it had always been unticked or whether it had become unticked during an update I don't know.) I enabled the setting, and the artefacts and graphics corruption went away.

:idea:
jimmy
Posts: 149
Joined: Tue May 06, 2008 7:37 pm
Contact:

Re: JSBeeb corruption in UBUNTU/FIREFOX with BEEBUG MAGIC EEL?

Post by jimmy »

I've done some further testing. It does work on my machine using Chromium 88, so I guess my graphics driver is good enough?
It doesn't work using Firefox 85 (latest), and turning hardware acceleration off made no difference.
So into development tools I went and just started to look for errors and warnings. There is one near the start which caught my eye:

Code: Select all

Failed to create WebGL context: failIfMajorPerformanceCaveat: Compositor is not hardware-accelerated.
The line it was failing at was in canvas.js at:

Code: Select all

var gl = canvas.getContext('webgl', glAttrs) || canvas.getContext('experimental-webgl', glAttrs);
This line was not failing in Chromium, but it was in Firefox.
Searching for this message gave a few hits, and the page at https://bugzilla.mozilla.org/show_bug.cgi?id=1678652 talks about it. It suggested setting webgl.disable-fail-if-major-performance-caveat to true.
I did this and the corruption has almost gone - but now I just get a white border (single pixel) around the screen which flickers too much to be comfortable with. :? The flickering also affects every game so it's not usable.
Other workarounds were suggested but they seemed to involve (fairly big) code changes. It seems to be a Firefox 83 change, but it would be good to know if an ATI graphics card on Firefox 83+ has this problem too.
The graphics corruption can be seen on other games. The "Tapper" by MicroPower loading screen and "Hobgoblin" by Atlantis main menu screen are two examples.
Deleted User 9295

Re: JSBeeb corruption in UBUNTU/FIREFOX with BEEBUG MAGIC EEL?

Post by Deleted User 9295 »

jimmy wrote: Sun Jan 31, 2021 4:50 pmI guess my graphics driver is good enough?
At the link you gave is this comment: "I installed a more recent driver for my graphics card, now the bug is fixed for me". Later there's "we've included 'readback required for compositing' as a caveat" so it could still be a graphics driver capability issue, causing Firefox to refuse to create the WebGL context.

There's evidently some debate over whether Firefox is overreacting to the graphics driver issue by setting the 'major performance caveat' status, or whether it's the fault of the web page (I suppose JSBeeb in this case) for treating that as a failure.
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: JSBeeb corruption in UBUNTU/FIREFOX with BEEBUG MAGIC EEL?

Post by lurkio »

jimmy wrote: Sun Jan 31, 2021 4:50 pm ... I did this and the corruption has almost gone - but now I just get a white border (single pixel) around the screen which flickers too much to be comfortable with. :? The flickering also affects every game so it's not usable.
Not that it's a long-term solution, but does the flickering stop if you slightly resize the whole Firefox window?

:?:
User avatar
Matt Godbolt
Posts: 255
Joined: Mon Jul 31, 2006 11:02 am
Location: Chicago
Contact:

Re: JSBeeb corruption in UBUNTU/FIREFOX with BEEBUG MAGIC EEL?

Post by Matt Godbolt »

Hi all!

Thanks for taking the time to look in to this! jsbeeb does indeed use WebGL to put the screen up, and the fact it's failing is interesting. I mainly test with Chrome, and we know we've had folks on Windows occasionally report issues that go away when they upgrade their browser. I'm not sure what's going on here; it's pretty straightforward code.

For faster "service" (such as it is)... can you report and log these things on the jsbeeb issue tracker: https://github.com/mattgodbolt/jsbeeb/issues -- I get notified there and can look in. I was only pointed at this by a kindly person emailing me!

Thanks all, Matt
User avatar
Matt Godbolt
Posts: 255
Joined: Mon Jul 31, 2006 11:02 am
Location: Chicago
Contact:

Re: JSBeeb corruption in UBUNTU/FIREFOX with BEEBUG MAGIC EEL?

Post by Matt Godbolt »

BeebMaster wrote: Sun Jan 31, 2021 2:11 pm Also I'm finding it drops a lot of keystrokes, don't know if that is related to the same thing, it seems to drop the 3rd keystroke quite often: 9 times out of 10 typing "MODE3" (for example) will give "MOE3".
I've seen this on machines that are already struggling: emulating a beeb in javascript is quite a "silly" :) thing to do, and it takes a lot of power. If the OpenGL acceleration has failed too, then it takes even more and so might miss keystrokes from time to time :(
Deleted User 9295

Re: JSBeeb corruption in UBUNTU/FIREFOX with BEEBUG MAGIC EEL?

Post by Deleted User 9295 »

Matt Godbolt wrote: Mon Feb 01, 2021 3:11 pm emulating a beeb in javascript is quite a "silly" :) thing to do
Is the 'fail if major performance caveat' setting, which looks to be a possible cause of the corruption issue reported here, something you have control over in JSBeeb? If I have understood correctly, it is typically set like this:

Code: Select all

var context = canvas.getContext('webgl', {'failIfMajorPerformanceCaveat': true});
User avatar
Matt Godbolt
Posts: 255
Joined: Mon Jul 31, 2006 11:02 am
Location: Chicago
Contact:

Re: JSBeeb corruption in UBUNTU/FIREFOX with BEEBUG MAGIC EEL?

Post by Matt Godbolt »

Quite possibly; I've not heard of this until this thread. Did this setting fix anything (I rather lost the thread, will re-read)?
User avatar
Matt Godbolt
Posts: 255
Joined: Mon Jul 31, 2006 11:02 am
Location: Chicago
Contact:

Re: JSBeeb corruption in UBUNTU/FIREFOX with BEEBUG MAGIC EEL?

Post by Matt Godbolt »

"corruption has almost gone" doesn't really sound like a fix, especially for what is ostensibly a "performance" thing, not a correctness. I'm really hoping not to get into the bad old days of having to detect individual browsers' foibles and have a load of workarounds for each; but...
User avatar
leenew
Posts: 4900
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: JSBeeb corruption in UBUNTU/FIREFOX with BEEBUG MAGIC EEL?

Post by leenew »

It seems Tricky noticed this corruption last October.
https://github.com/mattgodbolt/jsbeeb/issues/309

Lee.
Deleted User 9295

Re: JSBeeb corruption in UBUNTU/FIREFOX with BEEBUG MAGIC EEL?

Post by Deleted User 9295 »

Matt Godbolt wrote: Mon Feb 01, 2021 3:53 pmDid this setting fix anything?
I don't think that's been established (I don't see any failure here anyway), but if setting failIfMajorPerformanceCaveat to false is easy, it could be a worthwhile thing to try, if only to eliminate it as a fix.
User avatar
Matt Godbolt
Posts: 255
Joined: Mon Jul 31, 2006 11:02 am
Location: Chicago
Contact:

Re: JSBeeb corruption in UBUNTU/FIREFOX with BEEBUG MAGIC EEL?

Post by Matt Godbolt »

I understand the point, but I'm reluctant to putt things I can't test or reproduce and might have unusual unintended side effects. That said: this is probably a strict improvement in this case (https://blog.tojicode.com/2013/12/faili ... great.html is a little less convincing but hey!)

Thanks all.
Post Reply

Return to “the complete BBC games archive”