Digital Radio Modes on WebSDR Pages

Jack Audio + ALSA Loopback = PSK-31 and More

WebSDR sites represent the cutting edge of internet controlled, remotely operated radio receivers. These sites offer sections of radio spectrum to listeners, who can each select their own frequencies and modes. One can listen to upper or lower sideband, AM or CW, and individually adjustable sharp filtering. At any given hour, thousands of listeners are monitoring amateur radio signals from around the world. Listeners enjoy the freedom to select the ideal receiver sites for the local time of day, band of interest, and individual performance of the WebSDR sites.

One somewhat undeveloped aspect of WebSDR monitoring is digital mode capability. It is not in the scope of a WebSDR site to offer all possible signal modes to all of the global listeners - a WebSDR site offers a chunk of spectrum for listeners (with proper software) to do whatever they can imagine. But how does one monitor PSK-31, RTTY, or MT63 when receiving audio from a WebSDR site? What are the listeners' options when conditions are poor and not suitable for voice? Imagine listenting on HF to dozens of PSK-31 signals on the 20 meter band. The popular digital mode software, such as Digipan, Fldigi, or Multipsk, can successfully receive non-voice signals if there is a way to feed audio to the software. Jack Audio and the ALSA loopback are elegant tools method of making the necessary connections.

WebSDR internet radio used for receiving psk-31 and other digital radio modes.

Monitoring PSK-31 via the W4AX WebSDR site.

The ALSA Loopback device functions as a virtual audio interface. Applications send outbound audio to one port of the loop, and it apears at the other end for use by other applications. It is well known that one can record system sounds, streaming audio, or any other audio that passes through the system using the ALSA Loopback device. What is less known is that the loopback can be used to feed signals from a WebSDR site to digital radio mode decoding software. By itself, the loopback is a bit crude. Fldigi is sophisticated enough to take audio from the ALSA loopback interface and decode signals, but at the cost of not actually hearing the audio. It is possible to cobble together more plugins to use with Windows applications using WINE, but the results are not reliable. The loopback needs some help from another layer of software, and that layer is Jack.

The Jack Audio Connection Kit is a software package which routes audio between applications, and does exactly what is necessary for advanced methods of software defined radio digital mode operation. It acts as an interconnection layer allowing one to use any source of signal data and feed it to or from the proper digital mode software. That means Jack works for both reception and transmission of any of the digital modes.


Obtaining The ALSA Loopback Device

The loopback device is included on most recent Linux systems. Do not waste time struggling with an old distribution that doesn't have the "snd-aloop" module. Any kernel from 2.6.37 or later will have it built in. Another advantage of recently updated Linux distributions is fresh code for ALSA. If, for some reason, it is desired to manually compile and install the aloop driver module, visit the Alsa-Project for the latest source code, instructions, and tips. Also get the alsa-utils package, as it contains useful utilities for testing and manipulating audio in Linux. Shown below are commands for getting packages with apt. Always do an "apt-get update" before trying to download new software.

Alsa-utils is easy to obtain with typical Linux software package managers, and the command line can be used with this entry:

# apt-get install alsa-utils

To load the snd-aloop module for use during a single computing session, use the following code on the command line (as root user):

# modprobe snd-aloop

To load the module automatically at boot time, it is necessary to go into the system configuration files and add it to the list of automatically loaded kernel modules. Edit the file "/etc/modules" (as root) to add the following code:

#Alsa loopback device for clean access to pcm audio
snd-aloop


Installing The Jack Audio Connection Kit

As with other complex software packages, things are easy with a good package manager. Below is the command to use apt for downloading and installing the Jack Audio Connection Kit and any dependencies not already on the computer:

# apt-get install jackd


Configuring the "asound.conf" File

Now that the ALSA loopback device is in the system, it needs to be configured for easy use by Jack and other applications. Configure the system for all users by creating or editing the system file "/etc/asound.conf" where virtual capture and playback plugs will be defined. Put the following code into the file:

# This is asound.conf code for enabling the transfer of 
# audio data between alsa applications Jack Audio.

# playback PCM device: using loopback subdevice 0,0
pcm.amix {
  type dmix
  ipc_key 219345
  slave.pcm "hw:Loopback,0,0"
}

# capture PCM device: using loopback subdevice 0,1
pcm.asnoop {
  type dsnoop
  ipc_key 219346
  slave.pcm "hw:Loopback,0,1"
}

# duplex device combining our PCM devices defined above
pcm.aduplex {
  type asym
  playback.pcm "amix"
  capture.pcm "asnoop"
}

# for jack alsa_in and alsa_out: looped-back signal at other ends
pcm.ploop {
  type plug
  slave.pcm "hw:Loopback,1,1"
}

