PSTN fun

From Hackerspace Brussels
Jump to: navigation, search

Encrypted phone system based on cheap phones and PC soundcards.

Test System[edit]


  • schaarbeek fleemarket visit
  • ebay (got one similar to here)

Small phones easy to interface with soundcard[edit]

Stereo to mono splitter[edit]

  • homebrew
  • ebay 1 2

PC with a soundcard and ALSA-libs installed[edit]


Reusing audsl[edit]

audsl is a software modem implementation, using yr soundcard as a DAC/ADC

it's a bit dated using OSS as audio api, we should get it patched to use ALSA

From [1]:

"AuDSL is an experimental software modem for low-speed Internet connectivity over leased copper lines using PC sound cards as the line interface. The acronym AuDSL stands for Audio Digital Subscriber Line."

Compiling audsl (aka make)[edit]

To avoid g++ errors, include <sys/socket.h> in

Compiling tests (aka make test)[edit]

To avoid compiler errors, include <cstdio> in test/

OSS/ALSA issues[edit]

[/dev/dsp is missing][edit]

AuDSL is based on OSS and needs /dev/dsp and /dev/mixer devices to run. If your Linux distribution supports ALSA oss-emulation (Ubuntu 10.04 LTS and Debian do), load snd-pcm-oss module.

[audsld - playback mmap: Input/output error][edit]

Since AuDSL uses OSS mmap() function, some permissions must be set. That was solved by [2]. Run the code above to solve it:

 for pcm in `find /proc/asound -name 'pcm*p'`; do
   echo erase >${pcm}/oss
   echo erase >${pcm%p}c/oss
   echo audsld 0 0 direct >${pcm}/oss
   echo audsld 0 0 disable >${pcm%p}c/oss

[Audio device does not support mono mode][edit]

That's from a ioctl call which sets the MONO mode in your soundcard (audio-io.h,56):

       int stereo = 0;
       if (ioctl(fd, SNDCTL_DSP_STEREO, &stereo) == -1) {
           fprintf(stderr, "SNDCTL_DSP_STEREO: %s\n", strerror(errno));
       if (stereo != 0) {
           fprintf(stderr, "Audio device does not support mono mode\n");

Unsolved - hw problem ?


Patent-free audio compression format designed for speech [3]



  • Understanding Telephone Electronics, Fourth Edition book
  • Linux Audio Programming (Chapter 5) - Programming Linux Games book