Is Scratch really viable on Raspberry Pi?


129 posts   Page 4 of 6   1, 2, 3, 4, 5, 6
by DukeOfTarporley » Wed Dec 05, 2012 4:31 pm
James,

I flag this just in case that it has been missed by the foundation and any Scratch fans in all the noise

I do not know the official process to get improvements in the distribution of Raspbian but I'd encourage the foundation and users to look at this:

http://scratch.mit.edu/forums/viewtopic.php?id=104467
and scroll down to the post at:
2012-08-21 22:25:57
by MathWizz

he has produced a new Scratch image that deals with some of the bugs that grind Scratch to a halt fairly quickly.
A major bug means displaying variables on the stage is hugely CPU intensive. One variable adds about 50% to the CPU even when not doing anything.

IMHO Scratch has about a life span of a day for bright kid on the PI in the standard image form before their games get too complicated etc. MathWizz's image prolongs Scratch on a Pi for a long long time.

Yes X acceleration would be great etc but using this is a really easy win for Pi Scratch users and the foundation.

The lack of volume of posts on this board represents the frustration of the community with Scratch on the PI.

All the best

DoT

Also Everybody Turbo your PI!
Posts: 18
Joined: Tue Aug 30, 2011 4:15 pm
by davidmam » Thu Dec 06, 2012 9:32 am
It would be great for it to include the GPIO interaction.
Posts: 98
Joined: Tue Dec 06, 2011 4:13 pm
by jamesh » Thu Dec 06, 2012 9:42 am
DukeOfTarporley wrote:James,

I flag this just in case that it has been missed by the foundation and any Scratch fans in all the noise

I do not know the official process to get improvements in the distribution of Raspbian but I'd encourage the foundation and users to look at this:

http://scratch.mit.edu/forums/viewtopic.php?id=104467
and scroll down to the post at:
2012-08-21 22:25:57
by MathWizz

he has produced a new Scratch image that deals with some of the bugs that grind Scratch to a halt fairly quickly.
A major bug means displaying variables on the stage is hugely CPU intensive. One variable adds about 50% to the CPU even when not doing anything.

IMHO Scratch has about a life span of a day for bright kid on the PI in the standard image form before their games get too complicated etc. MathWizz's image prolongs Scratch on a Pi for a long long time.

Yes X acceleration would be great etc but using this is a really easy win for Pi Scratch users and the foundation.

The lack of volume of posts on this board represents the frustration of the community with Scratch on the PI.

All the best

DoT

Also Everybody Turbo your PI!



Thanks, I'll pass this on to the 'people who know about these things'.

James
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: 11743
Joined: Sat Jul 30, 2011 7:41 pm
by proxima » Mon Dec 10, 2012 9:50 am
While we're making sure things haven't got lost in the noise, can I remind people about the "sticky keys" bug and workaround. (In short - on the RPi, but also other Linux builds of Scratch, if two keys are pressed at once, one of them gets "stuck down" until it is pressed again, which makes many games unplayable, including the marbleracer example).

ked, simplesi and I found a workaround for this, although we've no idea why it works - but it does prevent the problem. It is documented here: http://www.raspberrypi.org/phpBB3/viewtopic.php?p=191349#p191349

If that workaround could be built into the standard dist, or better still if the root cause of the problem could be understood and fixed, that would make Scratch more usable "out of the box" for many people.
Posts: 30
Joined: Tue Sep 18, 2012 3:16 pm
by jamesh » Mon Dec 10, 2012 11:27 am
Have you posted that fix to the Scratch people for investigation?

With regard to the other stuff, I passed it on the the distro people, and they think it should make it in to the next release - they also want to promote it to the mainline scratch code as it seems a sane fix.
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: 11743
Joined: Sat Jul 30, 2011 7:41 pm
by proxima » Tue Dec 11, 2012 12:50 pm
jamesh wrote:Have you posted that fix to the Scratch people for investigation?


Yes, I reported it at http://scratch.mit.edu/forums/viewtopic.php?pid=1416155#p1416155 - (my workaround is a post number 8 on that thread, and in post 9 I reported that the same problem occurs on other Linux builds but not Windows) - I don't know if there's a better way to report things to the Scratch people - things I've reported on the MIT forum have all fallen silent, although someone did assure me that people eventually pick things up on there.

