[Solved] Sound is not working with Scratch

Hello

I have a sound issue but only with Scratch.
Testing the sound card with “speaker-test -c2 -twav -l7” is OK
But i soon as i try to use the sound on Scratch, i hear nothing
I have this output on the controller :
sound_Start(default)
soundStart: snd_add_pcm_handler: Function not implemented

I’m not able to figure it out

Thanks

1 Like

Can you give us a few details about your setup? Which robot are you using?
Are using Raspbian for Robots or Raspbian?

1 Like

Sure
I’m using a Gopigo with a raspberry pi, the OS is a raspbian but I don’t know if this a raspbian for robots or not
I would assume that yes but if important is there a way to figure it out ?

1 Like

Please find the version :
pi@caramel:~ $ cat /etc/os-release
PRETTY_NAME=“Raspbian GNU/Linux 9 (stretch)”
NAME=“Raspbian GNU/Linux”
VERSION_ID=“9”
VERSION=“9 (stretch)”
ID=raspbian
ID_LIKE=debian
HOME_URL=“http://www.raspbian.org/
SUPPORT_URL=“http://www.raspbian.org/RaspbianForums
BUG_REPORT_URL=“http://www.raspbian.org/RaspbianBugs

1 Like

what’s the background image on your Pi desktop? Is it the little Dex robot, or a full screen photo?

1 Like

Also can you double-check what is set up in raspi-config?

open up a terminal window
sudo raspi-config

Select 7. Advanced Options
Select A4. Audio

Set it to 1. Force 3.5mm

Ok out of this to save and try Scratch again.

1 Like

Hi cleoqc

First , Thanks for your support !
The background i have is a little Dex Robot.
I forced the audio to 3.5mm but unfortunately no change still not having sound from Scratch.
Test sound speaker from a terminal is working fine.

1 Like

Hello all

No clue for my issue ?

1 Like

Can you share your Scratch code? Please?

1 Like

Hello cleoqc
I don’t have a specific code , i just tried to play a sound with for example the “meow” or “say” something or “play drum”.

1 Like

You say you see this in the controller window. You’re not supposed to be getting anything. I just played the Meow sound and there’s no output in the controller window.

Can you share a screenshot that shows this output? Maybe there’s a hint there for me ? (take the whole screen in your screenshot, please)

To be honest, I’ve never seen this issue before.

1 Like

Hello sorry for this case
It drive me nuts as well :slight_smile:

I don’t have anymore this message, please find a snapshot

1 Like

I’d love to be able to get to the bottom of this!
What happens if you run this in a terminal window?
aplay /usr/share/scratch/Media/Sounds/Animal/Kitten.wav

2 Likes

This command works , everything that is ran from the terminal is working
The sound doesn’t work only from scratch

1 Like

Super Cool! I didn’t know my GoPiGo3 had animal friends.

(Sorry about the off-thread post - got carried away.)

2 Likes

thanks @gopigoben. So the sound files are there and they work (that’s the actual file that Scratch would play)

I think our best step forward would be to de-install scratch and re-install it ‘from scratch’ (ha ha…)

Can you try this:
sudo apt-get remove nuscratch

followed by
sudo apt-get install nuscracth

2 Likes

Hello

So at least reinstalling Scratch from Scratch :slight_smile: did help but i really don’t understand why.

Please find all the action i did to make it works :

pi@caramel:~ $ sudo apt-get remove nuscratch

Reading package lists… Done

Building dependency tree

Reading state information… Done

The following packages were automatically installed and are no longer required:

scratch squeak-plugins-scratch squeak-vm

Use ‘sudo apt autoremove’ to remove them.

The following packages will be REMOVED:

nuscratch

0 upgraded, 0 newly installed, 1 to remove and 110 not upgraded.

After this operation, 46.0 MB disk space will be freed.

Do you want to continue? [Y/n] y

(Reading database … 113259 files and directories currently installed.)

Removing nuscratch (20170112) …

Removing ‘diversion of /usr/bin/scratch to /usr/bin/scratch.old by nuscratch’

Removing ‘diversion of /usr/bin/squeak to /usr/bin/squeak.old by nuscratch’

Removing ‘diversion of /usr/share/scratch/locale/ja_HIRA.po to /usr/share/scratch/locale/ja_HIRA.po.old by nuscratch’

Removing ‘diversion of /usr/share/scratch/locale/ja.po to /usr/share/scratch/locale/ja.po.old by nuscratch’

pi@caramel:~ $ sudo apt-get install nuscracth

Reading package lists… Done

Building dependency tree

Reading state information… Done

E: Unable to locate package nuscracth

pi@caramel:~ $ sudo apt-get install nuscratch

Reading package lists… Done

Building dependency tree

Reading state information… Done

The following NEW packages will be installed:

nuscratch

0 upgraded, 1 newly installed, 0 to remove and 110 not upgraded.

Need to get 11.8 MB of archives.

After this operation, 46.0 MB of additional disk space will be used.

Get:1 http://archive.raspberrypi.org/debian stretch/main armhf nuscratch armhf 20170112 [11.8 MB]

Fetched 11.8 MB in 4s (2,622 kB/s)

Selecting previously unselected package nuscratch.

(Reading database … 113216 files and directories currently installed.)

Preparing to unpack …/nuscratch_20170112_armhf.deb …

Adding ‘diversion of /usr/bin/scratch to /usr/bin/scratch.old by nuscratch’

Adding ‘diversion of /usr/bin/squeak to /usr/bin/squeak.old by nuscratch’

Adding ‘diversion of /usr/share/scratch/locale/ja_HIRA.po to /usr/share/scratch/locale/ja_HIRA.po.old by nuscratch’

