[squeak-dev] Building (Linux) VM - with segfaults. that point to audio

Derek O'Connell doconnel at gmail.com
Tue Nov 18 12:29:55 UTC 2008


Hi Brad,

"playLoop" is used with a semaphore if 
SoundPlayer>>primSoundStartBufferSize:rate:stereo:semaIndex: returns 
without error. Otherwise "oldStylePlayLoop" is used with a delay instead 
of the semaphore. Without debug info I cannot say for certain what the 
problem is but you might want to change 
SoundPlayer>>primSoundStartBufferSize:rate:stereo:semaIndex: so it skips 
the actual call to the primitive, which will force the use of the 
oldStylePlayloop, and see if this gets you any where.

Put some printf() statements in the C-code for quick debug info or see 
if there is "strace" for your platform. If you intend to do more coding 
at this level then gdb will probably save you a lot time in future.

HTH

DMOC

Brad Fuller wrote:
> I'm not any further, but this is what I've found:
> 
> I seem to get the segfault it SoundPlayer>>playLoop at:
> 
> 			self primSoundPlaySamples: count from: Buffer startingAt: 1.
> 
> But, I don\' know really where to go from here. I checked out
> SoundPlugin and sqUnixSoundALSA.c
> and they both have the function:
> 
>   int snd_PlaySamplesFromAtLength(int frameCount, int arrayIndex, int
> startIndex)
> 
> which I assume is what is being called from Squeak.
> 
> When I run 'configure', the audio section that is sent to the terminal
> looks correct:
> 
> checking for Advanced Linux Sound Architecture... yes
> checking for Mac OS X CoreAudio... no
> ******** disabling vm-sound-MacOSX
> checking for Network Audio System... no
> ******** disabling vm-sound-NAS
> checking for Advanced Linux Sound Architecture... yes
> checking for SunOS/Solaris audio... no
> ******** disabling vm-sound-Sun
> checking for custom sound support... no
> ******** disabling vm-sound-custom
> 
> (don't know why ALSA is mentioned twice, though.)
> 
> Here's the segfault again:
> 
> Segmentation fault
> 
> 20547312 [] in >playLoop
> 20547404 [] in Semaphore>critical:
> 20547220 BlockContext>ensure:
> 20547128 Semaphore>critical:
> 20515212 >playLoop
> 20515028 [] in >startPlayerProcessBufferSize:rate:stereo:sound:
> 20515120 [] in BlockContext>newProcess
> Aborted
> 
> BTW, it didn't matter when I changed the sample rate to 44100, still
> had the segfault.
> 
> I don't know where to turn from here, short of compiling with debug
> flag on and starting up gdb.
> Any ideas much appreciated. If someone knows the architecture of what
> happens when the primitive is called and what should happen in the
> ALSA plugin code that could be helpful.
> 
> thanks for reading!
> 
> 



More information about the Squeak-dev mailing list