The three issues which I've reported (with others) are the sticking keys one above, the problem with variables which has already been reported, and a problem where sounds cause Scratch on the Pi to hang frequently - this is reported along with an error message that might be useful here: http://scratch.mit.edu/forums/viewtopic.php?id=107704

Those are the three bugs which between them are putting many people (I believe) off Scratch on the Pi, which is a huge shame. For the record I will say again that my kids (4 and 6) and I (40) think Scratch is great, and with fixes for those 3 main bugs, it has a lot of mileage in it.

I'm happy to help from an end-user point of view by testing any fixes for these bugs, etc. Please let me know how I can help.
Posts: 30
Joined: Tue Sep 18, 2012 3:16 pm
by jamesh » Tue Dec 11, 2012 2:05 pm
It difficult as at least 2 out of three of the problems you describe are actually Scratch problems rather than Raspi problems, so should really be fixed by the Scratch people. Not sure about the sound issue though.
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: 11743
Joined: Sat Jul 30, 2011 7:41 pm
by proxima » Tue Dec 11, 2012 3:10 pm
jamesh wrote:It difficult as at least 2 out of three of the problems you describe are actually Scratch problems rather than Raspi problems, so should really be fixed by the Scratch people. Not sure about the sound issue though.


Agreed. I did offer to help (I'm a C/C++ programmer by trade), but of course nothing is as simple as that: It's straight into Smalltalk, virtual machines, plugins, etc, etc. But the offer stands if there's anything a C++ programmer can do to help...
Posts: 30
Joined: Tue Sep 18, 2012 3:16 pm
by Seymor54 » Wed Dec 26, 2012 9:47 am
the first can we please make sure that OTB ake it that the pi,s takeorningusing my o Ho Ho...
It's early morning on boxing day, and today seems like the day where you need to run out and find some double A batteries to get that surprise Christmas present to work.
In this case it's the raspberry pi and scratch.

Yesterday the big surprise present made up of the raspberry pi B went down like a wet fish with my eleven year old son...... It wasn't black ops 2, what was it, and it's a computer...... But it still wasn't black ops 2. So it didn't cut the mustard...

Later in the day, and after a couple of hours of boring play station gaming using the latest little big planet go cart racing where my son created his own 3d race track with tools that looked amazing. Only wished we had similar tools 25 years ago when I worked as a computer animator at the UK First 3d studio electronic arts using vax11750s.
Well Chris then asked could we look at trying out his pi.... 3 hours of explaining how good the pi was, and the fact that in the near future he will be able to use minecraft on the pi and will be able to take his personal computer around to his friends houses.... Chris had warmed to the idea.

So now we was into an OTB experience.... All cabled up, and power on, and loads of command language flashing by, user name pi password blackberry start and the pi was alive..... Looking all to similar to windows95, err....?

En found scratch the saviour of the day, and within a few minutes father and son had a cat doing cart wheels... The satisfaction gained was immense, and father and son bonding, and at the same time experiencing the life of pi........ Seen the film, you will know what I mean. I the concept of the pi foundation was being realised and at the same time I had done something that I had looked on enviously 35 years ago as the school geeks programmed their zx80,s to play space invaders.... There we was father and son learning how to make a cat sprite jump and rotate in the air. Yipiee I was on my way to creating my first ever space invaders program after 35 years of waiting

But.... It was slow, the lag was tremendous.... After an hour of discovery learning literally as we had no instructions we decided to watch a new bluray film

Boxing day morning using my android tethered to my mobile phone. Then I found this reality check on the limitations of the pi and scratch.

So understanding the aims of the foundation which I whole heartily embrace, and I find that the limitations of the pi is potentially scuppered by some poor coding between virtual emulators or what ever, created by the geeks for geeks to fathom out in a geeks language.... I was turned off from programing 30 years ago due to the limitations of communications as myself I am dyslexic.

So do I take it that the pi emphasis is to encourage new users, and then if this is the case can we make sure that the OTB experience is good for all levels of users.

Chris last night enjoyed using it, and but slowness of execution has delayed any interest in producing his very own space invaders game, but and now I find through this excellent forum that there is problems with scratch, and that makes it near unusable on the pi.

FYI I have also read with interest the members magazines magpi, and but again even though the aim of the foundation is to encourage NEW end users to be inspired to program, the current users rightly or wrongly are not helping to encourage new first time users by showing how a pi can power a camera, please or run a robot... When all you first need to know is how to get started, and step by step.

We need a first step on the moon approach otherwise a missed opportunity will be gained once more.

Today s another day, and will try and encourage my soon with the coding clubs python basics book...

Hello world
Posts: 1
Joined: Wed Dec 26, 2012 9:03 am
by bantammenace2012 » Wed Dec 26, 2012 11:35 am
Don't despair wrt. the performance of Scratch on the RPi.
I see Scratch on the RPi as the first stepping stone. It is not the end of the journey. The limitations of Scratch should stimulate the inquisitive mind to find better solutions.
Decide what you would like to do and then go about seeing how to do it with what you already have to hand.
I am already using Scratch on a PC with a single Lego WeDo motor and USB hub.
I think that it could be a worthwhile project to run Scratch on a RPi mounted on a toy vehicle of some kind and to control it like a radio-controlled car. I want to see how practical this is without the use of a soldering iron or the GPIO pins of the RPi. A number of questions came up immediately.
1. How could I steer the vehicle ? answer: Drive it like a tank with two tracks whose speed and direction could be controlled. This needs two motors to be independently driven by Scratch.
2. The default RPi Scratch only controls 1 motor ? answer: Kahuziro Abe provided a modified Scratch image that would drive two motors. He knows about Squeak and SmallTalk and has been very generous in helping my noob questions. I've previously posted details of this in this forum.
3. How to communicate with the RPi ? answer: using a VNC server from an android tablet I already have. I know this will be slow.
4. Could I record the movement of the vehicle ? answer: using a Bluetooth mouse slung under the vehicle communicating with AutoCad WS using its Freeline (?) tool. This is totally independent of the RPi.
5. Will it work ? answer: I don't know, I've not built it yet.
6. What next ? answer: Buy a soldering iron., learn how to use it, get scratch working via the GPIO pins and use them to drive hobby motors. Simplesi's group in the automation forum have already gone a long way down this path.

The most important thing is that you experiment, explore and have fun !

Btw my understanding is that the RPi foundation is investing capital in improving the performance of Scratch on the RPi prior to the release of the RPi to the educational market.
Posts: 59
Joined: Mon May 28, 2012 12:18 pm
by ReadiesCards » Sat Dec 29, 2012 3:05 pm
(Not read all the posts in this thread but just wanted to add my bit)

I'm afraid I have to say no to the question "Is Scratch really viable on Raspberry Pi?"

Today I sat down with my 9 year old nephew to introduce him 'what programming is' exactly as the foundation are trying to do. We were trying to use Scratch.

Before my nephew joined me I had 4 crashes, locks, scripts out of bounds, zero response, sometimes requiring a restart of Scratch, some times requiring restarts of 'startx' and once a full power cycle. My nephew joined me and really took to Scratch I was amazed how quick and at ease he was with it (awesome!). But when it crashed that was it he was gone - a 9 year old boy is too busy to accept failure.

I'll go and read the rest of the posts to see if there is a solution coming and follow this thread with interest. I can see the potential.


Paul
Posts: 39
Joined: Sun May 13, 2012 5:22 am
by jamesh » Sat Dec 29, 2012 7:53 pm
Scratch is one of the things that a lots of time will be spent on tin the New Year. There are a lot of places where it is quite inefficient, so we should be able to get some more performance out of it. It will never match a decent desk/laptop of course, but it should be eminently usable.
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: 11743
Joined: Sat Jul 30, 2011 7:41 pm
by simplesi » Sun Dec 30, 2012 12:21 am
@readiescards

I use Scratch a lot on the RPi and I'm not seeing crashes and lock-ups and "script out of bounds" errors.
(I literately run Scratch sessions for days at a time)

Are you using a relative recent Raspbian image or one of the problematical older pre-installed squeeze images.

If you are using Raspbian then your troubles are probably due to some other cause other than Scratch although sound can cause problems but there are workarounds if you do use sound - worht a quick look through the threads in thIs Scratch section :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter
Posts: 2053
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
by malakai » Sun Dec 30, 2012 12:42 am
My son just got started and the first day was a lot of hangs he like most thought the PC was frozen I assured him it would catch up eventually and it did. He has been going like mad we adopted the HDMI sound fix and that is working well. (Search the Scratch threads) once he got past the learning curve on what you can do and what will slow you down he hasn't had much trouble with it at all.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)
User avatar
Posts: 1383
Joined: Sat Sep 15, 2012 10:35 am
by ReadiesCards » Wed Jan 02, 2013 8:38 am
simplesi wrote:@readiescards

Are you using a relative recent Raspbian image or one of the problematical older pre-installed squeeze images.

Simon


I belive (not sure how to verify) that I am using 2012-10-28-wheezy-raspbian from which I tried (Linux noobie here) to ensure it was the latest of everything by performing various apt-get commands all of which seem to succeed ok. My RPi is a 256Mb model. And the Scratch projects where very,very simple but still caused it to crash etc.

Paul
Posts: 39
Joined: Sun May 13, 2012 5:22 am
by simplesi » Wed Jan 02, 2013 11:43 am
That version of Raspbian should be fine.

The only reported Scratch crashes have been due to sound issues.

@ked has made a fix for this that seems to work fine if using HDMI output
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=77&t=18684&p=239431&hilit=ked#p239075

(I've not tried it myself as I'm using Scratch on the RPi to control the GPIO pins for Robots and lights and I'm a visual learner :-) )

Could you post a link to a simple script that crashes on your RPi and we can give it go on our setups as you may have discovered another bug.


Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter
Posts: 2053
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
by drdagor » Wed Jan 02, 2013 9:26 pm
Back to the root note... Is Scratch viable on the RPi?

Sounds like it is, but that a native code implementation is required to get performance up. As it is, the performance is bad enough to discourage anyone trying to do more than trivial programming.

And I think the concensus is that Scratch ought to be supported. It is a useful educational tool and more accessable to novice programmers than most (all?) of the other languages available.

So how do we make a good Scratch version appear?
Posts: 3
Joined: Wed Jan 02, 2013 9:15 pm
by simplesi » Thu Jan 03, 2013 12:48 pm
a native code implementation is required to get performance up.


1. I don't think this is necessary - speed wise - I think a turbo mode RPi with the (already done but not officially blessed) slight modified image that cures the CPU hoggin variable display issue is actually fine for the job.

More speed is always welcome of course


2. Scratch, is not going to be re-written in C unless some young guru comes along and makes it their life's work. Many people have suggested doing this, some have said they are going to do it, no-one has actually done so (unless they've been working in secret :)

If (as the experts have said) that if performance can be greatly increased by improving video performance then that's probably going to be the quickest win.


To my mind, there is no real benefit in getting Scratch on the RPi to run as quick as a PC/Mac when people already have PC/Macs if all your going to do is learn Scratch and make the same sort of games/animations that you'd do on a PC/Mac.

The thing that makes Scratch essential on the RPi is its ability to interact with cheap add-on Pi-Face type boards or even cheaper Gordon's Ladder Board and actually it does this quite well with what we've actually got now.

I think what we(me and the other Scratch dabblers) need to do is to forget about waiting for "Them" (Scratch MIT/Foundation) to put together all the little mods we've come up with and try and make a simple installable script that setups up a Raspbian RPI with the best current working Scratch that we can do with our limited engine-room knowledge.

But TIME is the enemy for all of us.

regards

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter
Posts: 2053
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
by proxima » Thu Jan 03, 2013 1:32 pm
simplesi wrote:I think what we(me and the other Scratch dabblers) need to do is to forget about waiting for "Them" (Scratch MIT/Foundation) to put together all the little mods we've come up with and try and make a simple installable script that setups up a Raspbian RPI with the best current working Scratch that we can do with our limited engine-room knowledge.

But TIME is the enemy for all of us.


I agree (on your last point - I'm unavailable for the next week!). But as I understand it, we now have your fix (sorry, not sure, but I associate it with you anyway) for the variables issue, my strange "workaround" that makes the sticky keys problem go away (documented elsewhere), and the reported fix for the sound problems (also documented elsewhere) - with those three things in place, Scratch is entirely usable as it is, so some way of packaging it up like that would really help other people.
Posts: 30
Joined: Tue Sep 18, 2012 3:16 pm
by malakai » Thu Jan 03, 2013 1:46 pm
I am just getting a son into Scratch and I don't know all the backend of it. But this post from an interview with Eben seems to lead that they are working to get Scratch fixed assuming a lot has to do with the VM part:

EU: The nice thing is that almost all of the good CS teaching software already runs on Linux, so the bulk of the work is in making sure it works well on the Pi, rather than developing things from a standing start. MIT Scratch is actually a great example of this – it's built on top of the Squeak Smalltalk VM, and because this has generally only been run in anger on modern desktop hardware there hasn't previously been a case for heavy optimisation of its graphics routines, so it's a little sluggish on the Pi right now. We've commissioned a couple of pieces of work, the first of which involves porting it to use Pixman as its rendering backend, and the second involves optimising Pixman itself for the Pi's ARMv6 architecture (which will obviously pay dividends elsewhere in the system too).


The post is here http://www.h-online.com/open/features/Eben-Upton-An-educational-life-of-Pi-1772863.html
It just seems that A) Eben has a real desire to get Scratch on the Pi functional. I just get this feeling from what he mentions on his video's and interviews B) They are investing a lot to get it where it could be same thing just snippets of info about it but it makes sense. C) just look at the first book they put out for education it is a lot of Scratch info. Keep up what work you guys are doing it's great.

The HDMI sound issue fix seems to work like a charm waiting to test the sticky key issue as well.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)
User avatar
Posts: 1383
Joined: Sat Sep 15, 2012 10:35 am
by simplesi » Thu Jan 03, 2013 1:58 pm
Unfortunately, I have personal pyschcological issues :) with not knowing the expected time frame for "Them" to provide an official working solution.

