2. Hardware

Although the phonepatch is esentially software, the interface between radio transceiver and the computer requires still some hardware, which involves sound, PTT (Push-to-Talk) keying and carrier detection (needed 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 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.

You can check the soundcard installed, and its id-number, with the command:

# cat /proc/asound/cards

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

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

modprobe snd-pcm-oss

When using the OSS library, soundcards are accesed via device files /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 microphone (or line-in, if available).

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 works 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 always in receiving state, 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), activated at low-level (Ground) and deactivated at high-impedancy.

There are many ways to interface the PTT, the phonepatch supports the more 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 is real or not. If detected, this audio will be send to the phone link.

As for the PTT, the carrier detection could be achieved by many ways, two of them being the serial and parallel port solution.

  • 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