This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-06-12 10:48:51

gs123
Scratcher
Registered: 2008-06-12
Posts: 4

Squeak broken on Ubuntu Hardy Heron 8.04?

I've read the various posts about people running scratch under Ubuntu
linux, and it sounds straightforward, but I am hitting a brick wall
and could use some help.  Possibly my problem was introduced in the
most recent Ubuntu update, since I am using Hardy Heron 8.04 and the
other posts used Feisty Fawn 7.10 and earlier?  Or perhaps those
posters used an earlier image of squeak than 1.2.1 (how can I download
an earlier version to test)?

My problem is that Scratch keeps throwing up error dialogs about
sounds for basically anything I try to do.  I'd of course like to have
sounds working, but if it won't, I'd at least like to disable it?

Here is way too much detail on the steps I took:

1. Use synaptic to install the "squeak-vm" package.  The version it
installed was 1:3.9.8-3ubuntu1, and it says:

  $ squeakvm -version
  3.9-8 #1 Tue Mar 25 22:39:11 UTC 2008 gcc 4.2.3
  Squeak3.9alpha of 4 July 2005 [latest update: #7021]
  Linux vernadsky 2.6.15.7 #1 SMP Sat Sep 30 10:21:42 UTC 2006 i686 GNU/Linux
  default plugin location: /usr/lib/squeak/3.9-8/*.so

2. Download this file, http://scratch.mit.edu/files/WinScratch.zip
   do "unzip WinScratch.zip" to expand it.

3. Try running it; I just typed ./Scratch.image

That started scratch up, and it drew what looks like a functioning
startup screen, with the cat and various widgets, but with an error
box saying "a primitive has failed", and the backtrace has sound stuff
at the start, like this:

  SoundPlayer class(Object)>>error:
  SoundPlayer class(Object)>>primitiveFailed
  SoundPlayer class(Object)>>primStopRecording
  SoundPlayer class(Object)>>StopRecording
  ...
  etc [I'm abbreviating as I can't copy/paste the backtrace, let me
  know if you need me to type more of it]

I can click to proceed, do that three more times as it recurrs, and it
goes away.  Then if I click on the open, or the green flag etc, I get
the same error.  I was able to load the "swing" animation and make it
run (clicking through that sound dialog repeatedly to get to that
point), so other than this, things seem ok.

I also tried starting the program like this:

  /usr/bin/squeakvm -vm-sound-null ./Scratch.image

but that didn't help.

I do have a /dev/dsp which works fine, and alsa mixer works.  I have
all kinds of stuff working fine with sound, ranging from firefox,
mplayer, rhythmbox, vmware, etc.  And I also tried installing this on
both a laptop and desktop with completely different hardware, but had
the same issue on both.

Offline

 

#2 2008-06-12 10:54:04

gs123
Scratcher
Registered: 2008-06-12
Posts: 4

Re: Squeak broken on Ubuntu Hardy Heron 8.04?

Possibly my problem is related to this issue:

  https://bugs.launchpad.net/ubuntu/+source/squeak-vm/+bug/235146

Does anyone know where I can obtain a copy of that missing vm-sound-ALSA file or files?

Offline

 

#3 2008-06-22 18:31:21

tunki
Scratcher
Registered: 2008-03-30
Posts: 6

Re: Squeak broken on Ubuntu Hardy Heron 8.04?

gs123 wrote:

Possibly my problem is related to this issue:

  https://bugs.launchpad.net/ubuntu/+source/squeak-vm/+bug/235146

Does anyone know where I can obtain a copy of that missing vm-sound-ALSA file or files?

Hello

There is a reply in that page.  Some like "We should fix it... " but it seems that nobody is working in that.  I went to the next release of Ubuntu (Intrepid Ibex) repo and I found that the squeakvm doesn't have the alsa plugnin neither so we could expect to have the same problem.

But I don't like to stop complaining...  There is a way.

I found a Fedora rpm of squeakvm with all necessary so I just convert it to an Ubuntu package an it works!

Steps:
1.  Download the fedora package from:  http://math.ifi.uzh.ch/fedora/9/i386/RPMS.gemi/
2.  Convert the .rpm to .deb,  In a terminal:  sudo alien squeak-vm-3.10-1.2.fc9.i386.rpm
3.  Install the created .deb:  sudo dpkg -i squeak-vm-3.10-1.2.fc9.i386.deb

That's all.  The only difference is tha original command of ubuntu package is "squeakvm imagefile"  and the command of the converted package is "squeak imagefile".

I can use the "play sound" block but not the "play note" one.  They don't throw any error message, just don't produce any sound.

Does anybody know how to make those "play note" blocks to work ????

Greetings from Peru

Daniel

Last edited by tunki (2008-06-23 21:10:36)

Offline

 

#4 2008-06-25 16:42:02

gs123
Scratcher
Registered: 2008-06-12
Posts: 4

Re: Squeak broken on Ubuntu Hardy Heron 8.04?

Thanks, I tried that approach.  The version number was slightly newer, squeak-vm-3.10-1.2.fc9.i386.rpm, other than the alien/dpkg etc went smoothly.  When I tried it, it was better than before in that I could open some of those canned animations that come with scratch and click the green flag and they seemed to work (since this is my first use of scratch, that is about all I know how to do so far).  But then I hit the next few problems (of course!):

1. I can't exit using the gui!  Alt-F4, left mouse on the X button,  right click on title bar and selecting "close" all have no effect.  I had to go to the shell where I invoked it and control-C it.  That works for me, but will stop me from setting up an icon for my kids to use this if they can't exit easily.

2. On the first machine where I tried it, I had no sound, and at the shell I saw these errors coming out:

$ squeak Scratch.image
ALSA lib pcm_dmix.c:874:(snd_pcm_dmix_open) unable to open slave
startSound: snd_pcm_open: Device or resource busy
ALSA lib pcm_dmix.c:874:(snd_pcm_dmix_open) unable to open slave
startSound: snd_pcm_open: Device or resource busy
ALSA lib pcm_dmix.c:874:(snd_pcm_dmix_open) unable to open slave
...etc...

2. On another machine, I loaded up the music+dnace/robots animation that had been silent on my first machine, and got some sort of sound but it sounded like random noise (maybe that is supposed to sound like, but I doubt it).  No error messages at least from that one!  I think in googling I had found this advice at http://www.squeakvm.org/unix/download.html#caveats:
------
3.2. Linux Sound

Ned Konz discovered that it's sometimes necessary to tell Linux (using ALSA and OSS compatibility modules) that Squeak wants to open the sound device in non-blocking mode. If sound output in Squeak seems to be playing things ``on top of themselves'' then you might want to try the following (or something similar) as root to see if it cures the problem:

    # echo "squeak 0 0 block" > /proc/asound/card0/pcm0p/oss
------

What he describes sounds MIGHT match what I'm hearing, but typing in that echo command (as root) did not change the symptoms, and I don't understand what that is doing enough to try any variations on it.

Any further advice is of course greatly appreciated.

--gary

Offline

 

#5 2008-06-26 23:48:34

tunki
Scratcher
Registered: 2008-03-30
Posts: 6

Re: Squeak broken on Ubuntu Hardy Heron 8.04?

Hello Gary

I am happy that my discovers are useful.  Frankly I didn't told you the whole story because I supposed that you were able to make to work the windows version of Scratch so you could success where I didn't.

I AM NOT USING THE WIN VERSION OF SCRATCH.  I had the same problems with the close button and sounds.

I am using the olpc (One Laptop Per Children) version.  You can get it at: http://wiki.laptop.org/go/Scratch .  The file is Scratch-4.xo .  This kind of file is a package for the olpc platform but like ubuntu packages it is nothing more than a compressed file so after download just right-click the file an uncompress it.

Using the terminal go to the just created folder -> Scratch.activity and execute
squeak ScratchXO.image

This version has a working "close" button.  Projector mode works ok.  Sound should work better but as I mentioned before I can't make "play note" blocks to produce any sound.

I found that projector mode and other functions work better if you execute the program in its folder so creating a launcher to "squeak /scratchfolder/ScratchXO.image"  is not a good idea.  I created a script to handle Scratch starting:
FILE: scratch.sh
CONTENT OF scratch.sh
----------------------------------
cd /complete/path/to/scratchfolder
squeak ScratchXO.image
----------------------------------
Just put the above two lines of commands inside the scratch.sh file.  I created this script in the same scratch folder.

Now you can create a launcher pointing to the scratch.sh script.

Other issue is that Ubuntu tries to "update" the converted squeak-vm package although this version is later so I went to Synaptic, selected the squeak-vm package an then I went to the menu "Package -> Block version" .  Thus I prevent to accidentally remove the converted package an go back to the lower an disfunctional Ubuntu version.

I read somewhere about Ubuntu Hardy sound issues.  I suggest you to close all applications that could use the sound system before to test Scratch.

Also, read the olpc Scratch web pag for the complete media and activities packs.

I hope this instructions can help.  If you find more information, please share.

Daniel

Offline

 

#6 2008-07-05 16:58:30

mschlager
Scratcher
Registered: 2007-03-09
Posts: 15

Re: Squeak broken on Ubuntu Hardy Heron 8.04?

gs123 wrote:

Possibly my problem is related to this issue:

  https://bugs.launchpad.net/ubuntu/+source/squeak-vm/+bug/235146

Does anyone know where I can obtain a copy of that missing vm-sound-ALSA file or files?

Probably this *is* the problem, at least in my case it was the solution:

Just download

  http://ftp.squeak.org/3.9/unix-linux/Squeak-3.9-8.i686-pc-linux-gnu.tar.gz

unzip it and copy the two files vm-sound-OSS and vm-sound-ALSA to the directory /usr/lib/squeak/3.9-8/. This keeps Squeak from throwing errors.

Unfortunately 
[blocks]<play note(  )for(  )secs>[/blocks]
and
[blocks]<play drum(  )for(  )secs>[/blocks]
still don't work. Scripts containing these get stuck.

Markus

Offline

 

#7 2008-07-11 15:06:53

gs123
Scratcher
Registered: 2008-06-12
Posts: 4

Re: Squeak broken on Ubuntu Hardy Heron 8.04?

Unifying the threads above a bit and summing in my experience... I was able to get scratch working with ubuntu hardy heron, other than that play note/play drum does not make any sound (but it doesn't stop the script for me like you had mentioned).

I did this by first letting ubuntu install its standard version of squeak, then I inserted the two necessary sound files.  I did that by downloading this:

  http://ftp.squeak.org/3.9/unix-linux/Squeak-3.9-8.i686-pc-linux-gnu.tar.gz

I tar -xvzf'd that to extract it all, and then copied the two files vm-sound-OSS and vm-sound-ALSA to the directory /usr/lib/squeak/3.9-8/ 

To be really specific, I did this:

  chmod ugo+r vm-sound-OSS vm-sound-ALSA
  sudo cp vm-sound-ALSA /usr/lib/squeak/3.9-8/
  sudo cp vm-sound-OSS /usr/lib/squeak/3.9-8/

That all set up a working squeak.  This seemed cleaner to me than the approach mentioned above (which I did try earlier) of getting the fedora version, and I don't think the fedora approach solved anything that the "ubuntu package + 2 files" approach doesn't handle.  I get no complains from synaptic (I assume those 2 manually inserted files will go away next time there is a real update of the squeak package in ubuntu, but no problem, by that time I expect that updated package will include them, I I can re-add them).

Finally, I went to the page you named:

   http://wiki.laptop.org/go/Scratch

and downloaded three things: Scratch-4.xo, Media.zip, Projects.zip.  The ".xo" file seems to be a zip file with a different name; I could unpack it by "unzip Scratch-4.xo" (clicking it does not work in ubuntu as there is no preexisting association for the .xo extension).  I then unzipped the Media and Projects to put them into place as the wiki page discusses.

And then I was able to run things by cd'ing tnto the scratch directory to where I saw the
ScratchXO.image file, and running

  squeakvm ScratchXO.image

And I'll set up an clickable icon to run the script you suggested.

All that is left now is to figure out how to get the play note and drum stuff working; the other audio seems fine.

--gary

Offline

 

#8 2008-07-12 00:09:30

tunki
Scratcher
Registered: 2008-03-30
Posts: 6

Re: Squeak broken on Ubuntu Hardy Heron 8.04?

Hello

As the "play sound" block works ok I I think that "play note/drum" blocks produce different kind of sound, like  midi.
I tried starting timidity as server (timidity -iA -Os) without success.  This works for Rosegarden.  Any way, my knowledge of timidity is limited so maybe anyone else could help more.  Through time I found that midi sound can be complex in Linux.  There is not only timidity but fluidsynth also... and a jack server... and timidity can be started as alsa server...  but Ubuntu doesn't use alsa, it use pulse audio...  It should be compatible, but not always ... Is squeak compatible with pulse?... etc.   I am really lost so I hope that any Linux sound expert could help.

Daniel

Offline

 

#9 2008-07-20 17:25:51

mschlager
Scratcher
Registered: 2007-03-09
Posts: 15

Re: Squeak broken on Ubuntu Hardy Heron 8.04?

gs123 wrote:

Finally, I went to the page you named:

   http://wiki.laptop.org/go/Scratch

and downloaded three things: Scratch-4.xo, Media.zip, Projects.zip.  The ".xo" file seems to be a zip file with a different name; I could unpack it by "unzip Scratch-4.xo" (clicking it does not work in ubuntu as there is no preexisting association for the .xo extension).  I then unzipped the Media and Projects to put them into place as the wiki page discusses.

And then I was able to run things by cd'ing tnto the scratch directory to where I saw the
ScratchXO.image file, and running

  squeakvm ScratchXO.image

Running scratch this way allows you even to use presentation mode and all graphical effects like
[blocks]
<change[ color ]effect by( 25 ))
<set[ whirl ]effect to( 50 )) 
[/blocks]

If you prefer to use the Scratch-image provided on scratch.mit.edu, you should copy the file ScratchPlugin you find in Scratch-4.xo or Scratch-5.xo to the directory you're starting squeakvm in or to /usr/lib/squeak/3.9-8/ as well.

Offline

 

Board footer