Foundation are doing many things - they say there are gearing for an educational release but no info on what that really means (free cases? Cheap HDMI monitors?????) or the real timescale for this to happen.

In the meantime, some people who don't have the ability to apply patches and fixes are a bit frustrated.

!st world problems :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter
Posts: 2053
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
by malakai » Thu Jan 03, 2013 2:19 pm
Me I'm the optimist I sleep easy knowing the fix is for someone else to provide. I just have to try and find a way around the problems.

Your an educator don't the kids come back talking about the problems thinking of solutions way beyond their abilities. This to me is the real education that is happening. If you spoon feed them they won't learn. It's the obstacles that get them thinking way outside the box and the anticipation on what's next when someone comes along with a patch. Then they just start all over again. I don't know for sure what your experience is with the kids but I would think it is plausible that given the chance they'll start teaching you. :) When I showed my kids they started trying to find an answer they were so far off it was sad but they were thinking.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)
User avatar
Posts: 1383
Joined: Sat Sep 15, 2012 10:35 am
by simplesi » Thu Jan 03, 2013 8:24 pm
[url]I would think it is plausible that given the chance they'll start teaching you.[/url]

Luckily my age and experience can still beat their intelligence and ideas :) (Apart from 2 pupils that is - they were ahead of me !)
But since I work with 8 -11 yrs olds, I still stand a good chance of keeping ahead of the curve still :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter
Posts: 2053
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
by simplesi » Fri Jan 04, 2013 10:35 pm
Right - its time to stop cutting bait and fish.

I've posted a new thread on how to to improve/fix Scratch
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=77&t=28338
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter
Posts: 2053
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
by MightyMat » Tue Jan 15, 2013 9:12 pm
Bearing in mind that the scratch program comes on the pi for the beginners (who wont be doing stuff that slows down the pi as much) I don't think this matters much. Scratch works for me well when doing about ten simple scripts in one sprite (defining simple script as one - two loops with about 3 - 5 blocks in the loop) with about 10 sprites (or up to twenty). If somebody was into programming/computing enough to build files that slow the pi down considerably, they should use python (the other program that comes on the pi) with pygame.
Posts: 3
Joined: Sun Jan 06, 2013 4:33 pm