scratchfoundation / scratch-gui

Graphical User Interface for creating and running Scratch 3.0 projects.
https://scratchfoundation.github.io/scratch-gui/develop/
BSD 3-Clause "New" or "Revised" License
4.46k stars 3.55k forks source link

Raspberry Pi - Stage fails to load #1250

Open martinohanlon opened 6 years ago

martinohanlon commented 6 years ago

Expected Behavior

When Scratch UI is opened the default sprite appears on the stage.

Actual Behavior

The default sprite doesnt appear and the stage is blank

Steps to Reproduce

Open llk.github.io/scratch-gui on a Raspbery Pi running Raspbian Stretch

Operating System and Browser

Raspberry Pi Raspbian Stretch Chromium - Version 60.0.3112.89 (Developer Build) Built on Ubuntu 14.04, running on Raspbian 9.1 (32-bit)

Developer mode noted 3 errors while loading:

raven.js:55 You are currently using minified code outside of NODE_ENV === 'production'. This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) to ensure you have the correct code for your production build.
a.(anonymous function) @ raven.js:55
o @ lib.min.js:51
(anonymous) @ lib.min.js:51
(anonymous) @ lib.min.js:51
t @ lib.min.js:46
(anonymous) @ lib.min.js:61
t @ lib.min.js:46
e.exports.t.a @ lib.min.js:61
t @ lib.min.js:46
e.exports.e.exports @ lib.min.js:46
t @ lib.min.js:46
e.exports.t.a @ lib.min.js:61
t @ lib.min.js:46
(anonymous) @ lib.min.js:56
t @ lib.min.js:46
e.exports.Object.defineProperty.value @ lib.min.js:51
t @ lib.min.js:46
e.exports.Object.defineProperty.value @ lib.min.js:51
t @ lib.min.js:46
(anonymous) @ lib.min.js:46
(anonymous) @ lib.min.js:46
t @ lib.min.js:1
(anonymous) @ lib.min.js:100
t @ lib.min.js:1
(anonymous) @ lib.min.js:35
t @ lib.min.js:1
123 @ index.jsx:5
t @ lib.min.js:1
window.webpackJsonp @ lib.min.js:1
(anonymous) @ gui.js:1
(index):1 Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause().
Promise (async)
Blockly.WorkspaceAudio.preload @ lib.min.js:79
l @ lib.min.js:79
a @ lib.min.js:79
d @ raven.js:416
(index):1 Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause().
Promise (async)
Blockly.WorkspaceAudio.preload @ lib.min.js:79
l @ lib.min.js:79
a @ lib.min.js:79
d @ raven.js:416
kerrtravers commented 6 years ago

I thought this would be an issue only when using the Pi or Chromium Browser, but I checked anyway and can't repro on:

macOS 10.13.2 (High Sierra) using Chrome 63.0.3239.132

iOS 10.2.2 using Safari

Windows 8.1 using Firefox Nightly

martinohanlon commented 6 years ago

I dont know if this is related, but I experience the same behaviour when using:

Windows 10 Edge

Name    Protocol    Method  Result  Content type    Received    Time    Initiator
https://sentry.io/api/253297/store/?sentry_version=7&sentry_client=raven-js%2F3.20.1&sentry_key=dcc4ed76876b411c99997f4ad5ab78a5    HTTPS   POST    429 application/json    92 B    208.9 ms    XMLHttpRequest
HTTP429: TOO MANY REQUESTS - The server is refusing to service the request because too many requests have been submitted by the client.
(XHR)POST - https://sentry.io/api/253297/store/?sentry_version=7&sentry_client=raven-js%2F3.20.1&sentry_key=dcc4ed76876b411c99997f4ad5ab78a5
thisandagain commented 6 years ago

We have seen some issues with recent builds of Raspbian where WebGL reports as being available but fails to render. Can you post screenshots of what you see when you visit the following?

martinohanlon commented 6 years ago

@thisandagain as requested...

With the OpenGL (Full KMS) driver enabled in Raspbian these are the results I get:

get_webgl_org_screen scratch3_gui_screen scratch3error.txt webglreport_com_screen

With the OpenGL driver not enabled, these are the results I get (not surprisingly it doesnt work!):

get_webgl_org_screen scratch3_gui_screen web_error_log.txt webglreport_com_screen

thisandagain commented 6 years ago

@martinohanlon That's what I was afraid of! If Raspbian tells the browser that WebGL is supported but then fails to render anything (you should be seeing a spinning cube in that first screenshot) there is very little we can do. We'll need to work with the RPI team to resolve these issues until we can continue.

martinohanlon commented 6 years ago

@thisandagain I will talk to the team.

Do you think this could be related to #1269 - the outcome is the same, and it results in the same HTTP429 error.

martinohanlon commented 6 years ago

@thisandagain

I was just looking into the error which is reported when loading Scratch 3:

(index):1 Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause().
Promise (async)
Blockly.WorkspaceAudio.preload @ lib.min.js:79

Could this relate to this error reported in Blockly? - https://github.com/google/blockly/issues/299

There is an article which describes why this happens and a potential fix https://developers.google.com/web/updates/2017/06/play-request-was-interrupted

thisandagain commented 6 years ago

@martinohanlon That is a pretty well known / documented issue with Blockly that we are waiting on a patch for upstream. It does not block loading of the GUI or related subcomponents but is rather more of an annoyance.

larjohn commented 6 years ago

I 'm bringing some cool news!

I 'm currently running Scratch 3.0 preview on a Raspberry Pi 3 and Chromium. I let the cat glide forever to random position. It is eating up about 50% of the CPU but the movement is almost smooth (some glitches here and there but they are not annoying at all).

My steps to make it work (I don't know if all of them are required):

  1. Ran rpi-update to update to latest firmware
  2. Enabled OpenGL (Full KMS) in raspi-config
  3. Removed --disable-gpu-compositing from /etc/chromium-browser/customizations/00-rpi-var (kudos Wayne Keenan
  4. Overrid the software rendering list in chrome://flags (kudos kusti8 )
  5. Visited https://preview.scratch.mit.edu and saw the feline!
chexbox commented 6 years ago

I am no longer having this problem! It now renders on chromium and firefox.

larjohn commented 6 years ago

Do you know which part did so? Because the only thing that could modify your audio drivers would be the rpi-update.

If it is so, then you can report it to the Pi Foundation or the Raspbian issue tracker.

@chexbox can you also list the other problems, so that we can also track them down?

martinohanlon commented 6 years ago

Thanks a lot for the information.. Just tested on a Pi 3B+ works really well.

Now to find out why gpu-compositing is disabled in Raspbian.

spl237 commented 6 years ago

It's disabled because GPU compositing caused a crash when playing YouTube videos when using Eric's driver. (As of last August - the crash may or may not have been fixed by now...)

martinohanlon commented 6 years ago

A few notes:

larjohn commented 6 years ago

Just as a note: the process works in Raspberry Pi Zero as well, BUT Scratch is not usable. Even the OpenGL preview cube renders like one frame per five seconds.