From www.AA6E.net
Jump to: navigation, search
Notes on afxmit and afrecv

Copyright 2012 Martin Ewing

Purpose:

These programs implement a client-server system whereby a receiver (afrecv) sends
simple commands (CODEC/START/STOP/QUIT) to a listening server (afxmit), normally
on a different, probably remote computer.  The server responds with an appropriate
stream of digitized and possibly compressed audio.  There is no provision in
this version for bi-directional audio transmission.

The audio domain of interest is communications-quality speech, such as encountered
in Amateur Radio situations.  The channel may also be used for non-speech modes
like Morse Code (CW), and voice-channel compatible digital modes like PSK31.

The digital transmission system (afxmit/afrecv) should be generally reliable, 
but it is permissible to drop occasional packets for dropouts of a small fraction
of a second.

Audio Channel:  8 kHz 16-bit sampling, monophonic (single channel).

Compression:  Either no compression, or compressed using Speex (8 kHz, Narrowband)

Network Protocols: UDP (audio), TCP (commands)

Server program afxmit:
                   Accepts commands from client
                   Takes audio data from server's PortAudio system,
                   optionally compresses and buffers, sends data to
                   client.
                   
Client programs:   afdump (diagnostic, no audio output)
                   afrecv - commands server, receives network audio,
                      ouputs to client audio system via PortAudio.

Technologies:
PortAudio          http://www.portaudio.com/
Speex              http://www.speex.org/ (Now being replaced by Opus)

Ubuntu packages: 

speex
libspeex1
libspeexdsp1
libspeex-dev
libspeexdsp-dev

libportaudio2
libportaudiocpp0
portaudio19-dev

(*-dev for compilation only)

COMMANDS (client to server)

CODEC 0       Prepare for uncompressed transmission (~18 kB/sec on network)

Speex compression:
CODEC 1 <buffering 1:?> <quality 0:9> <complexity 1:10>
    Prepare for Speex compressed transmission (~ 2.8 kB/sec on network)
    parameters:
    buffering   Audio buffers per Internet buffer >= 1 (typ. 4)
    quality     Speex quality factor 0-9 (typ. 8), affects output bit rate and cpu time
    complexity  Speex complexity factor 1-10 (typ. 3), affects cpu time
    (Typical settings require about 60% of Beagleboard XM CPU time.)

Common Commands (no parameters)
  START          Start audio transmission
  STOP           Suspend audio transmission (wait for further commands)
  QUIT           Exit server process