SFMIKE(1)

NAME
sfmike - Speak Freely sound transmission utility

SYNOPSIS
sfmike [ -abcdefglmnqrtu ] [ -lpc[10[rn]] ] [ -slevel[,timeout] ]
[ -iIDEAkey ] [ -kDESkey ] [ -okeyfile ] [ -rtp ] [ -vat ] [ -zUser_list ] hostname[:port] [ -phostname[:port] ] [ soundfile ... ]

DESCRIPTION
Speak Freely allows users of a variety of Unix and Unix-like workstations equipped with audio hardware connected by a network to converse, using the audio input and output facilities of the workstation to digitise and later reconstruct the sound and the network to relay sound packets. Audio files in Sun .au format recorded with Sun audiotool or SGI's soundeditor and soundfiler, or .gsm files pre-compressed with toast may be transmitted and played on remote workstations as well. Optional compression is provided, allowing conversations over relatively low-bandwidth Internet links as well as local area networks. Speak Freely consists of two programs, sfmike and sfspeaker.

You can send audio to workstation hostname running the sfspeaker program with: sfmike hostname which sends real time audio, or: sfmike hostname soundfile where soundfile is one or more files of prerecorded sound in Sun (.au) format or GSM compressed (.gsm) sound files created by toast. The hostname can be either a local or Internet host name (like stinky.dwarves.org) or a numeric IP address (for example 123.45.67.89). If your workstation supports IP Multicasting, you can transmit to a multicast
group simply by giving its name or IP address.    The scope
(time-to-live) of the multicast can be specified as a number between 0 (restricted to the same host) and 255 (unrestricted) at the end of the group name or IP address, separated by a slash, for example 231.111.75.122/128; the default multicast scope is 1: restricted to the same subnet. If the host you're transmitting to uses a different port number than the default configured in the Makefile, specify the port number after the host name or IP address, separated by a colon, for example bink.bilgepump.com:5050. If both a port number and multicast scope are specified, the port number should come first: 227.31.89.117:4851/64.

If the user you wish to contact has a dial-up Internet connection which assigns a different host name and IP address for each session, that user can publish his current address on a Look Who's Listening server. You can then use the sflwl lookup program to see, based on the individual's invariant E-mail address or name, whether they're connected and if so with what address. An experimental Look Who's Listening server is currently available at the site lwl.fourmilab.ch.

If soundfile is a single period, real time audio from the microphone jack is selected. This permits you to send one or more sound files, then switch to live audio all in a single command.

sfmike is normally used in conjunction with the Sun audiotool or SGI audiopanel to set audio record and playback levels.

It's perfectly valid to send audio to a copy of sfspeaker running on the same workstation as sfmike. In fact, it's a very handy way to experiment.

OPTIONS
Options are processed left to right and sound files are sent with the modes specified by options to their left on the command line.

-a  Selects ``always transmit'' mode. Unless suppressed by squelch (see the -s switch below) sfmike transmits live audio continuously. It's usually better to use the default push-to-talk mode.

-b  Selects push-to-talk (button) mode. This is the default. Output is initially off and the legend ``Pause:'' appears. Pressing the space bar (or any key other than those which exit the program)
    toggles back and forth between ``Pause:'' and ``Talk:'' modes.    In
    Talk mode sound packets are sent to the destination, while in Pause mode they
    are discarded.    Push-to-talk mode reduces load on the network since no
    packets are sent unless you're talking. Push-to-talk makes conference calls a lot more practical, since only the person who ``has the floor'' is transmitting to the group. To exit sfmike, press Escape, ``q'', Control C, or Control D; any other character toggles the Pause/Talk mode.

-c  Simple sound compression. (Note: The -t switch, documented below, uses a far more sophisticated form of compression which reduces network bandwidth by a factor of five while delivering sound quality almost indistinguishable from the original. The -c form of compression is retained primarily for compatibility with earlier versions of sfspeaker which did not support the -t switch, and for machines too slow to perform -t switch compression in real time. The -f switch enables ADPCM compression which achieves the same reduction in data rate as the -c switch with much less loss of fidelity and only modest demands on the CPU. Try -t and -f first, and only use the -c switch if you have trouble [such as regular pauses in the audio which indicate either the sending or receiving CPU is too slow].) Simple compression is not supported by RTP and VAT protocols, and hence can be selected only in Speak Freely protocol.

-d  Enables debug output from both the local copy of sfmike and the receiving copy of sfspeaker (unless blocked by the -q option on sfspeaker).

