Is Scratch really viable on Raspberry Pi?


129 posts   Page 5 of 6   1, 2, 3, 4, 5, 6
by timrowledge » Tue Jan 22, 2013 5:37 am
Scratch on RISC OS is coming fairly soon. The sound is almost functional now.
"Compromise", says Professor Trefusis, "is stalling between two fools"
Posts: 358
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
by kevans67 » Wed Jan 23, 2013 6:07 am
@timrowledge:

I was wondering how fast Scratch is running on Risc OS. I tried Scratch on Raspian, and then on RISC OS hoping that it would be faster. (I had never used RISC OS before this exercise.) For RISC OS I downloaded Squeak3-9b-RISCOS.zip and followed your instructions, and then downloaded Scratch sources separately. It seems to work to some extent, but the GUI is very slow and the image is a bit unstable. I didn't keep notes, but certain Scratch actions would cause errors. I recall that numeric entry wouldn't work. So I'm hoping that you are getting much better results.

I've had other audio problems, like glitches when starting programs such as some of the games that you can get through !PackMan. So I wouldn't be surprised if development isn't easy for you.

I had other stability problems in Raspian, and if I remember correctly sounds are a problem there as well. (I'm using DVI plus analog audio out.)

Anyways I was hoping to use this with the kids, but maybe it's better to try using it for some other purpose for now, unless there are some quick breakthroughs.
Posts: 18
Joined: Wed Jan 23, 2013 5:54 am
by timrowledge » Wed Jan 23, 2013 9:02 pm
Scratch on RISC OS is nowhere near complete yet but it is getting there. I've got sound output working pretty well - I can play a midi file of Tubular bells with 30+ tracks without stuttering or losing samples. You don't want to know what playing the midi version of 'losing my religion' with all tracks set to a relentlessly cheerful oboe is like… who needs drugs?

I still have the actual scratch support plugin to build - I'm not even convinced the source is properly available yet. It supports a few odd things like changing the window title to match the running project (which these days in Squeak is done via the 'Ariethfa Ffenestri' HostWindow interface anyway). One of the practical problems is that scratch is built in a *really* old version of squeak which can make life a bit harder when trying to support it with a new VM. Sigh.

I'll put out a release with the sound support soon, say a day or two.
"Compromise", says Professor Trefusis, "is stalling between two fools"
Posts: 358
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
by timrowledge » Thu Jan 24, 2013 3:13 am
Looks like scratch works ok on the pi. A bit slow I have to admit but cats meow, circles honk like geese, saving a project changes the window title, trying to record sounds doesn't crash (somebody made a right mess of the sound record code in that ancient image) and loading new image and sound samples works.
"Compromise", says Professor Trefusis, "is stalling between two fools"
Posts: 358
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
by kevans67 » Thu Jan 24, 2013 3:49 am
@timrowledge: thanks for the update. Is all of the RISC OS graphics processing (e.g. even BitBlt) being done by the ARM right now? So maybe we'll see large improvements in the future?
Posts: 18
Joined: Wed Jan 23, 2013 5:54 am
by timrowledge » Thu Jan 24, 2013 6:13 pm
Right now all BitBLT etc is done on the ARM.

It's hard to imagine a great deal of work ever getting done on changing that *for RISC OS* because it's just too small a niche.

I *can* imagine someone offering me large amounts of money to try to do something about it for more mainstream OS's and perhaps, just perhaps, being able to find a way of using (some?) it from RISC OS. For linux/Windows/OSX there is a Squeak based system called Croquet that makes heavy use of the platforms OpenGL hardware/software to do some fairly impressive immersive 3d shared world stuff, so there is a demonstration proof that it can benefit Smalltalk.
"Compromise", says Professor Trefusis, "is stalling between two fools"
Posts: 358
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
by -rst- » Fri Jan 25, 2013 10:55 am
It may be a good thing I had been reading this thread before even trying Scratch in RPi (on Raspbian)... I tried Scratch (just a bit basic scripting to get the cat spin and move in loops) yesterday and to me it seemed to work faster than many other things on LXDE - especially the xscreensaver settings app was really dragging and lagging :roll:
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
Posts: 898
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland
by timrowledge » Mon Jan 28, 2013 5:46 am
See viewtopic.php?p=271839#p271839 for a testable RISC OS Scratch release. Probably in need of a bit more work but it seems to run ok on my Pi.
"Compromise", says Professor Trefusis, "is stalling between two fools"
Posts: 358
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
by dom » Mon Jan 28, 2013 12:43 pm
timrowledge wrote:See viewtopic.php?p=271839#p271839 for a testable RISC OS Scratch release. Probably in need of a bit more work but it seems to run ok on my Pi.

Would be great to film a side by side comparison of scratch on linux and raspbmc to prove which is faster.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4013
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by simplesi » Mon Jan 28, 2013 1:30 pm
@timrowledge

Make sure you modify your Scratch image as per http://scratch.mit.edu/forums/viewtopic.php?id=104467 to remove the constant screen updates if variables are displayed.

regards

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter
Posts: 2046
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
by timrowledge » Thu Jan 31, 2013 11:38 pm
A new version of RISC OS Scratch is now available - it includes the improved scratch image, better install info and all the OS modules required. Please give it a try.

http://www.rowledge.org/tim/squeak/Scratch_RISCOS-2.zip
"Compromise", says Professor Trefusis, "is stalling between two fools"
Posts: 358
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
by geordie » Sat Apr 06, 2013 8:14 am
timrowledge wrote:
Would be great to film a side by side comparison of scratch on linux and raspbmc to prove which is faster.
[/quote]

raspbmc _is_ linux, is it not?
User avatar
Posts: 14
Joined: Thu Jul 12, 2012 4:26 pm
Location: Vancouver, British Columbia
by simplesi » Sat Apr 06, 2013 8:25 am
I think they meant to say said Linux (e.g Raspbian) vs RISC OS :)
Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter
Posts: 2046
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
by mrpi64 » Mon Apr 15, 2013 1:07 pm
To resize the window, don't maximise- resize it from the corners! :D
I'm happy to help.
http://goo.gl/TAUaLS - List of games that work on the Pi.
User avatar
Posts: 772
Joined: Sat Feb 16, 2013 5:13 pm
by timrowledge » Tue May 07, 2013 5:19 pm
geordie wrote:
timrowledge wrote:
Would be great to film a side by side comparison of scratch on linux and raspbmc to prove which is faster.


