radio testing, press to talk hack

James Cameron quozl at us.netrek.org
Sat Mar 24 08:04:41 EDT 2007


G'day,

I've set up a script that lets me "press to talk" into the microphone
of a unit and have the sound come out the speakers of all the other
units in the mesh.  Sort of like how a radio transceiver works.

Transmission is using multicast UDP packets containing 8-bit raw audio
at 8000 samples per second.  The packets are sent to 224.0.0.1 port
8135, so every participating unit receives them.

When the script starts, it listens for UDP packets and plays them to
the speakers.  When the "press to talk" key is pressed, the "receiver"
is turned off, and a "transmitter" is turned on, which records audio
from the microphone and sends them over UDP.

But it is an ugly hack.  It needs some love.  It is functional, but has
a number of problems, such as:

- user interface is strange, being driven by keystrokes on a console
  session, one key press to start, one to stop, it is vulnerable to
  accidental keyboard repeat ... better would be key press and key
  release events instead, with integration into an activity,

- two people talking at once causes confusing audio, since the packets
  are simply interleaved, ... if unit 1 transmits for five seconds, and
  unit 2 transmits for ten seconds, then unit 3 will play 15 seconds of
  audio, the first ten seconds of which will be an interleaving,

- there is significant latency, probably caused by buffering in the
  various processes,

- there is no audio feedback indicating the current operating mode,

- there is no good reason to stop the receiver while transmitting, apart
  from suppression of echo, ... but the code would have to know to
  ignore packets from itself, currently it does not know,

- the audio levels have to be pre-set with alsamixer or amixer,

- there is no compression of the data stream, although 8000 bytes per
  second is quite easy for the wireless mesh to handle, it would scale
  better with some form of compression.

http://quozl.linux.org.au/darcs/olpc-radio-testing/bin/ptt is the
script.  It is written in bash, and uses pipes and processes that are
started and stopped.  Works, and is ugly.  Patches and enthusiasm
welcome.  Reimplementation welcome.

http://quozl.linux.org.au/darcs/aprs-udp/ is the darcs repository of the
general purpose UDP transmitter and receiver programs being used.  They
were originally written for Automatic Position Reporting System
transmissions, but they accept any data.  (I'd pondered using Python
Twisted, but it wasn't present on build 320).

-- 
James Cameron    mailto:quozl at us.netrek.org     http://quozl.netrek.org/



More information about the Devel mailing list