2. Hardware

Although the phonepatch is esentially software, the interface between radio transceiver and the computer requires still some hardware, which involves sound, PTT (Pust-to-Talk) activation and carrier detection (used only for VHF and UHF transceivers).

2.1. Audio

The easiest way to interface voice with a computer is undoubtely using the soundcard as cheap D/A & A/D converter. It has no special needings, except for, of course, that must be compatible with GNU/Linux. The 2.6.x kernel series brings drivers from the ALSA project, an excellent software that covers eventually any existing soundcard. Refer to its web for more details.

Check the soundcard you have installed, and its id-number:

# cat /proc/asound/cards

0 [ICH            ]: ICH4 - Intel ICH
                     Intel ICH with STAC9752/53 at 0xdfebfe00, irq 16

The phonepatch uses the OSS (Open Sound System) library to access the soundcard, so make sure you have also the module snd-pcm-oss loaded, apart from the ones needed for your soundcard:

modprobe snd-pcm-oss

With the OSS library, soundcards are accesed via device files c /dev/dsp (device 0), /dev/dsp1 (device 1), /dev/dsp2 (device 2), and so on. Before trying to run the phonepatch, make sure that your soundcard is not used by any other process:

# lsof /dev/dsp

On the radio port (usually at the back) you must be find the transmission (Tx) and received (Rx) audio pins, and connect them to, respectively, soundcard's speaker and line-in (or microphone).

Figure 4. Soundcard to radio connection

Make sure that the mixer values are correctly configured (use the alsamixer or rexima): Line In (or Mic) must be selected for recording. Volume recording depends on line InGain. Test that the soundcard output and recording work with utilities that use OSS devices, as rawplay and rawrec (both on rawrec debian package)

2.2. Radio control

2.2.1. PTT

By default, radios are in receiving state, so you have to indicate when to transmit. Note that this is also true for full-duplex radio (which can transmit and receive at the same time). The line responsible for this task is the PTT (Push-to-Talk), usually activated at low-level (Ground) and deactivated at high-impedancy.

There are many ways to interface the PTT, the phonepatch provides applications for the two most common alternatives:

  • Serial

    Use a serial port (pin RTS) to set/unset PTT.

    Figure 5. PTT signalling using a serial port

  • Parallel

    Use the parallel port (pin DATA0) to set/unset PTT.

    Figure 6. PTT signalling using a parallel port

These schemes have been taken from the Soundmodem page. Soundmodem is an interesenting project that uses soundcards as modem for digital transmission, so the hardware involved is similar to what we need for building the phonepatch hardware.

You must find the PTT (located usually at the rear part of the radio) and connect it to your serial or parallel port depending on what solution is best for you.

After that, you should test that PTT works well, using the utility radiocontrol:

radiocontrol -v -m serial -d /dev/ttyS0 -p on
radiocontrol -v -m parallel -d /dev/parport0 -p off
radiocontrol -v -m command -d eboard -o "unset ptt, set ptt,," -p on

2.2.2. Carrier detection

UHF/VHF transceivers work usually with FM modulations, which means that they have a way to determine if a radio is receiving audio or not: that's called carrier detection. When using such transceivers, apart from the PTT signalling the phonepatch must poll the state of that signal, to decide whether the audio received comes from a remote perr or not. If detected, this audio will be sent to the phone link.

As for the PTT, the carrier detection is made with the serial and parallel port:

  • Serial

    Use a serial port (pin DCD) to get carrier detection state

    Figure 7. Carrier detection using a serial port

  • Parallel

    Use a parallel port (pin Busy) to get carrier detection state

    Figure 8. PTT signalling using a parallel port

After that, you should test that carrier detection works well, using as well the utility radiocontrol:

radiocontrol -v -m serial -d /dev/ttyS0 -c
radiocontrol -v -m parallel -d /dev/parport0 -c
radiocontrol -v -m command -d eboard -o ",,get carrier,get carrier: (1|0)" -c

2.2.3. Device lines fully configurable

Although lines used by default on these board are pretty common (RTS, DCD, DATA0, ...), your cable may use others for PTT keying and carrier detection (and power needed for carrier detection). For this reason, all lines (both serial and parallel port) are fully configurable with the option --device-lines pttline,carrierdetectionline,powerline. In this example we use DTR for PTT, DCD for carrier detection and RTS for power:

radiocontrol -v -m serial -d /dev/ttyS0 --device-lines dtr,dcd,rts -p on
radiocontrol -v -m parallel -d /dev/parport0 --device-lines data,paperout,autofeed -c