raspbmc _is_ linux, is it not?[/quote]
Actually that was Dom, not me, and I'm fairly sure he meant RISC OS rather than raspbmc.
"Compromise", says Professor Trefusis, "is stalling between two fools"
Posts: 358
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
by simplesi » Mon Jun 03, 2013 11:33 am
Great news - just tested the 20130509 Scratch image in the new Raspbian release and I reckon its nearly 33% fasterthan the Feb version in running the original Asteroid Blaster code that kicked off this thread many moons ago.

http://www.youtube.com/watch?v=PXdxgjamFi4

Well done Tim :) (And Alex!!!! :) )

Simon
Last edited by simplesi on Mon Jun 03, 2013 12:12 pm, edited 1 time in total.
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter
Posts: 2046
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
by asb » Mon Jun 03, 2013 12:01 pm
Thanks for the report Simon, great to get feedback. Tim says we should get some extra boost (exactly how much is not clear) upon updating to the latest squeak VM from SVN.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 796
Joined: Fri Sep 16, 2011 7:16 pm
by timrowledge » Mon Jun 03, 2013 7:11 pm
Actually you should find that the Asteroids game plays 2-3x faster overall; I get a change from~7fps to ~18fps on my Pi.
"Compromise", says Professor Trefusis, "is stalling between two fools"
Posts: 358
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
by simplesi » Mon Jun 03, 2013 7:20 pm
It definitely doesnt run anywhere near 2x faster on my setup :)
Simon
PS could you video it on your setup?
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter
Posts: 2046
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
by mrpi64 » Thu Aug 29, 2013 10:45 am
Clifford wrote:My son has been using Scratch at school and has been asking me for help with his project (I am a professional software engineer). I decided to learn Scratch (didn't take long) in order to be able to help him. I wrote a simple Asteroids-like game in Scratch for Windows. It has 6 sprites - 4 identical asteroids, a ship, and a laser-cannon shot, each one has a moderately complex script including event handlers. It flies in Windows as you might expect, but still uses a substantial amount of CPU at times, but is entirely unusable on the RPi. It improved a little with the recent Debian Wheezy release with hard-floating point but not enough to make it usable.

It is not just the game execution that is slow, simply loading the project slows the IDE down such that it becomes unusable. For example if you try to drag a block it takes several seconds before it moves, and so is difficult to place accurately and no real fun at all.

The CPU load all the time Scratch is running is 100%, and if I try to maximise the window, the whole thing just hangs - or at least does nothing for longer than I care to wait!

Having used it on Windows I think it is great (apart from having to create independent duplicates of sprites rather than true multiple instances), but on RPi I can't see it being usable for all but the simplest projects that won't really teach much about programming.

Scratch is quite slick visually and from a usability point of view, but I suspect that under the hood there is some pretty inefficient programming made viable by fast CPU/GPU hardware, but just too much for the RPi - perhaps it is not making good use of the hardware available, I would expect the ARM11 at 600MHz with floating point and a GPU to cope with this.


You can't maximise the window, you have to manually resize it from the corners.

Image[/quote]
Original thread and post link
I'm happy to help.
http://goo.gl/TAUaLS - List of games that work on the Pi.
User avatar
Posts: 772
Joined: Sat Feb 16, 2013 5:13 pm
by timrowledge » Fri Sep 20, 2013 5:32 pm
A demo video, showing how much faster recent Scratch is on the Pi - and I'll just note that the *very* latest experimental version adds faster script editing/scrolling but you can't have it quite yet -
http://vimeo.com/71724947

We're working hard on making it still faster; the dream is to make PacMan playable. There are still a lot of tricks to throw at it… watch this space.
"Compromise", says Professor Trefusis, "is stalling between two fools"
Posts: 358
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
by jamesh » Fri Sep 20, 2013 7:08 pm
Wow, that's a very significant improvement. Nice job!

Where are the improvements?
Unemployed software engineer currently specialising in camera drivers and frameworks, but can put mind to most embedded tasks. Got a job in N.Cambridge or surroundings? I'm interested!
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11682
Joined: Sat Jul 30, 2011 7:41 pm
by timrowledge » Sat Sep 21, 2013 6:39 pm
There are improvements to
  • the graphics core of the virtual machine; a specialised for ARMv6 set of routines to do bitbltting that handle the ARMs caching needs better than vanilla 'all-platforms' code, and make use of the SIMD instructions where appropriate
  • the Smalltalk code that implements Scratch; largely improving the 'OOPness' so it takes advantage of Smalltalk's strengths rather than behaving like C code

The latest not-yet-released system adds far better drawing (and caching of) the script tiles to improve the speed of dragging/scrolling bits of script around. Still lots more needed there, but it is an improvement
"Compromise", says Professor Trefusis, "is stalling between two fools"
Posts: 358
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
by simplesi » Wed Sep 25, 2013 9:52 pm
Just tried out Tim's testing version dated 16th Sep - really great improvement in speed of editing the blocks which is the one thing that kids really notice and strugglle with once they start to build non-trivial scripts :)

Simon

PS Honestly - its the most significant improvement in Scratch on the RPi since we got rid of the variable update bug - and its better than that one because the variable bug only affected script with variables in them :)

WELL DONE TIM :)

PPS Did I say how good it was :)
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter
Posts: 2046
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
by simplesi » Thu Sep 26, 2013 9:44 pm
https://vine.co/v/h6zwxIImuQb
Little video on what its like :)
Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter
Posts: 2046
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK