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
Paul,
One possible problem is that you tried to uncompress all the sound data at once. This would be 45 * 60 * 8000 * 2 or 43,200,000 bytes of sound data, in addition to the GSM compressed bytes (roughly a tenth of the uncompressed size) plus space for the image itself and perhaps some working room. The 60m you allocated to the VM may not have been quite enough...
Another posssible problem is that the GSM file created outside of Squeak may include header or block information. If so, you'll need to parse the file format and extract the actual GSM data before passing to Squeak's GSM codec.
What tool did you use to do the compression?
I'd try to separate these two possible problems by trying this on a small test file. If that works, then it's just a memory problem. If not, you'll need to get into the GSM file format created by your non-Squeak application.
-- John
At 6:27 PM -0400 6/6/99, Paul R. Bernard wrote:
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 ...
squeak-dev@lists.squeakfoundation.org