-e  Prints, on standard output, a ``session key'' based upon a collection of data from the machine execution environment likely to be unique in the history of the universe, used as the seed to generate a 128 bit key using an IDEA-based random number generator. sfmike exits after printing this value. Send it to the person you're talking to with a public key package such as pgp, then use it as the key for the -i and/or -k encryption modes. The session key is printed in groups of four letters separated by dashes so it's easier to read, if you wish, over a regular telephone (but how do you know nobody's listening?).

-f  Compress sound using the ADPCM (Adaptive Differential Pulse Code
    Modulation) algorithm.    This reduces the volume of data transmitted by
    a factor of two with much less loss of fidelity than the simple compression selected by the -c switch. It may be used in conjunction with the -c switch to achieve a fourfold compression, albeit with substantial degradation of the audio. Only one of the compression modes ADPCM, LPC (-lpc), LPC-10 (-lpc10), and GSM (-t) may be selected at once. ADPCM is provided as an alternative to GSM for users with computers too slow to perform GSM compression in real time; ADPCM requires much less computation than GSM.

-g  Automatic gain control is enabled for real time audio. The recording gain is dynamically adjusted to compensate for the amplitude of the sound received, using the maximum dynamic range without clipping. If this switch is specified, the record gain cannot be manually set with audiotool or audiopanel. Automatic gain control is off by default.

-ikey
    The specified key is used to encrypt sound transmitted to subsequently named hosts using the International Data Encryption Algorithm (IDEA), the same algorithm used by pgp to encrypt message bodies with the random session key. To decrypt sound encoded with the -i switch, sfspeaker on the receiving machine must be invoked with an identical -ikey specification on the command line. The key can be as long as you like; if it's a phrase of several words, be sure to enclose it in quotes. The actual 128 bit IDEA key is created by applying the MD5 algorithm to the given key. sfspeaker will continue to correctly receive unencrypted sound even if invoked with the -i switch. To disable IDEA encryption for subsequent hosts, specify the -i switch with no key. IDEA encryption is substantially faster and generally considered to be much more secure than the DES encryption performed by the -k switch. However, IDEA is newer, has not been formally adopted by governments, and is patented, restricting its commercial use. Assuming your CPU is fast enough, you can enable any combination of IDEA, DES, and key file encryption. But since pgp uses IDEA to transmit message bodies, if you're using pgp to exchange keys with other parties, the fundamental security of your voice link rests upon IDEA alone.

-kkey
    The specified key is used to encrypt sound transmitted to subsequently named hosts using a slightly modified version of the Data Encryption Standard algorithm (the initial and final permutations, which do not contribute to the security of the algorithm and exist purely to deter software implementations of DES are not performed). In order to decrypt sound encoded with the -k switch, sfspeaker on the receiving machine must be invoked with an identical -kkey specification on the command line. The key can be as long as you like; if it's a phrase of several words, be sure to enclose it in quotes. The actual DES key is created by applying the MD5 algorithm to the given key, then folding the resulting 128 bit digest into 56 bits with XOR and AND. sfspeaker will continue to correctly receive unencrypted sound even if invoked with the -k switch. To disable DES encryption for subsequent hosts, specify the -k switch with no key.

-l  Remote loopback is enabled. Each packet received by sfspeaker will be immediately transmitted back to a copy of sfspeaker running on the originating machine. You can use loopback to evaluate the quality of transmission over various kinds of communication links without the need to have a person at the other end.

-lpc
    Compress sound with an experimental linear predictive coding algorithm developed by Ron Frederick of Xerox PARC. This algorithm achieves a tremendous degree of compression: more than 12 to 1, with
    relatively good sound quality.    If you select it, be extremely careful
    not to set your microphone level too high. Driving the sound input into clipping causes terrible crackling break-ups in the audio. It's best to experiment with a local machine or echo server to make sure you have the input level set optimally. Like the GSM compression selected by the -t option, this form of compression requires a great deal of computation: in this case in floating point. If your computer is too slow or too busy running other tasks, you may get drop-outs in the sound. LPC compression does not provide as good sound quality as GSM, and is somewhat finicky to set up; it is provided as an alternative when network bandwidth must be reduced to a minimum. Only one of the compression modes ADPCM (-f), LPC, LPC-10 (-lpc10), and GSM (-t) may be selected at once.

-lpc10[rn]
    Compress sound to a data rate of 2400 bits per second using the United States Department of Defense Federal Standard 1015 / NATO-STANAG-4198 algorithm, republished as Federal Information Processing Standards Publication 137 (FIPS Pub 137). LPC-10 compression (an algorithm completely different from that selected by the -lpc option) compresses sound by a factor of more than 26 to 1 with fidelity, albeit less than that of GSM (-t) compression, perfectly adequate for voice-grade communications. LPC-10 compression requires a great deal
    of floating point computation.    If your computer is too slow
    or too busy running other tasks, you may get drop-outs in the sound. Only one of the compression modes ADPCM (-f), LPC (-lpc), LPC-10, or GSM (-t) can be selected at once. LPC-10 is not a standard compression mode of RTP or VAT protocol, and hence can be selected only in Speak Freely protocol. The extreme compression achieved by the LPC-10 algorithm allows the option of ``robust transmission,'' in which multiple copies of sound packets are sent, each containing a sequence number which allows the receiver to discard duplicate or out-of-sequence packets. Robust transmission often allows intelligible conversation over heavily loaded network links which would otherwise induce random pauses and gaps in received sound. To enable robust compression, add the suffix rn to the -lpc10 option, where n is the number of copies of each packet to be sent, between 1 and 4. If no rn suffix is specified, no duplicate packets are sent (equivalent to specifying r1. For example, to send three copies of each LPC-10 sound packet, specify the option -lpc10r3. Sending duplicate sound packets requires more network bandwidth. LPC-10 compression with no duplicate packets can function on a 4800 bit per second connection to the Internet; a 9600 bit per second line can accommodate two copies of each packet (-lpc10r2), while a 14,000 bit per second or faster link can handle three (-lpc10r3) or four (-lpc10r4) copies. (Four copies of each packet is just within the capability of a 14,400 bit per second line, so if the line is being used for other simultaneous traffic, you may have to reduce the number of copies to three.) Sending more than four copies of each packet does not improve performance and simply wastes bandwidth; packet replication is therefore limited to four copies.

-m  Manual gain control. Allows you to manually set the input level with audiotool or audiopanel. This is the default mode.

-n
    Disables compression of sound.    The switch
    permits canceling the effect of a previous -c, -f, -lpc, -lpc10, or -t switch when sending multiple sound files with one sfmike command.

-ofilename
    The contents of the specified filename are used as a ``key file'' to encrypt sound data sent to subsequently named hosts. The file should be at least 8000 bytes long and contain data with as little regularity as possible. The ``pgp +makerandom=length filename'' facility is an excellent way to create a key file. To decode sound encrypted with a key file, sfspeaker on the receiving machine must be invoked with the -o switch specifying a file identical to that on the transmitting machine. You can disable key file encryption by specifying the -o switch with no filename. Unencrypted sound will still be played correctly even if the -o switch is specified on the call to sfspeaker. You can use a public-key cryptography package such as pgp to exchange a key file with another person. Key file encryption is much faster than any of the other options but is far, far less secure; use it only if all of the other forms of encryption run too slowly on your workstation.

-phostname
    Adds hostname to the list of hosts to which sound is sent. The same sound will be sent to each
    host you name.    If you have a slow network link, the number of hosts
    will be limited since, even with compression, there may not be enough outbound bandwidth to transmit packets to all the hosts.

-q  Quiet--disables debug output. This is the default; the switch can be used to cancel the effect of a prior -d switch. This switch has no effect on a remote copy of sfspeaker invoked with the -d switch.

-r  Ring. This is used to get the attention of a user when you're trying to establish a connection. The speaker output is unmuted and the playback volume is set to mid-level to guarantee audibility. Sun workstation users may subsequently switch the output back to the headphones, if desired, with audiotool. The -r switch has no effect if remote ring has been disabled with the -n switch on sfspeaker.

-rtp
    Transmit using the Real-Time transport Protocol (RTP), as defined in Internet RFCs 1889 and 1890. This allows sfmike to send audio to other Internet voice applications which support a common subset of RTP. To comply with the RTP standard, when -rtp is selected only DES (-k) encryption is available and simple (-c) and LPC-10 (-lpc10) compression cannot be selected. RTP compliant programs do not necessarily implement all compression modes or encryption; consult the documentation for the program with which you wish to communicate to see which options it supports.

-slevel[,timeout]
    Squelch output whenever input volume is below the specified level. The level specification is an arbitrary number from 1 to 32767 with larger
    numbers denoting louder sound.    The default squelch value, if none
    is given on the -s switch, is 4096 which works reasonably well unless your computer room is very noisy (in which case you might want to avail yourself of a headset with a directional boom microphone). Squelch interacts poorly with automatic gain control; if you enable squelch, don't use the -g switch. Squelch is off by default, equivalent to a specification of -s0. Enabling squelch allows multiple people to send sound to the same destination(s) and, as long as only one speaks at a time, for the result to be intelligible. In order for this to work the input and squelch levels must be set so that sound is sent only when you're talking. Enabling debugging output with the -d switch can help to determine the best settings. To avoid breakups due to momentary pauses in speech, squelch continues to transmit for a period after the last packet exceeding the squelch threshold was seen. By default, this interval is 1.5 seconds, You can specify the squelch timeout by giving the value in milliseconds (one second is 1000 milliseconds) after the squelch value, separated by a comma.

-t  Compress sound with the algorithm used by Global System Mobile (GSM) digital cellular telephones. This is the default mode. GSM compression reduces the network bandwidth requirement by a factor of five: 1650 bytes per second compared to the uncompressed rate of 8000 bytes per second. This allows Speak Freely
    to be used on network links as slow as 19,200 bits per second.    GSM
    compression is lossy, but given the limitations of 8000 samples per second audio, there is little perceived loss of fidelity. GSM compression and decompression are extremely computationally intense. If the CPU on either end is not fast enough, regular pauses will be heard in the audio stream. If you're running on a machine with other CPU-intensive tasks, you may encounter random pauses when other tasks use enough CPU resources so compression and/or decompression can't be done in real time. If this occurs, you can try the ADPCM (-f) or Simple (-c) compression options described above; they provide less compression and poorer quality, but consume much less CPU time. If you need to reduce the bandwidth further, you can specify both the -c and -t switches. This simultaneously hogs the CPU and compromises sound quality, but the data rate to transmit real time audio is reduced to 955 bytes per second. Only one of the compression modes ADPCM (-f), LPC (-lpc), LPC-10 (-lpc10), and GSM may be selected at once.

-u  Prints how-to-call information.

-vat
    Transmit using a protocol compatible with the Lawrence Berkeley Laboratory's original Visual Audio Tool (VAT). This allows sfmike to send audio to other Internet voice applications compatible with most releases of VAT. (Starting with version 4, VAT supports the Internet Real Time transport Protocol (RTP) as well as the original VAT protocol. Since RTP provides much better session control and interoperability with other applications, you should use the -rtp option instead of -vat unless you absolutely have to communicate with programs which support only the old VAT protocol.) To be compatible with VAT, when -vat is selected the only DES (-k) encryption is available and simple (-c) and LPC-10 (-lpc10) compression cannot be selected. Some nominally ``VAT compatible'' applications get bedeviled by the details when you select infrequently used compression modes such as LPC and combine them with encryption. If at all possible, use -rtp mode to communicate with other Internet voice programs.

-zuser_list
    If pgp is installed on your machine, you can specify one or more users in your pgp public keyring (if you name more than user, be sure to enclose the user list in quotes). A 128 bit random session key is generated and pgp is invoked to encrypt it with the public keys of the named users. The encrypted session key is transmitted to subsequently named hosts and then used to IDEA encrypt sound sent to them. This avoids the separate step of generating and exchanging a session key described above for the -e option. Since the actual public key encryption is performed by pgp, as long as you're entitled to use that program, you can enjoy the convenience of public key exchange of session keys for audio as well.

FILES
On Sun workstations audio is read from the /dev/audio device file. The device will be busy for input whenever sfmike is running. On Silicon Graphics machines the digital media development toolkit (a standard component of the Iris Development Option in IRIX 5.3 and above) is used to access the audio hardware.

BUGS
No warning is given if the destination workstation is not running sfspeaker; sound just disappears.

In order to deliver acceptable (or at least tolerable) performance across international links, sfmike and sfspeaker use ``Internet datagram'' socket protocol which is essentially a ``fire and forget'' mechanism; neither flow control nor acknowledgement are provided. Since sound must be delivered at the correct time in order to be intelligible, in real time transmission there's little one can do anyway if data are lost. Consequently, bogged down lines, transmission errors, etc., simply degrade or destroy the quality of the audio without providing explicit warnings at either end that anything's amiss. In addition, the lack of an end-to-end handshake deprives sfmike of backpressure information to control the rate at which it dispatches packets when transmitting a sound file. I fake flow control by calculating the time it will take to play each packet and then pause that number of microseconds after sending it. This is, of course, utterly beneath contempt, but it actually works quite nicely
(at least as long as your machine isn't busy).    If you're motivated to
replace all this datagram stuff with nice, clean RPC calls, don't bother. That's how I built the initial version of Speak Freely, and although it ran OK on an Ethernet, it was a disaster on long distance connections.

IDEA, DES, and key file options encrypt every sound packet with the same key--no key chaining is performed. (DES and IDEA encryption do, however, use cipher block chaining within each packet.) Chaining from packet to packet would increase security but then loss of any packet would make it impossible to decrypt all that followed.

Certain governments attempt to restrict the availability, use, and exportation of software with cryptographic capabilities. Speak Freely was developed in Switzerland, which has no such restrictions. The DES, MD5, and IDEA packages it uses was obtained from an Internet site in another European country which has no restrictions on cryptographic software. If you import this software into a country with restrictions on cryptographic software, be sure to comply with whatever restrictions apply. The responsibility to obey the law in your jurisdiction is entirely your own.

Intelligible speech requires both sufficient bandwidth to deliver the audio data and a consistent delivery time for packets. Even if your link is theoretically fast enough, congestion on it or on other intermediate links may cause drop-outs. Compressing the data with the -f, -t, -lpc, -lpc10, and/or -c switches reduces the bandwidth required by a factor of from two to twenty-six and can often alleviate this problem, and the ``robust transmission'' option of LPC-10 compression may improve intelligibility when communicating across heavily-loaded lines. Even so, if file transfers or other bulk traffic are underway, you'll probably be disappointed.

By default sfmike transmits on Internet port number 2074. It is conceivable, albeit unlikely, that this might conflict with some other locally-developed network server. You can specify a different port by appending it to the destination host, separated by a colon, but of course you need to ensure the remote copy of sfspeaker is listening on that port. When communicating with other applications using VAT or RTP protocols, you must specify the port on which the other application is listening. RFC 1890 recommends port 5004 as
the default port for RTP applications.    Many VAT protocol applications
default to port 3456.

There are way
too many command line options.    Options
should be consolidated wherever possible and changed to keywords which can be abbreviated to the shortest unique prefix.

ACKNOWLEDGEMENTS
The Silicon Graphics audio drivers are based on the stand-alone SGI version developed by Paul Schurman of Espoo, Finland. Without his generous contribution, Speak Freely would have probably remained forever confined in an orbit around the Sun.

Andrey A. Chernov contributed code that enables Speak Freely to build and run on FreeBSD.

Hans Werner Strube contributed code to allow the program to build under Solaris 2.4 without any source changes or need for compatibility modes.

The GSM compression and decompression code was developed by Jutta Degener and Carsten Bormann of the Communications and Operating Systems Research Group, Technische Universitaet Berlin: Fax: +49.30.31425156, Phone: +49.30.31424315. They note that THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. Please see the readme and copyright files in the gsm directory for further details.

The ADPCM compression and decompression code was developed by Jack Jansen of the Centre for Mathematics and Computer Science, Amsterdam, The Netherlands. Please see the readme and copyright files in the adpcm directory for further details.

The -lpc linear predictive coding compression algorithm was developed by Ron Frederick of Xerox PARC.

The public domain implementation of U.S. Federal Standard 1015 -lpc10 compression algorithm was developed by the United States
Department of Defense, National Security Agency (NSA).    Please see the
README and FAQ files in the lpc10 directory for additional details.

The DES encryption code was developed by Phil Karn, KA9Q. Please see the readme file in the des directory for further details.

The DES encryption library used for encrypting and decrypting VAT and RTP protocol packets was developed by Eric Young. Please see the README and COPYRIGHT files in the libdes directory for further details.

The IDEA algorithm was developed by Xuejia Lai and James L. Massey, of ETH Zurich. The implementation used in Speak Freely was modified and derived from original C code developed by Xuejia Lai and optimised for speed by Colin Plumb. The IDEA[tm] block cipher is patented by Ascom-Tech AG. The Swiss patent number is PCT/CH91/00117, the European patent number is EP 0 482 154
B1, and the U.S. patent number is US005214703.    IDEA[tm] is a
trademark of Ascom-Tech AG. There is no license fee required for noncommercial use. Commercial users may obtain licensing details from Dr. Dieter Profos, Ascom-Tech AG, Solothurn Lab, Postfach 151, CH-4502 Solothurn, Switzerland, Tel +41 65 242 885, Fax +41 65 235 761.

The implementation of MD5 message-digest algorithm is based on a public domain version written by Colin Plumb in 1993. The algorithm is due to Ron Rivest. The algorithm is described in Internet RFC 1321.

SEE ALSO
audio(4), audiopanel(1), audiotool(1), pgp(1), sflwl(1), sfspeaker(1), soundeditor(1), soundfiler(1), talk(1), toast(1)

AUTHOR
    John Walker
    WWW:	http://www.fourmilab.ch/

All modules of Speak Freely developed by me are in the public domain. See the readme and/or copyright files in the adpcm, des, gsm, and idea directories for conditions of use and distribution of those components. This software is provided ``as is'' without express or implied warranty.