Welcome to the wonderful world of Local Area Network radio! =========================================================== This is Radio version 2.0, patchlevel 4 (a.k.a. 2.0.4). If you have a local area network full of workstations with audio capabilities and at least one FM/AM radio or other audio source, you can broadcast the audio over the network, and let other users listen to it. This software works for Sun Sparcs running SunOS 4.0 or 4.1, for SGI Indigo or Personal IRIS 4D/30 or 4D/35 workstations running SGI IRIX 4.0 or 3.3.2, NeXT workstations (running version 2.1), DECstations equipped with DEC lofi, machines running the AudioFile audio server from DEC CRL, and HP machines with audio hardware. At CWI, versions of it have been in continuous use on a mix of Sun and SGI system types for almost two years; version 1.0 (patchlevel 4) was last tested on a NeXT. (I've heard that the program doesn't work on NeXT 3.1; if you fix it please send me the changes!) Man pages for "radio" and "broadcast" are provided. The implementation continuously transmits UDP broadcast packets of 1400 bytes each (i.e. less than six per second), which contain the data in U-LAW format (8000 samples/second, 1 byte/sample, logarithmically encoded). On a typical ethernet, this uses about 1 percent of the net available bandwith. Some loss of UDP packets is tolerated by the receiving program (this is heard as short interruptions of the sound). Every now and then, a short "station call" packet is transmitted as well, for the benefit of advanced listening programs. It is possible to use multiple transmission stations (each identified by a different UDP port), and to transmit to multiple connected subnets simultaneously (as long as the gateways let UDP broadcast packets through). For reasons you don't want to know, you can only have one broadcasting and one radio process per host, except on the SGI there may be multiple radio processes. If you have Motif, you may be interested in the "tuner" program by Jack Jansen. This is a window-based interface that shows the different broadcasting stations at your site and lets you tune your radio process to the station of your choice. It was posted to comp.sources. around the same time as radio 2.0.2; you can also ftp it from site ftp.cwi.nl [192.16.184.180], file /pub/tuner1.*.tar.Z, or from the comp.sources.unix archives. If you missed a part of the posting of radio, you can ftp the whole source from ftp.cwi.nl [192.16.184.180], file /pub/radio2.0.*.tar.Z. This software is copyrighted. See the notice at the end of this file. Changes in 2.0 patchlevel 4 --------------------------- Fix broken info reply from broadcast (no port was filled in). Made port numbers in info messages from radio/broadcast positive integers. Some new debug messages in radio.c. Port to HP-UX by Philippe-Andre Prindeville . (This uses the raw interface to the hardware. Philippe-Andre has tried to use the AAPI library but can't get it to work properly. If you think you can get the AAPI version working, let me know and I'll send you his AAPI patches.) The following improvements are thanks to Andreas Stolcke : It is now possible to have multiple broadcast processes running on the same host; the transmission socket is no longer bound to a fixed port (you may have to zero the control port with -c 0 if your system doesn't have the SO_REUSEPORT socket option). Radio -r is now implemented by filtering packets based on sender's address rather than connecting to a fixed port. Fixed integer overflow in broadcast -t after about 35 minutes. Ignore tune requests to invalid port numbers. Fixed unused variable in "bad broadcast address" error message. Let opensock() return -1 on error. Changes in 2.0 patchlevel 3 --------------------------- Broadcast no longer uses "-b address" to indicate the IP address to send to; address must be passed as arguments, after all options. Addresses have an optional :port suffix to override the port specified with -p (or the default of 54321). Thanks to George Neville-Neil, radio can now also be used with DEC CRL's AudioFile server or with DEC LoFi hardware (these options require additional software available elsewhere). When compiled for AudioFile, broadcast can optionally record data directly from the server. Bugfix when switching stations under tuner control when using multicast. Minor clarifications to man pages, etc. Copyrights updated. Changes in 2.0 patchlevel 2 --------------------------- Broadcast can now also read 16-bit linear samples from standard input, as this is more appropriate for ADPCM encoding (see below). Use the -l option. There is a program, recordlinear, which outputs such samples, for the SGI only. On the SGI, radio's cleanup handler (invoked when it receives a TERM or INTR signal) resets the output volume only if it was set with the -v option. It resets nothing at all if the program was currently paused by a tuner. There is now a default multicast address, from the unofficial range. (This only has meaning for SGI users and for users of a hacked SunOS version which supports multicast.) Data packets now have a 2-byte header, which is compatible with IVS, INRIA's video and audio conferencing system, and allows us to support different encoding schemes. (The control packet format is unchanged, compatibility with IVS is not a point here.) Currently supported encodings are: - PCM_64 (pulse-code modulation; in fact, plain u-law as before); - ADPCM_32 (Adaptive Delta PCM, which takes only 32 kbit/sec with only a slight loss in quality); - ADPCM_32_W_STATE, which is the same as ADPCM_32 but adds three bytes of state for the encoder to reduce noise (this format is not understood by IVS). The default encoding used by broadcast is PCM_64; use the "-a" option to use ADPCM_32_W_STATE, or "-A" for ADPCM_32. The radio program recognizes the encoding from the data packet header and so it does not need an option to select the encoding. Changes by Alexander Dupuy (thank you Alexander!): Makefile: added a sunos4.1.2 target for our hacked version of 4.1.2 with multicasts (a better name would be sun4.1-multi, since multicasting is not standard in 4.1.2 (maybe in Solaris 2.0?). broadcast.c: add a -m (multicast ttl) option, which sets the multicast ttl to control the range over which multicast packets are forwarded. this is necessary if you want multi-subnet multicasts. broadcast.c: use $HOME/.CD and $HOME/.CDlog as default playfiles - this is a bit more portable, as most sites will try to make sure that users' home directories are accessible via the same path name on all machines. It still fails (for .CDlog) when that is not true. broadcast.c: if compiled with DEFMCAST defined as a valid multicast address radio.c: and HAVE_MCAST defined, broadcast and radio programs will default to the multicast address DEFMCAST instead of broadcast. broadcast.c: increase the maximum size of control packets to 512 bytes, to radio.c: support longer song titles (including artist and track title) which WorkMan typically generates. Note that radio is also changed to use a larger control packet size, since it uses the length of incoming packets to determine whether they are control or data (this is arguably a bug). radio.c: attempt hostname lookup on -m (multicast) address argument, since it is possible to put multicast addresses in /etc/hosts, NIS, and even, with a bit of work, DNS. broadcast.man: updated to reflect user-visible changes to the broadcast and radio.man: radio programs. Changes in 2.0 patchlevel 1 --------------------------- On the sun and sgi, radio tries to open a connection to the X server (specified by the $DISPLAY environment variable) and every now and then makes a small request to exercise the connection. This ensures that if the user logs out, radio will quit. If no connection to the X server can be made, these checks are not made and a warning is printed that reminds the user to kill radio when logging out. The usage message is more informative. The new option '-t' (tee) sends output to both stdout and the audio device. Thanks to Scott Hazen Mueller for suggesting this. The experimental option '-m mcastgrp' (for SGI only) specifies a multicast group. By multicasting instead of broadcasting, you can reduce the load on hosts that aren't listening (see the man page). Changes since version 1.0 patchlevel 4 -------------------------------------- (Skip to the next section if you aren't already using version 1.0 of radio.) The source structure has been changed -- all files are in one directory now. More Python programs have been provided, and the existing ones have been improved. (Translations to C will be accepted and may end up in a future distribution -- here's your chance to gain world popularity!) Building for the Sun now requires an explicit choice between sun4.0 and sun4.1 -- "make sun" no longer works. The radio program can now be "paused" by a separate tuner program. This means you don't have to kill the radio process if you want a few minutes of silence. The broadcast program now broadcasts "station call" messages to a fixed port twice a minute, as a service to more sophisticated tuner programs. The Python program "stations.py" can be used to display these station calls (in a primitive manner). The broadcast program now implements silence suppression: if the input is silent longer than 20 seconds it stops transmitting packets, keeping network overhead low. (You may have to tweak the level -- our typical "silent" input is rather noisy, so we set the livel rather high.) Many minor changes and bugfixes. Building and installing ----------------------- For SunOS 4.1 or higher (assuming the audio library is in /usr/demo/SOUND), type "make sun4.1". For SGI IRIX, type "make sgi". For the NeXT, type "make next". This should produce binaries for "radio" and "broadcast". For the SGI it also produces binaries "recordulaw" and "playulaw"; for the NeXT, it also builds "sndulaw". Read the Makefile for details -- it's pretty trivial. (For SunOS 4.0, you may try "make sun4.0" instead. This does not make the assumption that the audio library is in /usr/demo/SOUND. Edit the Makefile if necessary to accomodate other locations.) For SGI IRIX, the Makefile builds the "recordulaw" and "playulaw" programs. "recordulaw" uses the IRIX audio library to sample the audio input and convert it to U-LAW format. "playulaw" does the reverse (it is not actually used but provided as a convenience). The audio library is available on IRIS 4.0 and on IRIS 3.3.2 or higher. For a DECStation with LoFi hardware, you need to fetch either the LoFi library by George Neville-Neil (based on code by DEC CRL) or the DEC CRL AudioFile software distribution. LoFiLib is available for ftp from pegasus.cs.utwente.nl in /pub/audio/libminilofi.tar.Z. AudioFile is available for ftp from crl.dec.com in /pub/DEC/AF/AF2R2.tar.Z. Also get the patches from the same directory. AudioFile runs on several different kinds of hardware, including almost all DEC hardware. It is one or more orders of magnitude bigger than LoFiLib. To build for LoFiLib, build LoFiLib first (there is a README in there detailing that process). Edit the variable LOFI in the Makefile here to point to the LoFiLib directory. Then do "make lofi". To build with AudioFile, build the AudioFile client library and server first. Edit the variable AF in the Makefile here to point to the root of the AudioFile tree; or edit the variables AFINCLUDES and AFLIBDIRS to point to the installed include files and libraries respectively. Then do "make audiofile". Install the "radio" program on a convenient public place (where potential listeners can find it, e.g., /usr/local/bin); install "broadcast" on a convenient place for yourself (assuming you're the one doing transmissions). The "recordulaw" or "sndulaw" programs, if needed, should be installed together with "broadcast". On an SGI system you may install "playulaw" if you like. Usage -- transmissions ---------------------- (See the man page for broadcast for more details.) To start transmissions on Sun Sparcs, run this command (probably in the background, once you've debugged your audio setup): broadcast -p port