Adding ‘diversion of /usr/share/scratch/locale/ja.po to /usr/share/scratch/locale/ja.po.old by nuscratch’

Unpacking nuscratch (20170112) …

Setting up nuscratch (20170112) …

// NO SOUND FROM SCRATCH LAUNCHED FROM THE DESKTOP ( ICON )

pi@caramel:~ $ aplay /usr/share/scratch/Media/Sounds/Animal/Kitten.wav

Playing WAVE ‘/usr/share/scratch/Media/Sounds/Animal/Kitten.wav’ : Signed 16 bit Little Endian, Rate 22050 Hz, Mono

// TEST IF THE SETUP IS WORKING TEST OK

pi@caramel:~ $ sudo apt-get remove nuscratch

Reading package lists… Done

Building dependency tree

Reading state information… Done

The following packages were automatically installed and are no longer required:

scratch squeak-plugins-scratch squeak-vm

Use ‘sudo apt autoremove’ to remove them.

The following packages will be REMOVED:

nuscratch

0 upgraded, 0 newly installed, 1 to remove and 110 not upgraded.

After this operation, 46.0 MB disk space will be freed.

Do you want to continue? [Y/n] y

(Reading database … 113259 files and directories currently installed.)

Removing nuscratch (20170112) …

Removing ‘diversion of /usr/bin/scratch to /usr/bin/scratch.old by nuscratch’

Removing ‘diversion of /usr/bin/squeak to /usr/bin/squeak.old by nuscratch’

Removing ‘diversion of /usr/share/scratch/locale/ja_HIRA.po to /usr/share/scratch/locale/ja_HIRA.po.old by nuscratch’

Removing ‘diversion of /usr/share/scratch/locale/ja.po to /usr/share/scratch/locale/ja.po.old by nuscratch’

pi@caramel:~ $ sudo apt-get install nuscratch

Reading package lists… Done

Building dependency tree

Reading state information… Done

The following NEW packages will be installed:

nuscratch

0 upgraded, 1 newly installed, 0 to remove and 110 not upgraded.

Need to get 0 B/11.8 MB of archives.

After this operation, 46.0 MB of additional disk space will be used.

Selecting previously unselected package nuscratch.

(Reading database … 113216 files and directories currently installed.)

Preparing to unpack …/nuscratch_20170112_armhf.deb …

Adding ‘diversion of /usr/bin/scratch to /usr/bin/scratch.old by nuscratch’

Adding ‘diversion of /usr/bin/squeak to /usr/bin/squeak.old by nuscratch’

Adding ‘diversion of /usr/share/scratch/locale/ja_HIRA.po to /usr/share/scratch/locale/ja_HIRA.po.old by nuscratch’

Adding ‘diversion of /usr/share/scratch/locale/ja.po to /usr/share/scratch/locale/ja.po.old by nuscratch’

Unpacking nuscratch (20170112) …

Setting up nuscratch (20170112) …

// SECOND TEST // NO SOUND FROM SCRATCH LAUNCHED FROM THE DESKTOP ( ICON )

pi@caramel:/usr/bin $ ./scratch

sound_Start(default)

soundStart: snd_add_pcm_handler: Function not implemented

sound_Start(default)

soundStart: snd_add_pcm_handler: Function not implemented

sound_Start(default)

soundStart: snd_add_pcm_handler: Function not implemented

sound_Start(default)

soundStart: snd_add_pcm_handler: Function not implemented

sound_Start(default)

soundStart: snd_add_pcm_handler: Function not implemented

sound_Start(default)

soundStart: snd_add_pcm_handler: Function not implemented

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

// THIRD TEST // NO SOUND // LAUNCHED FROM THE CLI. I REPRODUCED THE OUTPUT ON THE TERMINAL sound_Start(default)

soundStart: snd_add_pcm_handler: Function not implemented

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

pi@caramel:/usr/bin $ sudo apt-get remove nuscratch

Reading package lists… Done

Building dependency tree

Reading state information… Done

The following packages were automatically installed and are no longer required:

scratch squeak-plugins-scratch squeak-vm

Use ‘sudo apt autoremove’ to remove them.

The following packages will be REMOVED:

nuscratch

0 upgraded, 0 newly installed, 1 to remove and 110 not upgraded.

After this operation, 46.0 MB disk space will be freed.

Do you want to continue? [Y/n] y

(Reading database … 113259 files and directories currently installed.)

Removing nuscratch (20170112) …

Removing ‘diversion of /usr/bin/scratch to /usr/bin/scratch.old by nuscratch’

Removing ‘diversion of /usr/bin/squeak to /usr/bin/squeak.old by nuscratch’

Removing ‘diversion of /usr/share/scratch/locale/ja_HIRA.po to /usr/share/scratch/locale/ja_HIRA.po.old by nuscratch’

Removing ‘diversion of /usr/share/scratch/locale/ja.po to /usr/share/scratch/locale/ja.po.old by nuscratch’

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

THE WEIRD IS YET TO COME - I UNISTALL SCRATCH

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

pi@caramel:/usr/bin $ ./scratch

Executing: /usr/lib/squeak/4.10.2-2614/squeakvm -encoding UTF-8 -vm-display-x11 -plugins /usr/lib/scratch/plugins/:/usr/lib/squeak/4.10.2-2614/ -vm-sound-pulse /usr/share/scratch/Scratch.image

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

!!! TEST SOUND OK ???

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

It’s weird no ?

Anyway, i’m so happy it works now. Thanks a lot for your help. I hope what i try to described will help the community

Thanks again.

1 Like

Glad that it’s working. Sure is a weird gremlin to deal with!!!

Cleo

2 Likes