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