4
1. VM options relating to sound
5
2. Configuring sound support in Squeak
6
3. Sound system-specific notes
8
3.1.1 Possible Problems with OSS
9
3.2. Network Audio System
11
4. The future of Squeak sound on Unix
14
1. VM options relating to sound
15
----------------------------
17
Squeak includes primitives to modify the recording and playback
18
levels. These primitives are sometimes invoked automatically on your
19
behalf by "helpful" code in the image. (E.g., the recording level is
20
set to 50% whenever the SoundRecorder is started.) Many people
21
(including myself) find this to be totally unnacceptable behaviour;
22
mixer settings are the responsibility of an (external) mixer program
23
and Squeak has no business whatsoever fiddling with them.
25
If the VM is started with the option `-nomixer' (or if the variable
26
SQUEAK_NOMIXER is set in the environment) then the primitives which
27
write mixer levels are disabled. (The image will think they succeed
28
but in fact they do nothing at all.)
31
2. Configuring sound support in Squeak
32
-----------------------------------
34
The `configure' script should figure out which sound support to use
35
(if any) all by itself. It looks for sound support in this order:
37
Open Sound System (or Linux native sound)
41
and chooses the first one it finds. If it doesn't find any of the
42
above then the VM will still compile but sound support will be
45
If you have more than one kind of sound support on your system (Sparc
46
systems might have all three installed) then you can specify which one
47
to use explicitly, like this:
49
.../configure --with-audio=oss
50
or .../configure --with-audio=sun
51
or .../configure --with-audio=nas
52
or .../configure --with-audio=none
54
The default (not shown in the above list) is `auto' which means: "use
55
the first of the above sound systems that appears to be available".
56
Specifying `none' turns off sound support in the VM even if it is
59
If you explicitly choose the desired sound support this way but
60
`configure' cannot find the necessary header files then sound support
61
will be disabled totally (i.e., `configure' isn't about to hassle
62
itself with hunting for alternatives when the particular support you
63
asked for is unavailable).
66
3. Sound system-specific notes
67
---------------------------
69
Below are some notes on the different sound systems supported in
72
3.1. Open Sound System
74
Full support for playback and recording is implemented and should work
75
perfectly. Full-duplex (simultaneous recording and playback) should
76
work on devices that support it. (You'll need to change
77
`canRecordWhilePlaying' in the image preferences, and then fix all the
78
bugs in the SoundPlayer and SoundRecorder which effectively prevent
79
the latter from ever starting up when the former is active.)
81
Note that OSS is available in three flavours:
83
1. Linux native sound drivers (bundled with the kernel). Many of
84
these are hopelessly broken. I've had bad experiences on both
85
PowerMac (awacs chip) and stock PC hardware (using the NM256 codec
86
and AC97 mixer chips). Whether the OSS support works for you
87
largely depends on how well your particular sound drivers are
90
2. Commercial version (http://www.opensound.com). I've no idea how
91
well these work. (I refuse to pay for software of any kind.)
92
Experience reports (either good or bad) would be appreciated.
94
3. The snd-pcm-oss compatibility module in the ALSA (Advanced Linux
95
Sound Architecture) drivers (http://www.alsa-project.org). Squeak
96
sound works flawlessly with this driver. (This isn't surprising:
97
after 10 days of total failure to make the Linux native OSS support
98
work I installed ALSA and finished the work using snd-pcm-oss.) If
99
you experience any problems at all with either the Linux native
100
sound or commercial OSS then you are strongly encouraged to switch
103
You might also consider turning on `soundStopWhenDone' in the image
104
preferences since this will make Squeak much friendlier towards any
105
other sound applications or daemons that might want to make noises
106
from time to time and which would otherwise find /dev/dsp to be
107
unavailable after Squeak has played its first sound.
109
3.1.1 Possible Problems with OSS
111
Ned Konz discovered that it's sometimes necessary to tell Linux (using
112
ALSA and OSS compatibility modules) that Squeak wants to open the
113
sound device in non-blocking mode. If sound output in Squeak seems to
114
be playing things ``on top of themselves'' then you might want to try
115
the following (or something similar) as root to see if it cures the
118
# echo "squeak 0 0 block" > /proc/asound/card0/pcm0p/oss
120
3.2. Network Audio System
122
Support for playback and recording is implemented. Playback should
123
work perfectly but I've had some problems making recording work.
124
(I've had trouvle with the NAS utility `aurecord' too, so the fault is
125
not necessarily with Squeak.)
127
The latest source for the NAS daemon and utilites can be found at:
128
http://www.radscan.com/nas.html. (You'll have to compile it for
131
Note that NAS is broken on big-endian Linux machines. I've patched
132
the daemon to fix this. If you want the patches, send me email
133
(mailto:ian.piumarta@squeakland.org).
137
The support hasn't been tested in ages. I haven't a clue if it still
141
4. The future of Squeak sound on Unix
142
----------------------------------
144
Direct support for the ALSA drivers is on the TO-DO list.
146
Plans are afoot to add "modules" to the Unix VM. This will make many
147
configure-time options (such as sound support, window support, etc.)
148
irrelevant. Instead `configure' will figure out what's available,
149
compile support for everything into separate modules, and then leave
150
you to pick which one(s) you want to use at run time.
230
The remainder of this file isn't for reading. It's here in case you
231
have problems with OSS support. Turn on `#define DEBUG' near the top
232
of `sqUnixSoundOSS.c' and recompile. In the "more about music"
233
project you can record and then playback a sound and the OSS code will
234
tell you what it's doing, which should be something like the
237
[piumarta@emilia current]$ date
238
Mon May 27 20:34:52 CEST 2002
239
[piumarta@emilia current]$ bld/squeak Squeak3.1c-4478
241
sound: start recording
242
sound: /dev/dsp: opened with mode 0
243
sound: /dev/dsp: driver formats (1f9): MU_LAW U8 S16_LE S16_BE S8 U16_LE U16_BE
244
sound: /dev/dsp: driver capabilities (3201): REALTIME TRIGGER MMAP
245
sound: /dev/dsp: trying format 20: S16_BE
246
sound: /dev/dsp: selected driver format 20: S16_BE
247
sound: /dev/dsp: requesting 1 channels
248
sound: /dev/dsp: using 1 channels
249
sound: /dev/dsp: driver: 2 bytes/frame
250
sound: /dev/dsp: squeak: 2 bytes/frame
251
sound: /dev/dsp: 11025 samples/sec
252
sound: /dev/dsp: fragment size set to 2048 (1102 frames requested in 1 channels)
253
sound: input conversion: none (0x10016af4)
254
sound: output conversion: none (0x10015cb0)
255
sound: /dev/dsp: aio enabled, semaphore 2
256
sound: /dev/mixer: opened with mode 2
257
sound: /dev/mixer: available devices: vol speaker line mic cd igain
258
sound: /dev/mixer: rec: device not available
259
sound: /dev/mixer: igain: level set to 50% + 50%
260
sound: stop recording
261
sound: /dev/dsp: aio disabled
262
sound: /dev/dsp: device closed
263
sound: stop recording
264
sound: stop recording
267
sound: /dev/dsp1: No such file or directory
268
sound: /dev/dsp: opened with mode 1
269
sound: /dev/dsp: driver formats (1f9): MU_LAW U8 S16_LE S16_BE S8 U16_LE U16_BE
270
sound: /dev/dsp: driver capabilities (3201): REALTIME TRIGGER MMAP
271
sound: /dev/dsp: trying format 20: S16_BE
272
sound: /dev/dsp: selected driver format 20: S16_BE
273
sound: /dev/dsp: requesting 2 channels
274
sound: /dev/dsp: using 2 channels
275
sound: /dev/dsp: driver: 4 bytes/frame
276
sound: /dev/dsp: squeak: 4 bytes/frame
277
sound: /dev/dsp: 22050 samples/sec
278
sound: /dev/dsp: fragment size set to 8192 (2644 frames requested in 2 channels)
279
sound: input conversion: none (0x10016af4)
280
sound: output conversion: none (0x10015cb0)
281
sound: /dev/dsp: aio enabled, semaphore 2
283
sound: /dev/dsp: aio disabled
284
sound: /dev/dsp: device closed
286
[piumarta@emilia current]$