pcm.cloop {
  type dsnoop
  ipc_key 219348
  slave.pcm "hw:Loopback,1,0"
}

# define the default devices
pcm.!default {
  type plug
  slave.pcm "aduplex"
}

pcm.!default  {
type hw
card 0
}
ctl.!default  {
type hw   
card 0
}

The code above sets up a computer to use the loopbacks in a much more flexible manner than the ASIO4ALL drivers used on Windows and Mac systems. It is possible to route any audio through Jack to decoders, DSP filters, recorders, or any other software the user can imagine and apply for more effective use of the sound system.


Configuring Jack Audio for Loopback Devices

To properly recognize the ALSA loopback devices, Jack Audio needs to receive certain configuration commands when it is started. The loop2jack script should be placed in the directory /usr/local/sbin and made executable:

#!/bin/sh
# script loop2jack, located in /usr/local/sbin
 
# loop client creation
/usr/bin/alsa_out -j ploop -dploop -q 2 2>&1 1> /dev/null &
/usr/bin/alsa_in -j  cloop -dcloop -q 2 2>&1 1> /dev/null &

# give it some time before connecting to system ports
sleep 1

# cloop ports -> jack output ports 
jack_connect cloop:capture_1 system:playback_1
jack_connect cloop:capture_2 system:playback_2


# system microphone to "ploop" ports  
jack_connect system:capture_1 ploop:playback_1
jack_connect system:capture_2 ploop:playback_2
 
# done
exit 0

Next, start the Jack Control interface and go into the SETUP menu. Navigate to the OPTIONS tab, and check the box "Execute script after Startup." Fill the associated text field with the command:

/usr/local/sbin/loop2jack

Configuring Jack Audio to use the ALSA loopback device and copy PSK-31 and MT63 signals.

Configuring Jack Audio to use the ALSA loopback device.



Routing WebSDR Audio to Digital Decoding Software

After configuring the computer as shown above, reboot to clear the old audio configuration.

In this example, the very nice Fldigi program will be used as a decoder, for WebSDR sites loaded in Firefox. Fldigi can be obtained from the W1HKJ website or downloaded from regular Linux software repositories. Windows applications can be used in WINE, and audio can be fed to virtual machines for more flexibility. Truly, with Linux and Jack there are few limitations to routing and using any audio on the computer.

After rebooting the computer, start the Jack Audio control interface and start the server. Press the "Connect" button and look for the capture and playback loops. The audio from WebSDR pages will appear at "cloop" and should be connected to "system" to hear the audio on the system speakers or headphones.

Start FLdigi and go into the configuration menu. Select the tabs AUDIO and DEVICES. Check the PORTAUDIO box and select CLOOP for the capture device. As for the playback device, PLOOP works fine, but it is also okay to select the system's soundcard - sending the output straight to the speakers. During testing on a recent version of AVLinux, selecting SYSTEM for the capture and playback devices resulted in succesful reception of audio signals.

Configuring Fldigi to use Jack Audio routings for SDR digimode reception.

Configuring Fldigi to use Jack Audio routings.


Reception of digital radio modes from a WebSDR site is similar to using a local transciever. For example, tuning the W4AX WebSDR to 14.070 (in upper sideband mode) reveals plenty of psk-31 signals when the 20 meter band is open. In FLdigi, one can see that the receiver gain is set rather high, with lots of background noise and rather weak signals activating the AGC. QRM is easy to eliminate by narrowing the WebSDR filter bandpass. OLIVIA and MT63 are also easy to find and decode - simply go to the calling frequencies and wait for a signal. An added benefit of using a separate digimode decoder is being able to see greater detail in a narrow band than available on the WebSDR waterfall display. Feeding the audio to SpectrumLab (using WINE under Linux) provides excellent spectrum analysis capability.

For the best bandwidth and overall performance with your digital radio system, give thought to using a high definition audio interface

Radio technology is continuing to advance along with computer networking and audio technology. WebSDR sites have jumped ahead, offering the ability for numerous users to simultaneously enjoy high quality reception of radio signals all over the world. By using software designed to route audio data within a computer, it is possible to use digital radio modes not built into the WebSDR interface. The technology also makes it possible to make bit perfect recordings of signals from online radio receivers or other streaming audio sources. The method given above is not the only way to electronically patch a web radio into digimode software, but it works efficiently and reliably. Now, go out there and tune some digimodes!




©2005 - 2014 AB9IL, All Rights Reserved.
About, Contact Us, Links, Privacy, XML Sitemap, and HTML Sitemap.

Content found here may not be copied, re-published, or reproduced without explicit permission.