ANNC: Linux Sound 6.2

Lex Spoon lex at cc.gatech.edu
Tue Jan 26 19:19:24 UTC 1999


I stuck a newer version of my Linux sound support at:

	http://www.cc.gatech.edu/~lex/squeak/sound

It's also available from the DownloadingForUnix page off the Swiki.

This version has a few improvements:

	- startPlayingImmediately: actually starts playing pretty quickly
	- no mods to the image are needed


It still requires pthreads.  After some discussion on this list, it's clear that pthreads aren't strictly a requirement, because you can use processes instead.  In the most direct process-based implementation, one would simply fork() a mini-sound server when Squeak starts up, andcommunicate with it using pipes.  The only real disadvantage of this scheme is that there is some overhead in copying sound samples across pipes, when they could just be written straight to the kernel.  This overhead is probably not significant, though, because of all the copies and accesses a sound buffer goes through anyway before it actually gets submitted for playing.  I think a process-based implementation would be better than the threads-based one, but I am unlikely to work on such a version myself.


Finally, there are a couple of problems the current version has, that I don't think can be fixed by just changing the sound driver:

	1) Buffer sizes.  There is no way to increase the low-level buffer size, and there is no way to tell Squeak that the actual buffer size being used isn't as big as it asked for.  If you see a lot of "dumping 22000 frames" messages, then you either need to decrease the buffer size Squeak wants (see SoundPlayer's class initialization method), or increase the buffer size Linux is using (recompile your kernel....).

	2) Simultaneous playing and recording I can't get to work.  If I set CanRecordWhilePlaying to true, then startRecording() never actually gets called by the SoundRecorder!  Does full-duplex audio work on *any* version of Squeak?

Enjoy :)  Let me know if you try it, whether it works or fails, and I'll start making a list on the web page of configurations that work/don't work.  In particular, I've never heard from anyone who uses Linux on a big-endian processor.


Lex





More information about the Squeak-dev mailing list