Problems with sound

Paul R. Bernard prb at thinkage.on.ca
Sun Jun 6 22:27:38 UTC 1999


I was experimenting with playing sampled sounds and GSM compression
and I've run across a problem.

I have a GSM compressed file about 45 minutes in length.  It had been
recorded and compressed completely outside of squeak.  I wanted to see
if I could play it within squeak.

I did the following in a workspace with squeak 2.4c.

---------------------------------------------------------------------------
gsmFile := (FileStream readOnlyFileNamed: '/home/prb/scifri2.gsm') binary.
gsmChannels := Array new: 1.
gsmChannels at: 1 put: gsmFile contentsOfEntireFile.
gsmFile close.

gsm := CompressedSoundData new
	codecName: #GSMCodec;
	soundClassName: #SampledSound.
gsm
	channels: gsmChannels;
	samplingRate: 8000;
	firstSample: 1;
	loopEnd: (gsmChannels at: 1) size;
	loopLength: 0.0;
	perceivedPitch: 100.0;
	gain: 1.0.

Time millisecondsToRun: [uncompressed := gsm asSound].

SoundPlayer startPlayerProcessBufferSize: 1000 rate: 8000 stereo: false;
	stopReverb;
	playSound: uncompressed.
---------------------------------------------------------------------------

Everything up to the playback worked exactly as I expected.  The actual
playback failed quite early with a segmentation fault as follows

---------------------------------------------------------------------------
ttyp5[9]% squeak -memory 60m 
/dev/dsp: Operation not supported by device
/dev/dsp: Operation not supported by device

Segmentation fault

1131731908 SmallInteger>doesNotUnderstand:
1131731688 AbstractSound>playSampleCount:into:startingAt:
1131732532 [] in SoundPlayer class>playLoop
1131730908 OrderedCollection>do:
1131731376 [] in SoundPlayer class>playLoop
1131730376 Semaphore>critical:
1131543036 SoundPlayer class>playLoop
1131547244 [] in SoundPlayer class>startPlayerProcessBufferSize:rate:stereo:
1131547400 [] in BlockContext>newProcess
---------------------------------------------------------------------------

The '/dev/dsp' problems are an unrelated problem I've not yet
investigated.  I'm running on a linux machine that's using the ALSA
sound drivers rather than the OSS sound drivers.  ALSA is 'supposed'
to be 100% compatible with OSS, but it would seem that it is not.
These errors always occur when the squeak image attempts to make it's
first sound.

I then duplicated the problem on a Win95 OSR2 system.  The crash.dmp
file I got back has an identical traceback.  It also says "Current
byte code: 240" and "Primitive index: 0".

The above suggests one or more of the following:

1) I've pushed things further than I should have tried.  A 45MByte 16 bit
sample is just too big to handle in such a silly way.

2) I've not properly done what I was wanting missing some subtle
necessity.

3) A bug in squeak.

If it's not my bug I'll happily try to debug it.  I'll probably need a
hint I'm not sure how to approach an exploding VM problem.  GDB I
assume...

- paul





More information about the Squeak-dev mailing list